summaryrefslogtreecommitdiffstats
path: root/apps/contacts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/contacts')
-rw-r--r--apps/contacts/ajax/addressbook/add.php2
-rw-r--r--apps/contacts/js/settings.js14
2 files changed, 8 insertions, 8 deletions
diff --git a/apps/contacts/ajax/addressbook/add.php b/apps/contacts/ajax/addressbook/add.php
index 617c2fd1822..65077743ed5 100644
--- a/apps/contacts/ajax/addressbook/add.php
+++ b/apps/contacts/ajax/addressbook/add.php
@@ -34,4 +34,4 @@ if(!OC_Contacts_Addressbook::setActive($bookid, 1)) {
bailOut('Error activating addressbook.');
}
$addressbook = OC_Contacts_App::getAddressbook($bookid);
-OCP\JSON::success(array('addressbook' => $addressbook));
+OCP\JSON::success(array('data' => array('addressbook' => $addressbook)));
diff --git a/apps/contacts/js/settings.js b/apps/contacts/js/settings.js
index 6f0a8b88353..284f972be8e 100644
--- a/apps/contacts/js/settings.js
+++ b/apps/contacts/js/settings.js
@@ -79,26 +79,26 @@ OC.Contacts.Settings = OC.Contacts.Settings || {
if(jsondata.status == 'success'){
self.showActions(['new',]);
self.adractions.removeData('id');
- active = Boolean(Number(jsondata.addressbook.active));
+ active = Boolean(Number(jsondata.data.addressbook.active));
if(id == 'new') {
self.adrsettings.find('table')
- .append('<tr class="addressbook" data-id="'+jsondata.addressbook.id+'" data-uri="'+jsondata.addressbook.uri+'">'
+ .append('<tr class="addressbook" data-id="'+jsondata.data.addressbook.id+'" data-uri="'+jsondata.data.addressbook.uri+'">'
+ '<td class="active"><input type="checkbox" '+(active ? 'checked="checked"' : '')+' /></td>'
- + '<td class="name">'+jsondata.addressbook.displayname+'</td>'
- + '<td class="description">'+jsondata.addressbook.description+'</td>'
+ + '<td class="name">'+jsondata.data.addressbook.displayname+'</td>'
+ + '<td class="description">'+jsondata.data.addressbook.description+'</td>'
+ '<td class="action"><a class="svg action globe" title="'+t('contacts', 'Show CardDav link')+'"></a></td>'
+ '<td class="action"><a class="svg action cloud" title="'+t('contacts', 'Show read-only VCF link')+'"></a></td>'
+ '<td class="action"><a class="svg action download" title="'+t('contacts', 'Download')+'" '
+ 'href="'+totalurl+'/'+encodeURIComponent(oc_current_user)+'/'
- + encodeURIComponent(jsondata.addressbook.uri)+'?export"></a></td>'
+ + encodeURIComponent(jsondata.data.addressbook.uri)+'?export"></a></td>'
+ '<td class="action"><a class="svg action edit" title="'+t('contacts', 'Edit')+'"></a></td>'
+ '<td class="action"><a class="svg action delete" title="'+t('contacts', 'Delete')+'"></a></td>'
+ '</tr>');
} else {
var row = self.adrsettings.find('tr[data-id="'+id+'"]');
row.find('td.active').find('input:checkbox').prop('checked', active);
- row.find('td.name').text(jsondata.addressbook.displayname);
- row.find('td.description').text(jsondata.addressbook.description);
+ row.find('td.name').text(jsondata.data.addressbook.displayname);
+ row.find('td.description').text(jsondata.data.addressbook.description);
}
OC.Contacts.Contacts.update();
} else {