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:
parent
d4b18987ae
commit
ea7ce48914
@ -37,7 +37,7 @@ OC.Contacts = OC.Contacts || {};
|
|||||||
};
|
};
|
||||||
|
|
||||||
Contact.prototype.getDisplayName = function() {
|
Contact.prototype.getDisplayName = function() {
|
||||||
return this.getPreferredValue('FN');
|
return this.getPreferredValue('FN') || this.getPreferredValue('ORG') || this.getPreferredValue('EMAIL');
|
||||||
};
|
};
|
||||||
|
|
||||||
Contact.prototype.getId = function() {
|
Contact.prototype.getId = function() {
|
||||||
@ -862,7 +862,7 @@ OC.Contacts = OC.Contacts || {};
|
|||||||
id: this.id,
|
id: this.id,
|
||||||
parent: this.metadata.parent,
|
parent: this.metadata.parent,
|
||||||
backend: this.metadata.backend,
|
backend: this.metadata.backend,
|
||||||
name: this.getPreferredValue('FN', ''),
|
name: this.getDisplayName(),
|
||||||
email: this.getPreferredValue('EMAIL', ''),
|
email: this.getPreferredValue('EMAIL', ''),
|
||||||
tel: this.getPreferredValue('TEL', ''),
|
tel: this.getPreferredValue('TEL', ''),
|
||||||
adr: this.getPreferredValue('ADR', []).clean('').join(', '),
|
adr: this.getPreferredValue('ADR', []).clean('').join(', '),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user