From 82148746d393ea41829ebbee29e9fd8739d3b26c Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 9 Jan 2012 22:05:28 +0100 Subject: [PATCH 01/17] Insert new contacts alphabetically correct in the list. Added some tipsys to the editor. --- css/styles.css | 2 +- js/interface.js | 27 +++++++++++++++++++++++---- templates/part.details.php | 5 +++++ 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/css/styles.css b/css/styles.css index c890be85..7b56767b 100644 --- a/css/styles.css +++ b/css/styles.css @@ -4,7 +4,7 @@ #contacts_details_name { font-weight:bold;font-size:1.1em;margin-left:25%;} #contacts_details_photo { margin:.5em 0em .5em 25%; } -#contacts_deletecard {position:absolute;top:15px;right:0;} +#contacts_deletecard {position:absolute;top:15px;right:15px;} #contacts_details_list { list-style:none; } #contacts_details_list li { overflow:visible; } #contacts_details_list li p.contacts_property_name { width:25%; float:left;text-align:right;padding-right:0.3em;color:#666; } diff --git a/js/interface.js b/js/interface.js index b9f75bdf..187c8941 100644 --- a/js/interface.js +++ b/js/interface.js @@ -236,7 +236,10 @@ $(document).ready(function(){ Contacts.UI.Addressbooks.overview(); return false; }); - + + /** + * Open blank form to add new contact. + */ $('#contacts_newcontact').click(function(){ $.getJSON('ajax/showaddcard.php',{},function(jsondata){ if(jsondata.status == 'success'){ @@ -250,14 +253,28 @@ $(document).ready(function(){ }); return false; }); - + + /** + * Add and insert a new contact into the list. + */ $('#contacts_addcardform input[type="submit"]').live('click',function(){ $.post('ajax/addcard.php',$('#contacts_addcardform').serialize(),function(jsondata){ 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+'
  • '); + var item = '
  • '+jsondata.data.name+'
  • '; + var added = false; + $('#leftcontent ul li').each(function(){ + if ($(this).text().toLowerCase() > jsondata.data.name.toLowerCase()) { + $(this).before(item).fadeIn('fast'); + added = true; + return false; + } + }); + if(!added) { + $('#leftcontent ul').append(item); + } } else{ alert(jsondata.data.message); @@ -265,7 +282,6 @@ $(document).ready(function(){ }, 'json'); return false; }); - $('.contacts_property [data-use="edit"]').live('click',function(){ var id = $('#rightcontent').data('id'); var checksum = $(this).parents('.contacts_property').first().data('checksum'); @@ -338,4 +354,7 @@ $(document).ready(function(){ // element has gone out of viewport } }); + + $('.action').tipsy(); + $('.button').tipsy(); }); diff --git a/templates/part.details.php b/templates/part.details.php index afad0b7f..1482c063 100644 --- a/templates/part.details.php +++ b/templates/part.details.php @@ -86,3 +86,8 @@ + From 6e88659b695c6c48de60935fd73e6868b65cdf50 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 9 Jan 2012 23:14:11 +0100 Subject: [PATCH 02/17] OC_DB::insertid was being called too late to get the correct result. --- lib/vcard.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/vcard.php b/lib/vcard.php index beb291b4..6a248ff5 100644 --- a/lib/vcard.php +++ b/lib/vcard.php @@ -130,10 +130,11 @@ class OC_Contacts_VCard{ $stmt = OC_DB::prepare( 'INSERT INTO *PREFIX*contacts_cards (addressbookid,fullname,carddata,uri,lastmodified) VALUES(?,?,?,?,?)' ); $result = $stmt->execute(array($id,$fn,$data,$uri,time())); + $newid = OC_DB::insertid('*PREFIX*contacts_cards'); OC_Contacts_Addressbook::touch($id); - return OC_DB::insertid('*PREFIX*contacts_cards'); + return $newid; } /** From 24e48ac2d9c7d1d0305cd4aa4a39fb3c436880d2 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Mon, 9 Jan 2012 23:16:07 +0100 Subject: [PATCH 03/17] Return standard thumbnail even if contact couldn't be found as it could be because it was just added, --- thumbnail.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/thumbnail.php b/thumbnail.php index 622718d6..e49098ce 100644 --- a/thumbnail.php +++ b/thumbnail.php @@ -46,8 +46,8 @@ $l10n = new OC_L10N('contacts'); $card = OC_Contacts_VCard::find( $id ); if( $card === false ){ - OC_Log::write('contacts','thumbnail.php. Contact could not be found.',OC_Log::ERROR); - //echo $l10n->t('Contact could not be found.'); + OC_Log::write('contacts','thumbnail.php. Contact could not be found: '.$id,OC_Log::ERROR); + getStandardImage(); exit(); } @@ -55,7 +55,6 @@ if( $card === false ){ $addressbook = OC_Contacts_Addressbook::find( $card['addressbookid'] ); if( $addressbook === false || $addressbook['userid'] != OC_USER::getUser()){ OC_Log::write('contacts','thumbnail.php. Wrong contact/addressbook - WTF?',OC_Log::ERROR); - //echo $l10n->t('This is not your contact.'); // This is a weird error, why would it come up? (Better feedback for users?) exit(); } From 253e0474e656d0151df8301112183fd7e3e61b7f Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Tue, 10 Jan 2012 14:59:31 +0100 Subject: [PATCH 04/17] More fixes on saving TYPE parameters. Use jQuery Dialog for error messages instead of alert() --- ajax/addcard.php | 17 ++++++++-- ajax/addproperty.php | 2 ++ js/interface.js | 76 ++++++++++++++++++++++++++------------------ templates/index.php | 3 -- 4 files changed, 62 insertions(+), 36 deletions(-) diff --git a/ajax/addcard.php b/ajax/addcard.php index 9d782246..54e4faa6 100644 --- a/ajax/addcard.php +++ b/ajax/addcard.php @@ -54,11 +54,24 @@ foreach( $add as $propname){ $value = $values[$propname]; if( isset( $parameters[$propname] ) && count( $parameters[$propname] )){ $prop_parameters = $parameters[$propname]; - } else{ $prop_parameters = array(); } - $vcard->addProperty($propname, $value, $prop_parameters); + $vcard->addProperty($propname, $value); //, $prop_parameters); + $line = count($vcard->children) - 1; + foreach ($prop_parameters as $key=>$element) { + if(is_array($element) && strtoupper($key) == 'TYPE') { + // FIXME: Maybe this doesn't only apply for TYPE? + // And it probably shouldn't be done here anyways :-/ + foreach($element as $e){ + if($e != '' && !is_null($e)){ + $vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter($key,$e); + } + } + } else { + $vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter($key,$element); + } + } } $id = OC_Contacts_VCard::add($aid,$vcard->serialize()); diff --git a/ajax/addproperty.php b/ajax/addproperty.php index 0122cf01..0f76add3 100644 --- a/ajax/addproperty.php +++ b/ajax/addproperty.php @@ -48,6 +48,8 @@ foreach ($parameters as $key=>$element) { $vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter($key,$e); } } + } else { + $vcard->children[$line]->parameters[] = new Sabre_VObject_Parameter($key,$element); } } diff --git a/js/interface.js b/js/interface.js index 187c8941..4a27073c 100644 --- a/js/interface.js +++ b/js/interface.js @@ -18,9 +18,6 @@ * You should have received a copy of the GNU Affero General Public * License along with this library. If not, see . * - * TODO: - * If you add a contact, its thumbnail doesnt show in the list. But when you add another one it shows up, but not for the second contact added. - * Place a new contact in correct alphabetic order */ @@ -31,6 +28,20 @@ Contacts={ $('#carddav_url').show(); $('#carddav_url_close').show(); }, + messageBox:function(title, msg) { + var $dialog = $('
    ') + .html(msg) + .dialog({ + autoOpen: true, + title: title,buttons: [ + { + text: "Ok", + click: function() { $(this).dialog("close"); } + } + ] + } + ); + }, Addressbooks:{ overview:function(){ if($('#chooseaddressbook_dialog').dialog('isOpen') == true){ @@ -85,7 +96,8 @@ Contacts={ Contacts.UI.Contacts.update(); Contacts.UI.Addressbooks.overview(); } else { - alert('Error: ' + data.message); + Contacts.UI.messageBox('Error', data.message); + //alert('Error: ' + data.message); } }); } @@ -114,37 +126,29 @@ Contacts={ } }, Contacts:{ + /** + * Reload the contacts list. + */ update:function(){ $.getJSON('ajax/contacts.php',{},function(jsondata){ if(jsondata.status == 'success'){ $('#contacts').html(jsondata.data.page); } else{ - alert(jsondata.data.message); + Contacts.UI.messageBox('Error',jsondata.data.message); + //alert(jsondata.data.message); } }); - /* - var contactlist = $('#contacts'); - var contacts = contactlist.children('li').get(); - //alert(contacts); - contacts.sort(function(a, b) { - var compA = $(a).text().toUpperCase(); - var compB = $(b).text().toUpperCase(); - return (compA < compB) ? -1 : (compA > compB) ? 1 : 0; - }) - $.each(contacts, function(idx, itm) { contactlist.append(itm); }); - */ - setTimeout(Contacts.UI.Contacts.lazyupdate(), 500); + setTimeout(Contacts.UI.Contacts.lazyupdate, 500); }, + /** + * Add thumbnails to the contact list as they become visible in the viewport. + */ lazyupdate:function(){ - //alert('lazyupdate'); $('#contacts li').live('inview', function(){ if (!$(this).find('a').attr('style')) { - //alert($(this).data('id') + ' has background: ' + $(this).attr('style')); $(this).find('a').css('background','url(thumbnail.php?id='+$(this).data('id')+') no-repeat'); - }/* else { - alert($(this).data('id') + ' has style ' + $(this).attr('style').match('url')); - }*/ + } }); } } @@ -168,7 +172,8 @@ $(document).ready(function(){ $('#leftcontent li[data-id="'+jsondata.data.id+'"]').addClass('active'); } else{ - alert(jsondata.data.message); + Contacts.UI.messageBox('Error', jsondata.data.message); + //alert(jsondata.data.message); } }); return false; @@ -183,7 +188,8 @@ $(document).ready(function(){ $('#rightcontent').empty(); } else{ - alert(jsondata.data.message); + Contacts.UI.messageBox('Error', jsondata.data.message); + //alert(jsondata.data.message); } }); return false; @@ -197,7 +203,8 @@ $(document).ready(function(){ $('#contacts_addproperty').hide(); } else{ - alert(jsondata.data.message); + Contacts.UI.messageBox('Error', jsondata.data.message); + //alert(jsondata.data.message); } }); return false; @@ -226,7 +233,8 @@ $(document).ready(function(){ $('#contacts_addpropertyform').before(jsondata.data.page); } else{ - alert(jsondata.data.message); + Contacts.UI.messageBox('Error', jsondata.data.message); + //alert(jsondata.data.message); } }, 'json'); return false; @@ -248,7 +256,8 @@ $(document).ready(function(){ .find('select').chosen(); } else{ - alert(jsondata.data.message); + Contacts.UI.messageBox('Error', jsondata.data.message); + //alert(jsondata.data.message); } }); return false; @@ -277,7 +286,8 @@ $(document).ready(function(){ } } else{ - alert(jsondata.data.message); + Contacts.UI.messageBox('Error', jsondata.data.message); + //alert(jsondata.data.message); } }, 'json'); return false; @@ -291,7 +301,8 @@ $(document).ready(function(){ .find('select').chosen(); } else{ - alert(jsondata.data.message); + Contacts.UI.messageBox('Error', jsondata.data.message); + //alert(jsondata.data.message); } }); return false; @@ -303,7 +314,8 @@ $(document).ready(function(){ $('.contacts_property[data-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page); } else{ - alert(jsondata.data.message); + Contacts.UI.messageBox('Error', jsondata.data.message); + //alert(jsondata.data.message); } },'json'); return false; @@ -317,7 +329,8 @@ $(document).ready(function(){ $('.contacts_property[data-checksum="'+checksum+'"]').remove(); } else{ - alert(jsondata.data.message); + Contacts.UI.messageBox('Error', jsondata.data.message); + //alert(jsondata.data.message); } }); return false; @@ -357,4 +370,5 @@ $(document).ready(function(){ $('.action').tipsy(); $('.button').tipsy(); + //Contacts.UI.messageBox('Hello','Sailor'); }); diff --git a/templates/index.php b/templates/index.php index 90143f25..24484231 100644 --- a/templates/index.php +++ b/templates/index.php @@ -31,7 +31,4 @@ OC_Util::addStyle('contacts','formtastic');
    -
    - t("There was a fail, while parsing the file."); ?> -
    From 3b1d6f03839a5b3694daf1754c8a620e085c614c Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Wed, 11 Jan 2012 01:06:59 +0100 Subject: [PATCH 05/17] update translations --- l10n/ar.php | 36 ++++++++++++++++++++++++++++++++ l10n/ca.php | 36 ++++++++++++++++++++++++++++++++ l10n/cs_CZ.php | 36 ++++++++++++++++++++++++++++++++ l10n/da.php | 36 +++++++++++++++----------------- l10n/de.php | 29 +++++++++++++++++++++++++- l10n/el.php | 36 ++++++++++++++++++++++++++++++++ l10n/eo.php | 36 ++++++++++++++++++++++++++++++++ l10n/es.php | 36 ++++++++++++++++++++++++++++++++ l10n/et_EE.php | 36 ++++++++++++++++++++++++++++++++ l10n/eu.php | 36 ++++++++++++++++++++++++++++++++ l10n/fr.php | 36 ++++++++++++++++++++++++++++++++ l10n/he.php | 36 ++++++++++++++++++++++++++++++++ l10n/hr.php | 36 ++++++++++++++++++++++++++++++++ l10n/hu_HU.php | 36 ++++++++++++++++++++++++++++++++ l10n/ia.php | 32 ++++++++++++++++++++++++++++ l10n/it.php | 34 ++++++++++++++---------------- l10n/ja_JP.php | 36 ++++++++++++++++++++++++++++++++ l10n/lb.php | 36 ++++++++++++++++++++++++++++++++ l10n/lt_LT.php | 33 +++++++++++++++++++++++++++++ l10n/nl.php | 53 +++++++++++++++++++++++++++++++++++++++++++++++ l10n/nn_NO.php | 36 ++++++++++++++++++++++++++++++++ l10n/pl.php | 36 ++++++++++++++++++++++++++++++++ l10n/pt_BR.php | 36 ++++++++++++++++++++++++++++++++ l10n/pt_PT.php | 36 ++++++++++++++++++++++++++++++++ l10n/ro.php | 36 ++++++++++++++++++++++++++++++++ l10n/ru.php | 36 ++++++++++++++++++++++++++++++++ l10n/sk_SK.php | 36 ++++++++++++++++++++++++++++++++ l10n/sl.php | 36 ++++++++++++++++++++++++++++++++ l10n/sr.php | 36 ++++++++++++++++++++++++++++++++ l10n/sr@latin.php | 36 ++++++++++++++++++++++++++++++++ l10n/sv.php | 36 ++++++++++++++++++++++++++++++++ l10n/tr.php | 36 ++++++++++++++++++++++++++++++++ l10n/zh_CN.php | 36 ++++++++++++++++++++++++++++++++ 33 files changed, 1151 insertions(+), 38 deletions(-) create mode 100644 l10n/ar.php create mode 100644 l10n/ca.php create mode 100644 l10n/cs_CZ.php create mode 100644 l10n/el.php create mode 100644 l10n/eo.php create mode 100644 l10n/es.php create mode 100644 l10n/et_EE.php create mode 100644 l10n/eu.php create mode 100644 l10n/fr.php create mode 100644 l10n/he.php create mode 100644 l10n/hr.php create mode 100644 l10n/hu_HU.php create mode 100644 l10n/ia.php create mode 100644 l10n/ja_JP.php create mode 100644 l10n/lb.php create mode 100644 l10n/lt_LT.php create mode 100644 l10n/nl.php create mode 100644 l10n/nn_NO.php create mode 100644 l10n/pl.php create mode 100644 l10n/pt_BR.php create mode 100644 l10n/pt_PT.php create mode 100644 l10n/ro.php create mode 100644 l10n/ru.php create mode 100644 l10n/sk_SK.php create mode 100644 l10n/sl.php create mode 100644 l10n/sr.php create mode 100644 l10n/sr@latin.php create mode 100644 l10n/sv.php create mode 100644 l10n/tr.php create mode 100644 l10n/zh_CN.php diff --git a/l10n/ar.php b/l10n/ar.php new file mode 100644 index 00000000..662c6577 --- /dev/null +++ b/l10n/ar.php @@ -0,0 +1,36 @@ + "هذا ليس دفتر عناوينك.", +"Contact could not be found." => "لم يتم العثور على الشخص.", +"vCard could not be read." => "لم يتم قراءة ال vCard بنجاح.", +"Information about vCard is incorrect. Please reload the page." => "المعلومات الموجودة في ال vCard غير صحيحة. الرجاء إعادة تحديث الصفحة.", +"Address" => "عنوان", +"Telephone" => "الهاتف", +"Email" => "البريد الالكتروني", +"Organization" => "المؤسسة", +"Work" => "الوظيفة", +"Home" => "البيت", +"Mobile" => "الهاتف المحمول", +"Text" => "معلومات إضافية", +"Voice" => "صوت", +"Fax" => "الفاكس", +"Video" => "الفيديو", +"Pager" => "الرنان", +"This is not your contact." => ".هذا ليس من معارفي", +"This card is not RFC compatible." => "هذا الكرت ليس متلائم مع نظام ال RFC.", +"This card does not contain a photo." => "لا يحتوي هذا الكرت على صورة.", +"Add Contact" => "أضف شخص ", +"Group" => "مجموعة", +"Name" => "الاسم", +"PO Box" => "العنوان البريدي", +"Extended" => "إضافة", +"Street" => "شارع", +"City" => "المدينة", +"Region" => "المنطقة", +"Zipcode" => "رقم المنطقة", +"Country" => "البلد", +"Create Contact" => "أضف شخص ", +"Edit" => "تعديل", +"Delete" => "حذف", +"Birthday" => "تاريخ الميلاد", +"Phone" => "الهاتف" +); diff --git a/l10n/ca.php b/l10n/ca.php new file mode 100644 index 00000000..4b917ef2 --- /dev/null +++ b/l10n/ca.php @@ -0,0 +1,36 @@ + "Aquesta no és la vostra llibreta d'adreces", +"Contact could not be found." => "No s'ha trobat el contacte.", +"vCard could not be read." => "No s'ha pogut llegir la vCard", +"Information about vCard is incorrect. Please reload the page." => "La informació de la vCard és incorrecta. Carregueu la pàgina de nou.", +"Address" => "Adreça", +"Telephone" => "Telèfon", +"Email" => "Correu electrònic", +"Organization" => "Organització", +"Work" => "Feina", +"Home" => "Casa", +"Mobile" => "Mòbil", +"Text" => "Text", +"Voice" => "Veu", +"Fax" => "Fax", +"Video" => "Vídeo", +"Pager" => "Paginador", +"This is not your contact." => "Aquest contacte no és vostre.", +"This card is not RFC compatible." => "Aquesta targeta no és compatible amb RFC.", +"This card does not contain a photo." => "Aquesta targeta no conté foto.", +"Add Contact" => "Afegeix un contacte", +"Group" => "Grup", +"Name" => "Nom", +"PO Box" => "Adreça Postal", +"Extended" => "Addicional", +"Street" => "Carrer", +"City" => "Ciutat", +"Region" => "Comarca", +"Zipcode" => "Codi postal", +"Country" => "País", +"Create Contact" => "Crea un contacte", +"Edit" => "Edita", +"Delete" => "Elimina", +"Birthday" => "Aniversari", +"Phone" => "Telèfon" +); diff --git a/l10n/cs_CZ.php b/l10n/cs_CZ.php new file mode 100644 index 00000000..7cdf8e42 --- /dev/null +++ b/l10n/cs_CZ.php @@ -0,0 +1,36 @@ + "Toto není Váš adresář.", +"Contact could not be found." => "Kontakt nebyl nalezen.", +"vCard could not be read." => "vCard nelze přečíst.", +"Information about vCard is incorrect. Please reload the page." => "Informace o vCard je nesprávná. Obnovte stránku, prosím.", +"Address" => "Adresa", +"Telephone" => "Telefon", +"Email" => "Email", +"Organization" => "Organizace", +"Work" => "Pracovní", +"Home" => "Domácí", +"Mobile" => "Mobil", +"Text" => "Text", +"Voice" => "Hlas", +"Fax" => "Fax", +"Video" => "Video", +"Pager" => "Pager", +"This is not your contact." => "Toto není Váš kontakt.", +"This card is not RFC compatible." => "Tato karta není kompatibilní s RFC.", +"This card does not contain a photo." => "Tato karta neobsahuje foto", +"Add Contact" => "Přidat kontakt", +"Group" => "Skupina", +"Name" => "Jméno", +"PO Box" => "PO box", +"Extended" => "Rozšířené", +"Street" => "Ulice", +"City" => "Město", +"Region" => "Kraj", +"Zipcode" => "PSČ", +"Country" => "Země", +"Create Contact" => "Vytvořit kontakt", +"Edit" => "Editovat", +"Delete" => "Odstranit", +"Birthday" => "Narozeniny", +"Phone" => "Telefon" +); diff --git a/l10n/da.php b/l10n/da.php index 2ab382f7..f4defa28 100644 --- a/l10n/da.php +++ b/l10n/da.php @@ -1,22 +1,26 @@ "Du skal logge ind.", "This is not your addressbook." => "Dette er ikke din adressebog.", -"Contact could not be found." => "Kontakt kunne ikke findes.", -"This is not your contact." => "Dette er ikke din kontakt.", +"Contact could not be found." => "Kontaktperson kunne ikke findes.", "vCard could not be read." => "Kunne ikke læse vCard.", "Information about vCard is incorrect. Please reload the page." => "Informationen om vCard er forkert. Genindlæs siden.", -"This card is not RFC compatible." => "Dette kort er ikke RFC-kompatibelt.", -"This card does not contain a photo." => "Dette kort indeholder ikke et foto.", -"Add Contact" => "Tilføj kontakt", -"Group" => "Gruppe", -"Name" => "Navn", -"Create Contact" => "Ny Kontakt", "Address" => "Adresse", "Telephone" => "Telefon", "Email" => "Email", "Organization" => "Organisation", "Work" => "Arbejde", -"Home" => "Hjem", +"Home" => "Hjemme", +"Mobile" => "Mobil", +"Text" => "SMS", +"Voice" => "Telefonsvarer", +"Fax" => "Fax", +"Video" => "Video", +"Pager" => "Personsøger", +"This is not your contact." => "Dette er ikke din kontaktperson.", +"This card is not RFC compatible." => "Dette kort er ikke RFC-kompatibelt.", +"This card does not contain a photo." => "Dette kort indeholder ikke et foto.", +"Add Contact" => "Tilføj kontaktperson", +"Group" => "Gruppe", +"Name" => "Navn", "PO Box" => "Postboks", "Extended" => "Udvidet", "Street" => "Vej", @@ -24,15 +28,9 @@ "Region" => "Region", "Zipcode" => "Postnummer", "Country" => "Land", -"Mobile" => "Mobil", -"Text" => "SMS", -"Voice" => "Telefonsvarer", -"Fax" => "Fax", -"Video" => "Video", -"Pager" => "Personsøger", +"Create Contact" => "Ny kontaktperson", +"Edit" => "Rediger", "Delete" => "Slet", -"Add Property" => "Tilføj Egenskab", "Birthday" => "Fødselsdag", -"Phone" => "Telefon", -"Edit" => "Redigér" +"Phone" => "Telefon" ); diff --git a/l10n/de.php b/l10n/de.php index 04a74024..f98cabcb 100644 --- a/l10n/de.php +++ b/l10n/de.php @@ -1,9 +1,36 @@ "Dies ist nicht dein Adressbuch.", +"Contact could not be found." => "Kontakt konnte nicht gefunden werden.", +"vCard could not be read." => "vCard konnte nicht gelesen werden.", +"Information about vCard is incorrect. Please reload the page." => "Die Information der vCard ist fehlerhaft. Bitte aktualisiere die Seite.", +"Address" => "Adresse", +"Telephone" => "Telefon", +"Email" => "Email", +"Organization" => "Organisation", +"Work" => "Arbeit", +"Home" => "Zuhause", "Mobile" => "Mobil", "Text" => "Text", +"Voice" => "Anruf", "Fax" => "Fax", "Video" => "Video", "Pager" => "Pager", +"This is not your contact." => "Dies ist nicht dein Kontakt.", +"This card is not RFC compatible." => "Diese Karte ist nicht RFC-kompatibel.", +"This card does not contain a photo." => "Diese Karte enthält kein Foto.", +"Add Contact" => "Kontakt hinzufügen", +"Group" => "Gruppe", +"Name" => "Name", +"PO Box" => "Postfach", +"Extended" => "Erweitert", +"Street" => "Straße", +"City" => "Stadt", +"Region" => "Region", +"Zipcode" => "Postleitzahl", +"Country" => "Land", +"Create Contact" => "Kontakt erstellen", +"Edit" => "Bearbeiten", +"Delete" => "Löschen", "Birthday" => "Geburtstag", -"Edit" => "Bearbeiten" +"Phone" => "Telefon" ); diff --git a/l10n/el.php b/l10n/el.php new file mode 100644 index 00000000..3a0b24ea --- /dev/null +++ b/l10n/el.php @@ -0,0 +1,36 @@ + "Αυτό δεν είναι βιβλίο διευθύνσεων σας.", +"Contact could not be found." => "Η επαφή δεν μπρόρεσε να βρεθεί.", +"vCard could not be read." => "Η vCard δεν μπορεί να διαβαστεί.", +"Information about vCard is incorrect. Please reload the page." => "Οι πληροφορίες σχετικά με vCard είναι εσφαλμένες. Παρακαλώ επαναφορτώστε τη σελίδα.", +"Address" => "Διεύθυνση", +"Telephone" => "Τηλέφωνο", +"Email" => "Email", +"Organization" => "Οργανισμός", +"Work" => "Εργασία", +"Home" => "Σπίτι", +"Mobile" => "Κινητό", +"Text" => "Κείμενο", +"Voice" => "Φωνή", +"Fax" => "Φαξ", +"Video" => "Βίντεο", +"Pager" => "Βομβητής", +"This is not your contact." => "Αυτή δεν είναι επαφή σας.", +"This card is not RFC compatible." => "Αυτή η κάρτα δεν είναι RFC συμβατή.", +"This card does not contain a photo." => "Αυτή η κάρτα δεν περιέχει φωτογραφία.", +"Add Contact" => "Προσθήκη επαφής", +"Group" => "Ομάδα", +"Name" => "Όνομα", +"PO Box" => "Ταχ. Θυρίδα", +"Extended" => "Εκτεταμένη", +"Street" => "Οδός", +"City" => "Πόλη", +"Region" => "Περιοχή", +"Zipcode" => "Τ.Κ.", +"Country" => "Χώρα", +"Create Contact" => "Δημιουργία επαφής", +"Edit" => "Επεξεργασία", +"Delete" => "Διαγραφή", +"Birthday" => "Γενέθλια", +"Phone" => "Τηλέφωνο" +); diff --git a/l10n/eo.php b/l10n/eo.php new file mode 100644 index 00000000..1b9fe8c1 --- /dev/null +++ b/l10n/eo.php @@ -0,0 +1,36 @@ + "Ĉi tiu ne estas via adresaro.", +"Contact could not be found." => "Ne eblis trovi la kontakton.", +"vCard could not be read." => "Ne eblis legi vCard-on.", +"Information about vCard is incorrect. Please reload the page." => "Informo pri vCard estas malĝusta. Bonvolu reŝargi la paĝon.", +"Address" => "Adreso", +"Telephone" => "Telefono", +"Email" => "Retpoŝtadreso", +"Organization" => "Organizaĵo", +"Work" => "Laboro", +"Home" => "Hejmo", +"Mobile" => "Poŝtelefono", +"Text" => "Teksto", +"Voice" => "Voĉo", +"Fax" => "Fakso", +"Video" => "Videaĵo", +"Pager" => "Televokilo", +"This is not your contact." => "Tiu ĉi ne estas via kontakto.", +"This card is not RFC compatible." => "Ĉi tiu karto ne kongruas kun RFC.", +"This card does not contain a photo." => "Ĉi tiu karto ne havas foton.", +"Add Contact" => "Aldoni kontakton", +"Group" => "Grupo", +"Name" => "Nomo", +"PO Box" => "Abonkesto", +"Extended" => "Etendita", +"Street" => "Strato", +"City" => "Urbo", +"Region" => "Regiono", +"Zipcode" => "Poŝtokodo", +"Country" => "Lando", +"Create Contact" => "Krei kontakton", +"Edit" => "Redakti", +"Delete" => "Forigi", +"Birthday" => "Naskiĝotago", +"Phone" => "Telefono" +); diff --git a/l10n/es.php b/l10n/es.php new file mode 100644 index 00000000..30dedf89 --- /dev/null +++ b/l10n/es.php @@ -0,0 +1,36 @@ + "Esta no es tu agenda de contactos.", +"Contact could not be found." => "No se pudo encontrar el contacto.", +"vCard could not be read." => "No se pudo leer el vCard.", +"Information about vCard is incorrect. Please reload the page." => "La información sobre el vCard es incorrecta. Por favor vuelve a cargar la página.", +"Address" => "Dirección", +"Telephone" => "Teléfono", +"Email" => "Correo electrónico", +"Organization" => "Organización", +"Work" => "Trabajo", +"Home" => "Particular", +"Mobile" => "Móvil", +"Text" => "Texto", +"Voice" => "Voz", +"Fax" => "Fax", +"Video" => "Video", +"Pager" => "Localizador", +"This is not your contact." => "Este no es tu contacto.", +"This card is not RFC compatible." => "Esta tarjeta no es compatible con RFC.", +"This card does not contain a photo." => "Esta tarjeta no contiene ninguna foto.", +"Add Contact" => "Agregar contacto", +"Group" => "Grupo", +"Name" => "Nombre", +"PO Box" => "Código postal", +"Extended" => "Extendido", +"Street" => "Calle", +"City" => "Ciudad", +"Region" => "Región", +"Zipcode" => "Código Postal", +"Country" => "País", +"Create Contact" => "Crear contacto", +"Edit" => "Editar", +"Delete" => "Borrar", +"Birthday" => "Cumpleaños", +"Phone" => "Teléfono" +); diff --git a/l10n/et_EE.php b/l10n/et_EE.php new file mode 100644 index 00000000..341a74cf --- /dev/null +++ b/l10n/et_EE.php @@ -0,0 +1,36 @@ + "See pole sinu aadressiraamat.", +"Contact could not be found." => "Kontakti ei leitud.", +"vCard could not be read." => "Visiitkaardi lugemine ebaõnnestus,", +"Information about vCard is incorrect. Please reload the page." => "Visiitkaardi info pole korrektne. Palun lae leht uuesti.", +"Address" => "Aadress", +"Telephone" => "Telefon", +"Email" => "E-post", +"Organization" => "Organisatsioon", +"Work" => "Töö", +"Home" => "Kodu", +"Mobile" => "Mobiil", +"Text" => "Tekst", +"Voice" => "Hääl", +"Fax" => "Faks", +"Video" => "Video", +"Pager" => "Piipar", +"This is not your contact." => "See pole sinu kontakt.", +"This card is not RFC compatible." => "See kaart ei ühildu RFC-ga.", +"This card does not contain a photo." => "Sellel kaardil pole fotot.", +"Add Contact" => "Lisa kontakt", +"Group" => "Grupp", +"Name" => "Nimi", +"PO Box" => "Postkontori postkast", +"Extended" => "Laiendatud", +"Street" => "Tänav", +"City" => "Linn", +"Region" => "Piirkond", +"Zipcode" => "Postiindeks", +"Country" => "Riik", +"Create Contact" => "Lisa kontakt", +"Edit" => "Muuda", +"Delete" => "Kustuta", +"Birthday" => "Sünnipäev", +"Phone" => "Telefon" +); diff --git a/l10n/eu.php b/l10n/eu.php new file mode 100644 index 00000000..19b7ddb3 --- /dev/null +++ b/l10n/eu.php @@ -0,0 +1,36 @@ + "Hau ez da zure helbide liburua.", +"Contact could not be found." => "Ezin izan da kontaktua aurkitu.", +"vCard could not be read." => "Ezin izan da vCard-a irakurri.", +"Information about vCard is incorrect. Please reload the page." => "vCard-aren inguruko informazioa okerra da. Mesedez birkargatu orrialdea.", +"Address" => "Helbidea", +"Telephone" => "Telefonoa", +"Email" => "Eposta", +"Organization" => "Erakundea", +"Work" => "Lana", +"Home" => "Etxea", +"Mobile" => "Mugikorra", +"Text" => "Testua", +"Voice" => "Ahotsa", +"Fax" => "Fax-a", +"Video" => "Bideoa", +"Pager" => "Bilagailua", +"This is not your contact." => "Hau ez da zure kontaktua.", +"This card is not RFC compatible." => "Txartel hau ez da RFC bateragarria.", +"This card does not contain a photo." => "Txartel honek ez dauka argazkirik.", +"Add Contact" => "Gehitu Kontaktua", +"Group" => "Taldea", +"Name" => "Izena", +"PO Box" => "Posta kutxa", +"Extended" => "Hedatua", +"Street" => "Kalea", +"City" => "Hiria", +"Region" => "Eskualdea", +"Zipcode" => "Posta Kodea", +"Country" => "Herrialdea", +"Create Contact" => "Sortu Kontaktua", +"Edit" => "Editatu", +"Delete" => "Ezabatu", +"Birthday" => "Jaioteguna", +"Phone" => "Telefonoa" +); diff --git a/l10n/fr.php b/l10n/fr.php new file mode 100644 index 00000000..2b9cdc77 --- /dev/null +++ b/l10n/fr.php @@ -0,0 +1,36 @@ + "Ce n'est pas votre carnet d'adresses.", +"Contact could not be found." => "Ce contact n'a pas été trouvé.", +"vCard could not be read." => "Cette vCard n'a pas pu être lue.", +"Information about vCard is incorrect. Please reload the page." => "Les informations relatives à cette vCard sont incorrectes. Veuillez recharger la page.", +"Address" => "Adresse", +"Telephone" => "Téléphone", +"Email" => "Email", +"Organization" => "Société", +"Work" => "Travail", +"Home" => "Maison", +"Mobile" => "Mobile", +"Text" => "Texte", +"Voice" => "Voix", +"Fax" => "Fax", +"Video" => "Vidéo", +"Pager" => "Bipeur", +"This is not your contact." => "Ce n'est pas votre contact.", +"This card is not RFC compatible." => "Cette fiche n'est pas compatible RFC.", +"This card does not contain a photo." => "Cette fiche ne contient pas de photo.", +"Add Contact" => "Ajouter un Contact", +"Group" => "Groupe", +"Name" => "Nom", +"PO Box" => "Boîte postale", +"Extended" => "Étendu", +"Street" => "Rue", +"City" => "Ville", +"Region" => "Région", +"Zipcode" => "Code postal", +"Country" => "Pays", +"Create Contact" => "Créer le Contact", +"Edit" => "Modifier", +"Delete" => "Effacer", +"Birthday" => "Anniversaire", +"Phone" => "Téléphone" +); diff --git a/l10n/he.php b/l10n/he.php new file mode 100644 index 00000000..22275f77 --- /dev/null +++ b/l10n/he.php @@ -0,0 +1,36 @@ + "זהו אינו ספר הכתובות שלך", +"Contact could not be found." => "לא ניתן לאתר איש קשר", +"vCard could not be read." => "לא ניתן לקרוא vCard.", +"Information about vCard is incorrect. Please reload the page." => "המידע אודות vCard אינו נכון. נא לטעון מחדש את הדף.", +"Address" => "כתובת", +"Telephone" => "טלפון", +"Email" => "דואר אלקטרוני", +"Organization" => "ארגון", +"Work" => "עבודה", +"Home" => "בית", +"Mobile" => "נייד", +"Text" => "טקסט", +"Voice" => "קולי", +"Fax" => "פקס", +"Video" => "וידאו", +"Pager" => "זימונית", +"This is not your contact." => "זהו אינו איש קשר שלך", +"This card is not RFC compatible." => "כרטיס זה אינו תואם ל־RFC", +"This card does not contain a photo." => "כרטיס זה אינו כולל תמונה", +"Add Contact" => "הוספת איש קשר", +"Group" => "קבוצה", +"Name" => "שם", +"PO Box" => "תא דואר", +"Extended" => "מורחב", +"Street" => "רחוב", +"City" => "עיר", +"Region" => "אזור", +"Zipcode" => "מיקוד", +"Country" => "מדינה", +"Create Contact" => "יצירת איש קשר", +"Edit" => "עריכה", +"Delete" => "מחיקה", +"Birthday" => "יום הולדת", +"Phone" => "טלפון" +); diff --git a/l10n/hr.php b/l10n/hr.php new file mode 100644 index 00000000..4b62b292 --- /dev/null +++ b/l10n/hr.php @@ -0,0 +1,36 @@ + "Ovo nije vaš adresar.", +"Contact could not be found." => "Kontakt ne postoji.", +"vCard could not be read." => "Nemoguće pročitati vCard.", +"Information about vCard is incorrect. Please reload the page." => "Informacija o vCard je neispravna. Osvježite stranicu.", +"Address" => "Adresa", +"Telephone" => "Telefon", +"Email" => "E-mail", +"Organization" => "Organizacija", +"Work" => "Posao", +"Home" => "Kuća", +"Mobile" => "Mobitel", +"Text" => "Tekst", +"Voice" => "Glasovno", +"Fax" => "Fax", +"Video" => "Video", +"Pager" => "Pager", +"This is not your contact." => "Ovo nije vaš kontakt.", +"This card is not RFC compatible." => "Ova kartica nije sukladna prema RFC direktivama.", +"This card does not contain a photo." => "Ova kartica ne sadrži fotografiju.", +"Add Contact" => "Dodaj kontakt", +"Group" => "Grupa", +"Name" => "Naziv", +"PO Box" => "Poštanski Pretinac", +"Extended" => "Prošireno", +"Street" => "Ulica", +"City" => "Grad", +"Region" => "Regija", +"Zipcode" => "Poštanski broj", +"Country" => "Država", +"Create Contact" => "Izradi Kontakt", +"Edit" => "Uredi", +"Delete" => "Obriši", +"Birthday" => "Rođendan", +"Phone" => "Telefon" +); diff --git a/l10n/hu_HU.php b/l10n/hu_HU.php new file mode 100644 index 00000000..21123645 --- /dev/null +++ b/l10n/hu_HU.php @@ -0,0 +1,36 @@ + "Ez nem a te címjegyzéked.", +"Contact could not be found." => "Kapcsolat nem található.", +"vCard could not be read." => "A vCard-ot nem lehet olvasni.", +"Information about vCard is incorrect. Please reload the page." => "A vCardról szóló információ helytelen. Töltsd újra az oldalt.", +"Address" => "Cím", +"Telephone" => "Telefonszám", +"Email" => "E-mail", +"Organization" => "Organizáció", +"Work" => "Munka", +"Home" => "Otthon", +"Mobile" => "Mobiltelefonszám", +"Text" => "Szöveg", +"Voice" => "Hang", +"Fax" => "Fax", +"Video" => "Video", +"Pager" => "Lapozó", +"This is not your contact." => "Nem a te kapcsolatod.", +"This card is not RFC compatible." => "A kártya nem RFC kompatibilis.", +"This card does not contain a photo." => "A kártya nem tartlmaz fényképet.", +"Add Contact" => "Kontakt hozzáadása", +"Group" => "Csoport", +"Name" => "Név", +"PO Box" => "Postafiók", +"Extended" => "Kiterjesztett", +"Street" => "Utca", +"City" => "Helység", +"Region" => "Megye", +"Zipcode" => "Irányítószám", +"Country" => "Ország", +"Create Contact" => "Kontakt létrehozása", +"Edit" => "Szerkesztés", +"Delete" => "Törlés", +"Birthday" => "Születésnap", +"Phone" => "Telefonszám" +); diff --git a/l10n/ia.php b/l10n/ia.php new file mode 100644 index 00000000..2bd53255 --- /dev/null +++ b/l10n/ia.php @@ -0,0 +1,32 @@ + "Iste non es tu libro de adresses", +"Contact could not be found." => "Contacto non poterea esser legite", +"vCard could not be read." => "vCard non poterea esser legite.", +"Address" => "Adresse", +"Telephone" => "Telephono", +"Email" => "E-posta", +"Organization" => "Organisation", +"Work" => "Travalio", +"Home" => "Domo", +"Text" => "Texto", +"Voice" => "Voce", +"Fax" => "Fax", +"Video" => "Video", +"Pager" => "Pager", +"This is not your contact." => "Iste non es tu contacto", +"This card is not RFC compatible." => "Iste carta non es compatibile con RFC", +"Add Contact" => "Adder contacto", +"Group" => "Gruppo", +"Name" => "Nomine", +"PO Box" => "Cassa postal", +"Street" => "Strata", +"City" => "Citate", +"Region" => "Region", +"Zipcode" => "Codice postal", +"Country" => "Pais", +"Create Contact" => "Crear contacto", +"Edit" => "Modificar", +"Delete" => "Deler", +"Birthday" => "Anniversario", +"Phone" => "Phono" +); diff --git a/l10n/it.php b/l10n/it.php index 7a57d6fc..c06a2b2a 100644 --- a/l10n/it.php +++ b/l10n/it.php @@ -1,38 +1,36 @@ "Bisogna effettuare il login.", "This is not your addressbook." => "Questa non è la tua rubrica.", "Contact could not be found." => "Il contatto non può essere trovato", -"This is not your contact." => "Questo non è un tuo contatto.", "vCard could not be read." => "La vCard non può essere letta", "Information about vCard is incorrect. Please reload the page." => "Informazioni sulla vCard incorrette. Ricaricare la pagina.", -"This card is not RFC compatible." => "Questa card non è compatibile con il protocollo RFC.", -"This card does not contain a photo." => "Questa card non contiene una foto.", -"Add Contact" => "Aggiungi contatto", -"Group" => "Gruppo", -"Name" => "Nome", -"Create Contact" => "Crea contatto", "Address" => "Indirizzo", "Telephone" => "Telefono", "Email" => "Email", "Organization" => "Organizzazione", "Work" => "Lavoro", "Home" => "Casa", -"PO Box" => "PO Box", +"Mobile" => "Cellulare", +"Text" => "Testo", +"Voice" => "Voce", +"Fax" => "Fax", +"Video" => "Video", +"Pager" => "Cercapersone", +"This is not your contact." => "Questo non è un tuo contatto.", +"This card is not RFC compatible." => "Questa card non è compatibile con il protocollo RFC.", +"This card does not contain a photo." => "Questa card non contiene una foto.", +"Add Contact" => "Aggiungi contatto", +"Group" => "Gruppo", +"Name" => "Nome", +"PO Box" => "Casella postale", "Extended" => "Estendi", "Street" => "Via", "City" => "Città", "Region" => "Regione", "Zipcode" => "CAP", "Country" => "Stato", -"Mobile" => "Cellulare", -"Text" => "Testo", -"Voice" => "Voce", -"Fax" => "Fax", -"Video" => "Video", -"Pager" => "Pager", +"Create Contact" => "Crea contatto", +"Edit" => "Modifica", "Delete" => "Cancella", -"Add Property" => "Aggiungi proprietà", "Birthday" => "Compleanno", -"Phone" => "Telefono", -"Edit" => "Modifica" +"Phone" => "Telefono" ); diff --git a/l10n/ja_JP.php b/l10n/ja_JP.php new file mode 100644 index 00000000..d5ae4b63 --- /dev/null +++ b/l10n/ja_JP.php @@ -0,0 +1,36 @@ + "これはあなたの電話帳ではありません。", +"Contact could not be found." => "連絡先を見つける事ができません。", +"vCard could not be read." => "vCardの読み込みに失敗しました。", +"Information about vCard is incorrect. Please reload the page." => "vCardの情報に誤りがあります。ページをリロードして下さい。", +"Address" => "住所", +"Telephone" => "電話番号", +"Email" => "メールアドレス", +"Organization" => "所属", +"Work" => "勤務先", +"Home" => "住居", +"Mobile" => "携帯電話", +"Text" => "TTY TDD", +"Voice" => "音声番号", +"Fax" => "FAX", +"Video" => "テレビ電話", +"Pager" => "ポケベル", +"This is not your contact." => "あなたの連絡先ではありません。", +"This card is not RFC compatible." => "このカードはRFCに準拠していません。", +"This card does not contain a photo." => "このカードは写真を含んでおりません。", +"Add Contact" => "連絡先の追加", +"Group" => "グループ", +"Name" => "氏名", +"PO Box" => "私書箱", +"Extended" => "拡張番地", +"Street" => "街路番地", +"City" => "都市", +"Region" => "地域", +"Zipcode" => "郵便番号", +"Country" => "国名", +"Create Contact" => "追加", +"Edit" => "編集", +"Delete" => "削除", +"Birthday" => "生年月日", +"Phone" => "電話番号" +); diff --git a/l10n/lb.php b/l10n/lb.php new file mode 100644 index 00000000..df6e22bf --- /dev/null +++ b/l10n/lb.php @@ -0,0 +1,36 @@ + "Dat do ass net däin Adressbuch.", +"Contact could not be found." => "Konnt den Kontakt net fannen.", +"vCard could not be read." => "vCard konnt net gelies ginn.", +"Information about vCard is incorrect. Please reload the page." => "Informatioun iwwert vCard ass net richteg. Lued d'Säit wegl nei.", +"Address" => "Adress", +"Telephone" => "Telefon's Nummer", +"Email" => "Email", +"Organization" => "Firma", +"Work" => "Aarbecht", +"Home" => "Doheem", +"Mobile" => "GSM", +"Text" => "SMS", +"Voice" => "Voice", +"Fax" => "Fax", +"Video" => "Video", +"Pager" => "Pager", +"This is not your contact." => "Dat do ass net däin Kontakt.", +"This card is not RFC compatible." => "Déi do Kaart ass net RFC kompatibel.", +"This card does not contain a photo." => "Déi do Kaart huet keng Foto.", +"Add Contact" => "Kontakt bäisetzen", +"Group" => "Grupp", +"Name" => "Numm", +"PO Box" => "Postleetzuel", +"Extended" => "Erweidert", +"Street" => "Strooss", +"City" => "Staat", +"Region" => "Regioun", +"Zipcode" => "Postleetzuel", +"Country" => "Land", +"Create Contact" => "Kontakt erstellen", +"Edit" => "Editéieren", +"Delete" => "Läschen", +"Birthday" => "Gebuertsdag", +"Phone" => "Telefon" +); diff --git a/l10n/lt_LT.php b/l10n/lt_LT.php new file mode 100644 index 00000000..ad92ebf9 --- /dev/null +++ b/l10n/lt_LT.php @@ -0,0 +1,33 @@ + "Tai ne jūsų adresų knygelė.", +"Contact could not be found." => "Kontaktas nerastas", +"vCard could not be read." => "Nenuskaitoma vCard.", +"Information about vCard is incorrect. Please reload the page." => "Informacija apie vCard yra neteisinga. ", +"Address" => "Adresas", +"Telephone" => "Telefonas", +"Email" => "El. paštas", +"Organization" => "Organizacija", +"Work" => "Darbo", +"Home" => "Namų", +"Mobile" => "Mobilusis", +"Text" => "Tekstas", +"Voice" => "Balso", +"Fax" => "Faksas", +"Video" => "Vaizdo", +"Pager" => "Pranešimų gaviklis", +"This is not your contact." => "Tai ne jūsų kontaktas", +"Add Contact" => "Pridėti kontaktą", +"Group" => "Grupė", +"Name" => "Vardas", +"PO Box" => "Pašto dėžutė", +"Street" => "Gatvė", +"City" => "Miestas", +"Region" => "Regionas", +"Zipcode" => "Pašto indeksas", +"Country" => "Šalis", +"Create Contact" => "Sukurti kontaktą", +"Edit" => "Keisti", +"Delete" => "Trinti", +"Birthday" => "Gimtadienis", +"Phone" => "Telefonas" +); diff --git a/l10n/nl.php b/l10n/nl.php new file mode 100644 index 00000000..0113eb9d --- /dev/null +++ b/l10n/nl.php @@ -0,0 +1,53 @@ + "Dit is niet uw adresboek.", +"Contact could not be found." => "Contact kon niet worden gevonden.", +"vCard could not be read." => "vCard kon niet worden gelezen.", +"Information about vCard is incorrect. Please reload the page." => "Informatie over de vCard is onjuist. Herlaad de pagina.", +"Address" => "Adres", +"Telephone" => "Telefoon", +"Email" => "E-mail", +"Organization" => "Organisatie", +"Work" => "Werk", +"Home" => "Thuis", +"Mobile" => "Mobiel", +"Text" => "Tekst", +"Voice" => "Stem", +"Fax" => "Fax", +"Video" => "Video", +"Pager" => "Pieper", +"This is not your contact." => "Dit is niet uw contactpersoon.", +"This card is not RFC compatible." => "Deze kaart is niet RFC compatibel.", +"This card does not contain a photo." => "Deze contact bevat geen foto.", +"Add Contact" => "Contact toevoegen", +"Address Books" => "Adresboeken", +"Group" => "Groep", +"Name" => "Naam", +"Number" => "Nummer", +"Type" => "Type", +"PO Box" => "Postbus", +"Extended" => "Uitgebreide", +"Street" => "Straat", +"City" => "Stad", +"Region" => "Regio", +"Zipcode" => "Postcode", +"Country" => "Land", +"Create Contact" => "Contact aanmaken", +"Choose active Address Books" => "Kies actief Adresboek", +"New Address Book" => "Nieuw Adresboek", +"CardDav Link" => "CardDav Link", +"Download" => "Download", +"Edit" => "Bewerken", +"Delete" => "Verwijderen", +"Delete contact" => "Verwijder contact", +"Add" => "Voeg toe", +"Edit Address Book" => "Bewerk Adresboek", +"Displayname" => "Weergavenaam", +"Active" => "Actief", +"Save" => "Opslaan", +"Submit" => "Opslaan", +"Cancel" => "Anuleren", +"Birthday" => "Verjaardag", +"Preferred" => "Voorkeur", +"Phone" => "Telefoon", +"Update" => "Vernieuwe" +); diff --git a/l10n/nn_NO.php b/l10n/nn_NO.php new file mode 100644 index 00000000..98db59d9 --- /dev/null +++ b/l10n/nn_NO.php @@ -0,0 +1,36 @@ + "Dette er ikkje di adressebok.", +"Contact could not be found." => "Fann ikkje kontakten.", +"vCard could not be read." => "Klarte ikkje å lesa vCard-et.", +"Information about vCard is incorrect. Please reload the page." => "Informasjonen om vCard-et er feil, ver venleg og last sida på nytt.", +"Address" => "Adresse", +"Telephone" => "Telefonnummer", +"Email" => "Epost", +"Organization" => "Organisasjon", +"Work" => "Arbeid", +"Home" => "Heime", +"Mobile" => "Mobil", +"Text" => "Tekst", +"Voice" => "Tale", +"Fax" => "Faks", +"Video" => "Video", +"Pager" => "Personsøkjar", +"This is not your contact." => "Dette er ikkje din kontakt.", +"This card is not RFC compatible." => "Dette kortet er ikkje RFC-kompatibelt", +"This card does not contain a photo." => "Dette kortet har ingen bilete.", +"Add Contact" => "Legg til kontakt", +"Group" => "Gruppe", +"Name" => "Namn", +"PO Box" => "Postboks", +"Extended" => "Utvida", +"Street" => "Gate", +"City" => "Stad", +"Region" => "Region/fylke", +"Zipcode" => "Postnummer", +"Country" => "Land", +"Create Contact" => "Opprett kontakt", +"Edit" => "Endra", +"Delete" => "Slett", +"Birthday" => "Bursdag", +"Phone" => "Telefonnummer" +); diff --git a/l10n/pl.php b/l10n/pl.php new file mode 100644 index 00000000..0302b0e3 --- /dev/null +++ b/l10n/pl.php @@ -0,0 +1,36 @@ + "To nie jest twoja książka adresowa.", +"Contact could not be found." => "Kontakt nie znaleziony.", +"vCard could not be read." => "Nie można odczytać vCard.", +"Information about vCard is incorrect. Please reload the page." => "Informacje o vCard są nieprawidłowe. Proszę odświeżyć stronę.", +"Address" => "Adres", +"Telephone" => "Telefon", +"Email" => "E-mail", +"Organization" => "Organizacja", +"Work" => "Praca", +"Home" => "Dom", +"Mobile" => "Komórka", +"Text" => "Tekst", +"Voice" => "Połączenie głosowe", +"Fax" => "Faks", +"Video" => "Połączenie wideo", +"Pager" => "Pager", +"This is not your contact." => "To nie jest twój kontakt.", +"This card is not RFC compatible." => "Ta karta nie jest zgodna ze specyfikacją RFC.", +"This card does not contain a photo." => "Ta karta nie zawiera zdjęć.", +"Add Contact" => "Dodaj kontakt", +"Group" => "Grupa", +"Name" => "Nazwisko", +"PO Box" => "PO Box", +"Extended" => "Rozszerzony", +"Street" => "Ulica", +"City" => "Miasto", +"Region" => "Region", +"Zipcode" => "Kod pocztowy", +"Country" => "Kraj", +"Create Contact" => "Utwórz kontakt", +"Edit" => "Edytuj", +"Delete" => "Usuń", +"Birthday" => "Urodziny", +"Phone" => "Telefon" +); diff --git a/l10n/pt_BR.php b/l10n/pt_BR.php new file mode 100644 index 00000000..42d37451 --- /dev/null +++ b/l10n/pt_BR.php @@ -0,0 +1,36 @@ + "Este não é o seu agenda de endereços.", +"Contact could not be found." => "Contato não pôde ser encontrado.", +"vCard could not be read." => "vCard não pôde ser lida.", +"Information about vCard is incorrect. Please reload the page." => "Informações sobre vCard é incorreta. Por favor, recarregue a página.", +"Address" => "Endereço", +"Telephone" => "Telefone", +"Email" => "E-mail", +"Organization" => "Organização", +"Work" => "Trabalho", +"Home" => "Home", +"Mobile" => "Móvel", +"Text" => "Texto", +"Voice" => "Voz", +"Fax" => "Fax", +"Video" => "Vídeo", +"Pager" => "Pager", +"This is not your contact." => "Este não é o seu contato.", +"This card is not RFC compatible." => "Este cartão não é compatível com RFC.", +"This card does not contain a photo." => "Este cartão não contém uma foto.", +"Add Contact" => "Adicionar Contato", +"Group" => "Grupo", +"Name" => "Nome", +"PO Box" => "Caixa Postal", +"Extended" => "Estendido", +"Street" => "Rua", +"City" => "Cidade", +"Region" => "Região", +"Zipcode" => "CEP", +"Country" => "País", +"Create Contact" => "Criar Contato", +"Edit" => "Editar", +"Delete" => "Excluir", +"Birthday" => "Aniversário", +"Phone" => "Telefone" +); diff --git a/l10n/pt_PT.php b/l10n/pt_PT.php new file mode 100644 index 00000000..b354272a --- /dev/null +++ b/l10n/pt_PT.php @@ -0,0 +1,36 @@ + "Esta não é a sua lista de contactos", +"Contact could not be found." => "O contacto não foi encontrado", +"vCard could not be read." => "o vCard não pode ser lido", +"Information about vCard is incorrect. Please reload the page." => "A informação sobre o vCard está incorreta. Por favor refresque a página", +"Address" => "Morada", +"Telephone" => "Telefone", +"Email" => "Email", +"Organization" => "Organização", +"Work" => "Trabalho", +"Home" => "Casa", +"Mobile" => "Telemovel", +"Text" => "Texto", +"Voice" => "Voz", +"Fax" => "Fax", +"Video" => "Vídeo", +"Pager" => "Pager", +"This is not your contact." => "Este não é o seu contacto", +"This card is not RFC compatible." => "Este cartão não é compativel com RFC", +"This card does not contain a photo." => "Este cartão não possui foto", +"Add Contact" => "Adicionar Contacto", +"Group" => "Grupo", +"Name" => "Nome", +"PO Box" => "Apartado", +"Extended" => "Extendido", +"Street" => "Rua", +"City" => "Cidade", +"Region" => "Região", +"Zipcode" => "Código Postal", +"Country" => "País", +"Create Contact" => "Criar Contacto", +"Edit" => "Editar", +"Delete" => "Apagar", +"Birthday" => "Aniversário", +"Phone" => "Telefone" +); diff --git a/l10n/ro.php b/l10n/ro.php new file mode 100644 index 00000000..2a89edc4 --- /dev/null +++ b/l10n/ro.php @@ -0,0 +1,36 @@ + "Nu se găsește în agendă.", +"Contact could not be found." => "Contactul nu a putut fi găsit.", +"vCard could not be read." => "vCard nu poate fi citit.", +"Information about vCard is incorrect. Please reload the page." => "Informațiile despre vCard sunt incorecte. Reîncărcați pagina.", +"Address" => "Adresă", +"Telephone" => "Telefon", +"Email" => "Email", +"Organization" => "Organizație", +"Work" => "Servici", +"Home" => "Acasă", +"Mobile" => "Mobil", +"Text" => "Text", +"Voice" => "Voce", +"Fax" => "Fax", +"Video" => "Video", +"Pager" => "Pager", +"This is not your contact." => "Nu este contactul tău", +"This card is not RFC compatible." => "Nu este compatibil RFC", +"This card does not contain a photo." => "Nu conține o fotografie", +"Add Contact" => "Adaugă contact", +"Group" => "Grup", +"Name" => "Nume", +"PO Box" => "CP", +"Extended" => "Extins", +"Street" => "Stradă", +"City" => "Oraș", +"Region" => "Regiune", +"Zipcode" => "Cod poștal", +"Country" => "Țară", +"Create Contact" => "Crează contact", +"Edit" => "Editează", +"Delete" => "Șterge", +"Birthday" => "Zi de naștere", +"Phone" => "Telefon" +); diff --git a/l10n/ru.php b/l10n/ru.php new file mode 100644 index 00000000..c3b66a83 --- /dev/null +++ b/l10n/ru.php @@ -0,0 +1,36 @@ + "Это не ваша адресная книга.", +"Contact could not be found." => "Контакт не найден.", +"vCard could not be read." => "Не удалось прочесть vCard.", +"Information about vCard is incorrect. Please reload the page." => "Информация о vCard некорректна. Пожалуйста, обновите страницу.", +"Address" => "Адрес", +"Telephone" => "Телефон", +"Email" => "Ящик эл. почты", +"Organization" => "Организация", +"Work" => "Рабочий", +"Home" => "Домашний", +"Mobile" => "Мобильный", +"Text" => "Текст", +"Voice" => "Голос", +"Fax" => "Факс", +"Video" => "Видео", +"Pager" => "Пейджер", +"This is not your contact." => "Это не контакт.", +"This card is not RFC compatible." => "Эта карточка не соответствует RFC.", +"This card does not contain a photo." => "Эта карточка не содержит фотографии.", +"Add Contact" => "Добавить Контакт", +"Group" => "Группа", +"Name" => "Имя", +"PO Box" => "АО", +"Extended" => "Расширенный", +"Street" => "Улица", +"City" => "Город", +"Region" => "Область", +"Zipcode" => "Почтовый индекс", +"Country" => "Страна", +"Create Contact" => "Создать Контакт", +"Edit" => "Редактировать", +"Delete" => "Удалить", +"Birthday" => "День рождения", +"Phone" => "Телефон" +); diff --git a/l10n/sk_SK.php b/l10n/sk_SK.php new file mode 100644 index 00000000..acc19672 --- /dev/null +++ b/l10n/sk_SK.php @@ -0,0 +1,36 @@ + "Toto nie je váš adresár.", +"Contact could not be found." => "Kontakt nebol nájdený.", +"vCard could not be read." => "vCard nemôže byť prečítaná.", +"Information about vCard is incorrect. Please reload the page." => "Informácie o vCard sú neplatné. Prosím obnovte stránku.", +"Address" => "Adresa", +"Telephone" => "Telefón", +"Email" => "E-mail", +"Organization" => "Organizácia", +"Work" => "Práca", +"Home" => "Domov", +"Mobile" => "Mobil", +"Text" => "SMS", +"Voice" => "Odkazová schránka", +"Fax" => "Fax", +"Video" => "Video", +"Pager" => "Pager", +"This is not your contact." => "Toto nie je váš kontakt.", +"This card is not RFC compatible." => "Táto karta nie je kompatibilná s RFC.", +"This card does not contain a photo." => "Táto karta neobsahuje fotografiu.", +"Add Contact" => "Pridať Kontakt.", +"Group" => "Skupina", +"Name" => "Meno", +"PO Box" => "PO Box", +"Extended" => "Rozšírené", +"Street" => "Ulica", +"City" => "Mesto", +"Region" => "Región", +"Zipcode" => "PSČ", +"Country" => "Krajina", +"Create Contact" => "Vytvoriť Kontakt.", +"Edit" => "Upraviť", +"Delete" => "Odstrániť", +"Birthday" => "Narodeniny", +"Phone" => "Telefón" +); diff --git a/l10n/sl.php b/l10n/sl.php new file mode 100644 index 00000000..bce43a7a --- /dev/null +++ b/l10n/sl.php @@ -0,0 +1,36 @@ + "To ni vaš adresar.", +"Contact could not be found." => "Kontakta ni bilo mogoče najti.", +"vCard could not be read." => "vVizitko (vCard) ni bilo mogoče prebrati.", +"Information about vCard is incorrect. Please reload the page." => "Informacije o vVizitki (vCard) niso pravilne, Prosimo ponovno naložite okno.", +"Address" => "Naslov", +"Telephone" => "Telefon", +"Email" => "Email", +"Organization" => "Organizacija", +"Work" => "Delo", +"Home" => "Doma", +"Mobile" => "Mobitel", +"Text" => "Tekst", +"Voice" => "Glas- Voice", +"Fax" => "Faks", +"Video" => "Video", +"Pager" => "Pager", +"This is not your contact." => "To ni vaš kontakt", +"This card is not RFC compatible." => "Ta karta ni RFC kopatibilna.", +"This card does not contain a photo." => "Ta karta ne vsebuje slike.", +"Add Contact" => "Dodaj Kontakt", +"Group" => "Skupina", +"Name" => "Ime", +"PO Box" => "PO Box", +"Extended" => "Razširjeno.", +"Street" => "Ulica", +"City" => "Mesto", +"Region" => "Regija", +"Zipcode" => "Poštna št.", +"Country" => "Dežela", +"Create Contact" => "Ustvari Kontakt", +"Edit" => "Uredi", +"Delete" => "Izbriši", +"Birthday" => "Rojstni Dan", +"Phone" => "Telefon" +); diff --git a/l10n/sr.php b/l10n/sr.php new file mode 100644 index 00000000..f0775f0a --- /dev/null +++ b/l10n/sr.php @@ -0,0 +1,36 @@ + "Ово није ваш адресар.", +"Contact could not be found." => "Контакт се не може наћи.", +"vCard could not be read." => "вКарта се не може читати.", +"Information about vCard is incorrect. Please reload the page." => "Подаци о вКарти су неисправни. Поново учитајте страницу.", +"Address" => "Адреса", +"Telephone" => "Телефон", +"Email" => "Е-маил", +"Organization" => "Организација", +"Work" => "Посао", +"Home" => "Кућа", +"Mobile" => "Мобилни", +"Text" => "Текст", +"Voice" => "Глас", +"Fax" => "Факс", +"Video" => "Видео", +"Pager" => "Пејџер", +"This is not your contact." => "Ово није ваш контакт.", +"This card is not RFC compatible." => "Ова карта није сагласна са РФЦ-ом.", +"This card does not contain a photo." => "Ова карта не садржи фотографију.", +"Add Contact" => "Додај контакт", +"Group" => "Група", +"Name" => "Име", +"PO Box" => "Поштански број", +"Extended" => "Прошири", +"Street" => "Улица", +"City" => "Град", +"Region" => "Регија", +"Zipcode" => "Зип код", +"Country" => "Земља", +"Create Contact" => "Направи контакт", +"Edit" => "Уреди", +"Delete" => "Обриши", +"Birthday" => "Рођендан", +"Phone" => "Телефон" +); diff --git a/l10n/sr@latin.php b/l10n/sr@latin.php new file mode 100644 index 00000000..a4e70daf --- /dev/null +++ b/l10n/sr@latin.php @@ -0,0 +1,36 @@ + "Ovo nije vaš adresar.", +"Contact could not be found." => "Kontakt se ne može naći.", +"vCard could not be read." => "vKarta se ne može čitati.", +"Information about vCard is incorrect. Please reload the page." => "Podaci o vKarti su neispravni. Ponovo učitajte stranicu.", +"Address" => "Adresa", +"Telephone" => "Telefon", +"Email" => "E-mail", +"Organization" => "Organizacija", +"Work" => "Posao", +"Home" => "Kuća", +"Mobile" => "Mobilni", +"Text" => "Tekst", +"Voice" => "Glas", +"Fax" => "Faks", +"Video" => "Video", +"Pager" => "Pejdžer", +"This is not your contact." => "Ovo nije vaš kontakt.", +"This card is not RFC compatible." => "Ova karta nije saglasna sa RFC-om.", +"This card does not contain a photo." => "Ova karta ne sadrži fotografiju.", +"Add Contact" => "Dodaj kontakt", +"Group" => "Grupa", +"Name" => "Ime", +"PO Box" => "Poštanski broj", +"Extended" => "Proširi", +"Street" => "Ulica", +"City" => "Grad", +"Region" => "Regija", +"Zipcode" => "Zip kod", +"Country" => "Zemlja", +"Create Contact" => "Napravi kontakt", +"Edit" => "Uredi", +"Delete" => "Obriši", +"Birthday" => "Rođendan", +"Phone" => "Telefon" +); diff --git a/l10n/sv.php b/l10n/sv.php new file mode 100644 index 00000000..d90f0693 --- /dev/null +++ b/l10n/sv.php @@ -0,0 +1,36 @@ + "Det här är inte din adressbok.", +"Contact could not be found." => "Kontakt kunde inte hittas.", +"vCard could not be read." => "vCard kunde inte läsas in.", +"Information about vCard is incorrect. Please reload the page." => "Information om vCard är felaktigt. Vänligen ladda om sidan.", +"Address" => "Adress", +"Telephone" => "Telefon", +"Email" => "E-post", +"Organization" => "Organisation", +"Work" => "Arbete", +"Home" => "Hem", +"Mobile" => "Mobil", +"Text" => "Text", +"Voice" => "Röst", +"Fax" => "Fax", +"Video" => "Video", +"Pager" => "Personsökare", +"This is not your contact." => "Det här är inte din kontakt.", +"This card is not RFC compatible." => "Detta kort är inte RFC-kompatibelt.", +"This card does not contain a photo." => "Detta kort innehåller inte något foto.", +"Add Contact" => "Lägg till kontakt", +"Group" => "Grupp", +"Name" => "Namn", +"PO Box" => "Postbox", +"Extended" => "Utökad", +"Street" => "Gata", +"City" => "Stad", +"Region" => "Län", +"Zipcode" => "Postnummer", +"Country" => "Land", +"Create Contact" => "Skapa kontakt", +"Edit" => "Redigera", +"Delete" => "Radera", +"Birthday" => "Födelsedag", +"Phone" => "Telefon" +); diff --git a/l10n/tr.php b/l10n/tr.php new file mode 100644 index 00000000..4ba41a34 --- /dev/null +++ b/l10n/tr.php @@ -0,0 +1,36 @@ + "Bu sizin adres defteriniz değil.", +"Contact could not be found." => "Kişi bulunamadı.", +"vCard could not be read." => "vCard okunamadı.", +"Information about vCard is incorrect. Please reload the page." => "vCard bilgileri doğru değil. Lütfen sayfayı yenileyin.", +"Address" => "Adres", +"Telephone" => "Telefon", +"Email" => "Eposta", +"Organization" => "Organizasyon", +"Work" => "İş", +"Home" => "Ev", +"Mobile" => "Mobil", +"Text" => "Metin", +"Voice" => "Ses", +"Fax" => "Faks", +"Video" => "Video", +"Pager" => "Sayfalayıcı", +"This is not your contact." => "Bu sizin kişiniz değil.", +"This card is not RFC compatible." => "Bu kart RFC uyumlu değil.", +"This card does not contain a photo." => "Bu kart resim içermiyor.", +"Add Contact" => "Kişi Ekle", +"Group" => "Grup", +"Name" => "Ad", +"PO Box" => "Posta Kutusu", +"Extended" => "Uzatılmış", +"Street" => "Sokak", +"City" => "Şehir", +"Region" => "Bölge", +"Zipcode" => "Posta kodu", +"Country" => "Ülke", +"Create Contact" => "Kişi Oluştur", +"Edit" => "Düzenle", +"Delete" => "Sil", +"Birthday" => "Doğum günü", +"Phone" => "Telefon" +); diff --git a/l10n/zh_CN.php b/l10n/zh_CN.php new file mode 100644 index 00000000..5ebf2d86 --- /dev/null +++ b/l10n/zh_CN.php @@ -0,0 +1,36 @@ + "这不是您的地址簿。", +"Contact could not be found." => "无法找到联系人。", +"vCard could not be read." => "vCard 无法读取。", +"Information about vCard is incorrect. Please reload the page." => "vCard 的信息不正确。请重新加载页面。", +"Address" => "地址", +"Telephone" => "电话", +"Email" => "电子邮件", +"Organization" => "组织", +"Work" => "工作", +"Home" => "家庭", +"Mobile" => "移动电话", +"Text" => "文本", +"Voice" => "语音", +"Fax" => "传真", +"Video" => "视频", +"Pager" => "传呼机", +"This is not your contact." => "这不是您的联系人。", +"This card is not RFC compatible." => "这张名片和RFC 标准不兼容。", +"This card does not contain a photo." => "这张名片不包含照片。", +"Add Contact" => "添加联系人", +"Group" => "分组", +"Name" => "名称", +"PO Box" => "邮箱", +"Extended" => "扩展", +"Street" => "街道", +"City" => "城市", +"Region" => "地区", +"Zipcode" => "邮编", +"Country" => "国家", +"Create Contact" => "创建联系人", +"Edit" => "编辑", +"Delete" => "删除", +"Birthday" => "生日", +"Phone" => "电话" +); From 6a85d92dfed66cfdb9c92136a167332bb4ad3511 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Tue, 10 Jan 2012 18:07:01 +0100 Subject: [PATCH 06/17] Added missing } --- ajax/addcard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ajax/addcard.php b/ajax/addcard.php index 54e4faa6..9d9a99de 100644 --- a/ajax/addcard.php +++ b/ajax/addcard.php @@ -54,7 +54,7 @@ foreach( $add as $propname){ $value = $values[$propname]; if( isset( $parameters[$propname] ) && count( $parameters[$propname] )){ $prop_parameters = $parameters[$propname]; - else{ + } else { $prop_parameters = array(); } $vcard->addProperty($propname, $value); //, $prop_parameters); From 370242836982bdc13e4b132454460be63693dcca Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Wed, 11 Jan 2012 03:56:53 +0100 Subject: [PATCH 07/17] CSS cleanup, more error checking, better error messages, general cleanup. --- ajax/addproperty.php | 10 ++- css/styles.css | 39 ++++++++++- export.php | 8 +-- index.php | 6 +- js/interface.js | 59 +++++++++++++---- lib/addressbook.php | 10 +-- lib/app.php | 1 + lib/vcard.php | 3 + templates/index.php | 7 -- templates/part.addcardform.php | 117 +++++++++++++++++++-------------- 10 files changed, 171 insertions(+), 89 deletions(-) diff --git a/ajax/addproperty.php b/ajax/addproperty.php index 0f76add3..74f1c3d0 100644 --- a/ajax/addproperty.php +++ b/ajax/addproperty.php @@ -26,13 +26,21 @@ require_once('../../../lib/base.php'); // Check if we are a user OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); +$l=new OC_L10N('contacts'); $id = $_POST['id']; $vcard = OC_Contacts_App::getContactVCard( $id ); $name = $_POST['name']; $value = $_POST['value']; -$parameters = isset($_POST['parameters'])?$_POST['parameters']:array(); +if(!is_array($value)){ + $value = trim($value); + if(!$value && in_array($name, array('TEL', 'EMAIL'))) { + OC_JSON::error(array('data' => array('message' => $l->t('Cannot add empty property.')))); + exit(); + } +} +$parameters = isset($_POST['parameters']) ? $_POST['parameters'] : array(); $property = $vcard->addProperty($name, $value); //, $parameters); diff --git a/css/styles.css b/css/styles.css index 7b56767b..dfc296a2 100644 --- a/css/styles.css +++ b/css/styles.css @@ -8,9 +8,46 @@ #contacts_details_list { list-style:none; } #contacts_details_list li { overflow:visible; } #contacts_details_list li p.contacts_property_name { width:25%; float:left;text-align:right;padding-right:0.3em;color:#666; } -#contacts_details_list li p.contacts_property_data, #contacts_details_list li ul.contacts_property_data { width:72%;float:left; } +#contacts_details_list li p.contacts_property_data, #contacts_details_list li ul.contacts_property_data { width:72%;float:left; clear: right; } #contacts_setproperty_button { margin-left:25%; } +dl.form +{ + width: 100%; + float: left; + clear: right; + margin: 1em; + padding: 0; +} + +.form dt +{ + display: table-cell; + clear: left; + float: left; + min-width: 10em; + margin: 0; + padding-top: 0.5em; + padding-right: 1em; + font-weight: bold; + text-align:right; + vertical-align: text-bottom; + bottom: 0px; +} + +.form dd +{ + display: table-cell; + clear: right; + float: left; + min-width: 20em; + margin: 0; + padding: 0; + white-space: nowrap; + top: 0px; +} +.form input { position: relative; width: 20em; } + .contacts_property_data ul, ol.contacts_property_data { list-style:none; } .contacts_property_data li { overflow: hidden; } .contacts_property_data li label { width:20%; float:left; text-align:right;padding-right:0.3em; } diff --git a/export.php b/export.php index fd2d7da1..a1e974c9 100644 --- a/export.php +++ b/export.php @@ -1,6 +1,6 @@ + * Copyright (c) 2011-2012 Thomas Tanghus * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. @@ -20,9 +20,9 @@ if(isset($book)){ $cardobjects = OC_Contacts_VCard::all($book); header('Content-Type: text/directory'); header('Content-Disposition: inline; filename=' . str_replace(' ', '_', $addressbook['displayname']) . '.vcf'); - for($i = 0;$i <= count($cardobjects); $i++){ - echo $cardobjects[$i]['carddata']; - //echo '\r\n'; + + foreach($cardobjects as $card) { + echo $card['carddata']; } }elseif(isset($contact)){ $data = OC_Contacts_App::getContactObject($contact); diff --git a/index.php b/index.php index 0b705e71..6f65ac1c 100644 --- a/index.php +++ b/index.php @@ -60,10 +60,10 @@ if(!is_null($id)) { // Include Style and Script OC_Util::addScript('contacts','interface'); -OC_Util::addStyle('contacts','styles'); -OC_Util::addStyle('contacts','formtastic'); +OC_Util::addScript('contacts','jquery.inview'); OC_Util::addScript('', 'jquery.multiselect'); -OC_Util::addStyle('', 'jquery.multiselect'); +OC_Util::addStyle('contacts','styles'); +//OC_Util::addStyle('contacts','formtastic'); $property_types = OC_Contacts_App::getAddPropertyOptions(); $adr_types = OC_Contacts_App::getTypesOfProperty('ADR'); diff --git a/js/interface.js b/js/interface.js index 4a27073c..9547c581 100644 --- a/js/interface.js +++ b/js/interface.js @@ -29,18 +29,28 @@ Contacts={ $('#carddav_url_close').show(); }, messageBox:function(title, msg) { - var $dialog = $('
    ') - .html(msg) - .dialog({ - autoOpen: true, - title: title,buttons: [ + if($('#messagebox').dialog('isOpen') == true){ + // NOTE: Do we ever get here? + $('#messagebox').dialog('moveToTop'); + }else{ + $('#dialog_holder').load(OC.filePath('contacts', 'ajax', 'messagebox.php'), function(){ + $('#messagebox').dialog( { - text: "Ok", - click: function() { $(this).dialog("close"); } - } - ] - } - ); + autoOpen: true, + title: title, + buttons: [{ + text: "Ok", + click: function() { $(this).dialog("close"); } + }], + close: function(event, ui) { + $(this).dialog('destroy').remove(); + }, + open: function(event, ui) { + $('#messagebox_msg').html(msg); + } + }); + }); + } }, Addressbooks:{ overview:function(){ @@ -159,6 +169,10 @@ $(document).ready(function(){ /*------------------------------------------------------------------------- * Event handlers *-----------------------------------------------------------------------*/ + + /** + * Load the details view for a contact. + */ $('#leftcontent li').live('click',function(){ var id = $(this).data('id'); var oldid = $('#rightcontent').data('id'); @@ -179,6 +193,9 @@ $(document).ready(function(){ return false; }); + /** + * Delete currently selected contact (and clear form?) + */ $('#contacts_deletecard').live('click',function(){ var id = $('#rightcontent').data('id'); $.getJSON('ajax/deletecard.php',{'id':id},function(jsondata){ @@ -195,6 +212,10 @@ $(document).ready(function(){ return false; }); + /** + * Add a property to the contact. + * NOTE: Where does 'contacts_addproperty' exist? + */ $('#contacts_addproperty').live('click',function(){ var id = $('#rightcontent').data('id'); $.getJSON('ajax/showaddproperty.php',{'id':id},function(jsondata){ @@ -204,12 +225,15 @@ $(document).ready(function(){ } else{ Contacts.UI.messageBox('Error', jsondata.data.message); - //alert(jsondata.data.message); + alert('From handler: '+jsondata.data.message); } }); return false; }); + /** + * Change the inputs based on which type of property is selected for addition. + */ $('#contacts_addpropertyform [name="name"]').live('change',function(){ $('#contacts_addpropertyform #contacts_addresspart').remove(); $('#contacts_addpropertyform #contacts_phonepart').remove(); @@ -234,12 +258,14 @@ $(document).ready(function(){ } else{ Contacts.UI.messageBox('Error', jsondata.data.message); - //alert(jsondata.data.message); } }, 'json'); return false; }); + /** + * Show the Addressbook chooser + */ $('#chooseaddressbook').click(function(){ Contacts.UI.Addressbooks.overview(); return false; @@ -292,6 +318,10 @@ $(document).ready(function(){ }, 'json'); return false; }); + + /** + * Show inputs for editing a property. + */ $('.contacts_property [data-use="edit"]').live('click',function(){ var id = $('#rightcontent').data('id'); var checksum = $(this).parents('.contacts_property').first().data('checksum'); @@ -308,6 +338,9 @@ $(document).ready(function(){ return false; }); + /** + * Save the edited property + */ $('#contacts_setpropertyform input[type="submit"]').live('click',function(){ $.post('ajax/setproperty.php',$(this).parents('form').first().serialize(),function(jsondata){ if(jsondata.status == 'success'){ diff --git a/lib/addressbook.php b/lib/addressbook.php index 78792f5f..41d488c0 100644 --- a/lib/addressbook.php +++ b/lib/addressbook.php @@ -203,15 +203,6 @@ class OC_Contacts_Addressbook{ while( $row = $result->fetchRow()){ $addressbooks[] = $row; } - /* - foreach( $active as $aid ){ - $stmt = OC_DB::prepare( 'SELECT * FROM *PREFIX*contacts_addressbooks WHERE id = ? ORDER BY displayname' ); - $result = $stmt->execute(array($aid,)); - - while( $row = $result->fetchRow()){ - $addressbooks[] = $row; - } - }*/ return $addressbooks; } @@ -240,6 +231,7 @@ class OC_Contacts_Addressbook{ unset($openaddressbooks[array_search($id, $openaddressbooks)]); } } + // NOTE: Ugly hack... $openaddressbooks = self::cleanArray($openaddressbooks, false); sort($openaddressbooks, SORT_NUMERIC); // FIXME: I alway end up with a ';' prepending when imploding the array..? diff --git a/lib/app.php b/lib/app.php index 79e00920..907ce82c 100644 --- a/lib/app.php +++ b/lib/app.php @@ -73,6 +73,7 @@ class OC_Contacts_App{ for($i=0;$ichildren);$i++){ if(md5($vcard->children[$i]->serialize()) == $checksum ){ $line = $i; + break; } } if(is_null($line)){ diff --git a/lib/vcard.php b/lib/vcard.php index 6a248ff5..401f9622 100644 --- a/lib/vcard.php +++ b/lib/vcard.php @@ -151,6 +151,7 @@ class OC_Contacts_VCard{ foreach($card->children as $property){ if($property->name == 'FN'){ $fn = $property->value; + break; } } } @@ -178,6 +179,7 @@ class OC_Contacts_VCard{ foreach($card->children as $property){ if($property->name == 'FN'){ $fn = $property->value; + break; } } } @@ -206,6 +208,7 @@ class OC_Contacts_VCard{ foreach($card->children as $property){ if($property->name == 'FN'){ $fn = $property->value; + break; } } } diff --git a/templates/index.php b/templates/index.php index 24484231..d548f171 100644 --- a/templates/index.php +++ b/templates/index.php @@ -1,10 +1,3 @@ - - diff --git a/templates/part.addcardform.php b/templates/part.addcardform.php index 62705354..510096a9 100644 --- a/templates/part.addcardform.php +++ b/templates/part.addcardform.php @@ -3,93 +3,108 @@
    -
      -
    1. +
      +
      +
      +
      -
    2. -
    + +
    -
      -
    1. +
      +
      + +

      -
    2. -
    3. + +
      +
      +
      -
    4. -
    + +
    -
      -
    1. +
      +
      +
      +
      -
    2. -
    3. -
      - - - -
        -
      1. - - -
      2. -
      3. - - -
      4. -
      -
      -
    4. -
    + +
    + +
    +
    + + +
    +
    t('Address'); ?> -
      -
    1. +
      +
      +
      +
      -
    2. -
    3. + +
      +
      +
      -
    4. -
    5. + +
      +
      +
      +
      -
    6. -
    7. + +
      +
      +
      -
    8. -
    9. + +
      +
      +
      -
    10. -
    11. + +
      +
      +
      -
    12. -
    13. + +
      + +
      -
    14. -
    15. + +
      +
      +
      -
    16. -
    + +
      From 57f9a00ccfb201bd76f0e8229ee168d0c4565f02 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Wed, 11 Jan 2012 04:02:55 +0100 Subject: [PATCH 08/17] Added files for error messages, removed old syle sheet. --- ajax/messagebox.php | 16 ++ css/formtastic.css | 270 ---------------------------------- templates/part.messagebox.php | 7 + 3 files changed, 23 insertions(+), 270 deletions(-) create mode 100644 ajax/messagebox.php delete mode 100644 css/formtastic.css create mode 100644 templates/part.messagebox.php diff --git a/ajax/messagebox.php b/ajax/messagebox.php new file mode 100644 index 00000000..b3cad947 --- /dev/null +++ b/ajax/messagebox.php @@ -0,0 +1,16 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +require_once('../../../lib/base.php'); +$l10n = new OC_L10N('contacts'); +OC_JSON::checkLoggedIn(); +OC_JSON::checkAppEnabled('contacts'); + +$output = new OC_TEMPLATE("contacts", "part.messagebox"); +$output -> printpage(); +?> diff --git a/css/formtastic.css b/css/formtastic.css deleted file mode 100644 index fede92b6..00000000 --- a/css/formtastic.css +++ /dev/null @@ -1,270 +0,0 @@ -/* ------------------------------------------------------------------------------------------------- - -ownCloud changes: search for OWNCLOUD - -Based on formtastic style sheet -This stylesheet forms part of the Formtastic Rails Plugin -(c) 2008-2011 Justin French - ---------------------------------------------------------------------------------------------------*/ -/* NORMALIZE AND RESET - obviously inspired by Yahoo's reset.css, but scoped to just .formtastic ---------------------------------------------------------------------------------------------------*/ -.formtastic, -.formtastic ul, -.formtastic ol, -.formtastic li, -.formtastic fieldset, -.formtastic legend, -/*.formtastic input, -.formtastic textarea, -.formtastic select, COMMENTED BY OWNCLOUD */ -.formtastic p { - margin:0; - padding:0; -} - -.formtastic fieldset { - border:0; -} - -.formtastic em, -.formtastic strong { - font-style:normal; - font-weight:normal; -} - -.formtastic ol, -.formtastic ul { - list-style:none; -} - -.formtastic abbr, -.formtastic acronym { - border:0; - font-variant:normal; -} - -/*.formtastic input, -.formtastic textarea { - font-family:sans-serif; - font-size:inherit; - font-weight:inherit; -} - -.formtastic input, -.formtastic textarea, -.formtastic select { - font-size:100%; -} COMMENTED BY OWNCLOUD */ - -.formtastic legend { - white-space:normal; - color:#000; -} - -/* SEMANTIC ERRORS ---------------------------------------------------------------------------------------------------*/ -.formtastic .errors { - color:#cc0000; - margin:0.5em 0 1.5em 25%; - list-style:square; -} - -.formtastic .errors li { - padding:0; - border:none; - display:list-item; -} - - -/* BUTTONS ---------------------------------------------------------------------------------------------------*/ -.formtastic .buttons { - overflow:hidden; /* clear containing floats */ - padding-left:25%; -} - -.formtastic .button { - float:left; - padding-right:0.5em; - border:none; /* ADDED BY OWNCLOUD */ -} - - -/* INPUTS ---------------------------------------------------------------------------------------------------*/ -.formtastic .inputs { - padding:0.5em 0; /* padding and negative margin juggling is for Firefox */ - margin-top:-0.5em; - margin-bottom:1em; -} - -.formtastic .input { -} - - -/* LEFT ALIGNED LABELS ---------------------------------------------------------------------------------------------------*/ -.formtastic .input .label { - display:block; - width:25%; - float:left; - padding-top:.2em; -} - -.formtastic .fragments .label, -.formtastic .choices .label { - position:absolute; - width:95%; - left:0px; -} - -.formtastic .fragments .label label, -.formtastic .choices .label label { - position:absolute; -} - -/* NESTED FIELDSETS AND LEGENDS (radio, check boxes and date/time inputs use nested fieldsets) ---------------------------------------------------------------------------------------------------*/ -.formtastic .choices { - position:relative; -} - -.formtastic .choices-group { - float:left; - width:74%; - margin:0; - padding:0 0 0 25%; -} - -.formtastic .choice { - padding:0; - border:0; -} - - -/* INLINE HINTS ---------------------------------------------------------------------------------------------------*/ -.formtastic .input .inline-hints { - color:#666; - margin:0.5em 0 0 25%; -} - - -/* INLINE ERRORS ---------------------------------------------------------------------------------------------------*/ -.formtastic .inline-errors { - color:#cc0000; - margin:0.5em 0 0 25%; -} - -.formtastic .errors { - color:#cc0000; - margin:0.5em 0 0 25%; - list-style:square; -} - -.formtastic .errors li { - padding:0; - border:none; - display:list-item; -} - - -/* STRING, NUMERIC, PASSWORD, EMAIL, URL, PHONE, SEARCH (ETC) OVERRIDES ---------------------------------------------------------------------------------------------------*/ -.formtastic .stringish input { - width:72%; -} - -.formtastic .stringish input[size] { - width:auto; - max-width:72%; -} - - -/* TEXTAREA OVERRIDES ---------------------------------------------------------------------------------------------------*/ -.formtastic .text textarea { - width:72%; -} - -.formtastic .text textarea[cols] { - width:auto; - max-width:72%; -} - - -/* HIDDEN OVERRIDES ---------------------------------------------------------------------------------------------------*/ -.formtastic .hidden { - display:none; -} - - -/* BOOLEAN LABELS ---------------------------------------------------------------------------------------------------*/ -.formtastic .boolean label { - padding-left:25%; - display:block; -} - - -/* CHOICE GROUPS ---------------------------------------------------------------------------------------------------*/ -.formtastic .choices-group { - margin-bottom:-0.5em; -} - -.formtastic .choice { - margin:0.1em 0 0.5em 0; -} - -.formtastic .choice label { - float:none; - width:100%; - line-height:100%; - padding-top:0; - margin-bottom:0.6em; -} - - -/* ADJUSTMENTS FOR INPUTS INSIDE LABELS (boolean input, radio input, check_boxes input) ---------------------------------------------------------------------------------------------------*/ -.formtastic .choice label input, -.formtastic .boolean label input { - margin:0 0.3em 0 0.1em; - line-height:100%; -} - - -/* FRAGMENTED INPUTS (DATE/TIME/DATETIME) ---------------------------------------------------------------------------------------------------*/ -.formtastic .fragments { - position:relative; -} - -.formtastic .fragments-group { - float:left; - width:74%; - margin:0; - padding:0 0 0 25%; -} - -.formtastic .fragment { - float:left; - width:auto; - margin:0 .3em 0 0; - padding:0; - border:0; -} - -.formtastic .fragment label { - display:none; -} - -.formtastic .fragment label input { - display:inline; - margin:0; - padding:0; -} diff --git a/templates/part.messagebox.php b/templates/part.messagebox.php new file mode 100644 index 00000000..3681bb6e --- /dev/null +++ b/templates/part.messagebox.php @@ -0,0 +1,7 @@ +
      + + + + +
      + From 30e1fffe15a7701dcf06683036b58ec778601df4 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Wed, 11 Jan 2012 06:20:06 +0100 Subject: [PATCH 09/17] Make sure VERSION is set. Set REV for each edit. Download single VCard. --- css/styles.css | 3 ++- export.php | 2 +- js/interface.js | 4 +++- lib/vcard.php | 21 +++++++++++++++++---- templates/part.details.php | 1 + 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/css/styles.css b/css/styles.css index dfc296a2..4fcd8fc1 100644 --- a/css/styles.css +++ b/css/styles.css @@ -4,7 +4,8 @@ #contacts_details_name { font-weight:bold;font-size:1.1em;margin-left:25%;} #contacts_details_photo { margin:.5em 0em .5em 25%; } -#contacts_deletecard {position:absolute;top:15px;right:15px;} +#contacts_deletecard {position:absolute;top:15px;right:25px;} +#contacts_downloadcard {position:absolute;top:15px;right:50px;} #contacts_details_list { list-style:none; } #contacts_details_list li { overflow:visible; } #contacts_details_list li p.contacts_property_name { width:25%; float:left;text-align:right;padding-right:0.3em;color:#666; } diff --git a/export.php b/export.php index a1e974c9..735d1c5b 100644 --- a/export.php +++ b/export.php @@ -33,7 +33,7 @@ if(isset($book)){ exit; } header('Content-Type: text/directory'); - header('Content-Disposition: inline; filename=' . $data['fullname'] . '.vcf'); + header('Content-Disposition: inline; filename=' . str_replace(' ', '_', $data['fullname']) . '.vcf'); echo $data['carddata']; } ?> diff --git a/js/interface.js b/js/interface.js index 9547c581..74148363 100644 --- a/js/interface.js +++ b/js/interface.js @@ -197,6 +197,7 @@ $(document).ready(function(){ * Delete currently selected contact (and clear form?) */ $('#contacts_deletecard').live('click',function(){ + $('#contacts_deletecard').tipsy('hide'); var id = $('#rightcontent').data('id'); $.getJSON('ajax/deletecard.php',{'id':id},function(jsondata){ if(jsondata.status == 'success'){ @@ -401,7 +402,8 @@ $(document).ready(function(){ } }); - $('.action').tipsy(); + $('#contacts_deletecard').tipsy(); + $('#contacts_downloadcard').tipsy(); $('.button').tipsy(); //Contacts.UI.messageBox('Hello','Sailor'); }); diff --git a/lib/vcard.php b/lib/vcard.php index 401f9622..72692701 100644 --- a/lib/vcard.php +++ b/lib/vcard.php @@ -111,16 +111,21 @@ class OC_Contacts_VCard{ if(is_null($uid)){ $card->setUID(); $uid = $card->getAsString('UID'); - $data = $card->serialize(); + //$data = $card->serialize(); }; $uri = $uid.'.vcf'; // VCARD must have a version $version = $card->getAsString('VERSION'); // Add version if needed - if(is_null($version)){ + if(!$version){ $card->add(new Sabre_VObject_Property('VERSION','3.0')); - $data = $card->serialize(); - } + //$data = $card->serialize(); + }/* else { + OC_Log::write('contacts','OC_Contacts_VCard::add. Version already set as: '.$version,OC_Log::DEBUG); + }*/ + $now = new DateTime; + $card->setString('REV', $now->format(DateTime::W3C)); + $data = $card->serialize(); } else{ // that's hard. Creating a UID and not saving it @@ -182,7 +187,12 @@ class OC_Contacts_VCard{ break; } } + } else { + return false; } + $now = new DateTime; + $card->setString('REV', $now->format(DateTime::W3C)); + $data = $card->serialize(); $stmt = OC_DB::prepare( 'UPDATE *PREFIX*contacts_cards SET fullname = ?,carddata = ?, lastmodified = ? WHERE id = ?' ); $result = $stmt->execute(array($fn,$data,time(),$id)); @@ -212,6 +222,9 @@ class OC_Contacts_VCard{ } } } + $now = new DateTime; + $card->setString('REV', $now->format(DateTime::W3C)); + $data = $card->serialize(); $stmt = OC_DB::prepare( 'UPDATE *PREFIX*contacts_cards SET fullname = ?,carddata = ?, lastmodified = ? WHERE id = ?' ); $result = $stmt->execute(array($fn,$data,time(),$oldcard['id'])); diff --git a/templates/part.details.php b/templates/part.details.php index 1482c063..fe0dac23 100644 --- a/templates/part.details.php +++ b/templates/part.details.php @@ -1,5 +1,6 @@ inc('part.property.FN', array('property' => $_['details']['FN'][0])); ?> + From 56c1d9ee54ee2db98314a80f52730628d6596276 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Wed, 11 Jan 2012 20:07:15 +0100 Subject: [PATCH 10/17] Localizin strings and adding error checking. --- ajax/activation.php | 9 +++++++- ajax/addcard.php | 7 ++++++ ajax/addproperty.php | 6 ++++- ajax/createaddressbook.php | 14 ++++++++++-- ajax/deleteproperty.php | 8 ++++++- ajax/setproperty.php | 7 +++++- ajax/updateaddressbook.php | 17 +++++++++++--- js/interface.js | 22 +++++++++---------- l10n/xgettextfiles | 21 ++++++++++++++++++ lib/addressbook.php | 1 + lib/vcard.php | 2 ++ templates/index.php | 2 +- templates/part.addcardform.php | 10 ++------- .../part.chooseaddressbook.rowfields.php | 2 +- templates/part.editaddressbook.php | 2 +- templates/settings.php | 4 ++-- 16 files changed, 101 insertions(+), 33 deletions(-) create mode 100644 l10n/xgettextfiles diff --git a/ajax/activation.php b/ajax/activation.php index f4a2c94a..fda63a52 100644 --- a/ajax/activation.php +++ b/ajax/activation.php @@ -10,10 +10,17 @@ require_once ("../../../lib/base.php"); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); +$l=new OC_L10N('contacts'); + $bookid = $_POST['bookid']; -OC_Contacts_Addressbook::setActive($bookid, $_POST['active']); +if(!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) { + OC_JSON::error(array('data' => array('message' => $l->t('Error (de)activating addressbook.')))); + OC_Log::write('contacts','ajax/activation.php: Error activating addressbook: '.$bookid, OC_Log::ERROR); + exit(); +} $book = OC_Contacts_App::getAddressbook($bookid); + /* is there an OC_JSON::error() ? */ OC_JSON::success(array( 'active' => OC_Contacts_Addressbook::isActive($bookid), diff --git a/ajax/addcard.php b/ajax/addcard.php index 9d9a99de..7e47659d 100644 --- a/ajax/addcard.php +++ b/ajax/addcard.php @@ -26,6 +26,7 @@ require_once('../../../lib/base.php'); // Check if we are a user OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); +$l=new OC_L10N('contacts'); $aid = $_POST['id']; $addressbook = OC_Contacts_App::getAddressbook( $aid ); @@ -74,5 +75,11 @@ foreach( $add as $propname){ } } $id = OC_Contacts_VCard::add($aid,$vcard->serialize()); +if(!$id) { + OC_JSON::error(array('data' => array('message' => $l->t('There was an error adding the contact.')))); + OC_Log::write('contacts','ajax/addcard.php: Recieved non-positive ID on adding card: '.$name, OC_Log::ERROR); + exit(); +} +// NOTE: Why is this in OC_Contacts_App? OC_Contacts_App::renderDetails($id, $vcard); diff --git a/ajax/addproperty.php b/ajax/addproperty.php index 74f1c3d0..6e3ba356 100644 --- a/ajax/addproperty.php +++ b/ajax/addproperty.php @@ -61,7 +61,11 @@ foreach ($parameters as $key=>$element) { } } -OC_Contacts_VCard::edit($id,$vcard->serialize()); +if(!OC_Contacts_VCard::edit($id,$vcard->serialize())) { + OC_JSON::error(array('data' => array('message' => $l->t('Error adding contact property.')))); + OC_Log::write('contacts','ajax/addproperty.php: Error updating contact property: '.$name, OC_Log::ERROR); + exit(); +} $adr_types = OC_Contacts_App::getTypesOfProperty('ADR'); $phone_types = OC_Contacts_App::getTypesOfProperty('TEL'); diff --git a/ajax/createaddressbook.php b/ajax/createaddressbook.php index f94ad34e..edcf794f 100644 --- a/ajax/createaddressbook.php +++ b/ajax/createaddressbook.php @@ -1,6 +1,6 @@ + * Copyright (c) 2011-2012 Thomas Tanghus * Copyright (c) 2011 Bart Visscher * This file is licensed under the Affero General Public License version 3 or * later. @@ -16,7 +16,17 @@ OC_JSON::checkAppEnabled('contacts'); $userid = OC_User::getUser(); $bookid = OC_Contacts_Addressbook::add($userid, $_POST['name'], null); -OC_Contacts_Addressbook::setActive($bookid, 1); +if(!$bookid) { + OC_JSON::error(array('data' => array('message' => $l->t('Error adding addressbook.')))); + OC_Log::write('contacts','ajax/createaddressbook.php: Error adding addressbook: '.$_POST['name'], OC_Log::ERROR); + exit(); +} + +if(!OC_Contacts_Addressbook::setActive($bookid, 1)) { + OC_JSON::error(array('data' => array('message' => $l->t('Error activating addressbook.')))); + OC_Log::write('contacts','ajax/createaddressbook.php: Error activating addressbook: '.$bookid, OC_Log::ERROR); + //exit(); +} $addressbook = OC_Contacts_App::getAddressbook($bookid); $tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); $tmpl->assign('addressbook', $addressbook); diff --git a/ajax/deleteproperty.php b/ajax/deleteproperty.php index f69735e6..89cf292f 100644 --- a/ajax/deleteproperty.php +++ b/ajax/deleteproperty.php @@ -26,6 +26,7 @@ require_once('../../../lib/base.php'); // Check if we are a user OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); +$l10n = new OC_L10N('contacts'); $id = $_GET['id']; $checksum = $_GET['checksum']; @@ -35,5 +36,10 @@ $line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum); unset($vcard->children[$line]); -OC_Contacts_VCard::edit($id,$vcard->serialize()); +if(!OC_Contacts_VCard::edit($id,$vcard->serialize())) { + OC_JSON::error(array('data' => array('message' => $l->t('Error deleting contact property.')))); + OC_Log::write('contacts','ajax/deleteproperty.php: Error deleting contact property', OC_Log::ERROR); + exit(); +} + OC_JSON::success(array('data' => array( 'id' => $id ))); diff --git a/ajax/setproperty.php b/ajax/setproperty.php index bcc4c161..e0cd7023 100644 --- a/ajax/setproperty.php +++ b/ajax/setproperty.php @@ -72,9 +72,14 @@ foreach($missingparameters as $i){ } // Do checksum and be happy +// NOTE: This checksum is not used..? $checksum = md5($vcard->children[$line]->serialize()); -OC_Contacts_VCard::edit($id,$vcard->serialize()); +if(!OC_Contacts_VCard::edit($id,$vcard->serialize())) { + OC_JSON::error(array('data' => array('message' => $l->t('Error updating contact property.')))); + OC_Log::write('contacts','ajax/setproperty.php: Error updating contact property: '.$value, OC_Log::ERROR); + exit(); +} $adr_types = OC_Contacts_App::getTypesOfProperty('ADR'); $phone_types = OC_Contacts_App::getTypesOfProperty('TEL'); diff --git a/ajax/updateaddressbook.php b/ajax/updateaddressbook.php index 516736cc..7d9e2aea 100644 --- a/ajax/updateaddressbook.php +++ b/ajax/updateaddressbook.php @@ -1,6 +1,6 @@ + * Copyright (c) 2011-2012 Thomas Tanghus * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. @@ -15,8 +15,19 @@ OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('contacts'); $bookid = $_POST['id']; -OC_Contacts_Addressbook::edit($bookid, $_POST['name'], null); -OC_Contacts_Addressbook::setActive($bookid, $_POST['active']); + +if(!OC_Contacts_Addressbook::edit($bookid, $_POST['name'], null)) { + OC_JSON::error(array('data' => array('message' => $l->t('Error updating addressbook.')))); + OC_Log::write('contacts','ajax/updateaddressbook.php: Error adding addressbook: ', OC_Log::ERROR); + //exit(); +} + +if(!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) { + OC_JSON::error(array('data' => array('message' => $l->t('Error (de)activating addressbook.')))); + OC_Log::write('contacts','ajax/updateaddressbook.php: Error (de)activating addressbook: '.$bookid, OC_Log::ERROR); + //exit(); +} + $addressbook = OC_Contacts_App::getAddressbook($bookid); $tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); $tmpl->assign('addressbook', $addressbook); diff --git a/js/interface.js b/js/interface.js index 74148363..8a1de305 100644 --- a/js/interface.js +++ b/js/interface.js @@ -106,7 +106,7 @@ Contacts={ Contacts.UI.Contacts.update(); Contacts.UI.Addressbooks.overview(); } else { - Contacts.UI.messageBox('Error', data.message); + Contacts.UI.messageBox(t('contacts', 'Error'), data.message); //alert('Error: ' + data.message); } }); @@ -145,7 +145,7 @@ Contacts={ $('#contacts').html(jsondata.data.page); } else{ - Contacts.UI.messageBox('Error',jsondata.data.message); + Contacts.UI.messageBox(t('contacts', 'Error'),jsondata.data.message); //alert(jsondata.data.message); } }); @@ -186,7 +186,7 @@ $(document).ready(function(){ $('#leftcontent li[data-id="'+jsondata.data.id+'"]').addClass('active'); } else{ - Contacts.UI.messageBox('Error', jsondata.data.message); + Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message); //alert(jsondata.data.message); } }); @@ -206,7 +206,7 @@ $(document).ready(function(){ $('#rightcontent').empty(); } else{ - Contacts.UI.messageBox('Error', jsondata.data.message); + Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message); //alert(jsondata.data.message); } }); @@ -225,7 +225,7 @@ $(document).ready(function(){ $('#contacts_addproperty').hide(); } else{ - Contacts.UI.messageBox('Error', jsondata.data.message); + Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message); alert('From handler: '+jsondata.data.message); } }); @@ -258,7 +258,7 @@ $(document).ready(function(){ $('#contacts_addpropertyform').before(jsondata.data.page); } else{ - Contacts.UI.messageBox('Error', jsondata.data.message); + Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message); } }, 'json'); return false; @@ -283,7 +283,7 @@ $(document).ready(function(){ .find('select').chosen(); } else{ - Contacts.UI.messageBox('Error', jsondata.data.message); + Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message); //alert(jsondata.data.message); } }); @@ -313,7 +313,7 @@ $(document).ready(function(){ } } else{ - Contacts.UI.messageBox('Error', jsondata.data.message); + Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message); //alert(jsondata.data.message); } }, 'json'); @@ -332,7 +332,7 @@ $(document).ready(function(){ .find('select').chosen(); } else{ - Contacts.UI.messageBox('Error', jsondata.data.message); + Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message); //alert(jsondata.data.message); } }); @@ -348,7 +348,7 @@ $(document).ready(function(){ $('.contacts_property[data-checksum="'+jsondata.data.oldchecksum+'"]').replaceWith(jsondata.data.page); } else{ - Contacts.UI.messageBox('Error', jsondata.data.message); + Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message); //alert(jsondata.data.message); } },'json'); @@ -363,7 +363,7 @@ $(document).ready(function(){ $('.contacts_property[data-checksum="'+checksum+'"]').remove(); } else{ - Contacts.UI.messageBox('Error', jsondata.data.message); + Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message); //alert(jsondata.data.message); } }); diff --git a/l10n/xgettextfiles b/l10n/xgettextfiles new file mode 100644 index 00000000..91d5da46 --- /dev/null +++ b/l10n/xgettextfiles @@ -0,0 +1,21 @@ +../appinfo/app.php +../ajax/activation.php +../ajax/addbook.php +../ajax/addcard.php +../ajax/addproperty.php +../ajax/createaddressbook.php +../ajax/deletebook.php +../ajax/deleteproperty.php +../ajax/getdetails.php +../ajax/setproperty.php +../ajax/updateaddressbook.php +../lib/app.php +../templates/index.php +../templates/part.addcardform.php +../templates/part.chooseaddressbook.php +../templates/part.chooseaddressbook.rowfields.php +../templates/part.details.php +../templates/part.editaddressbook.php +../templates/part.property.php +../templates/part.setpropertyform.php +../templates/settings.php diff --git a/lib/addressbook.php b/lib/addressbook.php index 41d488c0..052c19e5 100644 --- a/lib/addressbook.php +++ b/lib/addressbook.php @@ -256,6 +256,7 @@ class OC_Contacts_Addressbook{ * @return boolean */ public static function delete($id){ + // FIXME: There's no error checking at all. self::setActive($id, false); $stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_addressbooks WHERE id = ?' ); $stmt->execute(array($id)); diff --git a/lib/vcard.php b/lib/vcard.php index 72692701..c61f0dfc 100644 --- a/lib/vcard.php +++ b/lib/vcard.php @@ -240,6 +240,7 @@ class OC_Contacts_VCard{ * @return boolean */ public static function delete($id){ + // FIXME: Add error checking. $stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE id = ?' ); $stmt->execute(array($id)); @@ -261,6 +262,7 @@ class OC_Contacts_VCard{ * @return boolean */ public static function deleteFromDAVData($aid,$uri){ + // FIXME: Add error checking. Deleting a card gives an Kontact/Akonadi error. $stmt = OC_DB::prepare( 'DELETE FROM *PREFIX*contacts_cards WHERE addressbookid = ? AND uri=?' ); $stmt->execute(array($aid,$uri)); diff --git a/templates/index.php b/templates/index.php index d548f171..5d9c3127 100644 --- a/templates/index.php +++ b/templates/index.php @@ -4,7 +4,7 @@
      - +
      diff --git a/templates/part.addcardform.php b/templates/part.addcardform.php index 510096a9..53b32188 100644 --- a/templates/part.addcardform.php +++ b/templates/part.addcardform.php @@ -5,7 +5,7 @@
      - +
      - -
    -
    + diff --git a/templates/part.chooseaddressbook.rowfields.php b/templates/part.chooseaddressbook.rowfields.php index f612e39e..0cbfe2bf 100644 --- a/templates/part.chooseaddressbook.rowfields.php +++ b/templates/part.chooseaddressbook.rowfields.php @@ -1,5 +1,5 @@ "; echo ""; echo "t("CardDav Link") . "\" class=\"action\">t("Download") . "\" class=\"action\">t("Edit") . "\" class=\"action\" onclick=\"Contacts.UI.Addressbooks.editAddressbook(this, " . $_['addressbook']["id"] . ");\">t("Delete") . "\" class=\"action\">"; diff --git a/templates/part.editaddressbook.php b/templates/part.editaddressbook.php index cb137173..48fe5c3b 100644 --- a/templates/part.editaddressbook.php +++ b/templates/part.editaddressbook.php @@ -6,7 +6,7 @@ * See the COPYING-README file. */ ?> -t("Edit Address Book"); ?>" colspan="6"> +t("Edit Addressbook"); ?>" colspan="6"> diff --git a/templates/settings.php b/templates/settings.php index d9130625..c647e44c 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -1,7 +1,7 @@
    - Contacts
    - CardDAV syncing address: + t('Contacts'); ?>
    + t('CardDAV syncing address:'); ?>
    From 24eeefc342d72b799d2d2e8762225a5ef3e03d48 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Wed, 11 Jan 2012 23:03:55 +0100 Subject: [PATCH 11/17] Tweaked some tipsys. --- js/interface.js | 2 -- templates/part.details.php | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/js/interface.js b/js/interface.js index 8a1de305..fe58a46d 100644 --- a/js/interface.js +++ b/js/interface.js @@ -402,8 +402,6 @@ $(document).ready(function(){ } }); - $('#contacts_deletecard').tipsy(); - $('#contacts_downloadcard').tipsy(); $('.button').tipsy(); //Contacts.UI.messageBox('Hello','Sailor'); }); diff --git a/templates/part.details.php b/templates/part.details.php index fe0dac23..9af7f065 100644 --- a/templates/part.details.php +++ b/templates/part.details.php @@ -89,6 +89,7 @@ From 2859f5d607680162bd79682666eae78e7e23abb5 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Thu, 12 Jan 2012 02:34:22 +0100 Subject: [PATCH 12/17] Don't add address if none of the fields are filled out. --- ajax/addproperty.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ajax/addproperty.php b/ajax/addproperty.php index 6e3ba356..0050f5f4 100644 --- a/ajax/addproperty.php +++ b/ajax/addproperty.php @@ -35,10 +35,22 @@ $name = $_POST['name']; $value = $_POST['value']; if(!is_array($value)){ $value = trim($value); - if(!$value && in_array($name, array('TEL', 'EMAIL'))) { + if(!$value && in_array($name, array('TEL', 'EMAIL', 'ORG'))) { OC_JSON::error(array('data' => array('message' => $l->t('Cannot add empty property.')))); exit(); } +} elseif($name === 'ADR') { // only add if non-empty elements. + $empty = true; + foreach($value as $part) { + if(trim($part) != '') { + $empty = false; + break; + } + } + if($empty) { + OC_JSON::error(array('data' => array('message' => $l->t('At least one of the address fields has to be filled out.')))); + exit(); + } } $parameters = isset($_POST['parameters']) ? $_POST['parameters'] : array(); @@ -49,7 +61,7 @@ $line = count($vcard->children) - 1; // 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') { - // FIXME: Maybe this doesn't only apply for TYPE? + // NOTE: Maybe this doesn't only apply for TYPE? // And it probably shouldn't be done here anyways :-/ foreach($element as $e){ if($e != '' && !is_null($e)){ From 1e9453ea378cbfd1a626a839cad7c68807286778 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Thu, 12 Jan 2012 11:26:11 +0100 Subject: [PATCH 13/17] Add PRODID to vcards created by ownCloud. --- lib/vcard.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/vcard.php b/lib/vcard.php index c61f0dfc..04b59a04 100644 --- a/lib/vcard.php +++ b/lib/vcard.php @@ -114,6 +114,14 @@ class OC_Contacts_VCard{ //$data = $card->serialize(); }; $uri = $uid.'.vcf'; + + // Add product ID. + $prodid = trim($card->getAsString('PRODID')); + if(!$prodid) { + $appinfo = $info=OC_App::getAppInfo('contacts'); + $prodid = 'PRODID:-//ownCloud//NONSGML '.$appinfo['name'].' '.$appinfo['version'].'//EN'; + $card->setString('PRODID', $prodid); + } // VCARD must have a version $version = $card->getAsString('VERSION'); // Add version if needed From 02180541a35c4dbcb9c430075ff11f6cff9ac454 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Thu, 12 Jan 2012 16:06:27 +0100 Subject: [PATCH 14/17] Added search. Thanks to icewind it was mostly copy/paste :-) --- appinfo/app.php | 4 +++- lib/search.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 lib/search.php diff --git a/appinfo/app.php b/appinfo/app.php index 524cc640..1e9f8811 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -1,4 +1,5 @@ 10, 'href' => OC_Helper::linkTo( 'contacts', 'index.php' ), 'icon' => OC_Helper::imagePath( 'settings', 'users.svg' ), - 'name' => 'Contacts' )); + 'name' => $l->t('Contacts') )); OC_APP::registerPersonal('contacts','settings'); +require_once('apps/contacts/lib/search.php'); \ No newline at end of file diff --git a/lib/search.php b/lib/search.php new file mode 100644 index 00000000..97638821 --- /dev/null +++ b/lib/search.php @@ -0,0 +1,29 @@ + 0){ + $searchquery = explode(' ', $query); + }else{ + $searchquery[] = $query; + } + $l = new OC_l10n('contacts'); + foreach($addressbooks as $addressbook){ + $vcards = OC_Contacts_VCard::all($addressbook['id']); + foreach($vcards as $vcard){ + if(substr_count(strtolower($vcard['fullname']), strtolower($query)) > 0){ + $link = OC_Helper::linkTo('apps/contacts', 'index.php?id='.urlencode($vcard['id'])); + $results[]=new OC_Search_Result($vcard['fullname'],'', $link,$l->t('Contact'));//$name,$text,$link,$type + } + } + } + return $results; + } +} +new OC_Search_Provider_Contacts(); From cb5b166b52635dd86f9621d9e8ca17bbe62cedfb Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Thu, 12 Jan 2012 18:04:23 +0100 Subject: [PATCH 15/17] Don't chunk_split encoded image string. Don't return json error but null if card can't be parsed. Small check for non-parsable card in index.php. --- index.php | 12 +++++------- lib/app.php | 9 ++++----- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/index.php b/index.php index 6f65ac1c..b179d9bb 100644 --- a/index.php +++ b/index.php @@ -44,19 +44,17 @@ OC_App::setActiveNavigationEntry( 'contacts_index' ); $id = isset( $_GET['id'] ) ? $_GET['id'] : null; $details = array(); -// FIXME: This cannot work..? if(is_null($id) && count($contacts) > 0) { $id = $contacts[0]['id']; } +$vcard = null; +$details = null; if(!is_null($id)) { $vcard = OC_Contacts_App::getContactVCard($id); - $details = OC_Contacts_VCard::structureContact($vcard); + if(!is_null($vcard) { + $details = OC_Contacts_VCard::structureContact($vcard); + } } -// if( !is_null($id)/* || count($contacts)*/){ -// if(is_null($id)) $id = $contacts[0]['id']; -// $vcard = OC_Contacts_App::getContactVCard($id); -// $details = OC_Contacts_VCard::structureContact($vcard); -// } // Include Style and Script OC_Util::addScript('contacts','interface'); diff --git a/lib/app.php b/lib/app.php index 907ce82c..00a830d5 100644 --- a/lib/app.php +++ b/lib/app.php @@ -56,15 +56,14 @@ class OC_Contacts_App{ return $card; } + /** + * @brief Gets the VCard as text + * @returns The card or null if the card could not be parsed. + */ public static function getContactVCard($id){ $card = self::getContactObject( $id ); $vcard = OC_VObject::parse($card['carddata']); - // Check if the card is valid - if(is_null($vcard)){ - OC_JSON::error(array('data' => array( 'message' => self::$l10n->t('vCard could not be read.')))); - exit(); - } return $vcard; } From 3d412e2ebe39fbc43feaf5518119c52f6c067fa8 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Thu, 12 Jan 2012 22:55:43 +0100 Subject: [PATCH 16/17] Oops. Missing ')' :-P --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index b179d9bb..9012e5d8 100644 --- a/index.php +++ b/index.php @@ -51,7 +51,7 @@ $vcard = null; $details = null; if(!is_null($id)) { $vcard = OC_Contacts_App::getContactVCard($id); - if(!is_null($vcard) { + if(!is_null($vcard)) { $details = OC_Contacts_VCard::structureContact($vcard); } } From 6203fc9b75134c98e664fadb9622312f14ca1381 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Thu, 12 Jan 2012 23:43:00 +0100 Subject: [PATCH 17/17] Too quick on the copy/paste trigger... --- appinfo/app.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appinfo/app.php b/appinfo/app.php index 1e9f8811..df7e8cec 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -1,5 +1,5 @@
    t('Displayname') ?>