- Fix duplicate names handling in addressbook searches (#1488375)
| | |
| | | CHANGELOG Roundcube Webmail |
| | | =========================== |
| | | |
| | | - Fix duplicate names handling in addressbook searches (#1488375) |
| | | - Fix displaying HTML messages from Disqus (#1488372) |
| | | - Exclude E_STRICT from error_reporting for PHP 5.4 |
| | | - Copy all skins in installto script (#1488376) |
| | |
| | | |
| | | // update saved search after data changed |
| | | if (($search_request = $_REQUEST['_search']) && isset($_SESSION['search'][$search_request])) { |
| | | $sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name'); |
| | | $search = (array)$_SESSION['search'][$search_request]; |
| | | $records = array(); |
| | | |
| | |
| | | |
| | | while ($row = $result->next()) { |
| | | $row['sourceid'] = $s; |
| | | $key = $row['name'] . ':' . $row['sourceid']; |
| | | $key = rcmail_contact_key($row, $sort_col); |
| | | $records[$key] = $row; |
| | | } |
| | | unset($result); |
| | |
| | | // Use search result |
| | | if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) |
| | | { |
| | | $sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name'); |
| | | $search = (array)$_SESSION['search'][$_REQUEST['_search']]; |
| | | $records = array(); |
| | | |
| | |
| | | |
| | | while ($row = $result->next()) { |
| | | $row['sourceid'] = $s; |
| | | $key = $row['name'] . ':' . $row['sourceid']; |
| | | $key = rcmail_contact_key($row, $sort_col); |
| | | $records[$key] = $row; |
| | | } |
| | | unset($result); |
| | |
| | | } |
| | | |
| | | |
| | | function rcmail_contact_key($row, $sort_col) |
| | | { |
| | | $key = $row[$sort_col] . ':' . $row['sourceid']; |
| | | |
| | | // add email to a key to not skip contacts with the same name (#1488375) |
| | | if (!empty($row['email'])) { |
| | | if (is_array($row['email'])) { |
| | | $key .= ':' . implode(':', $row['email']); |
| | | } |
| | | else { |
| | | $key .= ':' . $row['email']; |
| | | } |
| | | } |
| | | |
| | | return $key; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Returns contact ID(s) and source(s) from GET/POST data |
| | | * |
| | |
| | | |
| | | while ($row = $result->next()) { |
| | | $row['sourceid'] = $s; |
| | | $key = $row[$sort_col] . ':' . $row['sourceid']; |
| | | $key = rcmail_contact_key($row, $sort_col); |
| | | $records[$key] = $row; |
| | | } |
| | | unset($result); |
| | |
| | | $sources = $RCMAIL->get_address_sources(); |
| | | $search_set = array(); |
| | | $records = array(); |
| | | $sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name'); |
| | | |
| | | foreach ($sources as $s) { |
| | | $source = $RCMAIL->get_address_book($s['id']); |
| | |
| | | |
| | | while ($row = $result->next()) { |
| | | $row['sourceid'] = $s['id']; |
| | | $key = $row['name'] . ':' . $row['sourceid']; |
| | | $key = rcmail_contact_key($row, $sort_col); |
| | | $records[$key] = $row; |
| | | } |
| | | |
| | |
| | | continue; |
| | | } |
| | | |
| | | while ($row = $result->next()) { |
| | | $row['sourceid'] = $s; |
| | | $key = $row['name'] . ':' . $row['sourceid']; |
| | | $records[$key] = $row; |
| | | } |
| | | unset($result); |
| | | |
| | | $search[$s] = $source->get_search_set(); |
| | | } |
| | | |