summaryrefslogtreecommitdiffstats
path: root/apps/contacts/ajax/saveproperty.php
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-04-07 16:03:11 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-04-07 16:03:43 +0200
commitd1ae6512cc760c76798a5a8636d1d7908c706ae8 (patch)
tree5de1276b45f830fb5b7bd97201708684acb885d1 /apps/contacts/ajax/saveproperty.php
parentb71cf1a4f97bb660a279a16ca4da864b56986a59 (diff)
downloadnextcloud-server-d1ae6512cc760c76798a5a8636d1d7908c706ae8.tar.gz
nextcloud-server-d1ae6512cc760c76798a5a8636d1d7908c706ae8.zip
Contacts: Misc. cleanup tweaks.
Diffstat (limited to 'apps/contacts/ajax/saveproperty.php')
-rw-r--r--apps/contacts/ajax/saveproperty.php58
1 files changed, 29 insertions, 29 deletions
diff --git a/apps/contacts/ajax/saveproperty.php b/apps/contacts/ajax/saveproperty.php
index 924d873652c..4cef4d1e7a5 100644
--- a/apps/contacts/ajax/saveproperty.php
+++ b/apps/contacts/ajax/saveproperty.php
@@ -97,39 +97,39 @@ switch($element) {
}
break;
case 'CATEGORIES':
- /* multi autocomplete triggers an save with empty value */
+ /* multi autocomplete triggers an save with empty value
if (!$value) {
$value = $vcard->getAsString('CATEGORIES');
}
- break;
+ break;*/
case 'EMAIL':
$value = strtolower($value);
break;
}
if(!$value) {
- bailOut(OC_Contacts_App::$l10n->t('Cannot save empty value.'));
-}
-
-/* setting value */
-switch($element) {
- case 'BDAY':
- case 'FN':
- case 'N':
- case 'ORG':
- case 'NOTE':
- case 'NICKNAME':
- case 'CATEGORIES':
- debug('Setting string:'.$name.' '.$value);
- $vcard->setString($name, $value);
- break;
- case 'EMAIL':
- case 'TEL':
- case 'ADR': // should I delete the property if empty or throw an error?
- debug('Setting element: (EMAIL/TEL/ADR)'.$element);
- if(!$value) {
- unset($vcard->children[$line]); // Should never happen...
- } else {
+ unset($vcard->children[$line]);
+ $checksum = '';
+} else {
+ /* setting value */
+ switch($element) {
+ case 'BDAY':
+ case 'FN':
+ case 'N':
+ case 'ORG':
+ case 'NOTE':
+ case 'NICKNAME':
+ debug('Setting string:'.$name.' '.$value);
+ $vcard->setString($name, $value);
+ break;
+ case 'CATEGORIES':
+ debug('Setting string:'.$name.' '.$value);
+ $vcard->children[$line]->setValue($value);
+ break;
+ case 'EMAIL':
+ case 'TEL':
+ case 'ADR': // should I delete the property if empty or throw an error?
+ debug('Setting element: (EMAIL/TEL/ADR)'.$element);
$vcard->children[$line]->setValue($value);
$vcard->children[$line]->parameters = array();
if(!is_null($parameters)) {
@@ -142,12 +142,12 @@ switch($element) {
}
}
}
- }
- break;
+ break;
+ }
+ // Do checksum and be happy
+ $checksum = md5($vcard->children[$line]->serialize());
}
-// Do checksum and be happy
-$checksum = md5($vcard->children[$line]->serialize());
-debug('New checksum: '.$checksum);
+//debug('New checksum: '.$checksum);
if(!OC_Contacts_VCard::edit($id,$vcard)) {
bailOut(OC_Contacts_App::$l10n->t('Error updating contact property.'));