From f540f86d19ae1d374ba3c78fe11eaf3f771af150 Mon Sep 17 00:00:00 2001 From: Thomas <tb@woodcrest.local> Date: Wed, 09 Oct 2013 06:04:17 -0400 Subject: [PATCH] Prepare message list to display IMAP folder --- program/js/list.js | 14 ++++++++++++++ program/lib/Roundcube/rcube_imap.php | 1 + program/steps/mail/func.inc | 4 +++- program/lib/Roundcube/rcube_message_header.php | 9 +++++++++ program/js/app.js | 4 +++- skins/larry/mail.css | 8 ++++++++ 6 files changed, 38 insertions(+), 2 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index 43ab7be..1d59794 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -5998,8 +5998,10 @@ if ((n = $.inArray('status', this.env.coltypes)) >= 0) this.env.status_col = n; - if (list) + if (list) { + list.hide_column('folder', !(this.env.search_request || this.env.search_id)); list.init_header(); + } }; // replace content of row count display diff --git a/program/js/list.js b/program/js/list.js index 0f8d56c..32e34e0 100644 --- a/program/js/list.js +++ b/program/js/list.js @@ -373,6 +373,20 @@ /** + * Set/unset the given column as hidden + */ +hide_column: function(col, hide) +{ + var method = hide ? 'addClass' : 'removeClass'; + + if (this.fixed_header) + $(this.row_tagname()+' '+this.col_tagname()+'.'+col, this.fixed_header)[method]('hidden'); + + $(this.row_tagname()+' '+this.col_tagname()+'.'+col, this.list)[method]('hidden'); +}, + + +/** * onmousedown-handler of message list column */ drag_column: function(e, col) diff --git a/program/lib/Roundcube/rcube_imap.php b/program/lib/Roundcube/rcube_imap.php index 9faf1bb..e0dce6f 100644 --- a/program/lib/Roundcube/rcube_imap.php +++ b/program/lib/Roundcube/rcube_imap.php @@ -1076,6 +1076,7 @@ } foreach ($headers as $h) { + $h->folder = $folder; $a_msg_headers[$h->uid] = $h; } diff --git a/program/lib/Roundcube/rcube_message_header.php b/program/lib/Roundcube/rcube_message_header.php index 2c5e2b6..2bda930 100644 --- a/program/lib/Roundcube/rcube_message_header.php +++ b/program/lib/Roundcube/rcube_message_header.php @@ -167,6 +167,13 @@ public $mdn_to; /** + * IMAP folder this message is stored in + * + * @var string + */ + public $folder; + + /** * Other message headers * * @var array @@ -189,6 +196,8 @@ 'reply-to' => 'replyto', 'cc' => 'cc', 'bcc' => 'bcc', + 'mbox' => 'folder', + 'folder' => 'folder', 'content-transfer-encoding' => 'encoding', 'in-reply-to' => 'in_reply_to', 'content-type' => 'ctype', diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 48afecb..b677c46 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -363,6 +363,8 @@ $cont = show_bytes($header->$col); else if ($col == 'date') $cont = format_date($header->date); + else if ($col == 'folder') + $cont = Q(rcube_charset::convert($header->folder, 'UTF7-IMAP')); else $cont = Q($header->$col); @@ -386,7 +388,7 @@ $a_msg_flags['prio'] = (int) $header->priority; $a_msg_flags['ctype'] = Q($header->ctype); - $a_msg_flags['mbox'] = $mbox; + $a_msg_flags['mbox'] = $header->folder; // merge with plugin result (Deprecated, use $header->flags) if (!empty($header->list_flags) && is_array($header->list_flags)) diff --git a/skins/larry/mail.css b/skins/larry/mail.css index b65b081..3c7242b 100644 --- a/skins/larry/mail.css +++ b/skins/larry/mail.css @@ -521,6 +521,14 @@ width: 135px; } +.messagelist tr td.folder { + width: 135px; +} + +.messagelist tr td.hidden { + display: none; +} + .messagelist tr.message { /* background-color: #fff; */ } -- Gitblit v1.9.1