From 1a75323982539550517e4ec6a17f5a0f8df65aac Mon Sep 17 00:00:00 2001 From: pdontthink Date: Fri, 17 Apr 2009 10:49:38 +0000 Subject: [PATCH] Add display indicator for forwarded messages git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13559 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- class/mime/Message.class.php | 5 + doc/ChangeLog | 1 + functions/mailbox_display.php | 15 ++- functions/mime.php | 3 + functions/template/message_list_util.php | 93 +++++++++++++----- .../default/msg_new_deleted_forwarded.png | Bin 0 -> 457 bytes images/themes/default/msg_new_forwarded.png | Bin 0 -> 332 bytes .../default/msg_read_deleted_forwarded.png | Bin 0 -> 326 bytes images/themes/default/msg_read_forwarded.png | Bin 0 -> 291 bytes .../themes/xp/msg_new_deleted_forwarded.png | Bin 0 -> 657 bytes images/themes/xp/msg_new_forwarded.png | Bin 0 -> 627 bytes .../themes/xp/msg_read_deleted_forwarded.png | Bin 0 -> 673 bytes images/themes/xp/msg_read_forwarded.png | Bin 0 -> 657 bytes 13 files changed, 87 insertions(+), 30 deletions(-) create mode 100644 images/themes/default/msg_new_deleted_forwarded.png create mode 100644 images/themes/default/msg_new_forwarded.png create mode 100644 images/themes/default/msg_read_deleted_forwarded.png create mode 100644 images/themes/default/msg_read_forwarded.png create mode 100644 images/themes/xp/msg_new_deleted_forwarded.png create mode 100644 images/themes/xp/msg_new_forwarded.png create mode 100644 images/themes/xp/msg_read_deleted_forwarded.png create mode 100644 images/themes/xp/msg_read_forwarded.png diff --git a/class/mime/Message.class.php b/class/mime/Message.class.php index 7d043732..f05abf4b 100644 --- a/class/mime/Message.class.php +++ b/class/mime/Message.class.php @@ -86,6 +86,11 @@ class Message { * @var boolean */ var $is_answered = 0; + /** + * Message forward status + * @var boolean + */ + var $is_forwarded = 0; /** * Message \deleted status * @var boolean diff --git a/doc/ChangeLog b/doc/ChangeLog index 32427a65..399767f3 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -291,6 +291,7 @@ Version 1.5.2 - SVN are now encoded so they are not corrupted by artificial line folds. Thanks to Kelly Fallon. (#2226470, $1473714) - Completed a massive update to contrib/flat2sql.pl. + - Display visual indication of forwarded messages. Version 1.5.1 (branched on 2006-02-12) -------------------------------------- diff --git a/functions/mailbox_display.php b/functions/mailbox_display.php index 1cd515ae..e6e16d26 100644 --- a/functions/mailbox_display.php +++ b/functions/mailbox_display.php @@ -624,17 +624,19 @@ function prepareMessageList(&$aMailbox, $aProps) { $aFlagColumn = array('seen' => false, 'deleted'=>false, 'answered'=>false, + 'forwarded'=>false, 'flagged' => false, 'draft' => false); if(!is_array($value)) $value = array(); foreach ($value as $sFlag => $v) { switch ($sFlag) { - case '\\seen' : $aFlagColumn['seen'] = true; break; - case '\\deleted' : $aFlagColumn['deleted'] = true; break; - case '\\answered': $aFlagColumn['answered'] = true; break; - case '\\flagged' : $aFlagColumn['flagged'] = true; break; - case '\\draft' : $aFlagColumn['draft'] = true; break; + case '\\seen' : $aFlagColumn['seen'] = true; break; + case '\\deleted' : $aFlagColumn['deleted'] = true; break; + case '\\answered': $aFlagColumn['answered'] = true; break; + case '$forwarded': $aFlagColumn['forwarded'] = true; break; + case '\\flagged' : $aFlagColumn['flagged'] = true; break; + case '\\draft' : $aFlagColumn['draft'] = true; break; default: break; } } @@ -1420,6 +1422,7 @@ function handleMessageListForm($imapConnection, &$aMailbox, $sButton='', $message = $aMailbox['MSG_HEADERS'][$iUid]['MESSAGE_OBJECT']; $message->is_seen = false; $message->is_answered = false; + $message->is_forwarded = false; $message->is_deleted = false; $message->is_flagged = false; $message->is_mdnsent = false; @@ -1428,6 +1431,8 @@ function handleMessageListForm($imapConnection, &$aMailbox, $sButton='', $message->is_seen = true; else if (strtolower($flag) == '\\answered' && $value) $message->is_answered = true; + else if (strtolower($flag) == '$forwarded' && $value) + $message->is_forwarded = true; else if (strtolower($flag) == '\\deleted' && $value) $message->is_deleted = true; else if (strtolower($flag) == '\\flagged' && $value) diff --git a/functions/mime.php b/functions/mime.php index 2e9d68e7..72e41843 100644 --- a/functions/mime.php +++ b/functions/mime.php @@ -92,6 +92,9 @@ function mime_structure ($bodystructure, $flags=array()) { if (strtolower($flag) == '\\flagged') { $msg->is_flagged = true; } + else if (strtolower($flag) == '$forwarded') { + $msg->is_forwarded = true; + } break; case 'M': if (strtolower($flag) == '$mdnsent') { diff --git a/functions/template/message_list_util.php b/functions/template/message_list_util.php index 590dfba3..0744d633 100644 --- a/functions/template/message_list_util.php +++ b/functions/template/message_list_util.php @@ -99,38 +99,79 @@ function getFlagIcon ($aFlags, $icon_theme_path) { * 13 = flagged aswered seen * 14 = flagged answered deleted * 15 = flagged anserwed deleted seen + * ... + * 32 = forwarded + * 33 = forwarded seen + * 34 = forwarded deleted + * 35 = forwarded deleted seen + * ... + * 41 = flagged forwarded seen + * 42 = flagged forwarded deleted + * 43 = flagged forwarded deleted seen */ /** * Use static vars to avoid initialisation of the array on each displayed row */ + global $nbsp; static $flag_icons, $flag_values; if (!isset($flag_icons)) { // This is by no means complete... - $flag_icons = array ( // Image icon name Text Icon Alt/Title Text - array ('msg_new.png', ' ', '('._("New").')') , - array ('msg_read.png', ' ', '('._("Read").')'), - array ('msg_new_deleted.png', _("D"), '('._("Deleted").')'), - array ('msg_read_deleted.png', _("D"), '('._("Deleted").')'), - array ('msg_new_reply.png', _("A"), '('._("Answered").')'), - array ('msg_read_reply.png', _("A"), '('._("Answered").')'), - array ('msg_read_deleted_reply.png', _("D"), '('._("Answered").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')'), - array ('flagged.png', _("F"), '('._("Flagged").')') - ); + $flag_icons = array ( + // Image icon name Text Icon Alt/Title Text + // --------------- --------- -------------- + array ('msg_new.png', $nbsp, '('._("New").')') , + array ('msg_read.png', $nbsp, '('._("Read").')'), + array ('msg_new_deleted.png', _("D"), '('._("Deleted").')'), + array ('msg_read_deleted.png', _("D"), '('._("Deleted").')'), + array ('msg_new_reply.png', _("A"), '('._("Answered").')'), + array ('msg_read_reply.png', _("A"), '('._("Answered").')'), + array ('msg_new_deleted_reply.png', _("D"), '('._("Answered").')'), + array ('msg_read_deleted_reply.png', _("D"), '('._("Answered").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + array ('msg_new_forwarded.png', _("O"), '('._("Forwarded").')'), + array ('msg_read_forwarded.png', _("O"), '('._("Forwarded").')'), + array ('msg_new_deleted_forwarded.png', _("D"), '('._("Forwarded").')'), + array ('msg_read_deleted_forwarded.png', _("D"), '('._("Forwarded").')'), + FALSE, + FALSE, + FALSE, + FALSE, + FALSE, + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + array ('flagged.png', _("F"), '('._("Flagged").')'), + ); - $flag_values = array('seen' => 1, - 'deleted' => 2, - 'answered' => 4, - 'flagged' => 8, - 'draft' => 16); + $flag_values = array('seen' => 1, + 'deleted' => 2, + 'answered' => 4, + 'flagged' => 8, + 'draft' => 16, + 'forwarded' => 32); } /** @@ -143,16 +184,18 @@ function getFlagIcon ($aFlags, $icon_theme_path) { switch ($flag) { case 'deleted': case 'answered': + case 'forwarded': case 'seen': case 'flagged': if ($flagvalue) $index += $flag_values[$flag]; break; default: break; } } - if (isset($flag_icons[$index])) { + if (!empty($flag_icons[$index])) { $data = $flag_icons[$index]; } else { - $data = end($flag_icons); +//FIXME: previously this default was set to the last value of the $flag_icons array (when it was index 15 - flagged anserwed deleted seen) but I don't understand why... am changing it to flagged (index 15 just shows (only) the flag icon anyway) + $data = $flag_icons[8]; // default to just flagged } $icon = getIcon($icon_theme_path, $data[0], $data[1], $data[2]); diff --git a/images/themes/default/msg_new_deleted_forwarded.png b/images/themes/default/msg_new_deleted_forwarded.png new file mode 100644 index 0000000000000000000000000000000000000000..ac8576ac7f31db098f1f4577be065d955d5e8394 GIT binary patch literal 457 zcmV;)0XF`LP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXJ> z3Li6@-J2r-00Bu!L_t(2&xMl7P6IIzL|;3RvcTVP&7zPC68RwxFk^>5;(~%SQ4%=9 z*RY&$aY)9q5J*Xu+}-YSSE)@P03@RgGabzzfh8g!cn`o`mNnx4kYyQ?%p_I6*AWdY zRbr>@T3)+6M5*T7T542W!;|ySj5c8Lm$&k%_Aw11n;@K&3S&= zFq%vuMvx;c^OIh6($E1zE<02IagAg$q# z!!HNSXDht#fmNmPW|Hm~j~9)JTzgOaeUJHU1+XWp8QLbR-(6ele70gZI0IlfI7_6Z ztTsxrZo5zv>puk44ofy`glX(f`uqAoByDx`7I;J!Gca%qgD@k*tT_@uLG}_)Usv{fyZTj_|6cGonli8biLkh+~dk&#Q9rVb5ib<<2_S5W- z=F&LM2RpyVrL@`AC_la;^Wa{$gQmR0s#}Tg8aj{#?!w#^4|7>k44ofy`glX(f`uqAoByDx`7I;J!Gca%qgD@k*tT_@uLG}_)Usv{| zgW!U_%O?XxI14-?iy0WWg+Z8+Vb&Z8pdfpRr>`sfO%_2e8C|dcUz>qKi#=T&Lp07W zo#f5es=(vQf6Vvbhg|Nq)M%c<$kHV%Ym}bdZP{Y-@JoBLlHf(NX+cFb6FXL{%3Aw1 zk@2teC(dtdkxgrz(hRQinIAh*C{ywNq~-pyLfwSz2PKp(pWkLu5&9a=$f0`2&O!6( zx9w)lt+8CHJhiL&t~iAy-j+VH&4{^tL7=K}g!Jt*UkcCJo_q6K>;9v{+CnR(fzD;{boFyt=akR{0PK!wn*aa+ literal 0 HcmV?d00001 diff --git a/images/themes/xp/msg_new_deleted_forwarded.png b/images/themes/xp/msg_new_deleted_forwarded.png new file mode 100644 index 0000000000000000000000000000000000000000..12138727322bd82f4663cdca98940d3b9aabd4cd GIT binary patch literal 657 zcmV;C0&e|@P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXJ> z2{;LbQckS^00I$7L_t(2&#jS7NK{c6hM#k1M(uAxc zWrR^FEh1_mQ49kuTm`La>#`q6Y!eFEm{XRP$yjFoOg}oMEAr#29%uh+Xfa zvd*PyXB7vI?nk8ryBcdLIep?^YB`fv4{y_YxQV&3$26S1kB(lVJJ{LtYQ^1v)J(n>f8gCKFyF2vsjje)|!2xHl{y})3T-u zspV8zQ%`pO1v0aSk$)KO?ZhaF_9O!62oEte5o6#&D?O31LTWknc3;6JiOT#&dWJP6 rNN0U$Kxlz6(C%4uM_!Zl*5CXEr7G^5<-|rO00000NkvXXu0mjfzIq)h literal 0 HcmV?d00001 diff --git a/images/themes/xp/msg_new_forwarded.png b/images/themes/xp/msg_new_forwarded.png new file mode 100644 index 0000000000000000000000000000000000000000..b0fb949502097d9637dcd7a1ef0ebbd4fd0b4e71 GIT binary patch literal 627 zcmV-(0*w8MP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iXJ> z3J4a}TFdeP00Hw!L_t(2&#jV6Yg1tmhM#kCa*s`@u~aQl+Sn?XXuySt=)z6^fcPU^ z2wFr0>!Ju!TnMiG0ph0MMii8;v{j0lc%e!SQEO=0poUn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