From: pdontthink Date: Fri, 17 Apr 2009 10:49:38 +0000 (+0000) Subject: Add display indicator for forwarded messages X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1a75323982539550517e4ec6a17f5a0f8df65aac;p=squirrelmail.git 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 --- 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 00000000..ac8576ac Binary files /dev/null and b/images/themes/default/msg_new_deleted_forwarded.png differ diff --git a/images/themes/default/msg_new_forwarded.png b/images/themes/default/msg_new_forwarded.png new file mode 100644 index 00000000..96afd6c9 Binary files /dev/null and b/images/themes/default/msg_new_forwarded.png differ diff --git a/images/themes/default/msg_read_deleted_forwarded.png b/images/themes/default/msg_read_deleted_forwarded.png new file mode 100644 index 00000000..384d5218 Binary files /dev/null and b/images/themes/default/msg_read_deleted_forwarded.png differ diff --git a/images/themes/default/msg_read_forwarded.png b/images/themes/default/msg_read_forwarded.png new file mode 100644 index 00000000..8f437690 Binary files /dev/null and b/images/themes/default/msg_read_forwarded.png differ 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 00000000..12138727 Binary files /dev/null and b/images/themes/xp/msg_new_deleted_forwarded.png differ diff --git a/images/themes/xp/msg_new_forwarded.png b/images/themes/xp/msg_new_forwarded.png new file mode 100644 index 00000000..b0fb9495 Binary files /dev/null and b/images/themes/xp/msg_new_forwarded.png differ diff --git a/images/themes/xp/msg_read_deleted_forwarded.png b/images/themes/xp/msg_read_deleted_forwarded.png new file mode 100644 index 00000000..6385e0f3 Binary files /dev/null and b/images/themes/xp/msg_read_deleted_forwarded.png differ diff --git a/images/themes/xp/msg_read_forwarded.png b/images/themes/xp/msg_read_forwarded.png new file mode 100644 index 00000000..b78235c3 Binary files /dev/null and b/images/themes/xp/msg_read_forwarded.png differ