diff options
author | Hugues Hiegel <root@paranoid> | 2014-08-05 16:46:22 +0200 |
---|---|---|
committer | Hugues Hiegel <root@paranoid> | 2014-08-05 16:46:22 +0200 |
commit | 59478e06c25303a790a0840ab2ac30662c4ef781 (patch) | |
tree | 8d5e964a8f94adaef41efebb0597629f11495c42 /program/steps/addressbook/copy.inc | |
parent | 7c494b677f9e470ee0d32e62cfa8dc709f39e748 (diff) |
c'est la merde..working
Diffstat (limited to 'program/steps/addressbook/copy.inc')
-rw-r--r-- | program/steps/addressbook/copy.inc | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/program/steps/addressbook/copy.inc b/program/steps/addressbook/copy.inc index d4387194a..480a9b52e 100644 --- a/program/steps/addressbook/copy.inc +++ b/program/steps/addressbook/copy.inc @@ -57,16 +57,10 @@ foreach ($cids as $source => $cid) foreach ($cid as $cid) { $a_record = $CONTACTS->get_record($cid, true); - // avoid copying groups - if ($a_record['_type'] == 'group') - continue; - // Check if contact exists, if so, we'll need it's ID // Note: Some addressbooks allows empty email address field - // @TODO: should we check all email addresses? - $email = $CONTACTS->get_col_values('email', $a_record, true); - if (!empty($email)) - $result = $TARGET->search('email', $email[0], 1, true, true); + if (!empty($a_record['email'])) + $result = $TARGET->search('email', $a_record['email'], 1, true, true); else if (!empty($a_record['name'])) $result = $TARGET->search('name', $a_record['name'], 1, true, true); else @@ -120,7 +114,7 @@ foreach ($cids as $source => $cid) } } -if (!$success) +if ($success == 0) $OUTPUT->show_message($errormsg, 'error'); else $OUTPUT->show_message('copysuccess', 'notice', array('nr' => $success)); |