summaryrefslogtreecommitdiffstats
path: root/apps/contacts
diff options
context:
space:
mode:
Diffstat (limited to 'apps/contacts')
-rw-r--r--apps/contacts/ajax/addcontact.php7
-rw-r--r--apps/contacts/ajax/saveproperty.php60
-rw-r--r--apps/contacts/appinfo/migrate.php68
-rw-r--r--apps/contacts/css/contacts.css40
-rw-r--r--apps/contacts/img/person_large.pngbin11517 -> 7929 bytes
-rw-r--r--apps/contacts/index.php22
-rw-r--r--apps/contacts/js/contacts.js203
-rw-r--r--apps/contacts/js/jquery.combobox.js23
-rw-r--r--apps/contacts/js/jquery.multi-autocomplete.js4
-rw-r--r--apps/contacts/lib/addressbook.php2
-rw-r--r--apps/contacts/templates/index.php1
-rw-r--r--apps/contacts/templates/part.contact.php84
-rw-r--r--apps/contacts/templates/part.edit_address_dialog.php14
-rw-r--r--apps/contacts/templates/part.no_contacts.php8
-rw-r--r--apps/contacts/templates/settings.php1
15 files changed, 367 insertions, 170 deletions
diff --git a/apps/contacts/ajax/addcontact.php b/apps/contacts/ajax/addcontact.php
index 839a3919981..68da54655ae 100644
--- a/apps/contacts/ajax/addcontact.php
+++ b/apps/contacts/ajax/addcontact.php
@@ -39,13 +39,14 @@ foreach ($_POST as $key=>$element) {
debug('_POST: '.$key.'=>'.$element);
}
-$aid = $_POST['aid'];
+$aid = isset($_POST['aid'])?$_POST['aid']:null;
+if(!$aid) {
+ $aid = min(OC_Contacts_Addressbook::activeIds()); // first active addressbook.
+}
OC_Contacts_App::getAddressbook( $aid ); // is owner access check
$fn = trim($_POST['fn']);
$n = trim($_POST['n']);
-debug('N: '.$n);
-debug('FN: '.$fn);
$vcard = new OC_VObject('VCARD');
$vcard->setUID();
diff --git a/apps/contacts/ajax/saveproperty.php b/apps/contacts/ajax/saveproperty.php
index 924d873652c..99d55e7927a 100644
--- a/apps/contacts/ajax/saveproperty.php
+++ b/apps/contacts/ajax/saveproperty.php
@@ -96,40 +96,40 @@ switch($element) {
//$value = getOtherValue();
}
break;
- case 'CATEGORIES':
- /* multi autocomplete triggers an save with empty value */
+ //case 'CATEGORIES':
+ /* multi autocomplete triggers an save with empty value
if (!$value) {
$value = $vcard->getAsString('CATEGORIES');
}
- break;
+ break;*/
case 'EMAIL':
$value = strtolower($value);
break;
}
if(!$value) {
- bailOut(OC_Contacts_App::$l10n->t('Cannot save empty value.'));
-}
-
-/* setting value */
-switch($element) {
- case 'BDAY':
- case 'FN':
- case 'N':
- case 'ORG':
- case 'NOTE':
- case 'NICKNAME':
- case 'CATEGORIES':
- debug('Setting string:'.$name.' '.$value);
- $vcard->setString($name, $value);
- break;
- case 'EMAIL':
- case 'TEL':
- case 'ADR': // should I delete the property if empty or throw an error?
- debug('Setting element: (EMAIL/TEL/ADR)'.$element);
- if(!$value) {
- unset($vcard->children[$line]); // Should never happen...
- } else {
+ unset($vcard->children[$line]);
+ $checksum = '';
+} else {
+ /* setting value */
+ switch($element) {
+ case 'BDAY':
+ case 'FN':
+ case 'N':
+ case 'ORG':
+ case 'NOTE':
+ case 'NICKNAME':
+ debug('Setting string:'.$name.' '.$value);
+ $vcard->setString($name, $value);
+ break;
+ case 'CATEGORIES':
+ debug('Setting string:'.$name.' '.$value);
+ $vcard->children[$line]->setValue($value);
+ break;
+ case 'EMAIL':
+ case 'TEL':
+ case 'ADR': // should I delete the property if empty or throw an error?
+ debug('Setting element: (EMAIL/TEL/ADR)'.$element);
$vcard->children[$line]->setValue($value);
$vcard->children[$line]->parameters = array();
if(!is_null($parameters)) {
@@ -142,12 +142,12 @@ switch($element) {
}
}
}
- }
- break;
+ break;
+ }
+ // Do checksum and be happy
+ $checksum = md5($vcard->children[$line]->serialize());
}
-// Do checksum and be happy
-$checksum = md5($vcard->children[$line]->serialize());
-debug('New checksum: '.$checksum);
+//debug('New checksum: '.$checksum);
if(!OC_Contacts_VCard::edit($id,$vcard)) {
bailOut(OC_Contacts_App::$l10n->t('Error updating contact property.'));
diff --git a/apps/contacts/appinfo/migrate.php b/apps/contacts/appinfo/migrate.php
new file mode 100644
index 00000000000..a6c6bc20fa4
--- /dev/null
+++ b/apps/contacts/appinfo/migrate.php
@@ -0,0 +1,68 @@
+<?php
+class OC_Migration_Provider_Contacts extends OC_Migration_Provider{
+
+ // Create the xml for the user supplied
+ function export( ){
+ $options = array(
+ 'table'=>'contacts_addressbooks',
+ 'matchcol'=>'userid',
+ 'matchval'=>$this->uid,
+ 'idcol'=>'id'
+ );
+ $ids = $this->content->copyRows( $options );
+
+ $options = array(
+ 'table'=>'contacts_cards',
+ 'matchcol'=>'addressbookid',
+ 'matchval'=>$ids
+ );
+
+ // Export tags
+ $ids2 = $this->content->copyRows( $options );
+
+ // If both returned some ids then they worked
+ if( is_array( $ids ) && is_array( $ids2 ) )
+ {
+ return true;
+ } else {
+ return false;
+ }
+
+ }
+
+ // Import function for bookmarks
+ function import( ){
+ switch( $this->appinfo->version ){
+ default:
+ // All versions of the app have had the same db structure, so all can use the same import function
+ $query = $this->content->prepare( "SELECT * FROM contacts_addressbooks WHERE userid LIKE ?" );
+ $results = $query->execute( array( $this->olduid ) );
+ $idmap = array();
+ while( $row = $results->fetchRow() ){
+ // Import each bookmark, saving its id into the map
+ $query = OC_DB::prepare( "INSERT INTO *PREFIX*contacts_addressbooks (`userid`, `displayname`, `uri`, `description`, `ctag`) VALUES (?, ?, ?, ?, ?)" );
+ $query->execute( array( $this->uid, $row['displayname'], $row['uri'], $row['description'], $row['ctag'] ) );
+ // Map the id
+ $idmap[$row['id']] = OC_DB::insertid();
+ }
+ // Now tags
+ foreach($idmap as $oldid => $newid){
+ $query = $this->content->prepare( "SELECT * FROM contacts_cards WHERE addressbookid LIKE ?" );
+ $results = $query->execute( array( $oldid ) );
+ while( $row = $results->fetchRow() ){
+ // Import the tags for this bookmark, using the new bookmark id
+ $query = OC_DB::prepare( "INSERT INTO *PREFIX*contacts_cards (`addressbookid`, `fullname`, `carddata`, `uri`, `lastmodified`) VALUES (?, ?, ?, ?, ?)" );
+ $query->execute( array( $newid, $row['fullname'], $row['carddata'], $row['uri'], $row['lastmodified'] ) );
+ }
+ }
+ // All done!
+ break;
+ }
+
+ return true;
+ }
+
+}
+
+// Load the provider
+new OC_Migration_Provider_Contacts( 'contacts' ); \ No newline at end of file
diff --git a/apps/contacts/css/contacts.css b/apps/contacts/css/contacts.css
index 76b5972ba3c..2d207943841 100644
--- a/apps/contacts/css/contacts.css
+++ b/apps/contacts/css/contacts.css
@@ -13,22 +13,26 @@
#contacts_propertymenu li a { padding: 3px; display: block }
#contacts_propertymenu li:hover { background-color: #1d2d44; }
#contacts_propertymenu li a:hover { color: #fff }
-#actionbar { height: 30px; width: 200px; position: fixed; right: 0px; top: 75px; margin: 0 0 0 0; padding: 0 0 0 0;}
-#card { /*max-width: 70em; border: thin solid lightgray; display: block;*/ }
+#actionbar { height: 30px; width: 200px; position: fixed; right: 0px; top: 75px; margin: 0 0 0 0; padding: 0 0 0 0; z-index: 1000; }
+#card { width: auto;/*max-width: 70em; border: thin solid lightgray; display: block;*/ }
#firstrun { width: 100%; position: absolute; top: 5em; left: 0; text-align: center; font-weight:bold; font-size:1.5em; color:#777; }
#firstrun #selections { font-size:0.8em; margin: 2em auto auto auto; clear: both; }
-#card input[type="text"].contacts_property,input[type="email"].contacts_property { width: 14em; }
+#card input[type="text"].contacts_property,input[type="email"].contacts_property { width: 14em; float: left; }
.categories { float: left; width: 16em; }
-#card input[type="text"],input[type="email"],input[type="tel"],input[type="date"], select { background-color: #f8f8f8; border: 0 !important; -webkit-appearance:none !important; -moz-appearance:none !important; -webkit-box-sizing:none !important; -moz-box-sizing:none !important; box-sizing:none !important; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; -moz-border-radius: 0px; -webkit-border-radius: 0px; border-radius: 0px; float: left; }
-#card input[type="text"]:hover, input[type="text"]:focus, input[type="text"]:active,input[type="email"]:hover,input[type="tel"]:hover,input[type="date"]:hover,input[type="date"],input[type="date"]:hover,input[type="date"]:active,input[type="date"]:active,input[type="date"]:active,input[type="email"]:active,input[type="tel"]:active, select:hover, select:focus, select:active { border: 0 !important; -webkit-appearance:textfield; -moz-appearance:textfield; -webkit-box-sizing:content-box; -moz-box-sizing:content-box; box-sizing:content-box; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #fff, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; outline:none; float: left; }
-input[type="text"]:invalid,input[type="email"]:invalid,input[type="tel"]:invalid,input[type="date"]:invalid { background-color: #ffc0c0 !important; }
+#card input[type="text"],input[type="email"],input[type="tel"],input[type="date"], select, textarea { background-color: #fefefe; border: 0 !important; -webkit-appearance:none !important; -moz-appearance:none !important; -webkit-box-sizing:none !important; -moz-box-sizing:none !important; box-sizing:none !important; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; -moz-border-radius: 0px; -webkit-border-radius: 0px; border-radius: 0px; float: left; }
+#card input[type="text"]:hover, input[type="text"]:focus, input[type="text"]:active,input[type="email"]:hover,input[type="tel"]:hover,input[type="date"]:hover,input[type="date"],input[type="date"]:hover,input[type="date"]:active,input[type="date"]:active,input[type="date"]:active,input[type="email"]:active,input[type="tel"]:active, select:hover, select:focus, select:active, textarea:focus, textarea:hover { border: 0 !important; -webkit-appearance:textfield; -moz-appearance:textfield; -webkit-box-sizing:content-box; -moz-box-sizing:content-box; box-sizing:content-box; background:#fff; color:#333; border:1px solid #ddd; -moz-box-shadow:0 1px 1px #fff, 0 2px 0 #bbb inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; box-shadow:0 1px 1px #fff, 0 1px 0 #bbb inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; outline:none; float: left; }
+input[type="text"]:invalid,input[type="email"]:invalid,input[type="tel"]:invalid,input[type="date"]:invalid, textarea:invalid { color: #bbb !important; }
+textarea { min-height: 4em; }
dl.form { width: 100%; float: left; clear: right; margin: 0; padding: 0; }
-.form dt { display: table-cell; clear: left; float: left; width: 7em; margin: 0; padding: 0.8em 0.5em 0 0; font-weight: bold; text-align:right; text-overflow:ellipsis; o-text-overflow: ellipsis; vertical-align: text-bottom;/* white-space: pre-wrap; white-space: -moz-pre-wrap !important; white-space: -pre-wrap; white-space: -o-pre-wrap;*/ }
+.form dt { display: table-cell; clear: left; float: left; width: 7em; margin: 0; padding: 0.8em 0.5em 0 0; text-align:right; text-overflow:ellipsis; o-text-overflow: ellipsis; vertical-align: text-bottom; color: #bbb;/* white-space: pre-wrap; white-space: -moz-pre-wrap !important; white-space: -pre-wrap; white-space: -o-pre-wrap;*/ }
.form dd { display: table-cell; clear: right; float: left; margin: 0; padding: 0px; white-space: nowrap; vertical-align: text-bottom; }
+#address.form dt { min-width: 5em; }
+#address.form dl { min-width: 10em; }
.loading { background: url('../../../core/img/loading.gif') no-repeat center !important; /*cursor: progress; */ cursor: wait; }
-
+.ui-autocomplete-loading { background: url('../../../core/img/loading.gif') right center no-repeat; }
+.float { float: left; }
.listactions { height: 1em; width:60px; float: left; clear: right; }
.add,.edit,.delete,.mail, .globe { cursor: pointer; width: 20px; height: 20px; margin: 0; float: left; position:relative; display: none; }
.add { background:url('../../../core/img/actions/add.svg') no-repeat center; clear: both; }
@@ -43,18 +47,18 @@ dl.form { width: 100%; float: left; clear: right; margin: 0; padding: 0; }
#edit_address_dialog { /*width: 30em;*/ }
#edit_address_dialog > input { width: 15em; }
#edit_photo_dialog_img { display: block; width: 150; height: 200; border: thin solid black; }
-#fn { float: left; }
-/**
- * Create classes form, floateven and floatodd which flows left and right respectively.
- */
-.contactsection { float: left; min-width: 30em; max-width: 40em; margin: 0.5em; border: thin solid lightgray; -webkit-border-radius: 0.5em; -moz-border-radius: 0.5em; border-radius: 0.5em; background-color: #f8f8f8; }
+#fn { float: left !important; width: 18em !important; }
+#name { /*position: absolute; top: 0px; left: 0px;*/ min-width: 25em; height: 2em; clear: right; display: block; }
+#identityprops { /*position: absolute; top: 2.5em; left: 0px;*/ }
+/*#contact_photo { max-width: 250px; }*/
+#contact_identity { min-width: 30em; }
+.contactsection { position: relative; float: left; /*max-width: 40em;*/ padding: 0.5em; height: auto: border: thin solid lightgray;/* -webkit-border-radius: 0.5em; -moz-border-radius: 0.5em; border-radius: 0.5em; background-color: #f8f8f8;*/ }
.contactpart legend { width:auto; padding:.3em; border:1px solid #ddd; font-weight:bold; cursor:pointer; background:#f8f8f8; color:#555; text-shadow:#fff 0 1px 0; -moz-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -webkit-box-shadow:0 1px 1px #fff, 0 1px 1px #fff inset; -moz-border-radius:.5em; -webkit-border-radius:.5em; border-radius:.5em; }
#cropbox { margin: auto; }
-
-#contacts_details_photo { border-radius: 0.5em; border: thin solid #bbb; padding: 0.5em; margin: 1em 1em 1em 7em; cursor: pointer; background: url(../../../core/img/loading.gif) no-repeat center center; clear: right; }
+#contacts_details_photo { border-radius: 0.5em; border: thin solid #bbb; margin: 0.3em; cursor: pointer; background: url(../../../core/img/loading.gif) no-repeat center center; display: block; /* clear: right;*/ }
#contacts_details_photo:hover { background: #fff; }
-#contacts_details_photo_progress { margin: 0.3em 0.3em 0.3em 7em; clear: left; }
+/*#contacts_details_photo_progress { margin: 0.3em 0.3em 0.3em 7em; clear: left; }*/
/* Address editor */
#addressdisplay { padding: 0.5em; }
dl.addresscard { background-color: #fff; float: left; width: 45%; margin: 0 0.3em 0.3em 0.3em; padding: 0; border: thin solid lightgray; }
@@ -72,8 +76,10 @@ dl.addresscard dd > ul { margin: 0.3em; padding: 0.3em; }
#file_upload_target, #crop_target { display:none; }
-#file_upload_start { opacity:0; filter:alpha(opacity=0); z-index:1; position:absolute; left:0; top:0; cursor:pointer; width:0; height:0;}
+#file_upload_start { opacity:0; filter:alpha(opacity=0); z-index:1; /*position:absolute; left:0; top:0;*/ cursor:pointer; width:0; height:0;}
input[type="checkbox"] { width: 20px; height: 20px; vertical-align: bottom; }
+.big { font-weight:bold; font-size:1.2em; }
+.huge { font-weight:bold; font-size:1.5em; }
.propertycontainer dd { float: left; width: 25em; }
.propertylist { clear: none; max-width: 28em; }
.propertylist li { /*background-color: cyan; */ min-width: 25em; /*max-width: 30em;*/ display: block; clear: right; }
diff --git a/apps/contacts/img/person_large.png b/apps/contacts/img/person_large.png
index f57511e1000..4edba0c5489 100644
--- a/apps/contacts/img/person_large.png
+++ b/apps/contacts/img/person_large.png
Binary files differ
diff --git a/apps/contacts/index.php b/apps/contacts/index.php
index 04f6c65a145..776c57ca605 100644
--- a/apps/contacts/index.php
+++ b/apps/contacts/index.php
@@ -34,7 +34,26 @@ if(!is_null($id)) {
}
$property_types = OC_Contacts_App::getAddPropertyOptions();
$phone_types = OC_Contacts_App::getTypesOfProperty('TEL');
-$categories = OC_Contacts_App::$categories->categories();
+$categories = OC_Contacts_App::getCategories();
+if(count($categories) == 0) {
+ $vcaddressbooks = OC_Contacts_Addressbook::all(OC_User::getUser());
+ if(count($vcaddressbooks) > 0) {
+ $vcaddressbookids = array();
+ foreach($vcaddressbooks as $vcaddressbook) {
+ $vcaddressbookids[] = $vcaddressbook['id'];
+ }
+ $vccontacts = OC_Contacts_VCard::all($vcaddressbookids);
+ if(count($vccontacts) > 0) {
+ $cards = array();
+ foreach($vccontacts as $vccontact) {
+ $cards[] = $vccontact['carddata'];
+ }
+
+ OC_Contacts_App::$categories->rescan($cards);
+ $categories = OC_Contacts_App::$categories->categories();
+ }
+ }
+}
$upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'));
$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size'));
@@ -61,7 +80,6 @@ $tmpl = new OC_Template( "contacts", "index", "user" );
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', OC_Helper::humanFileSize($maxUploadFilesize));
$tmpl->assign('property_types',$property_types);
-$tmpl->assign('categories',OC_Contacts_App::getCategories());
$tmpl->assign('phone_types',$phone_types);
$tmpl->assign('categories',$categories);
$tmpl->assign('addressbooks', $addressbooks);
diff --git a/apps/contacts/js/contacts.js b/apps/contacts/js/contacts.js
index d314878cc0a..6f34a42a73f 100644
--- a/apps/contacts/js/contacts.js
+++ b/apps/contacts/js/contacts.js
@@ -65,7 +65,7 @@ Contacts={
propertyTypeFor:function(obj) {
return $(obj).parents('.propertycontainer').first().data('element');
},
- showHideContactInfo:function() {
+ /*showHideContactInfo:function() {
var show = ($('#emaillist li.propertycontainer').length > 0 || $('#phonelist li.propertycontainer').length > 0 || $('#addressdisplay dl.propertycontainer').length > 0);
console.log('showHideContactInfo: ' + show);
if(show) {
@@ -73,8 +73,8 @@ Contacts={
} else {
$('#contact_communication').hide();
}
- },
- checkListFor:function(obj) {
+ },*/
+ /*checkListFor:function(obj) {
var type = $(obj).parents('.propertycontainer').first().data('element');
console.log('checkListFor: ' + type);
switch (type) {
@@ -101,7 +101,7 @@ Contacts={
case 'BDAY':
break;
}
- },
+ },*/
loading:function(obj, state) {
if(state) {
$(obj).addClass('loading');
@@ -116,7 +116,7 @@ Contacts={
},
loadListHandlers:function() {
//$('.add,.delete').hide();
- $('.globe,.mail,.delete,.edit').tipsy();
+ $('.globe,.mail,.delete,.edit,.tip').tipsy();
$('.addresscard,.propertylist li,.propertycontainer').hover(
function () {
$(this).find('.globe,.mail,.delete,.edit').fadeIn(100);
@@ -137,18 +137,14 @@ Contacts={
$(this).find('.add').fadeOut(500);
}
);*/
- $('.button,.action').tipsy();
- $('#contacts_deletecard').tipsy({gravity: 'ne'});
- $('#contacts_downloadcard').tipsy({gravity: 'ne'});
//$('#fn').jec();
$('#fn_select').combobox({
'id': 'fn',
'name': 'value',
- 'classes': ['contacts_property'],
+ 'classes': ['contacts_property', 'huge', 'tip', 'float'],
+ 'attributes': {'placeholder': t('contacts', 'Enter name')},
'title': t('contacts', 'Format custom, Short name, Full name, Reverse or Reverse with comma')});
//$('.jecEditableOption').attr('title', t('contacts','Custom'));
- $('#fn').tipsy();
- $('#contacts_details_photo_wrapper').tipsy();
$('#bday').datepicker({
dateFormat : 'dd-mm-yy'
});
@@ -175,10 +171,6 @@ Contacts={
// Contacts.UI.Card.editAddress();
// return false;
// });
- $('#n').click(function(){
- Contacts.UI.Card.editName();
- //return false;
- });
$('#edit_name').click(function(){
Contacts.UI.Card.editName();
return false;
@@ -200,6 +192,9 @@ Contacts={
}
] );
$('#categories').multiple_autocomplete({source: categories});
+ $('.button,.action,.tip').tipsy();
+ $('#contacts_deletecard').tipsy({gravity: 'ne'});
+ $('#contacts_downloadcard').tipsy({gravity: 'ne'});
Contacts.UI.loadListHandlers();
},
Card:{
@@ -259,16 +254,28 @@ Contacts={
});
}
},
- export:function() {
+ doExport:function() {
document.location.href = OC.linkTo('contacts', 'export.php') + '?contactid=' + this.id;
//$.get(OC.linkTo('contacts', 'export.php'),{'contactid':this.id},function(jsondata){
//});
},
- import:function(){
+ doImport:function(){
Contacts.UI.notImplemented();
},
- add:function(n, fn, aid){ // add a new contact
+ add:function(n, fn, aid, isnew){ // add a new contact
console.log('Add contact: ' + n + ', ' + fn + ' ' + aid);
+ var card = $('#card')[0];
+ if(!card) {
+ console.log('Loading proper card DOM');
+ $.getJSON(OC.filePath('contacts', 'ajax', 'loadcard.php'),{},function(jsondata){
+ if(jsondata.status == 'success'){
+ $('#rightcontent').html(jsondata.data.page);
+ Contacts.UI.loadHandlers();
+ } else{
+ OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
+ }
+ });
+ }
$.post(OC.filePath('contacts', 'ajax', 'addcontact.php'), { n: n, fn: fn, aid: aid },
function(jsondata) {
if (jsondata.status == 'success'){
@@ -291,7 +298,15 @@ Contacts={
if(!added) {
$('#leftcontent ul').append(item);
}
-
+ if(isnew) {
+ Contacts.UI.Card.addProperty('EMAIL');
+ Contacts.UI.Card.addProperty('TEL');
+ Contacts.UI.Card.addProperty('NICKNAME');
+ Contacts.UI.Card.addProperty('ORG');
+ Contacts.UI.Card.addProperty('CATEGORIES');
+ $('#fn').focus();
+ $('#fn').select();
+ }
}
else{
OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
@@ -308,7 +323,7 @@ Contacts={
}
});
},
- delete:function() {
+ doDelete:function() {
$('#contacts_deletecard').tipsy('hide');
OC.dialogs.confirm(t('contacts', 'Are you sure you want to delete this contact?'), t('contacts', 'Warning'), function(answer) {
if(answer == true) {
@@ -356,7 +371,7 @@ Contacts={
return false;
},
loadContact:function(jsondata){
- $('#contact_communication').hide();
+ //$('#contact_communication').hide();
this.data = jsondata;
this.id = this.data.id;
$('#rightcontent').data('id',this.id);
@@ -368,7 +383,6 @@ Contacts={
this.loadPhones();
this.loadAddresses();
this.loadSingleProperties();
- // TODO: load NOTE ;-)
if(this.data.NOTE) {
$('#note').data('checksum', this.data.NOTE[0]['checksum']);
$('#note').find('textarea').val(this.data.NOTE[0]['value']);
@@ -376,7 +390,7 @@ Contacts={
} else {
$('#note').data('checksum', '');
$('#note').find('textarea').val('');
- $('#note').hide();
+ //$('#note').hide();
}
},
loadSingleProperties:function() {
@@ -521,17 +535,18 @@ Contacts={
},*/
editNew:function(){ // add a new contact
this.id = ''; this.fn = ''; this.fullname = ''; this.givname = ''; this.famname = ''; this.addname = ''; this.honpre = ''; this.honsuf = '';
- $.getJSON(OC.filePath('contacts', 'ajax', 'newcontact.php'),{},function(jsondata){
+ Contacts.UI.Card.add(';;;;', '', '', true);
+ /*$.getJSON(OC.filePath('contacts', 'ajax', 'newcontact.php'),{},function(jsondata){
if(jsondata.status == 'success'){
id = '';
$('#rightcontent').data('id','');
$('#rightcontent').html(jsondata.data.page);
- Contacts.UI.Card.editName();
+ //Contacts.UI.Card.editName();
} else {
OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
//alert(jsondata.data.message);
}
- });
+ });*/
},
savePropertyInternal:function(name, fields, oldchecksum, checksum){
// TODO: Add functionality for new fields.
@@ -627,8 +642,8 @@ Contacts={
},'json');
}
},
- addProperty:function(obj){
- var type = $(obj).data('type');
+ addProperty:function(type){
+ //var type = $(obj).data('type');
console.log('addProperty:' + type);
switch (type) {
case 'PHOTO':
@@ -647,21 +662,21 @@ Contacts={
$('#emails').show();
}
Contacts.UI.Card.addMail();
- Contacts.UI.showHideContactInfo();
+ //Contacts.UI.showHideContactInfo();
break;
case 'TEL':
if($('#phonelist>li').length == 1) {
$('#phones').show();
}
Contacts.UI.Card.addPhone();
- Contacts.UI.showHideContactInfo();
+ //Contacts.UI.showHideContactInfo();
break;
case 'ADR':
if($('#addressdisplay>dl').length == 1) {
$('#addresses').show();
}
Contacts.UI.Card.editAddress('new', true);
- Contacts.UI.showHideContactInfo();
+ //Contacts.UI.showHideContactInfo();
break;
case 'NICKNAME':
case 'ORG':
@@ -682,8 +697,8 @@ Contacts={
if(jsondata.status == 'success'){
if(type == 'list') {
Contacts.UI.propertyContainerFor(obj).remove();
- Contacts.UI.showHideContactInfo();
- Contacts.UI.checkListFor(obj);
+ //Contacts.UI.showHideContactInfo();
+ //Contacts.UI.checkListFor(obj);
} else if(type == 'single') {
var proptype = Contacts.UI.propertyTypeFor(obj);
console.log('deleteProperty, hiding: ' + proptype);
@@ -718,8 +733,8 @@ Contacts={
} else { // Property hasn't been saved so there's nothing to delete.
if(type == 'list') {
Contacts.UI.propertyContainerFor(obj).remove();
- Contacts.UI.showHideContactInfo();
- Contacts.UI.checkListFor(obj);
+ //Contacts.UI.showHideContactInfo();
+ //Contacts.UI.checkListFor(obj);
} else if(type == 'single') {
var proptype = Contacts.UI.propertyTypeFor(obj);
console.log('deleteProperty, hiding: ' + proptype);
@@ -891,7 +906,7 @@ Contacts={
if(isnew) {
container.remove();
}
- Contacts.UI.showHideContactInfo();
+ //Contacts.UI.showHideContactInfo();
}
},
close : function(event, ui) {
@@ -900,11 +915,95 @@ Contacts={
if(isnew) {
container.remove();
}
- Contacts.UI.showHideContactInfo();
- }/*,
+ //Contacts.UI.showHideContactInfo();
+ },
open : function(event, ui) {
- // load 'ADR' property - maybe :-P
- }*/
+ $( "#adr_city" ).autocomplete({
+ source: function( request, response ) {
+ $.ajax({
+ url: "http://ws.geonames.org/searchJSON",
+ dataType: "jsonp",
+ data: {
+ featureClass: "P",
+ style: "full",
+ maxRows: 12,
+ lang: lang,
+ name_startsWith: request.term
+ },
+ success: function( data ) {
+ response( $.map( data.geonames, function( item ) {
+ /*for(var key in item) {
+ console.log(key + ': ' + item[key]);
+ }*/
+ return {
+ label: item.name + (item.adminName1 ? ", " + item.adminName1 : "") + ", " + item.countryName,
+ value: item.name,
+ country: item.countryName
+ }
+ }));
+ }
+ });
+ },
+ minLength: 2,
+ select: function( event, ui ) {
+ if(ui.item && $('#adr_country').val().trim().length == 0) {
+ $('#adr_country').val(ui.item.country);
+ }
+ /*log( ui.item ?
+ "Selected: " + ui.item.label :
+ "Nothing selected, input was " + this.value);*/
+ },
+ open: function() {
+ $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
+ },
+ close: function() {
+ $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
+ }
+ });
+ $( "#adr_country" ).autocomplete({
+ source: function( request, response ) {
+ $.ajax({
+ url: "http://ws.geonames.org/searchJSON",
+ dataType: "jsonp",
+ data: {
+ /*featureClass: "A",*/
+ featureCode: "PCLI",
+ /*countryBias: "true",*/
+ /*style: "full",*/
+ lang: lang,
+ maxRows: 12,
+ name_startsWith: request.term
+ },
+ success: function( data ) {
+ response( $.map( data.geonames, function( item ) {
+ for(var key in item) {
+ console.log(key + ': ' + item[key]);
+ }
+ return {
+ label: item.name,
+ value: item.name
+ }
+ }));
+ }
+ });
+ },
+ minLength: 2,
+ select: function( event, ui ) {
+ /*if(ui.item) {
+ $('#adr_country').val(ui.item.country);
+ }
+ log( ui.item ?
+ "Selected: " + ui.item.label :
+ "Nothing selected, input was " + this.value);*/
+ },
+ open: function() {
+ $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
+ },
+ close: function() {
+ $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
+ }
+ });
+ }
});
} else {
alert(jsondata.data.message);
@@ -973,7 +1072,7 @@ Contacts={
}
},
loadPhoto:function(force){
- if(this.data.PHOTO||force==true) {
+ //if(this.data.PHOTO||force==true) {
$.getJSON('ajax/loadphoto.php',{'id':this.id},function(jsondata){
if(jsondata.status == 'success'){
//alert(jsondata.data.page);
@@ -986,11 +1085,11 @@ Contacts={
});
$('#file_upload_form').show();
$('#contacts_propertymenu a[data-type="PHOTO"]').parent().hide();
- } else {
+ /*} else {
$('#contacts_details_photo_wrapper').empty();
$('#file_upload_form').hide();
$('#contacts_propertymenu a[data-type="PHOTO"]').parent().show();
- }
+ }*/
},
editPhoto:function(id, tmp_path){
//alert('editPhoto: ' + tmp_path);
@@ -1165,7 +1264,7 @@ Contacts={
});
}
},
- import:function(){
+ doImport:function(){
Contacts.UI.notImplemented();
},
submit:function(button, bookid){
@@ -1198,9 +1297,7 @@ Contacts={
}
},
Contacts:{
- /**
- * Reload the contacts list.
- */
+ // Reload the contacts list.
update:function(){
console.log('Contacts.update, start');
$.getJSON('ajax/contacts.php',{},function(jsondata){
@@ -1215,9 +1312,7 @@ Contacts={
});
setTimeout(Contacts.UI.Contacts.lazyupdate, 500);
},
- /**
- * Add thumbnails to the contact list as they become visible in the viewport.
- */
+ // Add thumbnails to the contact list as they become visible in the viewport.
lazyupdate:function(){
$('#contacts li').live('inview', function(){
if (!$(this).find('a').attr('style')) {
@@ -1237,9 +1332,6 @@ $(document).ready(function(){
OCCategories.changed = Contacts.UI.Card.categoriesChanged;
OCCategories.app = 'contacts';
- /**
- * Show the Addressbook chooser
- */
$('#chooseaddressbook').click(function(){
Contacts.UI.Addressbooks.overview();
return false;
@@ -1272,7 +1364,7 @@ $(document).ready(function(){
});
$('#contacts_deletecard').live('click',function(){
- Contacts.UI.Card.delete();
+ Contacts.UI.Card.doDelete();
});
$('#contacts li').bind('inview', function(event, isInView, visiblePartX, visiblePartY) {
@@ -1430,7 +1522,8 @@ $(document).ready(function(){
}
});
$('#contacts_propertymenu a').live('click',function(){
- Contacts.UI.Card.addProperty(this);
+ var type = $(this).data('type');
+ Contacts.UI.Card.addProperty(type);
$('#contacts_propertymenu').hide();
});
});
diff --git a/apps/contacts/js/jquery.combobox.js b/apps/contacts/js/jquery.combobox.js
index 6da4ecb5147..f46d7c14c18 100644
--- a/apps/contacts/js/jquery.combobox.js
+++ b/apps/contacts/js/jquery.combobox.js
@@ -72,17 +72,10 @@
.appendTo( ul );
};
- this.button = $( "<button type='button'>&nbsp;</button>" )
+ /*this.button = $( "<button type='button'>&nbsp;</button>" )
.attr( "tabIndex", -1 )
.attr( "title", "Show All Items" )
.insertAfter( input )
- /*.button({
- icons: {
- primary: "ui-icon-triangle-1-s"
- },
- text: false
- })
- .removeClass( "ui-corner-all" )*/
.addClass('svg')
.addClass('action')
.addClass('combo-button')
@@ -99,7 +92,7 @@
// pass empty string as value to search for, displaying all results
input.autocomplete( "search", "" );
input.focus();
- });
+ });*/
$.each(this.options, function(key, value) {
self._setOption(key, value);
});
@@ -123,17 +116,23 @@
case "id":
this.options['id'] = value;
this.input.attr('id', value);
- break;
+ break;
case "name":
this.options['name'] = value;
this.input.attr('name', value);
- break;
+ break;
+ case "attributes":
+ var input = this.input;
+ $.each(this.options['attributes'], function(key, value) {
+ input.attr(key, value);
+ });
+ break;
case "classes":
var input = this.input;
$.each(this.options['classes'], function(key, value) {
input.addClass(value);
});
- break;
+ break;
}
// In jQuery UI 1.8, you have to manually invoke the _setOption method from the base widget
$.Widget.prototype._setOption.apply( this, arguments );
diff --git a/apps/contacts/js/jquery.multi-autocomplete.js b/apps/contacts/js/jquery.multi-autocomplete.js
index 7607de3f918..e1c5d63dc5f 100644
--- a/apps/contacts/js/jquery.multi-autocomplete.js
+++ b/apps/contacts/js/jquery.multi-autocomplete.js
@@ -62,7 +62,7 @@
return false;
}
});
- this.button = $( "<button type='button'>&nbsp;</button>" )
+ /*this.button = $( "<button type='button'>&nbsp;</button>" )
.attr( "tabIndex", -1 )
.attr( "title", "Show All Items" )
.insertAfter( this.element )
@@ -86,7 +86,7 @@
// pass empty string as value to search for, displaying all results
self.element.autocomplete( "search", "" );
self.element.focus();
- });
+ });*/
},
});
})( jQuery );
diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php
index 052c19e55fe..9061fa19140 100644
--- a/apps/contacts/lib/addressbook.php
+++ b/apps/contacts/lib/addressbook.php
@@ -169,7 +169,7 @@ class OC_Contacts_Addressbook{
$uid = OC_User::getUser();
}
$prefbooks = OC_Preferences::getValue($uid,'contacts','openaddressbooks',null);
- if(is_null($prefbooks)){
+ if(!$prefbooks){
$addressbooks = OC_Contacts_Addressbook::all($uid);
if(count($addressbooks) == 0){
OC_Contacts_Addressbook::add($uid,'default','Default Address Book');
diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php
index af159ce9c60..d68dd68f605 100644
--- a/apps/contacts/templates/index.php
+++ b/apps/contacts/templates/index.php
@@ -1,6 +1,7 @@
<script type='text/javascript'>
var totalurl = '<?php echo OC_Helper::linkToAbsolute('contacts', 'carddav.php'); ?>/addressbooks';
var categories = <?php sort($_['categories']); echo json_encode($_['categories']); ?>;
+ var lang = '<?php echo OC_Preferences::getValue(OC_User::getUser(), 'core', 'lang', 'en'); ?>';
</script>
<div id="controls">
<form>
diff --git a/apps/contacts/templates/part.contact.php b/apps/contacts/templates/part.contact.php
index d243c2b5e14..ff1f081c4d4 100644
--- a/apps/contacts/templates/part.contact.php
+++ b/apps/contacts/templates/part.contact.php
@@ -17,16 +17,16 @@ $id = isset($_['id']) ? $_['id'] : '';
<li><a data-type="CATEGORIES"><?php echo $l->t('Categories'); ?></a></li>
</ul>
</div>
- <img onclick="Contacts.UI.Card.export();" class="svg action" id="contacts_downloadcard" src="<?php echo image_path('', 'actions/download.svg'); ?>" title="<?php echo $l->t('Download contact');?>" />
+ <img onclick="Contacts.UI.Card.doExport();" class="svg action" id="contacts_downloadcard" src="<?php echo image_path('', 'actions/download.svg'); ?>" title="<?php echo $l->t('Download contact');?>" />
<img class="svg action" id="contacts_deletecard" src="<?php echo image_path('', 'actions/delete.svg'); ?>" title="<?php echo $l->t('Delete contact');?>" />
</div>
- <div class="contactsection">
+ <div id="contact_photo" class="contactsection">
- <form style="display:none;" id="file_upload_form" action="ajax/uploadphoto.php" method="post" enctype="multipart/form-data" target="file_upload_target" class="propertycontainer" data-element="PHOTO">
- <fieldset id="photo" class="formfloat">
+ <form class="float" id="file_upload_form" action="ajax/uploadphoto.php" method="post" enctype="multipart/form-data" target="file_upload_target" class="propertycontainer" data-element="PHOTO">
+ <fieldset id="photo">
<a class="action delete" onclick="$(this).tipsy('hide');Contacts.UI.Card.deleteProperty(this, 'single');" title="<?php echo $l->t('Delete'); ?>"></a>
- <div id="contacts_details_photo_wrapper" title="<?php echo $l->t('Click or drop to upload picture'); ?> (max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
+ <div class="tip" id="contacts_details_photo_wrapper" title="<?php echo $l->t('Click or drop to upload picture'); ?> (max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
<!-- img style="padding: 1em;" id="contacts_details_photo" alt="Profile picture" src="photo.php?id=<?php echo $_['id']; ?>" / -->
<progress id="contacts_details_photo_progress" style="display:none;" value="0" max="100">0 %</progress>
</div>
@@ -37,58 +37,55 @@ $id = isset($_['id']) ? $_['id'] : '';
<iframe name="file_upload_target" id='file_upload_target' src=""></iframe>
</fieldset>
</form>
- <form id="contact_identity" method="post" <?php echo ($_['id']==''||!isset($_['id'])?'style="display:none;"':''); ?>>
+ </div> <!-- contact_photo -->
+
+ <div id="contact_identity" class="contactsection">
+ <form method="post">
<input type="hidden" name="id" value="<?php echo $_['id'] ?>">
- <fieldset class="propertycontainer" data-element="N"><input type="hidden" id="n" class="contacts_property" name="value" value="" /></fieldset>
- <fieldset id="ident" class="formfloat">
+ <fieldset id="ident" class="contactpart">
<!-- legend>Name</legend -->
- <dl class="form">
- <!-- dt><label for="n"><?php echo $l->t('Name'); ?></label></dt>
- <dd style="padding-top: 0.8em;vertical-align: text-bottom;"><span id="n" type="text"></span></dd -->
- <dt><label for="fn"><?php echo $l->t('Display name'); ?></label></dt>
- <dd class="propertycontainer" data-element="FN">
- <select id="fn_select" title="<?php echo $l->t('Format custom, Short name, Full name, Reverse or Reverse with comma'); ?>" style="width:16em;">
- </select><a id="edit_name" class="action edit" title="<?php echo $l->t('Edit name details'); ?>"></a>
- </dd>
+ <span class="propertycontainer" data-element="N"><input type="hidden" id="n" class="contacts_property" name="value" value="" /></span>
+ <span id="name" class="propertycontainer" data-element="FN">
+ <select class="float" id="fn_select" title="<?php echo $l->t('Format custom, Short name, Full name, Reverse or Reverse with comma'); ?>" style="width:16em;">
+ </select><a id="edit_name" class="action edit" title="<?php echo $l->t('Edit name details'); ?>"></a>
+ </span>
+ <dl id="identityprops" class="form">
<dt style="display:none;" id="org_label" data-element="ORG"><label for="org"><?php echo $l->t('Organization'); ?></label></dt>
- <dd style="display:none;" class="propertycontainer" id="org_value" data-element="ORG"><input id="org" required="required" name="value[ORG]" type="text" class="contacts_property" style="width:16em;" name="value" value="" placeholder="<?php echo $l->t('Organization'); ?>" /><a class="action delete" onclick="$(this).tipsy('hide');Contacts.UI.Card.deleteProperty(this, 'single');" title="<?php echo $l->t('Delete'); ?>"></a></dd>
+ <dd style="display:none;" class="propertycontainer" id="org_value" data-element="ORG"><input id="org" required="required" name="value[ORG]" type="text" class="contacts_property big" name="value" value="" placeholder="<?php echo $l->t('Organization'); ?>" /><a class="action delete" onclick="$(this).tipsy('hide');Contacts.UI.Card.deleteProperty(this, 'single');" title="<?php echo $l->t('Delete'); ?>"></a></dd>
<dt style="display:none;" id="nickname_label" data-element="NICKNAME"><label for="nickname"><?php echo $l->t('Nickname'); ?></label></dt>
- <dd style="display:none;" class="propertycontainer" id="nickname_value" data-element="NICKNAME"><input id="nickname" required="required" name="value[NICKNAME]" type="text" class="contacts_property" style="width:16em;" name="value" value="" placeholder="<?php echo $l->t('Enter nickname'); ?>" /><a class="action delete" onclick="$(this).tipsy('hide');Contacts.UI.Card.deleteProperty(this, 'single');" title="<?php echo $l->t('Delete'); ?>"></a></dd>
+ <dd style="display:none;" class="propertycontainer" id="nickname_value" data-element="NICKNAME"><input id="nickname" required="required" name="value[NICKNAME]" type="text" class="contacts_property big" name="value" value="" placeholder="<?php echo $l->t('Enter nickname'); ?>" /><a class="action delete" onclick="$(this).tipsy('hide');Contacts.UI.Card.deleteProperty(this, 'single');" title="<?php echo $l->t('Delete'); ?>"></a></dd>
<dt style="display:none;" id="bday_label" data-element="BDAY"><label for="bday"><?php echo $l->t('Birthday'); ?></label></dt>
- <dd style="display:none;" class="propertycontainer" id="bday_value" data-element="BDAY"><input id="bday" required="required" name="value" type="text" class="contacts_property" value="" placeholder="<?php echo $l->t('dd-mm-yyyy'); ?>" /><a class="action delete" onclick="$(this).tipsy('hide');Contacts.UI.Card.deleteProperty(this, 'single');" title="<?php echo $l->t('Delete'); ?>"></a></dd>
- <dt style="display:none;" id="categories_label" data-element="CATEGORIES"><label for="categories"><?php echo $l->t('Categories'); ?></label></dt>
- <dd style="display:none;" class="propertycontainer" id="categories_value" data-element="CATEGORIES"><input id="categories" required="required" name="value[CATEGORIES]" type="text" class="contacts_property" style="width:16em;" name="value" value="" placeholder="<?php echo $l->t('Categories'); ?>" /><a class="action delete" onclick="$(this).tipsy('hide');Contacts.UI.Card.deleteProperty(this, 'single');" title="<?php echo $l->t('Delete'); ?>"></a><a class="action edit" onclick="$(this).tipsy('hide');OCCategories.edit();" title="<?php echo $l->t('Edit categories'); ?>"></a></dd>
+ <dd style="display:none;" class="propertycontainer" id="bday_value" data-element="BDAY"><input id="bday" required="required" name="value" type="text" class="contacts_property big" value="" placeholder="<?php echo $l->t('dd-mm-yyyy'); ?>" /><a class="action delete" onclick="$(this).tipsy('hide');Contacts.UI.Card.deleteProperty(this, 'single');" title="<?php echo $l->t('Delete'); ?>"></a></dd>
+ <dt style="display:none;" id="categories_label" data-element="CATEGORIES"><label for="categories"><?php echo $l->t('Groups'); ?></label></dt>
+ <dd style="display:none;" class="propertycontainer" id="categories_value" data-element="CATEGORIES"><input id="categories" required="required" name="value[CATEGORIES]" type="text" class="contacts_property bold" name="value" value="" placeholder="
+<?php echo $l->t('Separate groups with commas'); ?>" /><a class="action delete" onclick="$(this).tipsy('hide');Contacts.UI.Card.deleteProperty(this, 'single');" title="<?php echo $l->t('Delete'); ?>"></a><a class="action edit" onclick="$(this).tipsy('hide');OCCategories.edit();" title="<?php echo $l->t('Edit categories'); ?>"></a></dd>
</dl>
</fieldset>
- <fieldset id="note" class="formfloat propertycontainer contactpart" style="display:none;" data-element="NOTE">
- <legend><?php echo $l->t('Note'); ?><a class="action delete" onclick="$(this).tipsy('hide');Contacts.UI.Card.deleteProperty(this, 'single');" title="<?php echo $l->t('Delete'); ?>"></a></legend>
- <textarea class="contacts_property note" name="value" cols="60" rows="10"></textarea>
- </fieldset>
</form>
- </div>
+ </div> <!-- contact_identity -->
<!-- div class="delimiter"></div -->
- <form id="contact_communication" method="post" style="display: none;">
- <div class="contactsection">
+ <div id="contact_communication" class="contactsection">
+ <form method="post">
<!-- email addresses -->
- <div id="emails" style="display:none;">
+ <div id="emails">
<fieldset class="contactpart">
- <legend><?php echo $l->t('Email'); ?></legend>
+ <!-- legend><?php echo $l->t('Email'); ?></legend -->
<ul id="emaillist" class="propertylist">
<li class="template" style="white-space: nowrap; display: none;" data-element="EMAIL">
- <input type="checkbox" class="contacts_property" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" />
+ <input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" />
<input type="email" required="required" class="nonempty contacts_property" style="width:15em;" name="value" value="" x-moz-errormessage="<?php echo $l->t('Please specify a valid email address.'); ?>" placeholder="<?php echo $l->t('Enter email address'); ?>" /><span class="listactions"><a onclick="Contacts.UI.mailTo(this)" class="action mail" title="<?php echo $l->t('Mail to address'); ?>"></a>
<a class="action delete" onclick="$(this).tipsy('hide');Contacts.UI.Card.deleteProperty(this, 'list');" title="<?php echo $l->t('Delete email address'); ?>"></a></span></li>
</ul><!-- a id="add_email" class="add" title="<?php echo $l->t('Add email address'); ?>"></a -->
</div> <!-- email addresses-->
<!-- Phone numbers -->
- <div id="phones" style="display:none;">
+ <div id="phones">
<fieldset class="contactpart">
- <legend><?php echo $l->t('Phone'); ?></legend>
+ <!-- legend><?php echo $l->t('Phone'); ?></legend -->
<ul id="phonelist" class="propertylist">
<li class="template" style="white-space: nowrap; display: none;" data-element="TEL">
- <input type="checkbox" class="contacts_property" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" />
+ <input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" />
<input type="text" required="required" class="nonempty contacts_property" style="width:10em; border: 0px;" name="value" value="" placeholder="<?php echo $l->t('Enter phone number'); ?>" />
<select multiple="multiple" name="parameters[TYPE][]">
<?php echo html_select_options($_['phone_types'], array()) ?>
@@ -100,7 +97,7 @@ $id = isset($_['id']) ? $_['id'] : '';
<!-- Addresses -->
<div id="addresses" style="display:none;">
<fieldset class="contactpart">
- <legend><?php echo $l->t('Address'); ?></legend>
+ <!-- legend><?php echo $l->t('Address'); ?></legend -->
<div id="addressdisplay">
<dl class="addresscard template" style="display: none;" data-element="ADR"><dt>
<input class="adr contacts_property" name="value" type="hidden" value="" />
@@ -109,13 +106,18 @@ $id = isset($_['id']) ? $_['id'] : '';
</dt><dd><ul class="addresslist"></ul></dd></dl>
</fieldset>
- </div>
+ </div> <!-- addressdisplay -->
</div> <!-- Addresses -->
- </div>
- <!-- a id="add_address" onclick="Contacts.UI.Card.editAddress('new', true)" class="add" title="<?php echo $l->t('Add address'); ?>"></a -->
- </div>
</form>
-</div>
+ </div> <!-- contact_communication -->
+ <div id="contact_note" class="contactsection">
+ <form class="float" method="post">
+ <fieldset id="note" class="formfloat propertycontainer contactpart" data-element="NOTE">
+ <textarea class="contacts_property note" name="value" cols="40" rows="10" required="required" placeholder="<?php echo $l->t('Add notes here.'); ?>"></textarea>
+ </fieldset>
+ </form>
+ </div> <!-- contact_note -->
+</div> <!-- card -->
<div id="edit_photo_dialog" title="Edit photo">
<div id="edit_photo_dialog_img"></div>
</div>
@@ -128,7 +130,7 @@ $(document).ready(function(){
Contacts.UI.Card.loadContact(jsondata.data);
}
else{
- Contacts.UI.messageBox(t('contacts', 'Error'), jsondata.data.message);
+ OC.dialogs.alert(jsondata.data.message, t('contacts', 'Error'));
}
});
}
diff --git a/apps/contacts/templates/part.edit_address_dialog.php b/apps/contacts/templates/part.edit_address_dialog.php
index 0ecdc4e1915..507a3acaa0c 100644
--- a/apps/contacts/templates/part.edit_address_dialog.php
+++ b/apps/contacts/templates/part.edit_address_dialog.php
@@ -22,44 +22,44 @@ foreach(isset($adr['parameters']['TYPE'])?array($adr['parameters']['TYPE']):arra
<label class="label" for="adr_pobox"><?php echo $l->t('PO Box'); ?></label>
</dt>
<dd>
- <input type="text" id="adr_pobox" name="value[ADR][0]" value="<?php echo isset($adr['value'][0])?$adr['value'][0]:''; ?>">
+ <input type="text" id="adr_pobox" name="value[ADR][0]" placeholder="<?php echo $l->t('PO Box'); ?>" value="<?php echo isset($adr['value'][0])?$adr['value'][0]:''; ?>">
</dd>
<dd>
<dt>
<label class="label" for="adr_extended"><?php echo $l->t('Extended'); ?></label>
</dt>
<dd>
- <input type="text" id="adr_extended" name="value[ADR][1]" value="<?php echo isset($adr['value'][1])?$adr['value'][1]:''; ?>">
+ <input type="text" id="adr_extended" name="value[ADR][1]" placeholder="<?php echo $l->t('Extended'); ?>" value="<?php echo isset($adr['value'][1])?$adr['value'][1]:''; ?>">
</dd>
<dt>
<label class="label" for="adr_street"><?php echo $l->t('Street'); ?></label>
</dt>
<dd>
- <input type="text" id="adr_street" name="value[ADR][2]" value="<?php echo isset($adr['value'][2])?$adr['value'][2]:''; ?>">
+ <input type="text" id="adr_street" name="value[ADR][2]" placeholder="<?php echo $l->t('Street'); ?>" value="<?php echo isset($adr['value'][2])?$adr['value'][2]:''; ?>">
</dd>
<dt>
<label class="label" for="adr_city"><?php echo $l->t('City'); ?></label>
</dt>
<dd>
- <input type="text" id="adr_city" name="value[ADR][3]" value="<?php echo isset($adr['value'][3])?$adr['value'][3]:''; ?>">
+ <input type="text" id="adr_city" name="value[ADR][3]" placeholder="<?php echo $l->t('City'); ?>" value="<?php echo isset($adr['value'][3])?$adr['value'][3]:''; ?>">
</dd>
<dt>
<label class="label" for="adr_region"><?php echo $l->t('Region'); ?></label>
</dt>
<dd>
- <input type="text" id="adr_region" name="value[ADR][4]" value="<?php echo isset($adr['value'][4])?$adr['value'][4]:''; ?>">
+ <input type="text" id="adr_region" name="value[ADR][4]" placeholder="<?php echo $l->t('Region'); ?>" value="<?php echo isset($adr['value'][4])?$adr['value'][4]:''; ?>">
</dd>
<dt>
<label class="label" for="adr_zipcode"><?php echo $l->t('Zipcode'); ?></label>
</dt>
<dd>
- <input type="text" id="adr_zipcode" name="value[ADR][5]" value="<?php echo isset($adr['value'][5])?$adr['value'][5]:''; ?>">
+ <input type="text" id="adr_zipcode" name="value[ADR][5]" placeholder="<?php echo $l->t('Zipcode'); ?>" value="<?php echo isset($adr['value'][5])?$adr['value'][5]:''; ?>">
</dd>
<dt>
<label class="label" for="adr_country"><?php echo $l->t('Country'); ?></label>
</dt>
<dd>
- <input type="text" id="adr_country" name="value[ADR][6]" value="<?php echo isset($adr['value'][6])?$adr['value'][6]:''; ?>">
+ <input type="text" id="adr_country" name="value[ADR][6]" placeholder="<?php echo $l->t('Country'); ?>" value="<?php echo isset($adr['value'][6])?$adr['value'][6]:''; ?>">
</dd>
</dl>
</fieldset>
diff --git a/apps/contacts/templates/part.no_contacts.php b/apps/contacts/templates/part.no_contacts.php
new file mode 100644
index 00000000000..7024a142aec
--- /dev/null
+++ b/apps/contacts/templates/part.no_contacts.php
@@ -0,0 +1,8 @@
+<div id="firstrun">
+ <?php echo $l->t('You have no contacts in your list.') ?>
+ <div id="selections">
+ <input type="button" value="<?php echo $l->t('Import contacts') ?>" onclick="Contacts.UI.Addressbooks.doImport()" />
+ <input type="button" value="<?php echo $l->t('Add contact') ?>" onclick="Contacts.UI.Card.editNew()" />
+ <input type="button" value="<?php echo $l->t('Edit addressbooks') ?>" onclick="Contacts.UI.Addressbooks.overview()" />
+ </div>
+</div>
diff --git a/apps/contacts/templates/settings.php b/apps/contacts/templates/settings.php
index f56de0ec8b0..5627a15c50a 100644
--- a/apps/contacts/templates/settings.php
+++ b/apps/contacts/templates/settings.php
@@ -8,5 +8,6 @@
<dt><?php echo $l->t('iOS/OS X'); ?></dt>
<dd><code><?php echo OC_Helper::linkToAbsolute('contacts', 'carddav.php'); ?>/principals/<?php echo OC_User::getUser(); ?></code>/</dd>
</dl>
+ Powered by <a href="http://geonames.org/" target="_blank">geonames.org webservice</a>
</fieldset>
</form>