Fix errors when adding/updating contacts in active search (#1490015)
| | |
| | | - 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 |
| | | ------------- |
| | |
| | | this.list_contacts = function(src, group, page) |
| | | { |
| | | var win, folder, url = {}, |
| | | refresh = src === undefined && group === undefined && page === undefined, |
| | | target = window; |
| | | |
| | | if (!src) |
| | |
| | | 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) |
| | |
| | | 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; |
| | |
| | | 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'])); |
| | |
| | | $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; |
| | |
| | | // 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 { |
| | |
| | | $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); |
| | | |
| | |
| | | $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 { |
| | |
| | | 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) |