From: Michael M Slusarz Date: Tue, 14 Apr 2009 02:32:15 +0000 (-0600) Subject: Move MDN notification to message body X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=5c440c85c5fe23ae78cd3ca7389ce0718b8f8d6f;p=horde.git Move MDN notification to message body --- diff --git a/imp/js/src/DimpCore.js b/imp/js/src/DimpCore.js index 2de6c31cc..715229c65 100644 --- a/imp/js/src/DimpCore.js +++ b/imp/js/src/DimpCore.js @@ -212,8 +212,6 @@ var DimpCore = { case 'imp.reply': case 'imp.forward': case 'imp.redirect': - case 'dimp.request': - case 'dimp.sticky': var log, tmp, msg = m.message; @@ -221,16 +219,10 @@ var DimpCore = { this.Growler = new Growler({ location: 'br' }); } - if ($w('dimp.request dimp.sticky').indexOf(m.type) == -1) { - msg = msg.unescapeHTML().unescapeHTML(); - } - - // TODO: dimp.request this.Growler.growl(msg, { className: m.type.replace('.', '-'), - life: (m.type == 'horde.error') ? 10 : 5, - sticky: true -// sticky: m.type == 'dimp.sticky' + life: 8, + sticky: m.type == 'horde.error' }); if (tmp = $('hordeAlertslog')) { diff --git a/imp/lib/Views/ShowMessage.php b/imp/lib/Views/ShowMessage.php index 1ddb19545..cc1c6b6d5 100644 --- a/imp/lib/Views/ShowMessage.php +++ b/imp/lib/Views/ShowMessage.php @@ -238,6 +238,16 @@ 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") . '')))); + } + /* Build body text. This needs to be done before we build the * attachment list that lives in the header. */ foreach ($parts_list as $mime_id => $mime_type) { @@ -328,19 +338,6 @@ class IMP_Views_ShowMessage $result = Horde::callHook('_imp_hook_dimp_messageview', array($result), 'imp'); } - /* Retrieve any history information for this message. */ - if (!empty($GLOBALS['conf']['maillog']['use_maillog'])) { - if (!$preview) { - IMP_Maillog::displayLog($mime_headers->getValue('message-id')); - } - - /* Do MDN processing now. */ - if ($imp_ui->MDNCheck($folder, $index, $mime_headers)) { - $confirm_link = Horde::link('', '', '', '', 'DimpCore.doAction(\'SendMDN\',{folder:\'' . $folder . '\',index:' . $index . '}); return false;', '', '') . _("HERE") . ''; - $GLOBALS['notification']->push(sprintf(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message. Click %s to send the notification message."), $confirm_link), 'dimp.request', array('content.raw')); - } - } - if (!$preview) { $result['list_info'] = $imp_ui->getListInformation($mime_headers); } diff --git a/imp/message.php b/imp/message.php index 57c7b3f2b..da311e6ea 100644 --- a/imp/message.php +++ b/imp/message.php @@ -381,15 +381,6 @@ $mailbox_url = Util::addParameter(IMP::generateIMPUrl('mailbox.php', $imp_mbox[' /* Generate the view link. */ $view_link = IMP::generateIMPUrl('view.php', $imp_mbox['mailbox'], $index, $mailbox_name); -/* Retrieve any history information for this message. */ -if (!IMP::$printMode && !empty($conf['maillog']['use_maillog'])) { - /* Do MDN processing now. */ - if ($imp_ui->MDNCheck($imp_mbox['mailbox'], $index, $mime_headers, Util::getFormData('mdn_confirm'))) { - $confirm_link = Horde::link(htmlspecialchars(Util::addParameter($selfURL, 'mdn_confirm', 1))) . _("HERE") . ''; - $notification->push(sprintf(_("The sender of this message is requesting a Message Disposition Notification from you when you have read this message. Please click %s to send the notification message."), $confirm_link), 'horde.message', array('content.raw')); - } -} - /* Everything below here is related to preparing the output. */ if (!IMP::$printMode) { /* Set the status information of the message. */ @@ -594,6 +585,12 @@ $strip_atc = $prefs->getValue('strip_attachments'); $atc_parts = $display_ids = array(); $msgtext = ''; +/* Do MDN processing now. */ +if (!IMP::$printMode && + $imp_ui->MDNCheck($imp_mbox['mailbox'], $index, $mime_headers, Util::getFormData('mdn_confirm'))) { + $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(htmlspecialchars(Util::addParameter($selfURL, 'mdn_confirm', 1))) . _("HERE") . '')))); +} + $show_parts = Util::getFormData('show_parts', $prefs->getValue('parts_display')); if ($show_parts == 'all') { $atc_parts = array_keys($parts_list); diff --git a/imp/themes/screen-dimp.css b/imp/themes/screen-dimp.css index f1faf10a6..fa58701cb 100644 --- a/imp/themes/screen-dimp.css +++ b/imp/themes/screen-dimp.css @@ -1073,12 +1073,6 @@ span.readonlyImg { } /* Growler notification styles. */ -#Growler div.dimp-sticky { - background-color: #ebe20c; - background-image: url("graphics/warning.png"); - border-color: #807b00; - color: #000; -} #Growler div.imp-reply { background-image: url("graphics/mail_answered.png"); } diff --git a/imp/themes/silver/screen-dimp.css b/imp/themes/silver/screen-dimp.css index 98dec9308..9154bd784 100644 --- a/imp/themes/silver/screen-dimp.css +++ b/imp/themes/silver/screen-dimp.css @@ -172,9 +172,6 @@ span.readonlyImg { background-image: url("graphics/locked.png"); } -#Growler div.dimp-sticky { - background-image: url("graphics/warning.png"); -} #Growler div.imp-reply { background-image: url("graphics/mail_answered.png"); }