[Svn] r3367 - in trunk/roundcubemail: . bin config plugins/password program/include program/js program/lib program/localization/de_CH program/localization/en_US program/localization/pl_PL program/steps/mail program/steps/settings skins/default skins/default/images skins/default/images/icons skins/default/includes skins/default/templates

trac at roundcube.net trac at roundcube.net
Wed Mar 17 13:24:09 CET 2010


Author: thomasb
Date: 2010-03-17 07:24:09 -0500 (Wed, 17 Mar 2010)
New Revision: 3367

Added:
   trunk/roundcubemail/THREADS
   trunk/roundcubemail/skins/default/images/icons/columnpicker.gif
   trunk/roundcubemail/skins/default/images/icons/unread_children.png
Modified:
   trunk/roundcubemail/
   trunk/roundcubemail/CHANGELOG
   trunk/roundcubemail/bin/msgexport.sh
   trunk/roundcubemail/config/main.inc.php.dist
   trunk/roundcubemail/index.php
   trunk/roundcubemail/plugins/password/config.inc.php.dist
   trunk/roundcubemail/program/include/html.php
   trunk/roundcubemail/program/include/rcmail.php
   trunk/roundcubemail/program/include/rcube_imap.php
   trunk/roundcubemail/program/include/rcube_shared.inc
   trunk/roundcubemail/program/include/rcube_user.php
   trunk/roundcubemail/program/js/app.js
   trunk/roundcubemail/program/js/common.js
   trunk/roundcubemail/program/js/list.js
   trunk/roundcubemail/program/lib/imap.inc
   trunk/roundcubemail/program/localization/de_CH/labels.inc
   trunk/roundcubemail/program/localization/en_US/labels.inc
   trunk/roundcubemail/program/localization/pl_PL/labels.inc
   trunk/roundcubemail/program/steps/mail/check_recent.inc
   trunk/roundcubemail/program/steps/mail/func.inc
   trunk/roundcubemail/program/steps/mail/list.inc
   trunk/roundcubemail/program/steps/mail/mark.inc
   trunk/roundcubemail/program/steps/mail/move_del.inc
   trunk/roundcubemail/program/steps/mail/search.inc
   trunk/roundcubemail/program/steps/mail/show.inc
   trunk/roundcubemail/program/steps/mail/viewsource.inc
   trunk/roundcubemail/program/steps/settings/func.inc
   trunk/roundcubemail/program/steps/settings/manage_folders.inc
   trunk/roundcubemail/program/steps/settings/save_prefs.inc
   trunk/roundcubemail/skins/default/common.css
   trunk/roundcubemail/skins/default/functions.js
   trunk/roundcubemail/skins/default/ie6hacks.css
   trunk/roundcubemail/skins/default/iehacks.css
   trunk/roundcubemail/skins/default/images/mail_footer.png
   trunk/roundcubemail/skins/default/images/messageactions.gif
   trunk/roundcubemail/skins/default/images/messageactions.png
   trunk/roundcubemail/skins/default/includes/messagemenu.html
   trunk/roundcubemail/skins/default/mail.css
   trunk/roundcubemail/skins/default/templates/mail.html
Log:
Merged devel-threads branch (r3066:3364) back into trunk


Property changes on: trunk/roundcubemail
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/devel-threads:3067-3364

Modified: trunk/roundcubemail/CHANGELOG
===================================================================
--- trunk/roundcubemail/CHANGELOG	2010-03-17 11:20:27 UTC (rev 3366)
+++ trunk/roundcubemail/CHANGELOG	2010-03-17 12:24:09 UTC (rev 3367)
@@ -1,6 +1,10 @@
 CHANGELOG RoundCube Webmail
 ===========================
 
+- Threaded message listing now available
+- Added sorting by ARRIVAL and CC
+- Message list columns configurable by the user
+- Removed 'index_sort' option, now we're using empty 'message_sort_col' for this
 - virtuser_query: support other identity data (#1486148)
 - Options virtuser_* replaced with virtuser_* plugins
 - Plugin API: Implemented 'email2user' and 'user2email' hooks

Copied: trunk/roundcubemail/THREADS (from rev 3364, branches/devel-threads/THREADS)
===================================================================
--- trunk/roundcubemail/THREADS	                        (rev 0)
+++ trunk/roundcubemail/THREADS	2010-03-17 12:24:09 UTC (rev 3367)
@@ -0,0 +1,43 @@
+CHANGES IN RELATION TO ORIGINAL PATCH
+    - don't add nested messages into selection on collapse if parent message
+      is in selection
+    - some changes in messages highlighting
+    - re-written all changes in rcube_imap.php
+    - temporary removed threads caching (see TODO)
+    - use depth=0 for roots
+    - thread expand state is not stored anywhere
+    - removed imap_thread_algorithm option, we're using the best algorithm
+      supported by server and implement REFS sorting in Roundcube
+    - use underlined subject for root with unread children (icon is still supported)
+    - on deleting messages the whole list isn't refreshed
+    - added 'expand unread' button
+
+TODO (must have):
+    - threads caching
+    - updating threaded message list on message delete
+    - don't reload messages list on check_recent
+
+TODO (other):
+    - performance: fetching all messages for list in "expand all" state only,
+      if "expand all" is disabled we should fetch only root messages and fetch
+      children on-demand (on expand button click),
+      Notice: this is not so simple, because we need to fetch children
+    	      to set "unread_children", but we can fetch only flags instead of
+    	      all headers for each child
+    - button in #listcontrols to mark all messages in current thread (with selected
+      root or child message),
+    + thread tree icons
+    + thread css: message row height, thread/status icon alignment
+      (change size of all list icons to 14x14)
+    - remove 'indexsort' label from localization files
+
+TODO (by the way):
+    - use jQuery.inArray instead of find_in_array() (common.js)
+    + use only one function (js) to generate messages list
+
+KNOWN ISSUES:
+    - on new message (check_recent) the whole list is reloaded
+    + table header replacement doesn't work on IE
+    - css issues on IE6
+    + css issues on IE7
+

Modified: trunk/roundcubemail/bin/msgexport.sh
===================================================================
--- trunk/roundcubemail/bin/msgexport.sh	2010-03-17 11:20:27 UTC (rev 3366)
+++ trunk/roundcubemail/bin/msgexport.sh	2010-03-17 12:24:09 UTC (rev 3367)
@@ -89,8 +89,8 @@
 		$from = current($IMAP->decode_address_list($headers->from, 1, false));
 		
 		fwrite($out, sprintf("From %s %s UID %d\n", $from['mailto'], $headers->date, $headers->uid));
-		fwrite($out, iil_C_FetchPartHeader($IMAP->conn, $IMAP->mailbox, $i, null));
-		fwrite($out, iil_C_HandlePartBody($IMAP->conn, $IMAP->mailbox, $i, null, 1));
+		fwrite($out, iil_C_FetchPartHeader($IMAP->conn, $mbox, $i, null));
+		fwrite($out, iil_C_HandlePartBody($IMAP->conn, $mbox, $i, null, 1));
 		fwrite($out, "\n\n\n");
 		
 		progress_update($i, $count);

Modified: trunk/roundcubemail/config/main.inc.php.dist
===================================================================
--- trunk/roundcubemail/config/main.inc.php.dist	2010-03-17 11:20:27 UTC (rev 3366)
+++ trunk/roundcubemail/config/main.inc.php.dist	2010-03-17 12:24:09 UTC (rev 3367)
@@ -232,10 +232,11 @@
 // USER INTERFACE
 // ----------------------------------
 
-// default sort col
-$rcmail_config['message_sort_col'] = 'date';
+// default messages sort column. Use empty value for default server's sorting, 
+// or 'arrival', 'date', 'subject', 'from', 'to', 'size', 'cc'
+$rcmail_config['message_sort_col'] = '';
 
-// default sort order
+// default messages sort order
 $rcmail_config['message_sort_order'] = 'DESC';
 
 // These cols are shown in the message list. Available cols are:
@@ -461,8 +462,10 @@
 // If true, after message delete/move, the next message will be displayed
 $rcmail_config['display_next'] = false;
 
-// If true, messages list will be sorted by message index instead of message date
-$rcmail_config['index_sort'] = true;
+// 0 - Do not expand threads 
+// 1 - Expand all threads automatically 
+// 2 - Expand only threads with unread messages 
+$rcmail_config['autoexpand_threads'] = 0;
 
 // When replying place cursor above original message (top posting)
 $rcmail_config['top_posting'] = false;

Modified: trunk/roundcubemail/index.php
===================================================================
--- trunk/roundcubemail/index.php	2010-03-17 11:20:27 UTC (rev 3366)
+++ trunk/roundcubemail/index.php	2010-03-17 12:24:09 UTC (rev 3367)
@@ -226,6 +226,8 @@
     'delete-folder' => 'manage_folders.inc',
     'subscribe'     => 'manage_folders.inc',
     'unsubscribe'   => 'manage_folders.inc',
+    'enable-threading'  => 'manage_folders.inc',
+    'disable-threading' => 'manage_folders.inc',
     'add-identity'  => 'edit_identity.inc',
   )
 );


Property changes on: trunk/roundcubemail/plugins/password/config.inc.php.dist
___________________________________________________________________
Deleted: svn:mergeinfo
   - 

Modified: trunk/roundcubemail/program/include/html.php
===================================================================
--- trunk/roundcubemail/program/include/html.php	2010-03-17 11:20:27 UTC (rev 3366)
+++ trunk/roundcubemail/program/include/html.php	2010-03-17 12:24:09 UTC (rev 3367)
@@ -5,7 +5,7 @@
  | program/include/html.php                                              |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005-2009, RoundCube Dev, - Switzerland                 |
+ | Copyright (C) 2005-2010, RoundCube Dev, - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -34,8 +34,7 @@
 
     public static $lc_tags = true;
     public static $common_attrib = array('id','class','style','title','align');
-    public static $containers = array('iframe','div','span','p','h1','h2','h3',
-	'form','textarea','table','tr','th','td','style','script');
+    public static $containers = array('iframe','div','span','p','h1','h2','h3','form','textarea','table','thead','tbody','tr','th','td','style','script');
 
     /**
      * Constructor

Modified: trunk/roundcubemail/program/include/rcmail.php
===================================================================
--- trunk/roundcubemail/program/include/rcmail.php	2010-03-17 11:20:27 UTC (rev 3366)
+++ trunk/roundcubemail/program/include/rcmail.php	2010-03-17 12:24:09 UTC (rev 3367)
@@ -410,7 +410,6 @@
     $this->imap = new rcube_imap($this->db);
     $this->imap->debug_level = $this->config->get('debug_level');
     $this->imap->skip_deleted = $this->config->get('skip_deleted');
-    $this->imap->index_sort = $this->config->get('index_sort', true);
 
     // enable caching of imap data
     if ($this->config->get('enable_caching')) {

Modified: trunk/roundcubemail/program/include/rcube_imap.php
===================================================================
--- trunk/roundcubemail/program/include/rcube_imap.php	2010-03-17 11:20:27 UTC (rev 3366)
+++ trunk/roundcubemail/program/include/rcube_imap.php	2010-03-17 12:24:09 UTC (rev 3367)
@@ -5,7 +5,7 @@
  | program/include/rcube_imap.php                                        |
  |                                                                       |
  | This file is part of the RoundCube Webmail client                     |
- | Copyright (C) 2005-2009, RoundCube Dev. - Switzerland                 |
+ | Copyright (C) 2005-2010, RoundCube Dev. - Switzerland                 |
  | Licensed under the GNU GPL                                            |
  |                                                                       |
  | PURPOSE:                                                              |
@@ -41,35 +41,40 @@
  */
 class rcube_imap
 {
-  var $db;
-  var $conn;
-  var $root_dir = '';
-  var $mailbox = 'INBOX';
-  var $list_page = 1;
-  var $page_size = 10;
-  var $sort_field = 'date';
-  var $sort_order = 'DESC';
-  var $index_sort = true;
-  var $delimiter = NULL;
-  var $caching_enabled = FALSE;
-  var $default_charset = 'ISO-8859-1';
-  var $struct_charset = NULL;
-  var $default_folders = array('INBOX');
-  var $fetch_add_headers = '';
-  var $cache = array();
-  var $cache_keys = array();  
-  var $cache_changes = array();
-  var $uid_id_map = array();
-  var $msg_headers = array();
-  var $skip_deleted = FALSE;
-  var $search_set = NULL;
-  var $search_string = '';
-  var $search_charset = '';
-  var $search_sort_field = '';  
-  var $debug_level = 1;
-  var $error_code = 0;
-  var $options = array('auth_method' => 'check');
-  
+  public $debug_level = 1;
+  public $error_code = 0;
+  public $skip_deleted = false;
+  public $root_dir = '';
+  public $page_size = 10;
+  public $list_page = 1;
+  public $delimiter = NULL;
+  public $threading = false;
+  public $fetch_add_headers = '';
+  public $conn;
+
+  private $db;
+  private $root_ns = '';
+  private $mailbox = 'INBOX';
+  private $sort_field = '';
+  private $sort_order = 'DESC';
+  private $caching_enabled = false;
+  private $default_charset = 'ISO-8859-1';
+  private $struct_charset = NULL;
+  private $default_folders = array('INBOX');
+  private $default_folders_lc = array('inbox');
+  private $icache = array();
+  private $cache = array();
+  private $cache_keys = array();  
+  private $cache_changes = array();
+  private $uid_id_map = array();
+  private $msg_headers = array();
+  public  $search_set = NULL;
+  public  $search_string = '';
+  private $search_charset = '';
+  private $search_sort_field = '';
+  private $search_threads = false;
+  private $db_header_fields = array('idx', 'uid', 'subject', 'from', 'to', 'cc', 'date', 'size');
+  private $options = array('auth_method' => 'check');
   private $host, $user, $pass, $port, $ssl;
 
 
@@ -299,17 +304,18 @@
    * @param  string  Charset of search string
    * @param  string  Sorting field
    */
-  function set_search_set($str=null, $msgs=null, $charset=null, $sort_field=null)
+  function set_search_se