SMTPQueue: add ability to rerun the queue
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 30 Jun 2012 14:35:39 +0000 (16:35 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 30 Jun 2012 14:35:39 +0000 (16:35 +0200)
  - to protect the user from himself force him to read the hint text before actualy triggering SMTP runqueue
  - add the status of the runqueue to the important message to give feedback to the user.

webcit/static/t/navbar.html
webcit/static/t/view_mailq/header.html
webcit/static/wclib.js

index 453759cefe490dd2029c848728185032e860e730..608606f3e4aa6941869d61bdf00028ea70135e32 100644 (file)
                        <img  src="static/webcit_icons/essen/16x16/nextroom.png" alt="" width="16" height="16">
                        <span class="navbar_link"><?_("Goto next room")></span></a>
        </li>
+<?!("COND:THISROOM:CURR_VIEW", 100, #"VIEW_QUEUE")>
+       <li class="runqueuenow">
+                <a href="javascript:ToggleVisibility('runqueue')"><img src="static/webcit_icons/essen/16x16/refresh.png" alt="" width="16" height="16">
+                       <span class="navbar_link"><?_("Resend Mailqueue now")></span></a>
+       </li>
+<??("X", 90)>
+
 </ul></div>
index d028db9dd920239c560623293f3e777f0def26f2..98cd3be6f901b18699ef9b5ace0fe28514bdcf5b 100644 (file)
@@ -4,7 +4,6 @@
 </h1>
 </div>
 
-<div id="content" class="service">
 <!--
 <table class="smtpqueue_background">
 <tr><td valign=top>
 </div>
 </td></tr></table>
 -->
+
+<div id="runqueue" class="runqueue" style="display:none">
+<?_("Citadel reattempts sending mail per interval; it starts at 60 second, and doubles each time. You can however bypass this mechanism once; all messages will be reattempted on the next queue run.")>
+<a href="javascript:ToggleVisibility('runqueue_help1')"><?_("OK, got you, lets go!")></a>
+</div>
+
+<div id="runqueue_help1" style="display:none">
+<br><a href="javascript:SMTPRunQueue();"><?_("Reschedule all messages for delivery on next queue run")></a>
+</div>
+
 <table class="mailbox_summary" rules=rows cellpadding=2 style="width:100%%;">
 <tr><td><b><i>
 <?_("Message ID")>
index c338cb055792c97b83f54a648567f85ed03dcefa..956dd67b53d40de30b298a6dd8c2086805b7d28b 100644 (file)
@@ -77,6 +77,18 @@ function ToggleLogEnable($Which)
     });
 }
 
+function SMTPRunQueue()
+{
+    var p;
+
+    p= encodeURI('g_cmd=SMTP runqueue');
+    new Ajax.Request('ajax_servcmd', {
+       method: 'post',
+       parameters: p,
+       onComplete: function(transport) { ajax_important_message(transport.responseText.substr(4));}
+    });
+}
+
 function ToggleVisibility ($Which)
 {
        if (document.getElementById)
@@ -177,6 +189,36 @@ function hide_imsg_popup() {
        document.poppedLayer.style.visibility = "hidden";
 }
 
+function unhide_imsg_popup() {
+       if (browserType == "gecko") {
+               document.poppedLayer = eval('document.getElementById(\'important_message\')');
+       }
+       else if (browserType == "ie") {
+               document.poppedLayer = eval('document.all[\'important_message\']');
+       }
+       else {
+               document.poppedLayer = eval('document.layers[\'`important_message\']');
+       }
+
+       document.poppedLayer.style.visibility = "visible";
+    setTimeout('hide_imsg_popup()', 5000);
+}
+
+function ajax_important_message(messagetext)
+{
+    if (browserType == "gecko") {
+       document.poppedLayer = eval('document.getElementById(\'important_message\')');
+    }
+    else if (browserType == "ie") {
+       document.poppedLayer = eval('document.all[\'important_message\']');
+    }
+    else {
+       document.poppedLayer = eval('document.layers[\'`important_message\']');
+    }
+    document.poppedLayer.style.visibility = "visible";
+    setTimeout('hide_imsg_popup()', 5000);
+    document.poppedLayer.innerHTML = messagetext;
+}
 
 // This function activates the ajax-powered recipient autocompleters on the message entry screen.
 function activate_entmsg_autocompleters() {