summaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax/addcard.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/contacts/ajax/addcard.php')
-rw-r--r--apps/contacts/ajax/addcard.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/apps/contacts/ajax/addcard.php b/apps/contacts/ajax/addcard.php
index 9d782246a0a..54e4faa6ed9 100644
--- a/apps/contacts/ajax/addcard.php
+++ b/apps/contacts/ajax/addcard.php
@@ -54,11 +54,24 @@ foreach( $add as $propname){
$value = $values[$propname];
if( isset( $parameters[$propname] ) && count( $parameters[$propname] )){
$prop_parameters = $parameters[$propname];
- }
else{
$prop_parameters = array();
}
- $vcard->addProperty($propname, $value, $prop_parameters);
+ $vcard->addProperty($propname, $value); //, $prop_parameters);
+ $line = count($vcard->children) - 1;
+ foreach ($prop_parameters as $key=>$element) {
+ if(is_array($element) && strtoupper($key) == 'TYPE') {
+ // FIXME: Maybe this doesn't only apply for TYPE?
+ // And it probably shouldn't be done here anyways :-/
+ foreach($element as $e){
+ if($e != '' && !is_null($e)){
+ $vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter($key,$e);
+ }
+ }
+ } else {
+ $vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter($key,$element);
+ }
+ }
}
$id = OC_Contacts_VCard::add($aid,$vcard->serialize());