Changeset 0203f16 in github


Ignore:
Timestamp:
Mar 5, 2012 2:56:17 PM (15 months ago)
Author:
alecpl <alec@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.8
Children:
4da69b9
Parents:
377bc60
Message:
  • Fix duplicate names handling in addressbook searches (#1488375)
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • CHANGELOG

    r6205a30 r0203f16  
    22=========================== 
    33 
     4- Fix duplicate names handling in addressbook searches (#1488375) 
    45- Fix displaying HTML messages from Disqus (#1488372) 
    56- Exclude E_STRICT from error_reporting for PHP 5.4 
  • program/steps/addressbook/delete.inc

    r7fe3811 r0203f16  
    7373// update saved search after data changed 
    7474if (($search_request = $_REQUEST['_search']) && isset($_SESSION['search'][$search_request])) { 
     75    $sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name'); 
    7576    $search  = (array)$_SESSION['search'][$search_request]; 
    7677    $records = array(); 
     
    9596        while ($row = $result->next()) { 
    9697            $row['sourceid'] = $s; 
    97             $key = $row['name'] . ':' . $row['sourceid']; 
     98            $key = rcmail_contact_key($row, $sort_col); 
    9899            $records[$key] = $row; 
    99100        } 
  • program/steps/addressbook/export.inc

    r7fe3811 r0203f16  
    2828if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) 
    2929{ 
     30    $sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name'); 
    3031    $search  = (array)$_SESSION['search'][$_REQUEST['_search']]; 
    3132    $records = array(); 
     
    4546        while ($row = $result->next()) { 
    4647            $row['sourceid'] = $s; 
    47             $key = $row['name'] . ':' . $row['sourceid']; 
     48            $key = rcmail_contact_key($row, $sort_col); 
    4849            $records[$key] = $row; 
    4950        } 
  • program/steps/addressbook/func.inc

    rf9a9677 r0203f16  
    730730 
    731731 
     732function rcmail_contact_key($row, $sort_col) 
     733{ 
     734    $key = $row[$sort_col] . ':' . $row['sourceid']; 
     735 
     736    // add email to a key to not skip contacts with the same name (#1488375) 
     737    if (!empty($row['email'])) { 
     738         if (is_array($row['email'])) { 
     739             $key .= ':' . implode(':', $row['email']); 
     740         } 
     741         else { 
     742             $key .= ':' . $row['email']; 
     743         } 
     744     } 
     745 
     746     return $key; 
     747} 
     748 
     749 
    732750/** 
    733751 * Returns contact ID(s) and source(s) from GET/POST data 
  • program/steps/addressbook/list.inc

    r4387537 r0203f16  
    5151        while ($row = $result->next()) { 
    5252            $row['sourceid'] = $s; 
    53             $key = $row[$sort_col] . ':' . $row['sourceid']; 
     53            $key = rcmail_contact_key($row, $sort_col); 
    5454            $records[$key] = $row; 
    5555        } 
  • program/steps/addressbook/search.inc

    r7fe3811 r0203f16  
    148148    $search_set = array(); 
    149149    $records    = array(); 
     150    $sort_col   = $RCMAIL->config->get('addressbook_sort_col', 'name'); 
    150151 
    151152    foreach ($sources as $s) { 
     
    186187        while ($row = $result->next()) { 
    187188            $row['sourceid'] = $s['id']; 
    188             $key = $row['name'] . ':' . $row['sourceid']; 
     189            $key = rcmail_contact_key($row, $sort_col); 
    189190            $records[$key] = $row; 
    190191        } 
  • program/steps/addressbook/undo.inc

    r7fe3811 r0203f16  
    6969        } 
    7070 
    71         while ($row = $result->next()) { 
    72             $row['sourceid'] = $s; 
    73             $key = $row['name'] . ':' . $row['sourceid']; 
    74             $records[$key] = $row; 
    75         } 
    76         unset($result); 
    77  
    7871        $search[$s] = $source->get_search_set(); 
    7972    } 
Note: See TracChangeset for help on using the changeset viewer.