If ordering contacts by a numeric field (last modified), apply letter filter to org name instead of ordered field

This commit is contained in:
Nathan Gray 2011-06-06 16:41:17 +00:00
parent 42af223052
commit 22426b6bd6

View File

@ -1232,7 +1232,8 @@ class addressbook_ui extends addressbook_bo
}
if ($query['searchletter']) // only show contacts if the order-criteria starts with the given letter
{
$query['col_filter'][] = ($query['order'] == 'adr_one_postalcode' ? 'org_name' : (substr($query['order'],0,1)=='#'?'':'egw_addressbook.').$query['order']).' '.
$no_letter_search = array('adr_one_postalcode', 'adr_two_postalcode', 'contact_id', 'contact_created','contact_modified');
$query['col_filter'][] = (in_array($query['order'],$no_letter_search) ? 'org_name' : (substr($query['order'],0,1)=='#'?'':'egw_addressbook.').$query['order']).' '.
$GLOBALS['egw']->db->capabilities['case_insensitive_like'].' '.$GLOBALS['egw']->db->quote($query['searchletter'].'%');
}
$wildcard = '%';