RCers-
I can't seem to get the auto-complete to display the address books in the order desired. That is to say I want an address in my personal address book to appear at the top of the autocomplete list rather than at the bottom.
I am using RC 0.3.1, and have two address books defined, plus the 'automatic_addressbook', plugin but I've verified I have the same problem even with no plugins enabled.
My LDAP address book is called 'People'
// An ordered array of the ids of the addressbooks that should be searched // when populating address autocomplete fields server-side. $rcmail_config['autocomplete_addressbooks'] = array('sql', 'People');
With the above config an address in 'sql' will always appear on the auto-complete list of 15, but at the bottom of the list. When I switch the order of 'sql' and 'People' the address from 'sql' won't appear until every address in 'People' is excluded.
Thus it appears to be working partially correctly. It searches correctly making sure if the address is in 'sql' it will always be on the auto-complete list, but it always shows up at the bottom of the list rather than the top, which not the desired behavior. An address book which is configured to be searched first should also be displayed first.
What am I doing wrong? Or is this a RC issue? I've searched any can't find any tickets on this issue.
Thanks,
--ry
On Wed, 10 Mar 2010 08:25:22 -0600, Ryan Horrisberger rhorrisb@ssc.wisc.edu wrote:
RCers-
I can't seem to get the auto-complete to display the address books in
the
order desired. That is to say I want an address in my personal address book to appear at the top of the autocomplete list rather than at the bottom.
I am using RC 0.3.1, and have two address books defined, plus the 'automatic_addressbook', plugin but I've verified I have the same
problem
even with no plugins enabled.
My LDAP address book is called 'People'
// An ordered array of the ids of the addressbooks that should be
searched
// when populating address autocomplete fields server-side. $rcmail_config['autocomplete_addressbooks'] = array('sql', 'People');
With the above config an address in 'sql' will always appear on the auto-complete list of 15, but at the bottom of the list. When I switch
the
order of 'sql' and 'People' the address from 'sql' won't appear until
every
address in 'People' is excluded.
Thus it appears to be working partially correctly. It searches
correctly
making sure if the address is in 'sql' it will always be on the auto-complete list, but it always shows up at the bottom of the list
rather
than the top, which not the desired behavior. An address book which is configured to be searched first should also be displayed first.
What am I doing wrong? Or is this a RC issue? I've searched any can't find any tickets on this issue.
Thanks,
--
I can't speak to whether your issue is correctable or not, but I can say that I've implemented our similar address books a bit differently to get around things like this.
We have personal books set to 'sql', and a medium-large (~2000 users) LDAP book named Global. I have only the sql book in the autocomplete config, and added the Global book to the compose_addressbook plugin, which adds an addressbook button to the compose window/page. In this way, autocomplete ONLY pulls from the personal SQL, but anyone in the Global book can be looked up and added easily as needed.
Thanks for the tip Arne. Will someone comment on whether they are experiencing the same behavior? I want to make sure it isn't something unique to me before I go digging through code.
To clarify here is my observed behavior with auto-complete:
Autocomplete search order set to 'sql', 'LDAP' in main.inc.php
auto-complete box +---------------+ |entry from LDAP| |entry from LDAP| |entry from LDAP| |entry from LDAP| |entry from LDAP| |entry from LDAP| |entry from sql | |entry from sql | +---------------+
There could be 100 matching results in 'LDAP' so it is searching 'sql' first because the 'sql' results always appear in the top 15, but they are at the bottom rather than the top.
-ry
On Wed, 10 Mar 2010 08:15:48 -0800, Arne Berglund wrote:
We have personal books set to 'sql', and a medium-large (~2000 users)
LDAP
book named Global. I have only the sql book in the autocomplete config,
and
added the Global book to the compose_addressbook plugin, which adds an addressbook button to the compose window/page. In this way, autocomplete ONLY pulls from the personal SQL, but anyone in the Global book can be looked up and added easily as needed.
On Thu, 11 Mar 2010 09:47:40 -0600, Ryan Horrisberger rhorrisb@ssc.wisc.edu wrote:
Thanks for the tip Arne. Will someone comment on whether they are experiencing the same behavior? I want to make sure it isn't something unique to me before I go digging through code.
To clarify here is my observed behavior with auto-complete:
Autocomplete search order set to 'sql', 'LDAP' in main.inc.php
auto-complete box +---------------+ |entry from LDAP| |entry from LDAP| |entry from LDAP| |entry from LDAP| |entry from LDAP| |entry from LDAP| |entry from sql | |entry from sql | +---------------+
There could be 100 matching results in 'LDAP' so it is searching 'sql' first because the 'sql' results always appear in the top 15, but they
are
at the bottom rather than the top.
-ry
I reset my autocomplete to match yours, and my behavior is quite different. My entries are sorted alphabetically by first name then last. If I have an SQL entry that is also in the LDAP book, it is listed twice, one right after the other.
However, I must confess that I have made a couple of changes to my auto-complete search and display params. So my results may not be applicable.
-- Arne Berglund System Administrator, Internet Services Lane Education Service District Eugene, OR ______________
List info: http://lists.roundcube.net/users/
On Thu, 11 Mar 2010 08:16:45 -0800, Arne Berglund wrote:
I reset my autocomplete to match yours, and my behavior is quite different. My entries are sorted alphabetically by first name then last.
If
I have an SQL entry that is also in the LDAP book, it is listed twice,
one
right after the other.
Thank again Arne! I setup a fresh install and my results matched yours, with results sorted by 'display name' attribute (normally the same as firstname, lastname).
I wonder then, what the point of the 'ordered' component of $rcmail_config['autocomplete_addressbooks'] is? Maybe it's time for a plugin that mirrors Mail.app and Thunderbird's behavior in this regard.
-ry
On Thu, 11 Mar 2010 10:38:20 -0600, Ryan Horrisberger rhorrisb@ssc.wisc.edu wrote:
On Thu, 11 Mar 2010 08:16:45 -0800, Arne Berglund wrote:
I reset my autocomplete to match yours, and my behavior is quite different. My entries are sorted alphabetically by first name then
last.
If
I have an SQL entry that is also in the LDAP book, it is listed twice,
one
right after the other.
Thank again Arne! I setup a fresh install and my results matched yours, with results sorted by 'display name' attribute (normally the same as firstname, lastname).
I wonder then, what the point of the 'ordered' component of $rcmail_config['autocomplete_addressbooks'] is? Maybe it's time for a plugin that mirrors Mail.app and Thunderbird's behavior in this regard.
-ry
I don't know why the order would be important in that config.
The changes I made to my autocomplete settings were to attempt to make the behavior more like that of other clients. I did two things. The first was to make it look for pattern match only from the beginning of a search string. That way a search for 'ran' only returns RANdy and RANdall, not bRANdi, bertRANd or bRANdenburg.
The other change is that by default, autocomplete searches for matches in the email address and the display name. I changed mine so that it searches both first and last names instead of the display name.
I should note that while these changes work fine in the SQL autocomplete, LDAP ignores them and still looks for pattern matches anywhere in the stringe, and only in email and display names. I haven't found where to make LDAP autocomplete mimic what I've done for the SQL book. This is another reason I went with the compose_addressbook plugin with the LDAP book, and limited autocomplete to SQL.
On Mar 11, 2010, at 10:58 AM, Arne Berglund wrote:
I don't know why the order would be important in that config.
Me either, but the comment description of $rcmail_config['autocomplete_addressbooks'] says 'An ordered array of the ids of the addressbooks that should be searched'
The changes I made to my autocomplete settings were to attempt to make the behavior more like that of other clients. I did two things. The first was to make it look for pattern match only from the beginning of a search string. That way a search for 'ran' only returns RANdy and RANdall, not bRANdi, bertRANd or bRANdenburg.
Would you mind sharing those changes with the list? I am very interested in making this change as well and I'd bet lots of users would like to benefit from your work which mimics more what they are used to coming from other mail clients
thanks,
Ryan
-- Ryan Horrisberger Software Developer
List info: http://lists.roundcube.net/users/
On Wed, 17 Mar 2010 15:12:46 -0500, Ryan Horrisberger rhorrisb@ssc.wisc.edu wrote:
On Mar 11, 2010, at 10:58 AM, Arne Berglund wrote:
I don't know why the order would be important in that config.
Me either, but the comment description of $rcmail_config['autocomplete_addressbooks'] says 'An ordered array of the ids of the addressbooks that should be
searched'
The changes I made to my autocomplete settings were to attempt to make the behavior more like that of other clients. I did two things. The first
was
to make it look for pattern match only from the beginning of a search string. That way a search for 'ran' only returns RANdy and RANdall, not bRANdi, bertRANd or bRANdenburg.
Would you mind sharing those changes with the list? I am very
interested
in making this change as well and I'd bet lots of users would like to benefit from your work which mimics more what they are used to coming
from
other mail clients
thanks,
Ryan
See http://www.roundcubeforum.net/5-release-support/16-requests/5693-address-aut...
-- Arne Berglund System Administrator, Internet Services Lane Education Service District Eugene, OR ______________
List info: http://lists.roundcube.net/users/
On Mar 11, 2010, at 10:58 AM, Arne Berglund wrote:
I haven't found where to make LDAP autocomplete mimic what I've done for the SQL book.
Here is a simple patch to prevent LDAP auto-complete from doing leading wildcard searches. eg
a search for 'ran' only returns RANdy and RANdall, not bRANdi, bertRANd or bRANdenburg. This will
mimic the results of popular email clients like, mail.app, thunderbird, gmail, outlook, and others. I also recommend
the change offered by aberglund to patch your SQL addressbook:
http://www.roundcubeforum.net/5-release-support/16-requests/5693-address-aut...
in [RC root]/program/include/
--- rcube_ldap.php.orig 2010-03-17 15:48:38.000000000 -0500 +++ rcube_ldap.php 2010-03-17 15:50:26.000000000 -0500 @@ -325,13 +325,13 @@ if (is_array($this->prop['search_fields'])) { foreach ($this->prop['search_fields'] as $k => $field)
$filter .= "($field=$wc" . rcube_ldap::quote_string($value) . "$wc)";
$filter .= "($field=" . rcube_ldap::quote_string($value) . "$wc)";
}
else
{
foreach ((array)$fields as $field)
if ($f = $this->_map_field($field)) $filter .= "($f=$wc" . rcube_ldap::quote_string($value) . "$wc)";
$filter .= "($f=" . rcube_ldap::quote_string($value) . "$wc)";
}
$filter .= ')';--ryan
-- Ryan Horrisberger Software Developer
List info: http://lists.roundcube.net/users/
On Fri, 19 Mar 2010 10:08:51 -0500, Ryan Horrisberger rhorrisb@ssc.wisc.edu wrote:
Here is a simple patch to prevent LDAP auto-complete from doing leading wildcard searches. eg a search for 'ran' only returns RANdy and RANdall, not bRANdi, bertRANd
or
bRANdenburg. This will mimic the results of popular email clients like, mail.app, thunderbird, gmail, outlook, and others. I also recommend the change offered by aberglund to patch your SQL addressbook:
http://www.roundcubeforum.net/5-release-support/16-requests/5693-address-aut...
in [RC root]/program/include/
--- rcube_ldap.php.orig 2010-03-17 15:48:38.000000000 -0500 +++ rcube_ldap.php 2010-03-17 15:50:26.000000000 -0500 @@ -325,13 +325,13 @@ if (is_array($this->prop['search_fields'])) { foreach ($this->prop['search_fields'] as $k => $field)
$filter .= "($field=$wc" . rcube_ldap::quote_string($value) .
"$wc)";
$filter .= "($field=" . rcube_ldap::quote_string($value) .
"$wc)";
} else { foreach ((array)$fields as $field) if ($f = $this->_map_field($field))
$filter .= "($f=$wc" . rcube_ldap::quote_string($value) .
"$wc)";
$filter .= "($f=" . rcube_ldap::quote_string($value) .
"$wc)";
} $filter .= ')';
Great work, Ryan. Works perfectly. Thanks for sharing!
-- Arne Berglund System Administrator, Internet Services Lane Education Service District Eugene, OR ______________
List info: http://lists.roundcube.net/users/