roundcube / roundcubemail

The Roundcube Webmail suite
https://roundcube.net
GNU General Public License v3.0
5.87k stars 1.64k forks source link

Use "Nickname" field for email autocomplete #5038

Open rcubetrac opened 13 years ago

rcubetrac commented 13 years ago

Reported by dmandell on 3 Oct 2011 17:09 UTC as Trac ticket #1488114

The "Nickname" field in the address book doesn't do anything right now, I assume that it's supposed to be usable for email address autocomplete when composing an email.

To reproduce:

Add a nickname to one of your address book contacts, save. Compose a new email. Type the nickname for your contact, note that autocomplete doesn't do anything.

Migrated-From: http://trac.roundcube.net/ticket/1488114

rcubetrac commented 12 years ago

Milestone changed by @alecpl on 10 Nov 2011 12:09 UTC

0.7-beta => later

rcubetrac commented 12 years ago

Comment by Seanster on 20 Nov 2011 17:06 UTC

This will add the nickname field to autocomplete:

/program/steps/mail/autocomplete.inc line 65

change:

if ($result = $abook->search(array('email','name'), $search, $mode, true, true, 'email')) {

to:

if ($result = $abook->search(array('email','name','nickname'), $search, $mode, true, true, 'email')) {

This only changes the search, it doesn't cause the nickname to be shown anywhere it didn't before.

The attached patch file adds this autocomplete ability and also adds an extra column in the address book list to show the nicknames, if any.

rcube.svn2011-11-18.nickname.patch

I also have a similar patch for the compose_addressbook plugin (but only for "full" book mode).

It's available here:

http://www.seanster.com/rcube/

rcubetrac commented 11 years ago

Comment by kgc on 17 Apr 2013 17:59 UTC

This issue has come up for us too. Any reason why this patch hasn't been included? Would the devs like to see additional functionality added before committing it?

jeffersonurban commented 8 years ago

/program/steps/mail/autocomplete.inc line 79

change: ` if (empty($email) || strpos($email, $search_lc) === false) { continue; }

$name = rcube_addressbook::compose_list_name($sql_arr); $contact = format_email_recipient($email, $name);

// skip entries that don't match if ($email_cnt > 1 && strpos(mb_strtolower($contact), $search_lc) === false) { continue; } `

to

$name = rcube_addressbook::compose_list_name($sql_arr); $contact = format_email_recipient($email, $name);

Works fine.

emtiu commented 7 years ago

Sorry for necrobumping, but I've also just been bitten by this issue, and I'd like to encourage merging the fix that's been proposed.

alecpl commented 7 years ago

We have contactlist_fields option now which contains fields used for autocompletion, so we could add 'nickname' there, but it's not as simple as that. Either we'd need to add a new 'nickname' column to contacts table or do non-trivial changes to rcube_contacts::search() to make it working.

rdacn commented 3 years ago

We can change the contactlist_fields option adding 'words' (actually 'words' because 'words' throws an error), or 'vcard', but I don't know the impact of this (particularly in terms of performance). Anyway, it works in a test environment : if I add a custom field like 'Organization', it is added to the 'vcard' and 'words' fields of the contacts table, and if I add 'words' or 'vcard' to contactlist_fields, it is searchable.

Overall, it's true that it would be good to have more searchable fields in the contact list, or at least a kind of 'custom' or 'joker' field that every user could use for its own purpose, to filter or sort results better when selecting recipients