From 50a4e8ed8d51fb9a6633d4bfd9a1c051daed30cd Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Tue, 7 Aug 2012 00:05:43 +0200 Subject: [PATCH 1/5] Some UI improvements on the addressbooks settings. --- css/contacts.css | 3 +++ js/settings.js | 21 +++++++++++++++------ templates/settings.php | 4 +--- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/css/contacts.css b/css/contacts.css index 0961550c..c5308c4d 100644 --- a/css/contacts.css +++ b/css/contacts.css @@ -140,4 +140,7 @@ input[type="checkbox"] { width: 20px; height: 20px; vertical-align: bottom; } .addressbooks-settings .actions * { float: left; } .addressbooks-settings .actions input.name { width: 5em; } .addressbooks-settings .actions input.name { width: 7em; } +.addressbooks-settings a.action { opacity: 0.2; } +.addressbooks-settings a.action:hover { opacity: 1; } +.addressbooks-settings td.active, .addressbooks-settings td.action { width: 20px; } diff --git a/js/settings.js b/js/settings.js index 284f972b..67aaa5b5 100644 --- a/js/settings.js +++ b/js/settings.js @@ -89,8 +89,7 @@ OC.Contacts.Settings = OC.Contacts.Settings || { + '' + '' + '' + + 'href="'+OC.linkTo('contacts', 'export.php')+'?bookid='+jsondata.data.addressbook.id+'">' + '' + '' + ''); @@ -106,17 +105,27 @@ OC.Contacts.Settings = OC.Contacts.Settings || { } }); }, + showLink:function(id, row, link) { + console.log('row:', row.length); + row.next('tr.link').remove(); + var linkrow = $('' + + '').insertAfter(row); + linkrow.find('input').focus().select(); + linkrow.find('button').click(function() { + $(this).parents('tr').first().remove(); + }); + }, showCardDAV:function(id) { console.log('showCardDAV: ', id); var row = this.adrsettings.find('tr[data-id="'+id+'"]'); - this.adractions.find('.link').val(totalurl+'/'+encodeURIComponent(oc_current_user)+'/'); - this.showActions(['link','cancel']); + this.showLink(id, row, totalurl+'/'+encodeURIComponent(oc_current_user)); }, showVCF:function(id) { console.log('showVCF: ', id); var row = this.adrsettings.find('tr[data-id="'+id+'"]'); - this.adractions.find('.link').val(totalurl+'/'+encodeURIComponent(oc_current_user)+'/'+encodeURIComponent(row.data('uri'))+'?export'); - this.showActions(['link','cancel']); + var link = totalurl+'/'+encodeURIComponent(oc_current_user)+'/'+encodeURIComponent(row.data('uri'))+'?export'; + console.log(link); + this.showLink(id, row, link); } } }; diff --git a/templates/settings.php b/templates/settings.php index 85dbca36..3fddc595 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -24,8 +24,7 @@ + href="?bookid="> "> @@ -41,7 +40,6 @@ - From a4deaea7bb3b14332adfefed55f0c84659da453f Mon Sep 17 00:00:00 2001 From: Jenkins for ownCloud Date: Tue, 7 Aug 2012 02:07:50 +0200 Subject: [PATCH 2/5] [tx-robot] updated from transifex --- l10n/de.php | 2 ++ l10n/fr.php | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/l10n/de.php b/l10n/de.php index 08e28f3f..5fa5bb4f 100644 --- a/l10n/de.php +++ b/l10n/de.php @@ -108,6 +108,8 @@ "Next contact in list" => "Nächster Kontakt aus der Liste", "Previous contact in list" => "Vorheriger Kontakt aus der Liste", "Expand/collapse current addressbook" => "Ausklappen/Einklappen des Adressbuches", +"Next addressbook" => "Nächstes Adressbuch", +"Previous addressbook" => "Vorheriges Adressbuch", "Actions" => "Aktionen", "Refresh contacts list" => "Kontaktliste neu laden", "Add new contact" => "Neuen Kontakt hinzufügen", diff --git a/l10n/fr.php b/l10n/fr.php index 88521f84..9b4822bd 100644 --- a/l10n/fr.php +++ b/l10n/fr.php @@ -63,6 +63,8 @@ "Result: " => "Résultat :", " imported, " => "importé,", " failed." => "échoué.", +"Displayname cannot be empty." => "Le nom d'affichage ne peut pas être vide.", +"Addressbook not found: " => "Carnet d'adresse introuvable : ", "This is not your addressbook." => "Ce n'est pas votre carnet d'adresses.", "Contact could not be found." => "Ce contact n'a pu être trouvé.", "Address" => "Adresse", @@ -97,6 +99,7 @@ "Contact" => "Contact", "Add Contact" => "Ajouter un Contact", "Import" => "Importer", +"Settings" => "Paramètres", "Addressbooks" => "Carnets d'adresses", "Close" => "Fermer", "Keyboard shortcuts" => "Raccourcis clavier", @@ -104,6 +107,8 @@ "Next contact in list" => "Contact suivant dans la liste", "Previous contact in list" => "Contact précédent dans la liste", "Expand/collapse current addressbook" => "Dé/Replier le carnet d'adresses courant", +"Next addressbook" => "Carnet d'adresses suivant", +"Previous addressbook" => "Carnet d'adresses précédent", "Actions" => "Actions", "Refresh contacts list" => "Actualiser la liste des contacts", "Add new contact" => "Ajouter un nouveau contact", @@ -190,9 +195,13 @@ "more info" => "Plus d'infos", "Primary address (Kontact et al)" => "Adresse principale", "iOS/OS X" => "iOS/OS X", +"Show CardDav link" => "Afficher le lien CardDav", "Download" => "Télécharger", "Edit" => "Modifier", "New Address Book" => "Nouveau Carnet d'adresses", +"Name" => "Nom", +"Description" => "Description", "Save" => "Sauvegarder", -"Cancel" => "Annuler" +"Cancel" => "Annuler", +"More..." => "Plus…" ); From ad653dddc9e9ce63075609ae157684bdaddd1c7a Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Thu, 9 Aug 2012 11:35:14 +0200 Subject: [PATCH 3/5] Fix require statements. Fix for oc-1460. --- ajax/contact/addproperty.php | 14 +++++++------- ajax/contact/delete.php | 3 ++- ajax/contact/deleteproperty.php | 3 ++- ajax/contact/saveproperty.php | 4 +++- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ajax/contact/addproperty.php b/ajax/contact/addproperty.php index 58b85754..ca28140e 100644 --- a/ajax/contact/addproperty.php +++ b/ajax/contact/addproperty.php @@ -25,7 +25,7 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); OCP\JSON::callCheck(); -require_once 'loghandler.php'; +require_once __DIR__.'/../loghandler.php'; $id = isset($_POST['id'])?$_POST['id']:null; $name = isset($_POST['name'])?$_POST['name']:null; @@ -48,9 +48,9 @@ if(!$vcard) { if(!is_array($value)) { $value = trim($value); - if(!$value + if(!$value && in_array( - $name, + $name, array('TEL', 'EMAIL', 'ORG', 'BDAY', 'URL', 'NICKNAME', 'NOTE')) ) { bailOut($l10n->t('Cannot add empty property.')); @@ -78,9 +78,9 @@ foreach($current as $item) { } if(is_array($value)) { - // NOTE: Important, otherwise the compound value will + // NOTE: Important, otherwise the compound value will // be set in the order the fields appear in the form! - ksort($value); + ksort($value); $value = array_map('strip_tags', $value); } else { $value = strip_tags($value); @@ -123,10 +123,10 @@ switch($name) { $line = count($vcard->children) - 1; -// Apparently Sabre_VObject_Parameter doesn't do well with +// Apparently Sabre_VObject_Parameter doesn't do well with // multiple values or I don't know how to do it. Tanghus. foreach ($parameters as $key=>$element) { - if(is_array($element) && strtoupper($key) == 'TYPE') { + if(is_array($element) && strtoupper($key) == 'TYPE') { // NOTE: Maybe this doesn't only apply for TYPE? // And it probably shouldn't be done here anyways :-/ foreach($element as $e) { diff --git a/ajax/contact/delete.php b/ajax/contact/delete.php index 9777046f..def98b36 100644 --- a/ajax/contact/delete.php +++ b/ajax/contact/delete.php @@ -23,7 +23,8 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); OCP\JSON::callCheck(); -require_once 'loghandler.php'; + +require_once __DIR__.'/../loghandler.php'; $id = isset($_POST['id'])?$_POST['id']:null; if(!$id) { diff --git a/ajax/contact/deleteproperty.php b/ajax/contact/deleteproperty.php index 205df8bc..9c3f09f8 100644 --- a/ajax/contact/deleteproperty.php +++ b/ajax/contact/deleteproperty.php @@ -24,7 +24,8 @@ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); OCP\JSON::callCheck(); -require_once 'loghandler.php'; + +require_once __DIR__.'/../loghandler.php'; $id = $_POST['id']; $checksum = $_POST['checksum']; diff --git a/ajax/contact/saveproperty.php b/ajax/contact/saveproperty.php index ef4d1b26..f9880c78 100644 --- a/ajax/contact/saveproperty.php +++ b/ajax/contact/saveproperty.php @@ -19,7 +19,9 @@ * License along with this library. If not, see . * */ -require_once 'loghandler.php'; + +require_once __DIR__.'/../loghandler.php'; + // Check if we are a user OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('contacts'); From 696a330c379550afc901d60fd11dc35fab105964 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Thu, 9 Aug 2012 16:31:04 +0200 Subject: [PATCH 4/5] Another take at profile photo/thumbnail caching. oc-839. --- ajax/contact/add.php | 8 +++++++- ajax/contact/addproperty.php | 7 ++++++- ajax/contact/deleteproperty.php | 7 ++++++- ajax/contact/details.php | 1 + ajax/contact/saveproperty.php | 5 +++-- ajax/savecrop.php | 31 ++++++++++++++-------------- js/contacts.js | 8 ++++---- lib/app.php | 12 +++++++++++ photo.php | 28 ++++++++++++++++--------- thumbnail.php | 36 ++++++++++++++++++++------------- 10 files changed, 96 insertions(+), 47 deletions(-) diff --git a/ajax/contact/add.php b/ajax/contact/add.php index 6aaf5a9d..043e947d 100644 --- a/ajax/contact/add.php +++ b/ajax/contact/add.php @@ -49,4 +49,10 @@ if(!$id) { exit(); } -OCP\JSON::success(array('data' => array( 'id' => $id, 'aid' => $aid ))); +OCP\JSON::success(array( + 'data' => array( + 'id' => $id, + 'aid' => $aid, + 'lastmodified' => OC_Contacts_VCard::lastModified($vcard)->format('U') + ) +)); diff --git a/ajax/contact/addproperty.php b/ajax/contact/addproperty.php index ca28140e..df064367 100644 --- a/ajax/contact/addproperty.php +++ b/ajax/contact/addproperty.php @@ -144,4 +144,9 @@ if(!OC_Contacts_VCard::edit($id, $vcard)) { bailOut($l10n->t('Error adding contact property: '.$name)); } -OCP\JSON::success(array('data' => array( 'checksum' => $checksum ))); +OCP\JSON::success(array( + 'data' => array( + 'checksum' => $checksum, + 'lastmodified' => OC_Contacts_VCard::lastModified($vcard)->format('U')) + ) +); diff --git a/ajax/contact/deleteproperty.php b/ajax/contact/deleteproperty.php index 9c3f09f8..d7545ff1 100644 --- a/ajax/contact/deleteproperty.php +++ b/ajax/contact/deleteproperty.php @@ -44,4 +44,9 @@ if(!OC_Contacts_VCard::edit($id, $vcard)) { bailOut($l10n->t('Error deleting contact property.')); } -OCP\JSON::success(array('data' => array( 'id' => $id ))); +OCP\JSON::success(array( + 'data' => array( + 'id' => $id, + 'lastmodified' => OC_Contacts_VCard::lastModified($vcard)->format('U'), + ) +)); diff --git a/ajax/contact/details.php b/ajax/contact/details.php index 0e07f9ec..c22f1893 100644 --- a/ajax/contact/details.php +++ b/ajax/contact/details.php @@ -53,5 +53,6 @@ if(isset($details['PHOTO'])) { $details['id'] = $id; $details['displayname'] = $card['fullname']; $details['addressbookid'] = $card['addressbookid']; +$details['lastmodified'] = OC_Contacts_App::lastModified($vcard)->format('U'); OC_Contacts_App::setLastModifiedHeader($vcard); OCP\JSON::success(array('data' => $details)); diff --git a/ajax/contact/saveproperty.php b/ajax/contact/saveproperty.php index f9880c78..799038b6 100644 --- a/ajax/contact/saveproperty.php +++ b/ajax/contact/saveproperty.php @@ -148,5 +148,6 @@ if(!OC_Contacts_VCard::edit($id, $vcard)) { OCP\JSON::success(array('data' => array( 'line' => $line, 'checksum' => $checksum, - 'oldchecksum' => $_POST['checksum'])) -); + 'oldchecksum' => $_POST['checksum'] + 'lastmodified' => OC_Contacts_VCard::lastModified($vcard)->format('U') +)); diff --git a/ajax/savecrop.php b/ajax/savecrop.php index 1df5299c..2483d0f7 100644 --- a/ajax/savecrop.php +++ b/ajax/savecrop.php @@ -62,17 +62,17 @@ if($data) { if($image->crop($x1, $y1, $w, $h)) { if(($image->width() <= 200 && $image->height() <= 200) || $image->resize(200)) { - $card = OC_Contacts_App::getContactVCard($id); - if(!$card) { + $vcard = OC_Contacts_App::getContactVCard($id); + if(!$vcard) { OC_Cache::remove($tmpkey); bailOut(OC_Contacts_App::$l10n ->t('Error getting contact object.')); } - if($card->__isset('PHOTO')) { + if($vcard->__isset('PHOTO')) { OCP\Util::writeLog('contacts', 'savecrop.php: PHOTO property exists.', OCP\Util::DEBUG); - $property = $card->__get('PHOTO'); + $property = $vcard->__get('PHOTO'); if(!$property) { OC_Cache::remove($tmpkey); bailOut(OC_Contacts_App::$l10n @@ -83,27 +83,28 @@ if($data) { = new Sabre_VObject_Parameter('ENCODING', 'b'); $property->parameters[] = new Sabre_VObject_Parameter('TYPE', $image->mimeType()); - $card->__set('PHOTO', $property); + $vcard->__set('PHOTO', $property); } else { OCP\Util::writeLog('contacts', 'savecrop.php: files: Adding PHOTO property.', OCP\Util::DEBUG); - $card->addProperty('PHOTO', + $vcard->addProperty('PHOTO', $image->__toString(), array('ENCODING' => 'b', 'TYPE' => $image->mimeType())); } $now = new DateTime; - $card->setString('REV', $now->format(DateTime::W3C)); - if(!OC_Contacts_VCard::edit($id, $card)) { + $vcard->setString('REV', $now->format(DateTime::W3C)); + if(!OC_Contacts_VCard::edit($id, $vcard)) { bailOut(OC_Contacts_App::$l10n->t('Error saving contact.')); } - $tmpl = new OCP\Template("contacts", "part.contactphoto"); - $tmpl->assign('id', $id); - $tmpl->assign('refresh', true); - $tmpl->assign('width', $image->width()); - $tmpl->assign('height', $image->height()); - $page = $tmpl->fetchPage(); - OCP\JSON::success(array('data' => array('page'=>$page))); + OCP\JSON::success(array( + 'data' => array( + 'id' => $id, + 'width' => $image->width(), + 'height' => $image->height(), + 'lastmodified' => OC_Contacts_App::lastModified($vcard)->format('U') + ) + )); } else { bailOut(OC_Contacts_App::$l10n->t('Error resizing image')); } diff --git a/js/contacts.js b/js/contacts.js index 9aec0255..67bfa984 100644 --- a/js/contacts.js +++ b/js/contacts.js @@ -835,7 +835,7 @@ OC.Contacts={ OC.Contacts.propertyContainerFor(obj).data('checksum', ''); if(proptype == 'PHOTO') { OC.Contacts.Contacts.refreshThumbnail(OC.Contacts.Card.id); - OC.Contacts.Card.loadPhoto(true); + OC.Contacts.Card.loadPhoto(); } else if(proptype == 'NOTE') { $('#note').find('textarea').val(''); OC.Contacts.propertyContainerFor(obj).hide(); @@ -1218,9 +1218,9 @@ OC.Contacts={ } }); }, - loadPhoto:function(refresh){ + loadPhoto:function(){ var self = this; - var refreshstr = (refresh?'&refresh=1'+Math.random():'') + var refreshstr = ''; //'&refresh='+Math.random(); $('#phototools li a').tipsy('hide'); var wrapper = $('#contacts_details_photo_wrapper'); wrapper.addClass('loading').addClass('wait'); @@ -1278,7 +1278,7 @@ OC.Contacts={ var response=jQuery.parseJSON(target.contents().text()); if(response != undefined && response.status == 'success'){ // load cropped photo. - self.loadPhoto(true); + self.loadPhoto(); OC.Contacts.Card.data.PHOTO = true; }else{ OC.dialogs.alert(response.data.message, t('contacts', 'Error')); diff --git a/lib/app.php b/lib/app.php index 3972d0e0..b59a8372 100644 --- a/lib/app.php +++ b/lib/app.php @@ -240,6 +240,18 @@ class OC_Contacts_App { self::getVCategories()->loadFromVObject($contact, true); } + /** + * @brief Get the last modification time. + * @param $vcard OC_VObject + * $return DateTime | null + */ + public static function lastModified($vcard) { + $rev = $vcard->getAsString('REV'); + if ($rev) { + return DateTime::createFromFormat(DateTime::W3C, $rev); + } + } + public static function setLastModifiedHeader($contact) { $rev = $contact->getAsString('REV'); if ($rev) { diff --git a/photo.php b/photo.php index efdf157c..f5c8e6fe 100644 --- a/photo.php +++ b/photo.php @@ -20,14 +20,15 @@ function getStandardImage() { } $id = isset($_GET['id']) ? $_GET['id'] : null; -$caching = isset($_GET['refresh']) ? 0 : null; +$etag = null; +$caching = null; if(is_null($id)) { getStandardImage(); } if(!extension_loaded('gd') || !function_exists('gd_info')) { - OCP\Util::writeLog('contacts', + OCP\Util::writeLog('contacts', 'photo.php. GD module not installed', OCP\Util::DEBUG); getStandardImage(); } @@ -39,25 +40,34 @@ if (!$image) { } // invalid vcard if (is_null($contact)) { - OCP\Util::writeLog('contacts', - 'photo.php. The VCard for ID ' . $id . ' is not RFC compatible', + OCP\Util::writeLog('contacts', + 'photo.php. The VCard for ID ' . $id . ' is not RFC compatible', OCP\Util::ERROR); } else { - OCP\Response::enableCaching($caching); - OC_Contacts_App::setLastModifiedHeader($contact); - // Photo :-) if ($image->loadFromBase64($contact->getAsString('PHOTO'))) { // OK - OCP\Response::setETagHeader(md5($contact->getAsString('PHOTO'))); + $etag = md5($contact->getAsString('PHOTO')); } else // Logo :-/ if ($image->loadFromBase64($contact->getAsString('LOGO'))) { // OK - OCP\Response::setETagHeader(md5($contact->getAsString('LOGO'))); + $etag = md5($contact->getAsString('LOGO')); } if ($image->valid()) { + $modified = OC_Contacts_App::lastModified($contact); + // Force refresh if modified within the last minute. + if(!is_null($modified)) { + $caching = (time() - $modified->format('U') > 60) ? null : 0; + } + OCP\Response::enableCaching($caching); + if(!is_null($modified)) { + OCP\Response::setLastModifiedHeader($modified); + } + if($etag) { + OCP\Response::setETagHeader($etag); + } $max_size = 200; if ($image->width() > $max_size || $image->height() > $max_size) { $image->resize($max_size); diff --git a/thumbnail.php b/thumbnail.php index 6deb5ca3..1e3714ae 100644 --- a/thumbnail.php +++ b/thumbnail.php @@ -26,27 +26,26 @@ OCP\App::checkAppEnabled('contacts'); session_write_close(); function getStandardImage() { - //OCP\Response::setExpiresHeader('P10D'); OCP\Response::enableCaching(); OCP\Response::redirect(OCP\Util::imagePath('contacts', 'person.png')); } if(!extension_loaded('gd') || !function_exists('gd_info')) { - OCP\Util::writeLog('contacts', + OCP\Util::writeLog('contacts', 'thumbnail.php. GD module not installed', OCP\Util::DEBUG); getStandardImage(); exit(); } $id = $_GET['id']; -$caching = isset($_GET['refresh']) ? 0 : null; +$caching = null; $contact = OC_Contacts_App::getContactVCard($id); // invalid vcard if(is_null($contact)) { - OCP\Util::writeLog('contacts', - 'thumbnail.php. The VCard for ID ' . $id . ' is not RFC compatible', + OCP\Util::writeLog('contacts', + 'thumbnail.php. The VCard for ID ' . $id . ' is not RFC compatible', OCP\Util::ERROR); getStandardImage(); exit(); @@ -60,30 +59,39 @@ $thumbnail_size = 23; $image = new OC_Image(); $photo = $contact->getAsString('PHOTO'); if($photo) { - OCP\Response::setETagHeader(md5($photo)); if($image->loadFromBase64($photo)) { if($image->centerCrop()) { if($image->resize($thumbnail_size)) { + $modified = OC_Contacts_App::lastModified($contact); + // Force refresh if modified within the last minute. + if(!is_null($modified)) { + $caching = (time() - $modified->format('U') > 60) ? null : 0; + } + OCP\Response::enableCaching($caching); + if(!is_null($modified)) { + OCP\Response::setLastModifiedHeader($modified); + } + OCP\Response::setETagHeader(md5($photo)); if($image->show()) { exit(); } else { - OCP\Util::writeLog('contacts', - 'thumbnail.php. Couldn\'t display thumbnail for ID ' . $id, + OCP\Util::writeLog('contacts', + 'thumbnail.php. Couldn\'t display thumbnail for ID ' . $id, OCP\Util::ERROR); } } else { - OCP\Util::writeLog('contacts', - 'thumbnail.php. Couldn\'t resize thumbnail for ID ' . $id, + OCP\Util::writeLog('contacts', + 'thumbnail.php. Couldn\'t resize thumbnail for ID ' . $id, OCP\Util::ERROR); } }else{ - OCP\Util::writeLog('contacts', - 'thumbnail.php. Couldn\'t crop thumbnail for ID ' . $id, + OCP\Util::writeLog('contacts', + 'thumbnail.php. Couldn\'t crop thumbnail for ID ' . $id, OCP\Util::ERROR); } } else { - OCP\Util::writeLog('contacts', - 'thumbnail.php. Couldn\'t load image string for ID ' . $id, + OCP\Util::writeLog('contacts', + 'thumbnail.php. Couldn\'t load image string for ID ' . $id, OCP\Util::ERROR); } } From 4ed4ef96cd8dbc7ebdfae779c0ca1af7e72e0511 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Thu, 9 Aug 2012 17:03:46 +0200 Subject: [PATCH 5/5] Change parameter name and update docs. --- lib/vcard.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/vcard.php b/lib/vcard.php index 990e790c..b213bcd7 100644 --- a/lib/vcard.php +++ b/lib/vcard.php @@ -282,18 +282,19 @@ class OC_Contacts_VCard{ /** * @brief Adds a card - * @param integer $aid Addressbook id - * @param OC_VObject $card vCard file - * @param string $uri the uri of the card, default based on the UID + * @param $aid integer Addressbook id + * @param $card OC_VObject vCard file + * @param $uri string the uri of the card, default based on the UID + * @param $isChecked boolean If the vCard should be checked for validity and version. * @return insertid on success or false. */ - public static function add($aid, OC_VObject $card, $uri=null, $isnew=false){ + public static function add($aid, OC_VObject $card, $uri=null, $isChecked=false){ if(is_null($card)) { OCP\Util::writeLog('contacts', 'OC_Contacts_VCard::add. No vCard supplied', OCP\Util::ERROR); return null; }; - if(!$isnew) { + if(!$isChecked) { OC_Contacts_App::loadCategoriesFromVCard($card); self::updateValuesFromAdd($aid, $card); }