From 9d448872b977118d9803ede3b1bdf1b8b97a9643 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Tue, 11 Dec 2012 02:27:37 +0100 Subject: [PATCH] Contacts: Forgot to save NOTE --- css/contacts.css | 2 ++ js/contacts.js | 18 +++++++++++++----- templates/contacts.php | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/css/contacts.css b/css/contacts.css index 8138bfc0..412fa58a 100644 --- a/css/contacts.css +++ b/css/contacts.css @@ -399,6 +399,8 @@ input.propertytype { float: left; font-size: .8em; width: 8em !important; text-a .adr.editor input.value.zip { width: 5em; } .adr.editor input.value.city { width: 10em; } +.note { margin-left: 120px; } + #rightcontent footer { padding: 1em; width: 100%; -moz-box-sizing: border-box; box-sizing: border-box; clear: both; } #rightcontent footer > { display: inline-block; } /* contact list */ diff --git a/js/contacts.js b/js/contacts.js index 17722886..ec3f3eac 100644 --- a/js/contacts.js +++ b/js/contacts.js @@ -46,20 +46,21 @@ OC.Contacts = OC.Contacts || {}; case 'TITLE': case 'ORG': case 'BDAY': + case 'NOTE': this.$fullelem.find('[data-element="' + name.toLowerCase() + '"]').addClass('new').show(); $option.prop('disabled', true); break; case 'TEL': case 'URL': case 'EMAIL': - $elem = this.renderStandardProperty(name.toLowerCase()); + var $elem = this.renderStandardProperty(name.toLowerCase()); var $list = this.$fullelem.find('ul.' + name.toLowerCase()); $list.show(); $list.append($elem); $elem.find('input.value').addClass('new'); break; case 'ADR': - $elem = this.renderAddressProperty(); + var $elem = this.renderAddressProperty(); var $list = this.$fullelem.find('ul.' + name.toLowerCase()); $list.show(); $list.append($elem); @@ -279,6 +280,7 @@ OC.Contacts = OC.Contacts || {}; case 'BDAY': case 'ORG': case 'TITLE': + case 'NOTE': self.data[element][0] = { name: element, value: value, @@ -448,8 +450,13 @@ OC.Contacts = OC.Contacts || {}; if($(obj).hasClass('propertycontainer')) { q += '&value=' + encodeURIComponent($(obj).val()); } else { - q += '&' + this.propertyContainerFor(obj) - .find('input.value,select.value,textarea.value,.parameter').serialize(); + var $elements = this.propertyContainerFor(obj) + .find('input.value,select.value,textarea.value,.parameter'); + if($elements.length > 1) { + q += '&' + $elements.serialize(); + } else { + q += '&value=' + encodeURIComponent($elements.val()); + } } return q; } @@ -556,8 +563,9 @@ OC.Contacts = OC.Contacts || {}; $.datepicker.parseDate('yy-mm-dd', this.getPreferredValue('BDAY', '').substring(0, 10))) : '', + note: this.getPreferredValue('NOTE', ''), } - : {id: '', favorite: '', name: '', nickname: '', title: '', org: '', bday: '', n0: '', n1: '', n2: '', n3: '', n4: ''}; + : {id:'', favorite:'', name:'', nickname:'', title:'', org:'', bday:'', note:'', n0:'', n1:'', n2:'', n3:'', n4:''}; this.$fullelem = this.$fullTemplate.octemplate(values).data('contactobject', this); this.$fullelem.find('.tooltipped.rightwards.onfocus').tipsy({trigger: 'focus', gravity: 'w'}); this.$fullelem.on('submit', function() { diff --git a/templates/contacts.php b/templates/contacts.php index b6944614..360b35a6 100644 --- a/templates/contacts.php +++ b/templates/contacts.php @@ -257,7 +257,7 @@
  • - +