diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-01-02 20:24:05 +0100 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-01-09 20:38:05 +0100 |
commit | d91a4fcaf3ffc0783f7aef6767d7b15773808eb5 (patch) | |
tree | 4922a034bf9c293e925ff262b1fa4e22341540a5 | |
parent | 5e40653713eed01d96841dc93e11534b46a443ee (diff) | |
download | nextcloud-server-d91a4fcaf3ffc0783f7aef6767d7b15773808eb5.tar.gz nextcloud-server-d91a4fcaf3ffc0783f7aef6767d7b15773808eb5.zip |
Changed SQL queries for looking up contacts to only query once and sort at the same time.
-rw-r--r-- | apps/contacts/ajax/addcard.php | 1 | ||||
-rw-r--r-- | apps/contacts/ajax/contacts.php | 15 | ||||
-rw-r--r-- | apps/contacts/index.php | 17 |
3 files changed, 0 insertions, 33 deletions
diff --git a/apps/contacts/ajax/addcard.php b/apps/contacts/ajax/addcard.php index 54c455e515f..9d782246a0a 100644 --- a/apps/contacts/ajax/addcard.php +++ b/apps/contacts/ajax/addcard.php @@ -61,6 +61,5 @@ foreach( $add as $propname){ $vcard->addProperty($propname, $value, $prop_parameters); } $id = OC_Contacts_VCard::add($aid,$vcard->serialize()); -OC_Log::write('contacts','ajax/addcard.php - adding id: '.$id,OC_Log::DEBUG); OC_Contacts_App::renderDetails($id, $vcard); diff --git a/apps/contacts/ajax/contacts.php b/apps/contacts/ajax/contacts.php index 54ad3e4c103..cf86764105f 100644 --- a/apps/contacts/ajax/contacts.php +++ b/apps/contacts/ajax/contacts.php @@ -12,21 +12,6 @@ OC_JSON::checkAppEnabled('contacts'); $ids = OC_Contacts_Addressbook::activeIds(OC_User::getUser()); $contacts = OC_Contacts_VCard::all($ids); -//OC_Log::write('contacts','contacts.php: '.count($contacts).' contacts.',OC_Log::DEBUG); -/* -$addressbooks = OC_Contacts_Addressbook::active(OC_User::getUser()); -$contacts = array(); -foreach( $addressbooks as $addressbook ){ - $addressbookcontacts = OC_Contacts_VCard::all($addressbook['id']); - foreach( $addressbookcontacts as $contact ){ - if(is_null($contact['fullname'])){ - continue; - } - $contacts[] = $contact; - } -} -usort($contacts,'contacts_namesort'); -*/ $tmpl = new OC_TEMPLATE("contacts", "part.contacts"); $tmpl->assign('contacts', $contacts); $page = $tmpl->fetchPage(); diff --git a/apps/contacts/index.php b/apps/contacts/index.php index 5ab6f293ab4..b392b195a9c 100644 --- a/apps/contacts/index.php +++ b/apps/contacts/index.php @@ -42,23 +42,6 @@ OC_App::setActiveNavigationEntry( 'contacts_index' ); // Load a specific user? $id = isset( $_GET['id'] ) ? $_GET['id'] : null; -/* -// sort addressbooks (use contactsort) -usort($addressbooks,'contacts_namesort'); - -$contacts = array(); -foreach( $addressbooks as $addressbook ){ - $addressbookcontacts = OC_Contacts_VCard::all($addressbook['id']); - foreach( $addressbookcontacts as $contact ){ - if(is_null($contact['fullname'])){ - continue; - } - $contacts[] = $contact; - } -} - -usort($contacts,'contacts_namesort'); -*/ $details = array(); // FIXME: This cannot work..? |