diff options
author | Marvin Thomas Rabe <m.rabe@echtzeitraum.de> | 2011-10-06 22:35:36 +0200 |
---|---|---|
committer | Marvin Thomas Rabe <m.rabe@echtzeitraum.de> | 2011-10-06 22:35:36 +0200 |
commit | 878178145d4238344add8b4ae68b6a0b48239d24 (patch) | |
tree | aa617a0d9a2988ba02f5568868c47704ae6dc500 | |
parent | 7579fc7bc9c894182b3de9bb9007aaa4b554b7fc (diff) | |
parent | 5570222b40194e6ef3a82857718dee2577818f79 (diff) | |
download | nextcloud-server-878178145d4238344add8b4ae68b6a0b48239d24.tar.gz nextcloud-server-878178145d4238344add8b4ae68b6a0b48239d24.zip |
Merge commit 'refs/merge-requests/54' of git://gitorious.org/owncloud/owncloud into merge-requests/54
-rw-r--r-- | apps/contacts/ajax/addproperty.php | 11 | ||||
-rw-r--r-- | apps/contacts/js/interface.js | 2 | ||||
-rw-r--r-- | apps/contacts/lib/vcard.php | 22 | ||||
-rw-r--r-- | apps/contacts/templates/part.addcardform.php | 36 | ||||
-rw-r--r-- | apps/files_sharing/get.php | 2 |
5 files changed, 61 insertions, 12 deletions
diff --git a/apps/contacts/ajax/addproperty.php b/apps/contacts/ajax/addproperty.php index 0b218c6298f..68c4f65fa5c 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 3ec84a3c8ba..47e9bb10b1f 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('<li data-id="'+jsondata.data.id+'" class="active"><a href="index.php?id='+jsondata.data.id+'">'+jsondata.data.name+'</a></li>'); } else{ alert(jsondata.data.message); diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php index 1c9a8049f73..bff2897384f 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); } @@ -273,6 +273,26 @@ class OC_Contacts_VCard{ } /** + * @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 * @return associative array diff --git a/apps/contacts/templates/part.addcardform.php b/apps/contacts/templates/part.addcardform.php index e87c64507dc..c7d668fae58 100644 --- a/apps/contacts/templates/part.addcardform.php +++ b/apps/contacts/templates/part.addcardform.php @@ -11,5 +11,41 @@ <?php endif; ?> <label for="fn"><?php echo $l->t('Name'); ?></label> <input type="text" name="fn" value=""><br> + <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> + </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> + <p><label><?php echo $l->t('Street'); ?></label> <input type="text" name="value[ADR][2]" value=""></p> + <p><label><?php echo $l->t('City'); ?></label> <input type="text" name="value[ADR][3]" value=""></p> + <p><label><?php echo $l->t('Region'); ?></label> <input type="text" name="value[ADR][4]" value=""></p> + <p><label><?php echo $l->t('Zipcode'); ?></label> <input type="text" name="value[ADR][5]" value=""></p> + <p><label><?php echo $l->t('Country'); ?></label> <input type="text" name="value[ADR][6]" value=""></p> + </div> + <label for="TEL"><?php echo $l->t('Telephone'); ?></label> + <div id="contacts_phonepart"> + <select id="TEL" name="parameters[TEL][TYPE]" size="1"> + <option value="home"><?php echo $l->t('Home'); ?></option> + <option value="cell" selected="selected"><?php echo $l->t('Mobile'); ?></option> + <option value="work"><?php echo $l->t('Work'); ?></option> + <option value="text"><?php echo $l->t('Text'); ?></option> + <option value="voice"><?php echo $l->t('Voice'); ?></option> + <option value="fax"><?php echo $l->t('Fax'); ?></option> + <option value="video"><?php echo $l->t('Video'); ?></option> + <option value="pager"><?php echo $l->t('Pager'); ?></option> + </select> + <input type="text" name="value[TEL]" value=""> + </div> + <label for="EMAIL"><?php echo $l->t('Email'); ?></label> + <div id="contacts_email"> + <input id="EMAIL" type="text" name="value[EMAIL]" value=""> + </div> + <label for="ORG"><?php echo $l->t('Organization'); ?></label> + <div id="contacts_organisation"> + <input id="ORG" type="text" name="value[ORG]" value=""> + </div> <input type="submit" name="submit" value="<?php echo $l->t('Create Contact'); ?>"> </form> diff --git a/apps/files_sharing/get.php b/apps/files_sharing/get.php index 083f48e1127..7d040689d41 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 |