summaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax/updateaddressbook.php
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2011-12-05 03:38:06 +0100
committerThomas Tanghus <thomas@tanghus.net>2011-12-05 03:38:06 +0100
commit830efdccac71ebbd4ee5f9414abd0878f2ff9349 (patch)
tree9a546b0c8b7a0e8e0ffd8d05d96bf0f17e778229 /apps/contacts/ajax/updateaddressbook.php
parent2b48b733a3052c07e199dc2196426a529e977d2d (diff)
downloadnextcloud-server-830efdccac71ebbd4ee5f9414abd0878f2ff9349.tar.gz
nextcloud-server-830efdccac71ebbd4ee5f9414abd0878f2ff9349.zip
Fixed adding, editing and deleting address books. One minor UI flaw remains.
Diffstat (limited to 'apps/contacts/ajax/updateaddressbook.php')
-rw-r--r--apps/contacts/ajax/updateaddressbook.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/apps/contacts/ajax/updateaddressbook.php b/apps/contacts/ajax/updateaddressbook.php
new file mode 100644
index 00000000000..ccf1cef03f7
--- /dev/null
+++ b/apps/contacts/ajax/updateaddressbook.php
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+require_once('../../../lib/base.php');
+
+$l10n = new OC_L10N('contacts');
+
+// Check if we are a user
+OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('contacts');
+
+$bookid = $_POST['id'];
+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);
+OC_JSON::success(array(
+ 'page' => $tmpl->fetchPage(),
+ 'addressbook' => $addressbook,
+));