Changeset 5967 in subversion


Ignore:
Timestamp:
Mar 5, 2012 2:59:07 PM (15 months ago)
Author:
alec
Message:
Location:
branches/release-0.7
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/release-0.7/CHANGELOG

    r5961 r5967  
    22=========================== 
    33 
     4- Fix duplicate names handling in addressbook searches (#1488375) 
    45- Fix displaying of HTML messages from Disqus (#1488372) 
    56- Disable E_STRICT warnings on PHP 5.4 
  • branches/release-0.7/program/steps/addressbook/delete.inc

    r4951 r5967  
    7070// update saved search after data changed 
    7171if (($search_request = $_REQUEST['_search']) && isset($_SESSION['search'][$search_request])) { 
     72    $sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name'); 
    7273    $search  = (array)$_SESSION['search'][$search_request]; 
    7374    $records = array(); 
     
    9293        while ($row = $result->next()) { 
    9394            $row['sourceid'] = $s; 
    94             $key = $row['name'] . ':' . $row['sourceid']; 
     95            $key = rcmail_contact_key($row, $sort_col); 
    9596            $records[$key] = $row; 
    9697        } 
  • branches/release-0.7/program/steps/addressbook/export.inc

    r5274 r5967  
    2525if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search']])) 
    2626{ 
     27    $sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name'); 
    2728    $search  = (array)$_SESSION['search'][$_REQUEST['_search']]; 
    2829    $records = array(); 
     
    4243        while ($row = $result->next()) { 
    4344            $row['sourceid'] = $s; 
    44             $key = $row['name'] . ':' . $row['sourceid']; 
     45            $key = rcmail_contact_key($row, $sort_col); 
    4546            $records[$key] = $row; 
    4647        } 
  • branches/release-0.7/program/steps/addressbook/func.inc

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

    r5872 r5967  
    4848        while ($row = $result->next()) { 
    4949            $row['sourceid'] = $s; 
    50             $key = $row[$sort_col] . ':' . $row['sourceid']; 
     50            $key = rcmail_contact_key($row, $sort_col); 
    5151            $records[$key] = $row; 
    5252        } 
  • branches/release-0.7/program/steps/addressbook/search.inc

    r5681 r5967  
    145145    $search_set = array(); 
    146146    $records    = array(); 
     147    $sort_col   = $RCMAIL->config->get('addressbook_sort_col', 'name'); 
    147148 
    148149    foreach ($sources as $s) { 
     
    183184        while ($row = $result->next()) { 
    184185            $row['sourceid'] = $s['id']; 
    185             $key = $row['name'] . ':' . $row['sourceid']; 
     186            $key = rcmail_contact_key($row, $sort_col); 
    186187            $records[$key] = $row; 
    187188        } 
  • branches/release-0.7/program/steps/addressbook/undo.inc

    r4916 r5967  
    6666        } 
    6767 
    68         while ($row = $result->next()) { 
    69             $row['sourceid'] = $s; 
    70             $key = $row['name'] . ':' . $row['sourceid']; 
    71             $records[$key] = $row; 
    72         } 
    73         unset($result); 
    74  
    7568        $search[$s] = $source->get_search_set(); 
    7669    } 
Note: See TracChangeset for help on using the changeset viewer.