diff --git a/apps/contacts/ajax/addproperty.php b/apps/contacts/ajax/addproperty.php index 0b218c6298..68c4f65fa5 100644 --- a/apps/contacts/ajax/addproperty.php +++ b/apps/contacts/ajax/addproperty.php @@ -53,16 +53,7 @@ $name = $_POST['name']; $value = $_POST['value']; $parameters = isset($_POST['parameteres'])?$_POST['parameters']:array(); -if(is_array($value)){ - $value = OC_Contacts_VCard::escapeSemicolons($value); -} -$property = new Sabre_VObject_Property( $name, $value ); -$parameternames = array_keys($parameters); -foreach($parameternames as $i){ - $property->parameters[] = new Sabre_VObject_Parameter($i,$parameters[$i]); -} - -$vcard->add($property); +OC_Contacts_VCard::addVCardProperty($vcard, $name, $value, $parameters); $line = count($vcard->children) - 1; $checksum = md5($property->serialize()); diff --git a/apps/contacts/js/interface.js b/apps/contacts/js/interface.js index 3ec84a3c8b..47e9bb10b1 100644 --- a/apps/contacts/js/interface.js +++ b/apps/contacts/js/interface.js @@ -104,6 +104,8 @@ $(document).ready(function(){ if(jsondata.status == 'success'){ $('#rightcontent').data('id',jsondata.data.id); $('#rightcontent').html(jsondata.data.page); + $('#leftcontent .active').removeClass('active'); + $('#leftcontent ul').append('
  • '+jsondata.data.name+'
  • '); } else{ alert(jsondata.data.message); diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php index 1c9a8049f7..bff2897384 100644 --- a/apps/contacts/lib/vcard.php +++ b/apps/contacts/lib/vcard.php @@ -246,7 +246,7 @@ class OC_Contacts_VCard{ public static function escapeSemicolons($value){ foreach($value as &$i ){ $i = implode("\\\\;", explode(';', $i)); - } unset($i); + } return implode(';',$value); } @@ -272,6 +272,26 @@ class OC_Contacts_VCard{ return $array; } + /** + * @brief Add property to vcard object + * @param object $vcard + * @param object $name of property + * @param object $value of property + * @param object $paramerters of property + */ + public static function addVCardProperty($vcard, $name, $value, $parameters=array()){ + if(is_array($value)){ + $value = OC_Contacts_VCard::escapeSemicolons($value); + } + $property = new Sabre_VObject_Property( $name, $value ); + $parameternames = array_keys($parameters); + foreach($parameternames as $i){ + $property->parameters[] = new Sabre_VObject_Parameter($i,$parameters[$i]); + } + + $vcard->add($property); + } + /** * @brief Data structure of vCard * @param object $property diff --git a/apps/contacts/templates/part.addcardform.php b/apps/contacts/templates/part.addcardform.php index e87c64507d..c7d668fae5 100644 --- a/apps/contacts/templates/part.addcardform.php +++ b/apps/contacts/templates/part.addcardform.php @@ -11,5 +11,41 @@
    + +
    + +

    +

    +

    +

    +

    +

    +

    +
    + +
    + + +
    + +
    + +
    + +
    + +
    diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php index 083f48e112..7d040689d4 100644 --- a/apps/files_sharing/get.php +++ b/apps/files_sharing/get.php @@ -70,7 +70,7 @@ if ($source !== false) { header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Pragma: public"); - header("Content-Disposition: filename=".basename($source)); + header('Content-Disposition: filename="'.basename($source).'"'); header("Content-Type: " . $mimetype); header("Content-Length: " . OC_Filesystem::filesize($source)); //download the file