diff --git a/ajax/selectaddressbook.php b/ajax/selectaddressbook.php index e5527c8e..04c871bd 100644 --- a/ajax/selectaddressbook.php +++ b/ajax/selectaddressbook.php @@ -11,12 +11,8 @@ OCP\JSON::checkAppEnabled('contacts'); $books = OC_Contacts_Addressbook::all(OCP\USER::getUser()); if(count($books) > 1) { - $addressbooks = array(); - foreach($books as $book) { - $addressbooks[] = array('id' => $book['id'], 'name' => $book['displayname']); - } $tmpl = new OCP\Template("contacts", "part.selectaddressbook"); - $tmpl->assign('addressbooks', $addressbooks); + $tmpl->assign('addressbooks', $books); $page = $tmpl->fetchPage(); OCP\JSON::success(array('data' => array( 'type' => 'dialog', 'page' => $page ))); } else {