Changeset 3971 in subversion


Ignore:
Timestamp:
Sep 17, 2010 5:14:13 AM (3 years ago)
Author:
alec
Message:
  • Fix list_cols is not updated after column dragging (#1486999)
  • Improved save-pref action and moved to separate file in utils task directory
  • Improved http_post/http_request to support first argument in form 'task/action'
Location:
trunk/roundcubemail
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/roundcubemail/CHANGELOG

    r3969 r3971  
    2424- Fix format=flowed handling (#1486989) 
    2525- Fix when IMAP connection fails in 'get' action session shouldn't be destroyed (#1486995) 
     26- Fix list_cols is not updated after column dragging (#1486999) 
    2627 
    2728RELEASE 0.4 
  • trunk/roundcubemail/index.php

    r3879 r3971  
    185185// handle keep-alive signal 
    186186if ($RCMAIL->action == 'keep-alive') { 
    187   $OUTPUT->reset(); 
    188   $OUTPUT->send(); 
    189 } 
    190 // save preference value 
    191 else if ($RCMAIL->action == 'save-pref') { 
    192   $RCMAIL->user->save_prefs(array(get_input_value('_name', RCUBE_INPUT_POST) => get_input_value('_value', RCUBE_INPUT_POST))); 
    193187  $OUTPUT->reset(); 
    194188  $OUTPUT->send(); 
  • trunk/roundcubemail/program/js/app.js

    r3927 r3971  
    12891289    } 
    12901290 
    1291     this.http_post('save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders)); 
     1291    this.http_post('utils/save-pref', '_name=collapsed_folders&_value='+urlencode(this.env.collapsed_folders)); 
    12921292    this.set_unread_count_display(id, false); 
    12931293  }; 
     
    14601460      this.set_env('subject_col', found); 
    14611461 
    1462     this.http_post('save-pref', { '_name':'list_cols', '_value':this.env.coltypes }); 
     1462    this.http_post('utils/save-pref', { '_name':'list_cols', '_value':this.env.coltypes, '_session':'list_attrib/columns' }); 
    14631463  }; 
    14641464 
     
    48954895  this.http_request = function(action, querystring, lock) 
    48964896  { 
     4897    var url = this.env.comm_path; 
     4898 
     4899    // overwrite task name 
     4900    if (action.match(/([a-z]+)\/([a-z-_]+)/)) { 
     4901      action = RegExp.$2; 
     4902      url = url.replace(/\_task=[a-z]+/, '_task='+RegExp.$1); 
     4903    } 
     4904 
    48974905    // trigger plugin hook 
    48984906    var result = this.triggerEvent('request'+action, querystring); 
     4907 
    48994908    if (typeof result != 'undefined') { 
    49004909      // abort if one the handlers returned false 
     
    49054914    } 
    49064915 
    4907     querystring += (querystring ? '&' : '') + '_remote=1'; 
    4908     var url = this.env.comm_path + '&_action=' + action + '&' + querystring; 
     4916    url += '&_remote=1&_action=' + action + (querystring ? '&' : '') + querystring; 
    49094917 
    49104918    // send request 
     
    49164924  this.http_post = function(action, postdata, lock) 
    49174925  { 
    4918     var url = this.env.comm_path+'&_action=' + action; 
     4926    var url = this.env.comm_path; 
     4927 
     4928    // overwrite task name 
     4929    if (action.match(/([a-z]+)\/([a-z-_]+)/)) { 
     4930      action = RegExp.$2; 
     4931      url = url.replace(/\_task=[a-z]+/, '_task='+RegExp.$1); 
     4932    } 
     4933 
     4934    url += '&_action=' + action; 
    49194935 
    49204936    if (postdata && typeof(postdata) == 'object') { 
  • trunk/roundcubemail/program/steps/mail/func.inc

    r3969 r3971  
    172172    $a_show_cols[$f] = 'to'; 
    173173 
    174   // make sure 'threads' column is present  
     174  // make sure 'threads' and 'subject' columns are present 
     175  if (!in_array('subject', $a_show_cols)) 
     176    array_unshift($a_show_cols, 'subject'); 
    175177  if (!in_array('threads', $a_show_cols)) 
    176178    array_unshift($a_show_cols, 'threads'); 
     
    224226/** 
    225227 * return javascript commands to add rows to the message list 
    226  * or to replace the whole list (IE only) 
    227  */ 
    228 function rcmail_js_message_list($a_headers, $insert_top=FALSE, $head_replace=FALSE) 
     228 */ 
     229function rcmail_js_message_list($a_headers, $insert_top=FALSE, $a_show_cols=null) 
    229230{ 
    230231  global $CONFIG, $IMAP, $RCMAIL, $OUTPUT; 
    231232 
    232   if (!empty($_SESSION['list_attrib']['columns'])) 
    233     $a_show_cols = $_SESSION['list_attrib']['columns']; 
    234   else 
    235     $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject'); 
     233  if (empty($a_show_cols)) { 
     234    if (!empty($_SESSION['list_attrib']['columns'])) 
     235      $a_show_cols = $_SESSION['list_attrib']['columns']; 
     236    else 
     237      $a_show_cols = is_array($CONFIG['list_cols']) ? $CONFIG['list_cols'] : array('subject'); 
     238  } 
     239  else { 
     240    if (!is_array($a_show_cols)) 
     241      $a_show_cols = preg_split('/[\s,;]+/', strip_quotes($a_show_cols)); 
     242    $head_replace = true; 
     243  } 
    236244 
    237245  $mbox = $IMAP->get_mailbox_name(); 
    238246  $delim = $IMAP->get_hierarchy_delimiter(); 
     247 
     248  // make sure 'threads' and 'subject' columns are present 
     249  if (!in_array('subject', $a_show_cols)) 
     250    array_unshift($a_show_cols, 'subject'); 
     251  if (!in_array('threads', $a_show_cols)) 
     252    array_unshift($a_show_cols, 'threads'); 
     253 
     254  $_SESSION['list_attrib']['columns'] = $a_show_cols; 
    239255 
    240256  // show 'to' instead of 'from' in sent/draft messages 
     
    243259    $a_show_cols[$f] = 'to'; 
    244260 
    245   // make sure 'threads' column is present  
    246   if (!in_array('threads', $a_show_cols)) 
    247     array_unshift($a_show_cols, 'threads'); 
     261  // Make sure there are no duplicated columns (#1486999) 
     262  $a_show_cols = array_unique($a_show_cols); 
    248263 
    249264  // Plugins may set header's list_cols/list_flags and other rcube_mail_header variables 
  • trunk/roundcubemail/program/steps/mail/list.inc

    r3780 r3971  
    4949} 
    5050 
    51 if ($save_arr)   
     51if ($save_arr) 
    5252  $RCMAIL->user->save_prefs($save_arr); 
    5353 
     
    8989 
    9090// add message rows 
    91 rcmail_js_message_list($a_headers, FALSE, (bool) $cols); 
     91rcmail_js_message_list($a_headers, FALSE, $cols); 
    9292if (isset($a_headers) && count($a_headers)) 
    9393{ 
Note: See TracChangeset for help on using the changeset viewer.