1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-01 13:24:10 +01:00

Fixed showing first contact if non is selected.

This commit is contained in:
Thomas Tanghus 2012-01-02 23:14:58 +01:00
parent c76097f7fe
commit 4e095cb3f0

View File

@ -45,11 +45,17 @@ $id = isset( $_GET['id'] ) ? $_GET['id'] : null;
$details = array();
// FIXME: This cannot work..?
if( !is_null($id)/* || count($contacts)*/){
if(is_null($id)) $id = $contacts[0]['id'];
$vcard = OC_Contacts_App::getContactVCard($id);
$details = OC_Contacts_VCard::structureContact($vcard);
if(is_null($id) && count($contacts) > 0) {
$id = $contacts[0]['id'];
}
$vcard = OC_Contacts_App::getContactVCard($id);
$details = OC_Contacts_VCard::structureContact($vcard);
// if( !is_null($id)/* || count($contacts)*/){
// if(is_null($id)) $id = $contacts[0]['id'];
// $vcard = OC_Contacts_App::getContactVCard($id);
// $details = OC_Contacts_VCard::structureContact($vcard);
// }
// Include Style and Script
OC_Util::addScript('contacts','interface');