Feature Requests item #2846760, was opened at 2009-08-29 10:52
Message generated for change (Tracker Item Submitted) made by valroff
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1126468&aid=2846760&group_id=250683

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: webui
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Julien Valroff (valroff)
Assigned to: Nobody/Anonymous (nobody)
Summary: Please do only show quarantine tab when quarantine is used

Initial Comment:
Hi,

Following to discussion on the mailing-list, it would be better to only show 
the quarantine tab when the quarantine is used (or if not empty in case a user 
changes her preferences).

Here is a quick hack to do this (could be improved, but this is just to
demonstrate the idea):

diff --git a/webui/cgi-bin/dspam.cgi b/webui/cgi-bin/dspam.cgi
index 3d2a3c3..4626924 100755
--- a/webui/cgi-bin/dspam.cgi
+++ b/webui/cgi-bin/dspam.cgi
@@ -760,6 +760,13 @@ _END
     $DATA{"OPTION"} = "";
   }
 
+  # Check whether the quarantine tab should be displayed
+  if ( ($PREFS{"spamAction"} ne "quarantine") && 
($DATA{'TOTAL_QUARANTINED_MESSAGES'} == $LANG{'empty'}) ) {
+    $DATA{'NAV_QUARANTINE'} = '';
+  } else {
+    $DATA{'NAV_QUARANTINE'} = qq!<li><a 
href="$CONFIG{'ME'}?user=$CURRENT_USER&template=quarantine">$LANG{'quarantine'} 
($DATA{'TOTAL_QUARANTINED_MESSAGES'})</a></li>!;
+  }
+
   &output(%DATA);
 }
 
diff --git a/webui/cgi-bin/templates/nav_performance.html 
b/webui/cgi-bin/templates/nav_performance.html
index de1b0e0..1a68535 100644
--- a/webui/cgi-bin/templates/nav_performance.html
+++ b/webui/cgi-bin/templates/nav_performance.html
@@ -20,7 +20,7 @@
                <li id="active"><a id="current" 
href="$CGI$?$USER$template=performance">Performance</a></li>
                <li><a 
href="$CGI$?$USER$template=preferences">Preferences</a></li>
                <li><a href="$CGI$?$USER$template=alerts">Alerts</a></li>
-               <li><a href="$CGI$?$USER$template=quarantine">Quarantine 
($TOTAL_QUARANTINED_MESSAGES$)</a></li>
+               $NAV_QUARANTINE$
                <li><a href="$CGI$?$USER$template=analysis">Analysis</a></li>
                <li><a 
href="$CGI$?$USER$template=history&history_page=1">History</a></li>
                $NAV_ADMIN$


Obviously, all the templates will need to be updated (also the translated 
templates).
It also requires to add $LANG{'quarantine'} to strings.pl files.

Another (better but not fully tested) idea would be to you a css property, I am 
not however sure if all supported browser can deal with this (I do not even 
know which browsers are supported!):
diff --git a/webui/cgi-bin/dspam.cgi b/webui/cgi-bin/dspam.cgi
index 3d2a3c3..101be8b 100755
--- a/webui/cgi-bin/dspam.cgi
+++ b/webui/cgi-bin/dspam.cgi
@@ -760,6 +760,13 @@ _END
     $DATA{"OPTION"} = "";
   }
 
+  # Check wether the quarantine tab should be displayed
+  if ( ($PREFS{"spamAction"} ne "quarantine") && 
($DATA{'TOTAL_QUARANTINED_MESSAGES'} == $LANG{'empty'}) ) {
+    $DATA{'NAV_QUARANTINE'} = qq!style="display: none"!;
+  } else {
+    $DATA{'NAV_QUARANTINE'} = "";
+  }
+
   &output(%DATA);
 }
 
diff --git a/webui/cgi-bin/templates/nav_performance.html 
b/webui/cgi-bin/templates/nav_performance.html
index de1b0e0..9ae325e 100644
--- a/webui/cgi-bin/templates/nav_performance.html
+++ b/webui/cgi-bin/templates/nav_performance.html
@@ -20,7 +20,7 @@
                <li id="active"><a id="current" 
href="$CGI$?$USER$template=performance">Performance</a></li>
                <li><a 
href="$CGI$?$USER$template=preferences">Preferences</a></li>
                <li><a href="$CGI$?$USER$template=alerts">Alerts</a></li>
-               <li><a href="$CGI$?$USER$template=quarantine">Quarantine 
($TOTAL_QUARANTINED_MESSAGES$)</a></li>
+               <li $NAV_QUARANTINE$><a 
href="$CGI$?$USER$template=quarantine">Quarantine 
($TOTAL_QUARANTINED_MESSAGES$)</a></li>
                <li><a href="$CGI$?$USER$template=analysis">Analysis</a></li>
                <li><a 
href="$CGI$?$USER$template=history&history_page=1">History</a></li>
                $NAV_ADMIN$

Cheers,
Julien

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1126468&aid=2846760&group_id=250683

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Dspam-devel mailing list
Dspam-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspam-devel

Reply via email to