From 388112362d2dfec7d6e517727251d7dd092b3e65 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Mon, 9 Jul 2012 14:14:41 +0200 Subject: [PATCH] SMTP-Queue: streamline redisplaying - on delete, display important message, and trigger re-display of the queue - re-add the refresh button which re-loads the page - add ListOnly=yes to output just the table to replace not the full document. --- webcit/smtpqueue.c | 26 ++++++++++++++----- webcit/static/t/view_mailq/footer.html | 4 +-- webcit/static/t/view_mailq/footer_empty.html | 2 +- .../static/t/view_mailq/footer_listonly.html | 1 + webcit/static/t/view_mailq/header.html | 16 +++--------- webcit/static/t/view_mailq/table.html | 13 ++++++++++ webcit/static/wclib.js | 6 ++--- 7 files changed, 43 insertions(+), 25 deletions(-) create mode 100644 webcit/static/t/view_mailq/footer_listonly.html create mode 100644 webcit/static/t/view_mailq/table.html diff --git a/webcit/smtpqueue.c b/webcit/smtpqueue.c index 0ce44e328..360886380 100644 --- a/webcit/smtpqueue.c +++ b/webcit/smtpqueue.c @@ -311,7 +311,10 @@ ServerStartModule_SMTP_QUEUE int qview_PrintPageHeader(SharedMessageStatus *Stat, void **ViewSpecific) { - output_headers(1, 1, 1, 0, 0, 0); + if (yesbstr("ListOnly")) + output_headers(1, 0, 0, 0, 0, 0); + else + output_headers(1, 1, 1, 0, 0, 0); return 0; } @@ -333,7 +336,10 @@ int qview_GetParamsGetServerCall(SharedMessageStatus *Stat, else { snprintf(cmd, len, "MSGS ALL|0|1"); snprintf(filter, flen, "SUBJ|QMSG"); - DoTemplate(HKEY("view_mailq_header"), NULL, NULL); + if (yesbstr("ListOnly")) + DoTemplate(HKEY("view_mailq_table"), NULL, NULL); + else + DoTemplate(HKEY("view_mailq_header"), NULL, NULL); return 200; } } @@ -364,16 +370,22 @@ int qview_RenderView_or_Tail(SharedMessageStatus *Stat, wcsession *WCC = WC; WCTemplputParams SubTP; - if (GetCount(WCC->summ) == 0) - DoTemplate(HKEY("view_mailq_footer_empty"),NULL, &SubTP); + if (yesbstr("ListOnly")) + DoTemplate(HKEY("view_mailq_footer_listonly"),NULL, &SubTP); else - DoTemplate(HKEY("view_mailq_footer"),NULL, &SubTP); - + { + if (GetCount(WCC->summ) == 0) + DoTemplate(HKEY("view_mailq_footer_empty"),NULL, &SubTP); + else + DoTemplate(HKEY("view_mailq_footer"),NULL, &SubTP); + } + return 0; } int qview_Cleanup(void **ViewSpecific) { - wDumpContent(1); + + wDumpContent(yesbstr("ListOnly")?0:1); return 0; } diff --git a/webcit/static/t/view_mailq/footer.html b/webcit/static/t/view_mailq/footer.html index 2880a2b46..d6c5574b5 100644 --- a/webcit/static/t/view_mailq/footer.html +++ b/webcit/static/t/view_mailq/footer.html @@ -1,7 +1,7 @@ - - +



+ diff --git a/webcit/static/t/view_mailq/footer_empty.html b/webcit/static/t/view_mailq/footer_empty.html index 52e2324b6..50ac5ad05 100644 --- a/webcit/static/t/view_mailq/footer_empty.html +++ b/webcit/static/t/view_mailq/footer_empty.html @@ -1,5 +1,5 @@ - +



diff --git a/webcit/static/t/view_mailq/footer_listonly.html b/webcit/static/t/view_mailq/footer_listonly.html new file mode 100644 index 000000000..bdcc76e37 --- /dev/null +++ b/webcit/static/t/view_mailq/footer_listonly.html @@ -0,0 +1 @@ + diff --git a/webcit/static/t/view_mailq/header.html b/webcit/static/t/view_mailq/header.html index 98cd3be6f..20e5ce3e4 100644 --- a/webcit/static/t/view_mailq/header.html +++ b/webcit/static/t/view_mailq/header.html @@ -25,16 +25,8 @@
- - +
+ +
+ diff --git a/webcit/static/t/view_mailq/table.html b/webcit/static/t/view_mailq/table.html new file mode 100644 index 000000000..4d036e4cc --- /dev/null +++ b/webcit/static/t/view_mailq/table.html @@ -0,0 +1,13 @@ +
+
- - - - - - - - - -
+ diff --git a/webcit/static/wclib.js b/webcit/static/wclib.js index 632153126..fb828a683 100644 --- a/webcit/static/wclib.js +++ b/webcit/static/wclib.js @@ -931,8 +931,8 @@ function WCLog(msg) { } function RefreshSMTPqueueDisplay() { - new Ajax.Updater('smtpqueue_inner_div', - 'display_smtpqueue_inner_div', { method: 'get', + new Ajax.Updater('mailqueue_list', + 'dotskip?room=__CitadelSMTPspoolout__&view=11&ListOnly=yes', { method: 'get', parameters: Math.random() } ); } @@ -942,7 +942,7 @@ function DeleteSMTPqueueMsg(msgnum1, msgnum2) { 'ajax_servcmd', { method: 'post', parameters: p, - onComplete: RefreshSMTPqueueDisplay() + onComplete: function(transport) { ajax_important_message(transport.responseText.substr(4)); RefreshSMTPqueueDisplay();} } ); } -- 2.30.2
+ + + + + + + + + +