1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-19 08:52:22 +01:00

Contacts: Get display name from either FN, ORG or EMAIL.

This commit is contained in:
Thomas Tanghus 2013-05-02 20:45:52 +02:00
parent d4b18987ae
commit ea7ce48914

View File

@ -37,7 +37,7 @@ OC.Contacts = OC.Contacts || {};
};
Contact.prototype.getDisplayName = function() {
return this.getPreferredValue('FN');
return this.getPreferredValue('FN') || this.getPreferredValue('ORG') || this.getPreferredValue('EMAIL');
};
Contact.prototype.getId = function() {
@ -862,7 +862,7 @@ OC.Contacts = OC.Contacts || {};
id: this.id,
parent: this.metadata.parent,
backend: this.metadata.backend,
name: this.getPreferredValue('FN', ''),
name: this.getDisplayName(),
email: this.getPreferredValue('EMAIL', ''),
tel: this.getPreferredValue('TEL', ''),
adr: this.getPreferredValue('ADR', []).clean('').join(', '),