X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fagent.cgi;h=44343e15c427f1eb33e4a31cd88e2ff1bb55010e;hb=3f0c721ee27ead3504df80addd947057e4fc4c14;hp=79f6c3dcfca1ee1af0fa7fc334f2156486139e87;hpb=ea1e0de8c51ea562308c20416e1f3fcb719a8847;p=freeside.git
diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi
index 79f6c3dcf..44343e15c 100755
--- a/httemplate/browse/agent.cgi
+++ b/httemplate/browse/agent.cgi
@@ -2,6 +2,14 @@
<%
+ my %search;
+ if ( $cgi->param('showdisabled')
+ || !dbdef->table('agent')->column('disabled') ) {
+ %search = ();
+ } else {
+ %search = ( 'disabled' => '' );
+ }
+
#bad false laziness with search/cust_main.cgi (also needs fixing up for
#old mysql)
my $ncancelled = "
@@ -18,7 +26,7 @@
my $ncancelled_sth = dbh->prepare("SELECT COUNT(*) FROM cust_main
WHERE agentnum = ?
- AND $ncancelled ")
+ AND ( $ncancelled ) ")
or die dbh->errstr;
my $total_sth = dbh->prepare("SELECT COUNT(*) FROM cust_main
@@ -36,9 +44,18 @@ Agents are resellers of your service. Agents may be limited to a subset of your
full offerings (via their type).
Add a new agent
+<% if ( dbdef->table('agent')->column('disabled') ) { %>
+ <%= $cgi->param('showdisabled')
+ ? do { $cgi->param('showdisabled', 0);
+ '( hide disabled agents )'; }
+ : do { $cgi->param('showdisabled', 1);
+ '( show disabled agents )'; }
+ %>
+<% } %>
+
<%= table() %>