| | |
| | | $form .= html::p(null, $check_replace->show(get_input_value('_replace', RCUBE_INPUT_GPC)) . |
| | | html::label('rcmimportreplace', rcube_label('importreplace'))); |
| | | |
| | | $OUTPUT->set_env('writable_source', !empty($writable_books)); |
| | | $OUTPUT->add_label('selectimportfile','importwait'); |
| | | $OUTPUT->add_gui_object('importform', $attrib['id']); |
| | | |
| | |
| | | $CONTACTS = $RCMAIL->get_address_book($target, true); |
| | | |
| | | // let rcube_vcard do the hard work :-) |
| | | $vcards = rcube_vcard::import(file_get_contents($_FILES['_file']['tmp_name'])); |
| | | $vcard_o = new rcube_vcard(); |
| | | $vcard_o->extend_fieldmap($CONTACTS->vcard_map); |
| | | |
| | | $vcards = $vcard_o->import(file_get_contents($_FILES['_file']['tmp_name'])); |
| | | |
| | | // no vcards detected |
| | | if (!count($vcards)) { |
| | |
| | | |
| | | if (!$replace && $email) { |
| | | // compare e-mail address |
| | | $existing = $CONTACTS->search('email', $email, false, false); |
| | | $existing = $CONTACTS->search('email', $email, 1, false); |
| | | if (!$existing->count && $vcard->displayname) { // compare display name |
| | | $existing = $CONTACTS->search('name', $vcard->displayname, false, false); |
| | | $existing = $CONTACTS->search('name', $vcard->displayname, 1, false); |
| | | } |
| | | if ($existing->count) { |
| | | $IMPORT_STATS->skipped++; |