From 5363ae4cfb6828d3705cdda7b53a6f44056b8d90 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 12 Jun 2009 10:23:44 -0600 Subject: [PATCH] Use message info display on dimp popup message view also --- imp/js/src/DimpBase.js | 20 ++------------------ imp/js/src/DimpCore.js | 22 ++++++++++++++++++++++ imp/js/src/fullmessage-dimp.js | 6 ++++++ imp/lib/Views/ShowMessage.php | 27 +++++++++++---------------- imp/message-dimp.php | 2 +- imp/templates/chunks/message.php | 9 +++++++++ 6 files changed, 51 insertions(+), 35 deletions(-) diff --git a/imp/js/src/DimpBase.js b/imp/js/src/DimpBase.js index 9fa264e01..f7d3882a9 100644 --- a/imp/js/src/DimpBase.js +++ b/imp/js/src/DimpBase.js @@ -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 += '
  • ' + entry.m + '
  • '; - }); - - $('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); diff --git a/imp/js/src/DimpCore.js b/imp/js/src/DimpCore.js index 7f1167ede..fd1cd8d45 100644 --- a/imp/js/src/DimpCore.js +++ b/imp/js/src/DimpCore.js @@ -317,6 +317,16 @@ var DimpCore = { return elt; }, + /* Add message info to message view. */ + updateInfoList: function(log) + { + var tmp = ''; + log.each(function(entry) { + tmp += '
  • ' + entry.m + '
  • '; + }); + $('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; diff --git a/imp/js/src/fullmessage-dimp.js b/imp/js/src/fullmessage-dimp.js index 8fe5a037f..f0e317330 100644 --- a/imp/js/src/fullmessage-dimp.js +++ b/imp/js/src/fullmessage-dimp.js @@ -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); + } } }; diff --git a/imp/lib/Views/ShowMessage.php b/imp/lib/Views/ShowMessage.php index de0912817..a3db8c756 100644 --- a/imp/lib/Views/ShowMessage.php +++ b/imp/lib/Views/ShowMessage.php @@ -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") . '')))); diff --git a/imp/message-dimp.php b/imp/message-dimp.php index 9d2e12693..7548a0fb4 100644 --- a/imp/message-dimp.php +++ b/imp/message-dimp.php @@ -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); } diff --git a/imp/templates/chunks/message.php b/imp/templates/chunks/message.php index a97d82ca2..c637cbfcb 100644 --- a/imp/templates/chunks/message.php +++ b/imp/templates/chunks/message.php @@ -91,6 +91,15 @@ function _createDAfmsg($text, $image, $id, $class = '', $show_text = true) + + + +
    + + + -- 2.11.0