alecpl
2011-11-11 ecfaed571b2c38f4bcc2b6a0fa39fba15a5126ce
program/steps/addressbook/import.inc
@@ -54,6 +54,7 @@
  $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']);
@@ -137,7 +138,10 @@
  $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)) {
@@ -170,9 +174,9 @@
      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++;