Move MDN notification to message body
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 14 Apr 2009 02:32:15 +0000 (20:32 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 14 Apr 2009 02:32:15 +0000 (20:32 -0600)
imp/js/src/DimpCore.js
imp/lib/Views/ShowMessage.php
imp/message.php
imp/themes/screen-dimp.css
imp/themes/silver/screen-dimp.css

index 2de6c31..715229c 100644 (file)
@@ -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')) {
index 1ddb195..cc1c6b6 100644 (file)
@@ -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") . '</a>'))));
+        }
+
         /* 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") . '</a>';
-                $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);
         }
index 57c7b3f..da311e6 100644 (file)
@@ -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") . '</a>';
-        $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") . '</a>'))));
+}
+
 $show_parts = Util::getFormData('show_parts', $prefs->getValue('parts_display'));
 if ($show_parts == 'all') {
     $atc_parts = array_keys($parts_list);
index f1faf10..fa58701 100644 (file)
@@ -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");
 }
index 98dec93..9154bd7 100644 (file)
@@ -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");
 }