From 24e89eceed9694882ff943c4106519fab449705f Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Wed, 4 Jun 2014 12:10:49 +0200 Subject: Add fieldset legends and input element labels to contact edit form --- program/steps/addressbook/edit.inc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'program/steps/addressbook/edit.inc') diff --git a/program/steps/addressbook/edit.inc b/program/steps/addressbook/edit.inc index 3bbbfccdf..0fc753056 100644 --- a/program/steps/addressbook/edit.inc +++ b/program/steps/addressbook/edit.inc @@ -98,12 +98,15 @@ function rcmail_get_edit_record() function rcmail_contact_edithead($attrib) { + global $RCMAIL; + // check if we have a valid result $record = rcmail_get_edit_record(); $i_size = !empty($attrib['size']) ? $attrib['size'] : 20; $form = array( 'head' => array( + 'name' => $RCMAIL->gettext('contactnameandorg'), 'content' => array( 'prefix' => array('size' => $i_size), 'firstname' => array('size' => $i_size, 'visible' => true), -- cgit v1.2.3 From 1e22cb1e86d1e4c9e689d2e5bca7beccb380742a Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 14 Jun 2014 17:54:36 +0200 Subject: Unify some labels --- program/localization/en_US/labels.inc | 20 ++++++++++---------- program/steps/addressbook/edit.inc | 2 ++ program/steps/settings/edit_identity.inc | 2 +- program/steps/settings/edit_response.inc | 2 +- program/steps/settings/func.inc | 2 +- skins/classic/templates/addressbook.html | 2 +- skins/classic/templates/compose.html | 2 +- skins/larry/templates/addressbook.html | 4 ++-- skins/larry/templates/compose.html | 2 +- skins/larry/templates/contactedit.html | 5 +---- skins/larry/templates/identities.html | 2 +- skins/larry/templates/responses.html | 2 +- 12 files changed, 23 insertions(+), 24 deletions(-) (limited to 'program/steps/addressbook/edit.inc') diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index 21c774b97..ba8fe2e40 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -255,9 +255,10 @@ $labels['restoremessage'] = 'Restore message?'; $labels['responses'] = 'Responses'; $labels['insertresponse'] = 'Insert a response'; $labels['manageresponses'] = 'Manage responses'; -$labels['savenewresponse'] = 'Save new response'; -$labels['editresponses'] = 'Edit responses'; +$labels['newresponse'] = 'Create new response'; +$labels['addresponse'] = 'Add response'; $labels['editresponse'] = 'Edit response'; +$labels['editresponses'] = 'Edit responses'; $labels['responsename'] = 'Name'; $labels['responsetext'] = 'Response Text'; @@ -353,7 +354,7 @@ $labels['typeblog'] = 'Blog'; $labels['typeprofile'] = 'Profile'; $labels['addfield'] = 'Add field...'; -$labels['addcontact'] = 'Add new contact'; +$labels['addcontact'] = 'Add contact'; $labels['editcontact'] = 'Edit contact'; $labels['contacts'] = 'Contacts'; $labels['contactproperties'] = 'Contact properties'; @@ -370,7 +371,7 @@ $labels['addphoto'] = 'Add'; $labels['replacephoto'] = 'Replace'; $labels['uploadphoto'] = 'Upload photo'; -$labels['newcontact'] = 'Create new contact card'; +$labels['newcontact'] = 'Create new contact'; $labels['deletecontact'] = 'Delete selected contacts'; $labels['composeto'] = 'Compose mail to'; $labels['contactsfromto'] = 'Contacts $from to $to of $count'; @@ -379,7 +380,7 @@ $labels['export'] = 'Export'; $labels['exportall'] = 'Export all'; $labels['exportsel'] = 'Export selected'; $labels['exportvcards'] = 'Export contacts in vCard format'; -$labels['newcontactgroup'] = 'Create new contact group'; +$labels['newgroup'] = 'Create new group'; $labels['grouprename'] = 'Rename group'; $labels['groupdelete'] = 'Delete group'; $labels['groupremoveselected'] = 'Remove selected contacts from group'; @@ -417,11 +418,10 @@ $labels['userpreferences'] = 'User preferences'; $labels['editpreferences'] = 'Edit user preferences'; $labels['identities'] = 'Identities'; -$labels['manageidentities'] = 'Manage identities for this account'; -$labels['newidentity'] = 'New identity'; - -$labels['newitem'] = 'New item'; -$labels['edititem'] = 'Edit item'; +$labels['manageidentities'] = 'Manage identities'; +$labels['newidentity'] = 'Create new identity'; +$labels['addidentity'] = 'Add identity'; +$labels['editidentity'] = 'Edit identity'; $labels['preferhtml'] = 'Display HTML'; $labels['defaultcharset'] = 'Default Character Set'; diff --git a/program/steps/addressbook/edit.inc b/program/steps/addressbook/edit.inc index 0fc753056..27d26791b 100644 --- a/program/steps/addressbook/edit.inc +++ b/program/steps/addressbook/edit.inc @@ -69,6 +69,8 @@ $OUTPUT->add_handlers(array( 'filedroparea' => 'rcmail_photo_drop_area', )); +$OUTPUT->set_pagetitle($RCMAIL->gettext(($RCMAIL->action == 'add' ? 'addcontact' : 'editcontact'))); + if ($RCMAIL->action == 'add' && $OUTPUT->template_exists('contactadd')) { $OUTPUT->send('contactadd'); } diff --git a/program/steps/settings/edit_identity.inc b/program/steps/settings/edit_identity.inc index e43a7bb60..20f822027 100644 --- a/program/steps/settings/edit_identity.inc +++ b/program/steps/settings/edit_identity.inc @@ -54,7 +54,7 @@ $OUTPUT->add_handler('identityform', 'rcube_identity_form'); $OUTPUT->set_env('identities_level', IDENTITIES_LEVEL); $OUTPUT->add_label('deleteidentityconfirm'); -$OUTPUT->set_pagetitle($RCMAIL->gettext(($RCMAIL->action == 'add-identity' ? 'newidentity' : 'edititem'))); +$OUTPUT->set_pagetitle($RCMAIL->gettext(($RCMAIL->action == 'add-identity' ? 'addidentity' : 'editidentity'))); if ($RCMAIL->action == 'add-identity' && $OUTPUT->template_exists('identityadd')) { $OUTPUT->send('identityadd'); diff --git a/program/steps/settings/edit_response.inc b/program/steps/settings/edit_response.inc index 6d3c3dc41..10dec1096 100644 --- a/program/steps/settings/edit_response.inc +++ b/program/steps/settings/edit_response.inc @@ -72,7 +72,7 @@ if ($RCMAIL->action == 'save-response' && isset($_POST['_name']) && !$RESPONSE_R $OUTPUT->set_env('readonly', !empty($RESPONSE_RECORD['static'])); $OUTPUT->add_handler('responseform', 'rcube_response_form'); -$OUTPUT->set_pagetitle($RCMAIL->gettext($RCMAIL->action == 'add-response' ? 'savenewresponse' : 'editresponse')); +$OUTPUT->set_pagetitle($RCMAIL->gettext($RCMAIL->action == 'add-response' ? 'addresponse' : 'editresponse')); $OUTPUT->send('responseedit'); diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index 8f9cf090f..89103ee44 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -1332,7 +1332,7 @@ function rcmail_settings_tabs($attrib) array('command' => 'preferences', 'type' => 'link', 'label' => 'preferences', 'title' => 'editpreferences'), array('command' => 'folders', 'type' => 'link', 'label' => 'folders', 'title' => 'managefolders'), array('command' => 'identities', 'type' => 'link', 'label' => 'identities', 'title' => 'manageidentities'), - array('command' => 'responses', 'type' => 'link', 'label' => 'responses', 'title' => 'editresponses'), + array('command' => 'responses', 'type' => 'link', 'label' => 'responses', 'title' => 'manageresponses'), ); // get all identites from DB and define list of cols to be displayed diff --git a/skins/classic/templates/addressbook.html b/skins/classic/templates/addressbook.html index 98658f28b..53995860d 100644 --- a/skins/classic/templates/addressbook.html +++ b/skins/classic/templates/addressbook.html @@ -63,7 +63,7 @@ diff --git a/skins/classic/templates/compose.html b/skins/classic/templates/compose.html index 4705600c7..19b22bc69 100644 --- a/skins/classic/templates/compose.html +++ b/skins/classic/templates/compose.html @@ -202,7 +202,7 @@
  • -
  • +
  • diff --git a/skins/larry/templates/addressbook.html b/skins/larry/templates/addressbook.html index e1101e648..0ce036850 100644 --- a/skins/larry/templates/addressbook.html +++ b/skins/larry/templates/addressbook.html @@ -67,7 +67,7 @@ @@ -99,7 +99,7 @@
    - + diff --git a/skins/larry/templates/compose.html b/skins/larry/templates/compose.html index 98ef2963c..83a47913e 100644 --- a/skins/larry/templates/compose.html +++ b/skins/larry/templates/compose.html @@ -212,7 +212,7 @@ -
  • +
  • diff --git a/skins/larry/templates/contactedit.html b/skins/larry/templates/contactedit.html index b7aafed31..da7953eae 100644 --- a/skins/larry/templates/contactedit.html +++ b/skins/larry/templates/contactedit.html @@ -6,10 +6,7 @@ -

    - - -

    +

    diff --git a/skins/larry/templates/identities.html b/skins/larry/templates/identities.html index 91f7f8f71..5878155c6 100644 --- a/skins/larry/templates/identities.html +++ b/skins/larry/templates/identities.html @@ -22,7 +22,7 @@
    - +
    diff --git a/skins/larry/templates/responses.html b/skins/larry/templates/responses.html index 503ed2177..538a025f0 100644 --- a/skins/larry/templates/responses.html +++ b/skins/larry/templates/responses.html @@ -22,7 +22,7 @@
    - +
    -- cgit v1.2.3 From 765a0b0706a2ef347b71627e75bdc06d9656fe96 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 10 Aug 2014 10:39:25 +0200 Subject: Fix errors when adding/updating contacts in active search (#1490015) --- CHANGELOG | 1 + program/js/app.js | 6 +++++- program/steps/addressbook/edit.inc | 1 + program/steps/addressbook/save.inc | 24 ++++++++++++++++-------- program/steps/addressbook/show.inc | 5 +++++ 5 files changed, 28 insertions(+), 9 deletions(-) (limited to 'program/steps/addressbook/edit.inc') diff --git a/CHANGELOG b/CHANGELOG index ea50a53c0..5148767d4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -50,6 +50,7 @@ CHANGELOG Roundcube Webmail - Fix bug where $Forwarded flag was being set even if server didn't support it (#1490000) - Fix various iCloud vCard issues, added fallback for external photos (#1489993) - Fix invalid Content-Type header when send_format_flowed=false (#1489992) +- Fix errors when adding/updating contacts in active search (#1490015) RELEASE 1.0.2 ------------- diff --git a/program/js/app.js b/program/js/app.js index 6a68ebfae..c64318858 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -4739,6 +4739,7 @@ function rcube_webmail() this.list_contacts = function(src, group, page) { var win, folder, url = {}, + refresh = src === undefined && group === undefined && page === undefined, target = window; if (!src) @@ -4751,7 +4752,7 @@ function rcube_webmail() page = this.env.current_page = 1; this.reset_qsearch(); } - else if (group != this.env.group) + else if (!refresh && group != this.env.group) page = this.env.current_page = 1; if (this.env.search_id) @@ -4890,6 +4891,9 @@ function rcube_webmail() if (this.env.group) url._gid = this.env.group; + if (this.env.search_request) + url._search = this.env.search_request; + url._action = action; url._source = this.env.source; url._cid = cid; diff --git a/program/steps/addressbook/edit.inc b/program/steps/addressbook/edit.inc index 27d26791b..a7def586d 100644 --- a/program/steps/addressbook/edit.inc +++ b/program/steps/addressbook/edit.inc @@ -258,6 +258,7 @@ function get_form_tags($attrib) if ($RCMAIL->action == 'edit') $hiddenfields->add(array('name' => '_source', 'value' => $SOURCE_ID)); $hiddenfields->add(array('name' => '_gid', 'value' => $CONTACTS->group_id)); + $hiddenfields->add(array('name' => '_search', 'value' => rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC))); if (($result = $CONTACTS->get_result()) && ($record = $result->first())) $hiddenfields->add(array('name' => '_cid', 'value' => $record['ID'])); diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc index 7451f433b..fd0517fe8 100644 --- a/program/steps/addressbook/save.inc +++ b/program/steps/addressbook/save.inc @@ -148,6 +148,15 @@ if (!empty($cid)) { $result = $plugin['result']; if ($result) { + // show confirmation + $OUTPUT->show_message('successfullysaved', 'confirmation', null, false); + + // in search mode, just reload the list (#1490015) + if ($_REQUEST['_search']) { + $OUTPUT->command('parent.command', 'list'); + $OUTPUT->send('iframe'); + } + // LDAP DN change if (is_string($result) && strlen($result)>1) { $newcid = $result; @@ -172,8 +181,6 @@ if (!empty($cid)) { // update the changed col in list $OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols, $newcid, $source, $record); - // show confirmation - $OUTPUT->show_message('successfullysaved', 'confirmation', null, false); $RCMAIL->overwrite_action('show'); } else { @@ -232,8 +239,11 @@ else { $counts = $CONTACTS->count(); } - if ((string)$source === (string)$orig_source) { - // add contact row or jump to the page where it should appear + // show confirmation + $OUTPUT->show_message('successfullysaved', 'confirmation', null, false); + + // add contact row to the list + if (empty($_REQUEST['_search']) && (string)$source === (string)$orig_source) { $CONTACTS->reset(); $result = $CONTACTS->search($CONTACTS->primary_key, $insert_id); @@ -244,13 +254,11 @@ else { $CONTACTS->reset(); $OUTPUT->command('parent.set_rowcount', rcmail_get_rowcount_text($counts)); } + // just refresh the list (#1490015) else { - // re-set iframe - $OUTPUT->command('parent.show_contentframe'); + $OUTPUT->command('parent.command', 'list'); } - // show confirmation - $OUTPUT->show_message('successfullysaved', 'confirmation', null, false); $OUTPUT->send('iframe'); } else { diff --git a/program/steps/addressbook/show.inc b/program/steps/addressbook/show.inc index 8f357cd96..5835ce7e5 100644 --- a/program/steps/addressbook/show.inc +++ b/program/steps/addressbook/show.inc @@ -32,6 +32,11 @@ $SOURCE_ID = $source; if ($cid && ($record = $CONTACTS->get_record($cid, true))) { $OUTPUT->set_env('readonly', $CONTACTS->readonly || $record['readonly']); $OUTPUT->set_env('cid', $record['ID']); + + // remember current search request ID (if in search mode) + if ($search = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GET)) { + $OUTPUT->set_env('search_request', $search); + } } // get address book name (for display) -- cgit v1.2.3