From fb960939640cfcd5137f22b3d437d244eb0e540f Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Fri, 21 Oct 2011 20:41:48 +0200 Subject: [PATCH] Fix translations, empty properties --- ajax/addcard.php | 8 ++++++-- index.php | 1 - templates/part.addcardform.php | 4 ++-- templates/part.addpropertyform.php | 4 ++-- templates/part.property.php | 4 ++-- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ajax/addcard.php b/ajax/addcard.php index e7b56a7b..4e68dc96 100644 --- a/ajax/addcard.php +++ b/ajax/addcard.php @@ -44,10 +44,14 @@ $vcard = new Sabre_VObject_Component('VCARD'); $vcard->add(new Sabre_VObject_Property('FN',$fn)); $vcard->add(new Sabre_VObject_Property('UID',OC_Contacts_VCard::createUID())); foreach(array('ADR', 'TEL', 'EMAIL', 'ORG') as $propname){ + if( !( isset( $values[$propname] ) && $values[$propname] )){ + continue; + } $value = $values[$propname]; - if (isset($parameters[$propname])){ + if( isset( $parameters[$propname] ) && count$parameters[$propname] ){ $prop_parameters = $parameters[$propname]; - } else { + } + else{ $prop_parameters = array(); } OC_Contacts_VCard::addVCardProperty($vcard, $propname, $value, $prop_parameters); diff --git a/index.php b/index.php index 7e8eb8e6..7e93d618 100644 --- a/index.php +++ b/index.php @@ -65,7 +65,6 @@ foreach( $openaddressbooks as $addressbook ){ } } - usort($contacts,'contacts_namesort'); $details = array(); diff --git a/templates/part.addcardform.php b/templates/part.addcardform.php index c7d668fa..9899f552 100644 --- a/templates/part.addcardform.php +++ b/templates/part.addcardform.php @@ -14,8 +14,8 @@

diff --git a/templates/part.addpropertyform.php b/templates/part.addpropertyform.php index 885330e5..7c366e03 100644 --- a/templates/part.addpropertyform.php +++ b/templates/part.addpropertyform.php @@ -14,8 +14,8 @@