summaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2011-12-09 15:10:51 +0100
committerThomas Tanghus <thomas@tanghus.net>2011-12-09 15:10:51 +0100
commitb3661adf028570f6158dfd5092ecb1398d5be0df (patch)
treeeb421923ccdea71a34203a83fbec16732760b196 /apps/contacts/ajax
parent830efdccac71ebbd4ee5f9414abd0878f2ff9349 (diff)
downloadnextcloud-server-b3661adf028570f6158dfd5092ecb1398d5be0df.tar.gz
nextcloud-server-b3661adf028570f6158dfd5092ecb1398d5be0df.zip
Various fixes to multiple address books handling
Diffstat (limited to 'apps/contacts/ajax')
-rw-r--r--apps/contacts/ajax/chooseaddressbook.php2
-rw-r--r--apps/contacts/ajax/createaddressbook.php6
-rw-r--r--apps/contacts/ajax/showaddcard.php2
-rw-r--r--apps/contacts/ajax/updateaddressbook.php2
4 files changed, 6 insertions, 6 deletions
diff --git a/apps/contacts/ajax/chooseaddressbook.php b/apps/contacts/ajax/chooseaddressbook.php
index d55fdf3e93b..e150f97f541 100644
--- a/apps/contacts/ajax/chooseaddressbook.php
+++ b/apps/contacts/ajax/chooseaddressbook.php
@@ -12,7 +12,7 @@ if(!OC_USER::isLoggedIn()) {
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>");
}
OC_JSON::checkAppEnabled('contacts');
-/* OC_Log::write('contacts','chooseaddressbook.php',OC_Log::DEBUG); */
+OC_Log::write('contacts','chooseaddressbook.php',OC_Log::DEBUG);
$output = new OC_TEMPLATE("contacts", "part.chooseaddressbook");
$output -> printpage();
diff --git a/apps/contacts/ajax/createaddressbook.php b/apps/contacts/ajax/createaddressbook.php
index 3dd38703c17..8fec07ebcae 100644
--- a/apps/contacts/ajax/createaddressbook.php
+++ b/apps/contacts/ajax/createaddressbook.php
@@ -17,10 +17,10 @@ OC_JSON::checkAppEnabled('contacts');
$userid = OC_User::getUser();
$bookid = OC_Contacts_Addressbook::add($userid, $_POST['name'], null);
OC_Contacts_Addressbook::setActive($bookid, 1);
-$book = OC_Contacts_Addressbook::find($bookid);
+$addressbook = OC_Contacts_Addressbook::find($bookid);
$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields');
-$tmpl->assign('addressbook', $book);
+$tmpl->assign('addressbook', $addressbook);
OC_JSON::success(array(
'page' => $tmpl->fetchPage(),
- 'bookid' => $bookid,
+ 'addressbook' => $addressbook,
));
diff --git a/apps/contacts/ajax/showaddcard.php b/apps/contacts/ajax/showaddcard.php
index 98367758fd4..5842046f00c 100644
--- a/apps/contacts/ajax/showaddcard.php
+++ b/apps/contacts/ajax/showaddcard.php
@@ -32,7 +32,7 @@ OC_JSON::checkAppEnabled('contacts');
$adr_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'ADR');
$phone_types = OC_Contacts_VCard::getTypesOfProperty($l10n, 'TEL');
-$addressbooks = OC_Contacts_Addressbook::all(OC_USER::getUser());
+$addressbooks = OC_Contacts_Addressbook::allAddressbooks(OC_USER::getUser());
$tmpl = new OC_Template('contacts','part.addcardform');
$tmpl->assign('addressbooks',$addressbooks);
$tmpl->assign('adr_types',$adr_types);
diff --git a/apps/contacts/ajax/updateaddressbook.php b/apps/contacts/ajax/updateaddressbook.php
index ccf1cef03f7..011dfc35d1a 100644
--- a/apps/contacts/ajax/updateaddressbook.php
+++ b/apps/contacts/ajax/updateaddressbook.php
@@ -19,7 +19,7 @@ OC_Contacts_Addressbook::edit($bookid, $_POST['name'], null);
OC_Contacts_Addressbook::setActive($bookid, $_POST['active']);
$addressbook = OC_Contacts_Addressbook::find($bookid);
$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields');
-$tmpl->assign('book', $book);
+$tmpl->assign('addressbook', $addressbook);
OC_JSON::success(array(
'page' => $tmpl->fetchPage(),
'addressbook' => $addressbook,