Ejemplo n.º 1
0
    bailOut(OC_Contacts_App::$l10n->t('checksum is not set.'));
}
if (is_array($value)) {
    $value = array_map('strip_tags', $value);
    ksort($value);
    // NOTE: Important, otherwise the compound value will be set in the order the fields appear in the form!
    //if($name == 'CATEGORIES') {
    //	$value = OC_Contacts_VCard::escapeDelimiters($value, ',');
    //} else {
    $value = OC_Contacts_VCard::escapeDelimiters($value, ';');
    //}
} else {
    $value = trim(strip_tags($value));
}
$vcard = OC_Contacts_App::getContactVCard($id);
$line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum);
if (is_null($line)) {
    bailOut(OC_Contacts_App::$l10n->t('Information about vCard is incorrect. Please reload the page: ') . $checksum);
}
$element = $vcard->children[$line]->name;
if ($element != $name) {
    bailOut(OC_Contacts_App::$l10n->t('Something went FUBAR. ') . $name . ' != ' . $element);
}
/* preprocessing value */
switch ($element) {
    case 'BDAY':
        $date = new DateTime($value);
        //$vcard->setDateTime('BDAY', $date, Sabre_VObject_Element_DateTime::DATE);
        $value = $date->format('Y-m-d');
        break;
    case 'FN':