| | |
| | | $RCMAIL->session->remove('contacts'); |
| | | } |
| | | |
| | | $source = get_input_value('_source', RCUBE_INPUT_GPC); |
| | | |
| | | // update an existing contact |
| | | if (!empty($cid)) |
| | | { |
| | | $plugin = $RCMAIL->plugins->exec_hook('contact_update', |
| | | array('id' => $cid, 'record' => $a_record, 'source' => get_input_value('_source', RCUBE_INPUT_GPC))); |
| | | array('id' => $cid, 'record' => $a_record, 'source' => $source)); |
| | | $a_record = $plugin['record']; |
| | | |
| | | if (!$plugin['abort']) |
| | |
| | | $a_js_cols[] = Q((string)$record[$col]); |
| | | |
| | | // update the changed col in list |
| | | $OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols, $newcid); |
| | | $OUTPUT->command('parent.update_contact_row', $cid, $a_js_cols, $newcid, $source); |
| | | |
| | | // show confirmation |
| | | $OUTPUT->show_message('successfullysaved', 'confirmation', null, false); |
| | |
| | | |
| | | // insert a new contact |
| | | else { |
| | | $source = get_input_value('_source', RCUBE_INPUT_GPC); |
| | | // Name of the addressbook already selected on the list |
| | | $orig_source = get_input_value('_orig_source', RCUBE_INPUT_GPC); |
| | | |
| | |
| | | // show notice if existing contacts with same e-mail are found |
| | | $existing = false; |
| | | foreach ($CONTACTS->get_col_values('email', $a_record, true) as $email) { |
| | | if ($email && ($res = $CONTACTS->search('email', $email, false, false, true)) && $res->count) { |
| | | if ($email && ($res = $CONTACTS->search('email', $email, 1, false, true)) && $res->count) { |
| | | $OUTPUT->show_message('contactexists', 'notice', null, false); |
| | | break; |
| | | } |