summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-06-15 23:02:00 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2016-06-16 11:09:17 +0200
commit0cf6d0f744532089709f0b8087df1907db5a4d95 (patch)
tree9daa1ad260e2ed8739326c9151596b0422bb83c0 /js
parentc83f7ca4aa92c77ca81d42d4f0f8e6b05309e58d (diff)
Adding detailed name field with all structured elements including sync N to FN
Diffstat (limited to 'js')
-rw-r--r--js/components/detailsItem/detailsItem_controller.js33
-rw-r--r--js/services/vCardProperties.js9
2 files changed, 38 insertions, 4 deletions
diff --git a/js/components/detailsItem/detailsItem_controller.js b/js/components/detailsItem/detailsItem_controller.js
index fdf970bb..e296da43 100644
--- a/js/components/detailsItem/detailsItem_controller.js
+++ b/js/components/detailsItem/detailsItem_controller.js
@@ -6,13 +6,18 @@ angular.module('contactsApp')
ctrl.type = undefined;
ctrl.isPreferred = false;
ctrl.t = {
- poBox : t('contacts', 'Post Office Box'),
- postalCode : t('contacts', 'Postal Code'),
+ poBox : t('contacts', 'Post office box'),
+ postalCode : t('contacts', 'Postal code'),
city : t('contacts', 'City'),
state : t('contacts', 'State or province'),
country : t('contacts', 'Country'),
address: t('contacts', 'Address'),
- newGroup: t('contacts', '(new group)')
+ newGroup: t('contacts', '(new group)'),
+ familyName: t('contacts', 'Last name'),
+ firstName: t('contacts', 'First name'),
+ additionalNames: t('contacts', 'Additional names'),
+ honorificPrefix: t('contacts', 'Prefix'),
+ honorificSuffix: t('contacts', 'Suffix')
};
ctrl.availableOptions = ctrl.meta.options || [];
@@ -54,6 +59,28 @@ angular.module('contactsApp')
ctrl.model.updateContact();
};
+ ctrl.updateDetailedName = function () {
+ var fn = '';
+ if (ctrl.data.value[3]) {
+ fn += ctrl.data.value[3] + ' ';
+ }
+ if (ctrl.data.value[1]) {
+ fn += ctrl.data.value[1] + ' ';
+ }
+ if (ctrl.data.value[2]) {
+ fn += ctrl.data.value[2] + ' ';
+ }
+ if (ctrl.data.value[0]) {
+ fn += ctrl.data.value[0] + ' ';
+ }
+ if (ctrl.data.value[4]) {
+ fn += ctrl.data.value[4];
+ }
+
+ ctrl.model.contact.fullName(fn);
+ ctrl.model.updateContact();
+ };
+
ctrl.getTemplate = function() {
var templateUrl = OC.linkTo('contacts', 'templates/detailItems/' + ctrl.meta.template + '.html');
return $templateRequest(templateUrl);
diff --git a/js/services/vCardProperties.js b/js/services/vCardProperties.js
index 56a640a6..eb7ce6d0 100644
--- a/js/services/vCardProperties.js
+++ b/js/services/vCardProperties.js
@@ -15,6 +15,13 @@ angular.module('contactsApp')
readableName: t('contacts', 'Nickname'),
template: 'text'
},
+ n: {
+ readableName: t('contacts', 'Detailed name'),
+ defaultValue: {
+ value:['', '', '', '', '']
+ },
+ template: 'n'
+ },
note: {
readableName: t('contacts', 'Notes'),
template: 'textarea'
@@ -108,7 +115,7 @@ angular.module('contactsApp')
},
'X-SOCIALPROFILE': {
multiple: true,
- readableName: t('contacts', 'Social Network'),
+ readableName: t('contacts', 'Social network'),
template: 'text',
defaultValue: {
value:[''],