summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorivan <ivan>2006-07-25 08:33:46 +0000
committerivan <ivan>2006-07-25 08:33:46 +0000
commita0732f52fdcc2bca7c399d1249ccceb191de51cd (patch)
tree9b8d3af4ea844cd9dfa448772b30bed5e1e99b42 /httemplate/search
parent4f056133e2a2bd84d8d789acf24aba695a6e3688 (diff)
this should finish adding the "inactive" status, i think?
Diffstat (limited to 'httemplate/search')
-rwxr-xr-xhttemplate/search/cust_main.cgi111
-rwxr-xr-xhttemplate/search/cust_pkg.cgi13
2 files changed, 82 insertions, 42 deletions
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
index 7d5941a16..c72ab44df 100755
--- a/httemplate/search/cust_main.cgi
+++ b/httemplate/search/cust_main.cgi
@@ -109,6 +109,7 @@ if ( $cgi->param('browse')
push @qual, FS::cust_main->cancel_sql if $cgi->param('cancelled');
push @qual, FS::cust_main->prospect_sql if $cgi->param('prospect');
push @qual, FS::cust_main->active_sql if $cgi->param('active');
+ push @qual, FS::cust_main->inactive_sql if $cgi->param('inactive');
push @qual, FS::cust_main->susp_sql if $cgi->param('suspended');
#EWWWWWW
@@ -415,48 +416,78 @@ END
foreach my $addl_col ( @addl_cols ) { %>
- <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>" ROWSPAN=<%= $rowspan || 1 %> ALIGN=right><FONT SIZE=-1>
-
- <% if ( $addl_col eq 'tickets' ) {
- if ( @custom_priorities ) {
- print &itable('', 0);
- foreach my $priority ( @custom_priorities, '' ) {
-
- my $num =
- FS::TicketSystem->num_customer_tickets($custnum,$priority);
- my $ahref = '';
- $ahref= '<A HREF="'.
- FS::TicketSystem->href_customer_tickets($custnum,$priority).
- '">'
- if $num;
-
- print '<TR>'.
- " <TD ALIGN=right><FONT SIZE=-1>$ahref$num</A></FONT></TD>".
- "<TD ALIGN=left><FONT SIZE=-1>$ahref".
- ( $priority || '<i>(none)</i>' ).
- "</A></FONT></TD></TR>";
-
- }
- print '<TR><TD BGCOLOR="#000000" COLSPAN=2></TD></TR>'.
- '<TR><TD ALIGN=right><FONT SIZE=-1>';
- }
-
- my $ahref = '';
- $ahref = '<A HREF="'.
- FS::TicketSystem->href_customer_tickets($custnum).
- '">'
- if $cust_main->get($addl_col);
-
- print $ahref. $cust_main->get($addl_col). '</A>';
- print "</FONT></TD><TD ALIGN=left>".
- "<FONT SIZE=-1>${ahref}Total</A><FONT>".
- "</TD></TR></TABLE>"
- if @custom_priorities;
+ <% if ( $addl_col eq 'tickets' ) { %>
- } else {
- print $cust_main->get($addl_col);
+ <% if ( @custom_priorities ) { %>
+
+ <TD CLASS="inv" BGCOLOR="<%= $bgcolor %>" ROWSPAN=<%= $rowspan || 1 %> ALIGN=right><FONT SIZE=-1>
+
+ <TABLE CLASS="inv" CELLSPACING=0 CELLPADDING=0>
+
+ <% foreach my $priority ( @custom_priorities, '' ) { %>
+
+ <%
+ my $num =
+ FS::TicketSystem->num_customer_tickets($custnum,$priority);
+ my $ahref = '';
+ $ahref= '<A HREF="'.
+ FS::TicketSystem->href_customer_tickets($custnum,$priority).
+ '">'
+ if $num;
+ %>
+
+ <TR>
+ <TD ALIGN=right>
+ <FONT SIZE=-1><%= $ahref.$num %></A></FONT>
+ </TD>
+ <TD ALIGN=left>
+ <FONT SIZE=-1><%= $ahref %><%= $priority || '<i>(none)</i>' %></A></FONT>
+ </TD>
+ </TR>
+
+ <% } %>
+
+ <TR>
+ <TH ALIGN=right STYLE="border-top: dashed 1px black">
+ <FONT SIZE=-1>
+
+ <% } else { %>
+
+ <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>" ROWSPAN=<%= $rowspan || 1 %> ALIGN=right><FONT SIZE=-1>
+
+ <% } %>
+
+ <%
+ my $ahref = '';
+ $ahref = '<A HREF="'.
+ FS::TicketSystem->href_customer_tickets($custnum).
+ '">'
+ if $cust_main->get($addl_col);
+ %>
+
+ <%= $ahref %><%= $cust_main->get($addl_col) %></A>
+
+ <% if ( @custom_priorities ) { %>
+
+ </FONT></TH>
+ <TH ALIGN=left STYLE="border-top: dashed 1px black">
+ <FONT SIZE=-1><%= ${ahref} %>Total</A><FONT>
+ </TH>
+ </TR>
+ </TABLE>
+
+ <% } %>
+
+ </FONT></TD>
+
+ } else { %>
+
+ <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>" ROWSPAN=<%= $rowspan || 1 %> ALIGN=right><FONT SIZE=-1>
+ <%= $cust_main->get($addl_col) %>
+ </FONT></TD>
+
+<%
}
- print "</FONT></TD>";
}
my($n1)='';
diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi
index e8b3f490d..614e9b509 100755
--- a/httemplate/search/cust_pkg.cgi
+++ b/httemplate/search/cust_pkg.cgi
@@ -24,6 +24,12 @@ if ( $cgi->param('magic') eq 'active'
push @where, FS::cust_pkg->active_sql();
+} elsif ( $cgi->param('magic') eq 'inactive'
+ || $cgi->param('status') eq 'inactive' ) {
+
+ push @where, FS::cust_pkg->inactive_sql();
+
+
} elsif ( $cgi->param('magic') eq 'suspended'
|| $cgi->param('status') eq 'suspended' ) {
@@ -47,7 +53,10 @@ if ( $cgi->param('magic') eq 'active'
#false lazinessish w/graph/cust_bill_pkg.cgi
my $classnum = 0;
my @pkg_class = ();
-if ( $cgi->param('classnum') =~ /^(\d*)$/ ) {
+if ( exists($cgi->Vars->{'classnum'})
+ && $cgi->param('classnum') =~ /^(\d*)$/
+ )
+{
$classnum = $1;
if ( $classnum ) { #a specific class
push @where, "classnum = $classnum";
@@ -90,7 +99,7 @@ if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) {
} else {
if ( $cgi->param('magic') &&
- $cgi->param('magic') =~ /^(active|suspended|cancell?ed)$/
+ $cgi->param('magic') =~ /^(active|inactive|suspended|cancell?ed)$/
) {
$orderby = 'ORDER BY pkgnum';