mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-12-01 13:24:10 +01:00
Changed SQL queries for looking up contacts to only query once and sort at the same time.
This commit is contained in:
parent
aa2fabaef9
commit
35b3b8756e
@ -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);
|
||||
|
@ -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();
|
||||
|
17
index.php
17
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..?
|
||||
|
Loading…
Reference in New Issue
Block a user