aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Sack <kde@jakobsack.de>2011-10-21 20:41:48 +0200
committerJakob Sack <kde@jakobsack.de>2011-10-22 19:23:22 +0200
commitb224991ea2899f4991b8defb7653bdbf5a08631f (patch)
tree358de5275c82b99778eba371d521376f80734d41
parent045c42aa99d3f7ad45434ab371828853f3378968 (diff)
downloadnextcloud-server-b224991ea2899f4991b8defb7653bdbf5a08631f.tar.gz
nextcloud-server-b224991ea2899f4991b8defb7653bdbf5a08631f.zip
Fix translations, empty properties
-rw-r--r--apps/contacts/ajax/addcard.php8
-rw-r--r--apps/contacts/index.php1
-rw-r--r--apps/contacts/templates/part.addcardform.php4
-rw-r--r--apps/contacts/templates/part.addpropertyform.php4
-rw-r--r--apps/contacts/templates/part.property.php4
5 files changed, 12 insertions, 9 deletions
diff --git a/apps/contacts/ajax/addcard.php b/apps/contacts/ajax/addcard.php
index e7b56a7bf00..4e68dc96385 100644
--- a/apps/contacts/ajax/addcard.php
+++ b/apps/contacts/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/apps/contacts/index.php b/apps/contacts/index.php
index 7e8eb8e6951..7e93d6183ed 100644
--- a/apps/contacts/index.php
+++ b/apps/contacts/index.php
@@ -65,7 +65,6 @@ foreach( $openaddressbooks as $addressbook ){
}
}
-
usort($contacts,'contacts_namesort');
$details = array();
diff --git a/apps/contacts/templates/part.addcardform.php b/apps/contacts/templates/part.addcardform.php
index c7d668fae58..9899f552857 100644
--- a/apps/contacts/templates/part.addcardform.php
+++ b/apps/contacts/templates/part.addcardform.php
@@ -14,8 +14,8 @@
<label for="ADR"><?php echo $l->t('Address'); ?></label>
<div id="contacts_addresspart">
<select id="ADR" name="parameters[ADR][TYPE]" size="1">
- <option value="adr_work"><?php echo $l->t('Work'); ?></option>
- <option value="adr_home" selected="selected"><?php echo $l->t('Home'); ?></option>
+ <option value="work"><?php echo $l->t('Work'); ?></option>
+ <option value="home" selected="selected"><?php echo $l->t('Home'); ?></option>
</select>
<p><label><?php echo $l->t('PO Box'); ?></label> <input type="text" name="value[ADR][0]" value=""></p>
<p><label><?php echo $l->t('Extended'); ?></label> <input type="text" name="value[ADR][1]" value=""></p>
diff --git a/apps/contacts/templates/part.addpropertyform.php b/apps/contacts/templates/part.addpropertyform.php
index 885330e5778..7c366e03242 100644
--- a/apps/contacts/templates/part.addpropertyform.php
+++ b/apps/contacts/templates/part.addpropertyform.php
@@ -14,8 +14,8 @@
<div id="contacts_addcontactsparts" style="display:none;">
<div id="contacts_addresspart">
<select name="parameters[TYPE]" size="1">
- <option value="adr_work"><?php echo $l->t('Work'); ?></option>
- <option value="adr_home" selected="selected"><?php echo $l->t('Home'); ?></option>
+ <option value="work"><?php echo $l->t('Work'); ?></option>
+ <option value="home" selected="selected"><?php echo $l->t('Home'); ?></option>
</select>
<p><label><?php echo $l->t('PO Box'); ?></label> <input type="text" name="value[0]" value=""></p>
<p><label><?php echo $l->t('Extended'); ?></label> <input type="text" name="value[1]" value=""></p>
diff --git a/apps/contacts/templates/part.property.php b/apps/contacts/templates/part.property.php
index 31fb187a0d3..ffc056e5aba 100644
--- a/apps/contacts/templates/part.property.php
+++ b/apps/contacts/templates/part.property.php
@@ -30,7 +30,7 @@
<td class="contacts_details_right">
<?php echo $_['property']['value']; ?>
<?php if(isset($_['property']['parameters']['TYPE'])): ?>
- (<?php echo strtolower($_['property']['parameters']['TYPE']); ?>)
+ (<?php echo $l->t(ucwords(str_replace('cell','mobile',strtolower($_['property']['parameters']['TYPE'])))); ?>)
<?php endif; ?>
<span style="display:none;" data-use="edit"><img class="svg action" src="<?php echo image_path('', 'actions/rename.svg'); ?>" /></span>
<span style="display:none;" data-use="delete"><img class="svg action" src="<?php echo image_path('', 'actions/delete.svg'); ?>" /></span>
@@ -40,7 +40,7 @@
<?php echo $l->t('Address'); ?>
<?php if(isset($_['property']['parameters']['TYPE'])): ?>
<br>
- (<?php echo strtolower($_['property']['parameters']['TYPE']); ?>)
+ (<?php echo $l->t(ucwords($_['property']['parameters']['TYPE'])); ?>)
<?php endif; ?>
</td>
<td class="contacts_details_right">