Add display indicator for forwarded messages
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 17 Apr 2009 10:49:38 +0000 (10:49 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 17 Apr 2009 10:49:38 +0000 (10:49 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13559 7612ce4b-ef26-0410-bec9-ea0150e637f0

13 files changed:
class/mime/Message.class.php
doc/ChangeLog
functions/mailbox_display.php
functions/mime.php
functions/template/message_list_util.php
images/themes/default/msg_new_deleted_forwarded.png [new file with mode: 0644]
images/themes/default/msg_new_forwarded.png [new file with mode: 0644]
images/themes/default/msg_read_deleted_forwarded.png [new file with mode: 0644]
images/themes/default/msg_read_forwarded.png [new file with mode: 0644]
images/themes/xp/msg_new_deleted_forwarded.png [new file with mode: 0644]
images/themes/xp/msg_new_forwarded.png [new file with mode: 0644]
images/themes/xp/msg_read_deleted_forwarded.png [new file with mode: 0644]
images/themes/xp/msg_read_forwarded.png [new file with mode: 0644]

index 7d04373..f05abf4 100644 (file)
@@ -87,6 +87,11 @@ class Message {
      */
     var $is_answered = 0;
     /**
+     * Message forward status
+     * @var boolean
+     */
+    var $is_forwarded = 0;
+    /**
      * Message \deleted status
      * @var boolean
      */
index 32427a6..399767f 100644 (file)
@@ -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)
 --------------------------------------
index 1cd515a..e6e16d2 100644 (file)
@@ -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)
index 2e9d68e..72e4184 100644 (file)
@@ -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') {
index 590dfba..0744d63 100644 (file)
@@ -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',                '&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_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 (file)
index 0000000..ac8576a
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 (file)
index 0000000..96afd6c
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 (file)
index 0000000..384d521
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 (file)
index 0000000..8f43769
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 (file)
index 0000000..1213872
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 (file)
index 0000000..b0fb949
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 (file)
index 0000000..6385e0f
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 (file)
index 0000000..b78235c
Binary files /dev/null and b/images/themes/xp/msg_read_forwarded.png differ