aboutsummaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax/setproperty.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2011-11-23 21:06:51 +0100
committerBart Visscher <bartv@thisnet.nl>2011-11-23 21:07:32 +0100
commita2ecdfcac102395ce3d9da41b4074fd7e4cc927e (patch)
treee5d5b653d4588faa8effd67fa233325addd7fd1c /apps/contacts/ajax/setproperty.php
parentad390d5e42eaa9d56c79f7d81d057ef88eda9117 (diff)
downloadnextcloud-server-a2ecdfcac102395ce3d9da41b4074fd7e4cc927e.tar.gz
nextcloud-server-a2ecdfcac102395ce3d9da41b4074fd7e4cc927e.zip
Contacts: support multiple phone type parameter
Diffstat (limited to 'apps/contacts/ajax/setproperty.php')
-rw-r--r--apps/contacts/ajax/setproperty.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/contacts/ajax/setproperty.php b/apps/contacts/ajax/setproperty.php
index 9164f86913d..c9102c4a2ee 100644
--- a/apps/contacts/ajax/setproperty.php
+++ b/apps/contacts/ajax/setproperty.php
@@ -70,6 +70,9 @@ $vcard->children[$line]->setValue($value);
// Add parameters
$postparameters = isset($_POST['parameters'])?$_POST['parameters']:array();
+if ($vcard->children[$line]->name == 'TEL' && !array_key_exists('TYPE', $postparameters)){
+ $postparameters['TYPE']='';
+}
for($i=0;$i<count($vcard->children[$line]->parameters);$i++){
$name = $vcard->children[$line]->parameters[$i]->name;
if(array_key_exists($name,$postparameters)){
@@ -77,7 +80,14 @@ for($i=0;$i<count($vcard->children[$line]->parameters);$i++){
unset($vcard->children[$line]->parameters[$i]);
}
else{
- $vcard->children[$line]->parameters[$i]->value = $postparameters[$name];
+ unset($vcard->children[$line][$name]);
+ $values = $postparameters[$name];
+ if (!is_array($values)){
+ $values = array($values);
+ }
+ foreach($values as $value){
+ $vcard->children[$line]->add($name, $value);
+ }
}
unset($postparameters[$name]);
}