diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-08-16 00:24:38 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-08-16 00:25:32 +0200 |
commit | 4c638f101e09cbe43a2114c64ebb30774bafce4b (patch) | |
tree | 80a01ed4cce75428b66e9fc343d336bf59f357cf /apps/contacts/lib | |
parent | dd3208fe6fadff3ad831df2fa5220e2184738b21 (diff) | |
download | nextcloud-server-4c638f101e09cbe43a2114c64ebb30774bafce4b.tar.gz nextcloud-server-4c638f101e09cbe43a2114c64ebb30774bafce4b.zip |
Merge addressbooks.
Diffstat (limited to 'apps/contacts/lib')
-rw-r--r-- | apps/contacts/lib/vcard.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php index b213bcd7623..91ac89f5535 100644 --- a/apps/contacts/lib/vcard.php +++ b/apps/contacts/lib/vcard.php @@ -589,7 +589,7 @@ class OC_Contacts_VCard{ * @return boolean * */ - public static function moveToAddressBook($aid, $id) { + public static function moveToAddressBook($aid, $id, $isAddressbook = false) { OC_Contacts_App::getAddressbook($aid); // check for user ownership. if(is_array($id)) { $id_sql = join(',', array_fill(0, count($id), '?')); @@ -606,8 +606,13 @@ class OC_Contacts_VCard{ return false; } } else { - try { + $stmt = null; + if($isAddressbook) { + $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*contacts_cards SET addressbookid = ? WHERE addressbookid = ?' ); + } else { $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*contacts_cards SET addressbookid = ? WHERE id = ?' ); + } + try { $result = $stmt->execute(array($aid, $id)); } catch(Exception $e) { OCP\Util::writeLog('contacts', __CLASS__.'::'.__METHOD__.', exception: '.$e->getMessage(), OCP\Util::DEBUG); |