Use message info display on dimp popup message view also
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 12 Jun 2009 16:23:44 +0000 (10:23 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 12 Jun 2009 16:23:58 +0000 (10:23 -0600)
imp/js/src/DimpBase.js
imp/js/src/DimpCore.js
imp/js/src/fullmessage-dimp.js
imp/lib/Views/ShowMessage.php
imp/message-dimp.php
imp/templates/chunks/message.php

index 9fa264e..f7d3882 100644 (file)
@@ -1033,7 +1033,7 @@ var DimpBase = {
     // opts = index, mailbox
     updateMsgInfo: function(log, opts)
     {
-        var tmp = '';
+        var tmp;
 
         if (!opts ||
             (this.pp.imapuid == opts.index &&
@@ -1045,11 +1045,7 @@ var DimpBase = {
                 $('infolist_exp').hide();
             }
 
-            log.each(function(entry) {
-                tmp += '<li><span class="iconImg imp-' + entry.t + '"></span>' + entry.m + '</li>';
-            });
-
-            $('infolist').down('UL').update(tmp);
+            DimpCore.updateInfoList(log);
         }
 
         if (opts) {
@@ -1650,18 +1646,6 @@ var DimpBase = {
                 $('qsearch_input').focus();
                 break;
 
-            case 'infolist_toggle':
-                $('infolist_col', 'infolist_exp').invoke('toggle');
-                Effect.toggle('infolist', 'blind', {
-                    duration: 0.2,
-                    queue: {
-                        position: 'end',
-                        scope: 'infolist',
-                        limit: 2
-                    }
-                });
-                break;
-
             default:
                 if (elt.hasClassName('RBFolderOk')) {
                     this.cfolderaction(e);
index 7f1167e..fd1cd8d 100644 (file)
@@ -317,6 +317,16 @@ var DimpCore = {
         return elt;
     },
 
+    /* Add message info to message view. */
+    updateInfoList: function(log)
+    {
+        var tmp = '';
+        log.each(function(entry) {
+            tmp += '<li><span class="iconImg imp-' + entry.t + '"></span>' + entry.m + '</li>';
+        });
+        $('infolist').down('UL').update(tmp);
+    },
+
     /* Removes event handlers from address links. */
     removeAddressLinks: function(id)
     {
@@ -376,6 +386,18 @@ var DimpCore = {
                 });
                 break;
 
+            case 'infolist_toggle':
+                $('infolist_col', 'infolist_exp').invoke('toggle');
+                Effect.toggle('infolist', 'blind', {
+                    duration: 0.2,
+                    queue: {
+                        position: 'end',
+                        scope: 'infolist',
+                        limit: 2
+                    }
+                });
+                break;
+
             case 'msg_print':
                 window.print();
                 break;
index 8fe5a03..f0e3173 100644 (file)
@@ -155,6 +155,12 @@ var DimpFullmessage = {
                 elt.replace(DimpCore.buildAddressLinks(this[a], elt.cloneNode(false)));
             }
         }, this);
+
+        /* Add message information. */
+        if (this.log) {
+            $('msgInfo').show();
+            DimpCore.updateInfoList(this.log);
+        }
     }
 
 };
index de09128..a3db8c7 100644 (file)
@@ -69,6 +69,7 @@ class IMP_Views_ShowMessage
      * 'from' - The From addresses
      * 'folder' - The IMAP folder
      * 'index' - The IMAP UID
+     * 'log' - Log information
      * 'msgtext' - The text of the message
      * 'to' - The To addresses
      *
@@ -76,7 +77,6 @@ class IMP_Views_ShowMessage
      * 'fulldate' - The fully formatted date
      * 'js' - Javascript code to run on display (only if the previewview
      *        hook is active)
-     * 'log' - Log information
      * 'minidate' - A miniature date
      *
      * FOR NON-PREVIEW MODE:
@@ -187,6 +187,16 @@ class IMP_Views_ShowMessage
             }
         }
 
+        /* Grab maillog information. */
+        if (!empty($GLOBALS['conf']['maillog']['use_maillog'])) {
+            foreach (IMP_Maillog::parseLog($envelope['message-id']) as $val) {
+                $result['log'][] = array_map('htmlspecialchars', array(
+                    'm' => $val['msg'],
+                    't' => $val['action']
+                ));
+            }
+        }
+
         if ($preview) {
             /* Get minidate. */
             $imp_mailbox_ui = new IMP_UI_Mailbox();
@@ -195,16 +205,6 @@ class IMP_Views_ShowMessage
                 $minidate = _("Unknown Date");
             }
             $result['minidate'] = htmlspecialchars($minidate);
-
-            /* Grab maillog information. */
-            if (!empty($GLOBALS['conf']['maillog']['use_maillog'])) {
-                foreach (IMP_Maillog::parseLog($envelope['message-id']) as $val) {
-                    $result['log'][] = array_map('htmlspecialchars', array(
-                        'm' => $val['msg'],
-                        't' => $val['action']
-                    ));
-                }
-            }
         } else {
             /* Display the user-specified headers for the current identity. */
             $user_hdrs = $imp_ui->getUserHeaders();
@@ -249,11 +249,6 @@ class IMP_Views_ShowMessage
             array_unshift($part_info, 'id');
         }
 
-        /* Retrieve any history information for this message. */
-        if (!$preview && !empty($GLOBALS['conf']['maillog']['use_maillog'])) {
-            IMP_Maillog::displayLog($mime_headers->getValue('message-id'));
-        }
-
         /* Do MDN processing now. */
         if ($imp_ui->MDNCheck($folder, $index, $mime_headers)) {
             $result['msgtext'] .= $imp_ui->formatStatusMsg(array('text' => array(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message."), sprintf(_("Click %s to send the notification message."), Horde::link('', '', '', '', 'DimpCore.doAction(\'SendMDN\',{folder:\'' . $folder . '\',index:' . $index . '}); return false;', '', '') . _("HERE") . '</a>'))));
index 9d2e126..7548a0f 100644 (file)
@@ -49,7 +49,7 @@ $js_out = array(
     'DIMP.conf.msg_folder = "' . $show_msg_result['folder'] . '"'
 );
 
-foreach (array('from', 'to', 'cc', 'bcc', 'replyTo') as $val) {
+foreach (array('from', 'to', 'cc', 'bcc', 'replyTo', 'log') as $val) {
     if (!empty($show_msg_result[$val])) {
         $js_out[] = 'DimpFullmessage.' . $val . ' = ' . Horde_Serialize::serialize($show_msg_result[$val], Horde_Serialize::JSON);
     }
index a97d82c..c637cbf 100644 (file)
@@ -91,6 +91,15 @@ function _createDAfmsg($text, $image, $id, $class = '', $show_text = true)
          </td>
         </tr>
 <?php endif; ?>
+        <tr id="msgInfo" style="display:none">
+         <td class="label"><a id="infolist_toggle"><span class="iconImg" id="infolist_col"></span><span class="iconImg" id="infolist_exp" style="display:none"></span></a></td>
+         <td>
+          <div><span class="infoLabel"><?php echo _("Message Information") ?></span></div>
+          <div id="infolist" style="display:none">
+           <ul></ul>
+          </div>
+         </td>
+        </tr>
        </thead>
       </table>
      </div>