diff options
Diffstat (limited to 'program/steps/addressbook/save.inc')
-rw-r--r-- | program/steps/addressbook/save.inc | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc index 94556f96b..4f30fd4b7 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; @@ -165,11 +174,13 @@ if (!empty($cid)) { $a_js_cols[] = rcube::Q((string)$record[$col]); } + // performance: unset some big data items we don't need here + $record = array_intersect_key($record, array('ID' => 1,'email' => 1,'name' => 1)); + $record['_type'] = 'person'; + // 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 { @@ -224,29 +235,13 @@ else { $CONTACTS->add_to_group($plugin['group_id'], $plugin['ids']); } } - else { - $counts = $CONTACTS->count(); - } - - if ((string)$source === (string)$orig_source) { - // add contact row or jump to the page where it should appear - $CONTACTS->reset(); - $result = $CONTACTS->search($CONTACTS->primary_key, $insert_id); - - rcmail_js_contacts_list($result, 'parent.'); - $OUTPUT->command('parent.contact_list.select', rcube_utils::html_identifier($insert_id)); - - // update record count display - $CONTACTS->reset(); - $OUTPUT->command('parent.set_rowcount', rcmail_get_rowcount_text($counts)); - } - else { - // re-set iframe - $OUTPUT->command('parent.show_contentframe'); - } // show confirmation $OUTPUT->show_message('successfullysaved', 'confirmation', null, false); + + $OUTPUT->command('parent.set_rowcount', $RCMAIL->gettext('loading')); + $OUTPUT->command('parent.list_contacts'); + $OUTPUT->send('iframe'); } else { |