[Owncloud] [Contacts] Hack for sorting by last name

Thomas Tanghus thomas at tanghus.net
Fri Aug 2 10:19:18 UTC 2013


On Thursday 01 August 2013 13:32 Andreas Borutta wrote:
> Thomas Tanghus schrieb:
> > On Wednesday 31 July 2013 13:02 Andreas Borutta wrote:
> >> If anyone could give me a hint ...?
> > 
> > You could change getDisplayName() at
> > https://github.com/owncloud/apps/blob/stable5/contacts/js/contacts.js#L29
> > to return the values from the N property instead of the FN property.
> 
> Thanks for your hint Thomas.
> 
> Contact.prototype.getDisplayName = function() {
> 		return this.getPreferredValue('N') || this.getPreferredValue('ORG',
> []).clean('').join(', ') || this.getPreferredValue('EMAIL');
> 	};
> ***

That won't work as N is an array.
 
> > this.getPreferredValue('N', [this.getPreferredValue('FN','')])
> >   .slice(0, 2).join(', ');
> 
> Where please do I have to place that code?

In getDisplayName() as mentioned above ;)

Contact.prototype.getDisplayName = function() {
    return this.getPreferredValue('N', [this.getPreferredValue('FN',[])]).slice(0, 2).join(', ');
};


-- 
Med venlig hilsen / Best Regards

Thomas Tanghus



More information about the Owncloud mailing list