Changeset baecd8b in github


Ignore:
Timestamp:
Jul 26, 2012 11:18:38 AM (10 months ago)
Author:
Thomas Bruederli <thomas@…>
Children:
750fcf8, c40419b
Parents:
5bc1233
Message:

Move the hard-coded list of fields used to list contacts to a central location

Location:
program
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_config.php

    r740875e rbaecd8b  
    5050    { 
    5151        $this->load(); 
     52 
     53        // Defaults, that we do not require you to configure, 
     54        // but contain information that is used in various 
     55        // locations in the code: 
     56        $this->set('contactlist_fields', array('name', 'firstname', 'surname', 'email')); 
    5257    } 
    5358 
  • program/include/rcube_ldap.php

    r5bc1233 rbaecd8b  
    768768 
    769769        // use VLV pseudo-search for autocompletion 
    770         if ($this->prop['vlv_search'] && $this->conn && join(',', (array)$fields) == 'name,firstname,surname,email') 
     770        $rcmail = rcmail::get_instance(); 
     771 
     772        if ($this->prop['vlv_search'] && $this->conn && join(',', (array)$fields) == join(',', $rcmail->config->get('contactlist_fields'))) 
    771773        { 
    772774            // add general filter to query 
  • program/steps/addressbook/delete.inc

    r041c93c rbaecd8b  
    7171if (($search_request = $_REQUEST['_search']) && isset($_SESSION['search'][$search_request])) { 
    7272    $sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name'); 
     73    $afields = $RCMAIL->config->get('contactlist_fields'); 
    7374    $search  = (array)$_SESSION['search'][$search_request]; 
    7475    $records = array(); 
     
    8485 
    8586        // get records 
    86         $result = $source->list_records(array('name', 'firstname', 'surname', 'email')); 
     87        $result = $source->list_records($afields); 
    8788 
    8889        if (!$result->count) { 
  • program/steps/addressbook/list.inc

    r041c93c rbaecd8b  
    1919 +-----------------------------------------------------------------------+ 
    2020*/ 
     21 
     22$afields = $RCMAIL->config->get('contactlist_fields'); 
    2123 
    2224// Use search result 
     
    4446 
    4547        // get records 
    46         $result = $source->list_records(array('name', 'firstname', 'surname', 'email')); 
     48        $result = $source->list_records($afields); 
    4749 
    4850        while ($row = $result->next()) { 
     
    7476 
    7577    // get contacts for this user 
    76     $result = $CONTACTS->list_records(array('name', 'firstname', 'surname', 'email')); 
     78    $result = $CONTACTS->list_records($afields); 
    7779 
    7880    if (!$result->count && $result->searchonly) { 
  • program/steps/addressbook/search.inc

    r041c93c rbaecd8b  
    146146    $records    = array(); 
    147147    $sort_col   = $RCMAIL->config->get('addressbook_sort_col', 'name'); 
     148    $afields = $RCMAIL->config->get('contactlist_fields'); 
    148149 
    149150    foreach ($sources as $s) { 
     
    180181 
    181182        // get records 
    182         $result = $source->list_records(array('name', 'firstname', 'surname', 'email')); 
     183        $result = $source->list_records($afields); 
    183184 
    184185        while ($row = $result->next()) { 
  • program/steps/mail/autocomplete.inc

    r041c93c rbaecd8b  
    2727    $abook->set_group($gid); 
    2828    $abook->set_pagesize(1000);  // TODO: limit number of group members by config 
    29     $result = $abook->list_records(array('name', 'firstname', 'surname', 'email')); 
     29    $result = $abook->list_records($RCMAIL->config->get('contactlist_fields')); 
    3030    while ($result && ($sql_arr = $result->iterate())) { 
    3131      foreach ((array)$sql_arr['email'] as $email) { 
     
    6565    $abook->set_pagesize($MAXNUM); 
    6666 
    67     if ($result = $abook->search(array('name', 'firstname', 'surname', 'email'), $search, $mode, true, true, 'email')) { 
     67    if ($result = $abook->search($RCMAIL->config->get('contactlist_fields'), $search, $mode, true, true, 'email')) { 
    6868      while ($sql_arr = $result->iterate()) { 
    6969        // Contact can have more than one e-mail address 
  • program/steps/mail/list_contacts.inc

    r041c93c rbaecd8b  
    5858    // get contacts for this user 
    5959    $CONTACTS->set_group(0); 
    60     $result = $CONTACTS->list_records(array('name', 'firstname', 'surname', 'email')); 
     60    $afields = $RCMAIL->config->get('contactlist_fields'); 
     61    $result = $CONTACTS->list_records($afields); 
    6162 
    6263    if (!$result->count && $result->searchonly) { 
Note: See TracChangeset for help on using the changeset viewer.