diff options
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/browse/agent.cgi | 114 | ||||
-rw-r--r-- | httemplate/elements/table-grid.html | 6 | ||||
-rwxr-xr-x | httemplate/search/cust_main.cgi | 111 | ||||
-rwxr-xr-x | httemplate/search/cust_pkg.cgi | 13 |
4 files changed, 174 insertions, 70 deletions
diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi index 17cc8bd40..f5157d9b7 100755 --- a/httemplate/browse/agent.cgi +++ b/httemplate/browse/agent.cgi @@ -29,21 +29,27 @@ full offerings (via their type).<BR><BR> %> <% } %> -<%= table() %> +<%= include('/elements/table-grid.html') %> + +<% my $bgcolor1 = '#eeeeee'; + my $bgcolor2 = '#ffffff'; + my $bgcolor = ''; +%> + <TR> - <TH COLSPAN=<%= ( $cgi->param('showdisabled') || !dbdef->table('agent')->column('disabled') ) ? 2 : 3 %>>Agent</TH> - <TH>Type</TH> - <TH>Customers</TH> - <TH><FONT SIZE=-1>Customer<BR>packages</FONT></TH> - <TH>Reports</TH> - <TH>Registration codes</TH> - <TH>Prepaid cards</TH> + <TH CLASS="grid" BGCOLOR="#cccccc" COLSPAN=<%= ( $cgi->param('showdisabled') || !dbdef->table('agent')->column('disabled') ) ? 2 : 3 %>>Agent</TH> + <TH CLASS="grid" BGCOLOR="#cccccc">Type</TH> + <TH CLASS="grid" BGCOLOR="#cccccc">Customers</TH> + <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Customer<BR>packages</FONT></TH> + <TH CLASS="grid" BGCOLOR="#cccccc">Reports</TH> + <TH CLASS="grid" BGCOLOR="#cccccc">Registration codes</TH> + <TH CLASS="grid" BGCOLOR="#cccccc">Prepaid cards</TH> <% if ( $conf->config('ticket_system') ) { %> - <TH>Ticketing</TH> + <TH CLASS="grid" BGCOLOR="#cccccc">Ticketing</TH> <% } %> - <TH><FONT SIZE=-1>Payment Gateway Overrides</FONT></TH> - <TH><FONT SIZE=-1>Freq.</FONT></TH> - <TH><FONT SIZE=-1>Prog.</FONT></TH> + <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Payment Gateway Overrides</FONT></TH> + <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Freq.</FONT></TH> + <TH CLASS="grid" BGCOLOR="#cccccc"><FONT SIZE=-1>Prog.</FONT></TH> </TR> <% # <TH><FONT SIZE=-1>Agent #</FONT></TH> @@ -58,107 +64,157 @@ foreach my $agent ( sort { 'agentnum='. $agent->agentnum; my $cust_pkg_link = $p. 'search/cust_pkg.cgi?agentnum='. $agent->agentnum; + + if ( $bgcolor eq $bgcolor1 ) { + $bgcolor = $bgcolor2; + } else { + $bgcolor = $bgcolor1; + } %> <TR> - <TD><A HREF="<%=$p%>edit/agent.cgi?<%= $agent->agentnum %>"> + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"><A HREF="<%=$p%>edit/agent.cgi?<%= $agent->agentnum %>"> <%= $agent->agentnum %></A></TD> <% if ( dbdef->table('agent')->column('disabled') && !$cgi->param('showdisabled') ) { %> - <TD><%= $agent->disabled ? 'DISABLED' : '' %></TD> + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"><%= $agent->disabled ? 'DISABLED' : '' %></TD> <% } %> - <TD><A HREF="<%=$p%>edit/agent.cgi?<%= $agent->agentnum %>"> + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"><A HREF="<%=$p%>edit/agent.cgi?<%= $agent->agentnum %>"> <%= $agent->agent %></A></TD> - <TD><A HREF="<%=$p%>edit/agent_type.cgi?<%= $agent->typenum %>"><%= $agent->agent_type->atype %></A></TD> + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"><A HREF="<%=$p%>edit/agent_type.cgi?<%= $agent->typenum %>"><%= $agent->agent_type->atype %></A></TD> + + <TD CLASS="inv" BGCOLOR="<%= $bgcolor %>"> + <TABLE CLASS="inv" CELLSPACING=0 CELLPADDING=0> - <TD> - <TABLE CELLSPACING=0 CELLPADDING=0> <TR> <TH ALIGN="right" WIDTH="40%"> - <%= my $num_prospect = $agent->num_prospect_cust_main %> + <FONT COLOR="#7e0079"> + <%= my $num_prospect = $agent->num_prospect_cust_main %> + </FONT> </TH> + <TD> <% if ( $num_prospect ) { %> <A HREF="<%= $cust_main_link %>&prospect=1"><% } %>prospects<% if ($num_prospect ) { %></A><% } %> <TD> </TR> + + <TR> + <TH ALIGN="right" WIDTH="40%"> + <FONT COLOR="#0000CC"> + <%= my $num_inactive = $agent->num_inactive_cust_main %> + </FONT> + </TH> + + <TD> + <% if ( $num_inactive ) { %> + <A HREF="<%= $cust_main_link %>&inactive=1"><% } %>inactive<% if ( $num_inactive ) { %></A><% } %> + </TD> + </TR> + <TR> <TH ALIGN="right" WIDTH="40%"> <FONT COLOR="#00CC00"> <%= my $num_active = $agent->num_active_cust_main %> </FONT> </TH> + <TD> <% if ( $num_active ) { %> <A HREF="<%= $cust_main_link %>&active=1"><% } %>active<% if ( $num_active ) { %></A><% } %> </TD> </TR> + <TR> <TH ALIGN="right" WIDTH="40%"> <FONT COLOR="#FF9900"> <%= my $num_susp = $agent->num_susp_cust_main %> </FONT> </TH> + <TD> <% if ( $num_susp ) { %> <A HREF="<%= $cust_main_link %>&suspended=1"><% } %>suspended<% if ( $num_susp ) { %></A><% } %> </TD> </TR> + <TR> <TH ALIGN="right" WIDTH="40%"> <FONT COLOR="#FF0000"> <%= my $num_cancel = $agent->num_cancel_cust_main %> </FONT> </TH> + <TD> <% if ( $num_cancel ) { %> <A HREF="<%= $cust_main_link %>&showcancelledcustomers=1&cancelled=1"><% } %>cancelled<% if ( $num_cancel ) { %></A><% } %> </TD> </TR> + </TABLE> </TD> - <TD> - <TABLE CELLSPACING=0 CELLPADDING=0> + <TD CLASS="inv" BGCOLOR="<%= $bgcolor %>" VALIGN="bottom"> + <TABLE CLASS="inv" CELLSPACING=0 CELLPADDING=0> + + <TR> + <TH ALIGN="right" WIDTH="40%"> + <FONT COLOR="#0000CC"> + <%= my $num_inactive_pkg = $agent->num_inactive_cust_pkg %> + </FONT> + </TH> + + <TD> + <% if ( $num_inactive_pkg ) { %> + <A HREF="<%= $cust_pkg_link %>&magic=inactive"><% } %>inactive<% if ( $num_inactive_pkg ) { %></A><% } %> + </TD> + </TR> + <TR> <TH ALIGN="right" WIDTH="40%"> <FONT COLOR="#00CC00"> <%= my $num_active_pkg = $agent->num_active_cust_pkg %> </FONT> </TH> + <TD> <% if ( $num_active_pkg ) { %> <A HREF="<%= $cust_pkg_link %>&magic=active"><% } %>active<% if ( $num_active_pkg ) { %></A><% } %> </TD> </TR> + <TR> <TH ALIGN="right" WIDTH="40%"> <FONT COLOR="#FF9900"> <%= my $num_susp_pkg = $agent->num_susp_cust_pkg %> </FONT> + </TH> <TD> <% if ( $num_susp_pkg ) { %> <A HREF="<%= $cust_pkg_link %>&magic=suspended"><% } %>suspended<% if ( $num_susp_pkg ) { %></A><% } %> </TD> </TR> + <TR> <TH ALIGN="right" WIDTH="40%"> <FONT COLOR="#FF0000"> <%= my $num_cancel_pkg = $agent->num_cancel_cust_pkg %> </FONT> </TH> + <TD> <% if ( $num_cancel_pkg ) { %> <A HREF="<%= $cust_pkg_link %>&magic=cancelled"><% } %>cancelled<% if ( $num_cancel_pkg ) { %></A><% } %> </TD> </TR> + </TABLE> </TD> - <TD> + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"> <A HREF="<%= $p %>search/report_cust_pay.html?agentnum=<%= $agent->agentnum %>">Payments</A> <BR><A HREF="<%= $p %>search/report_cust_credit.html?agentnum=<%= $agent->agentnum %>">Credits</A> <BR><A HREF="<%= $p %>search/report_receivables.cgi?agentnum=<%= $agent->agentnum %>">A/R Aging</A> @@ -166,14 +222,14 @@ foreach my $agent ( sort { </TD> - <TD> + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"> <%= my $num_reg_code = $agent->num_reg_code %> <% if ( $num_reg_code ) { %> <A HREF="<%=$p%>search/reg_code.html?agentnum=<%= $agent->agentnum %>"><% } %>Unused<% if ( $num_reg_code ) { %></A><% } %> <BR><A HREF="<%=$p%>edit/reg_code.cgi?agentnum=<%= $agent->agentnum %>">Generate codes</A> </TD> - <TD> + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"> <%= my $num_prepay_credit = $agent->num_prepay_credit %> <% if ( $num_prepay_credit ) { %> <A HREF="<%=$p%>search/prepay_credit.html?agentnum=<%= $agent->agentnum %>"><% } %>Unused<% if ( $num_prepay_credit ) { %></A><% } %> @@ -182,7 +238,7 @@ foreach my $agent ( sort { <% if ( $conf->config('ticket_system') ) { %> - <TD> + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"> <% if ( $agent->ticketing_queueid ) { %> Queue: <%= $agent->ticketing_queueid %>: <%= $agent->ticketing_queue %><BR> <% } %> @@ -190,7 +246,7 @@ foreach my $agent ( sort { <% } %> - <TD> + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"> <TABLE CELLSPACING=0 CELLPADDING=0> <% foreach my $override ( # sort { } want taxclass-full stuff first? and default cards (empty cardtype) @@ -214,8 +270,10 @@ foreach my $agent ( sort { </TABLE> </TD> - <TD><%= $agent->freq %></TD> - <TD><%= $agent->prog %></TD> +<!-- + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"><%= $agent->freq %></TD> + <TD CLASS="grid" BGCOLOR="<%= $bgcolor %>"><%= $agent->prog %></TD> +--> </TR> diff --git a/httemplate/elements/table-grid.html b/httemplate/elements/table-grid.html index 17eafdf1a..fd1cb9113 100644 --- a/httemplate/elements/table-grid.html +++ b/httemplate/elements/table-grid.html @@ -5,9 +5,15 @@ %> <STYLE TYPE="text/css"> + .grid table { border: solid; empty-cells: show } .grid TH { padding-left: 3px; padding-right: 3px; border: 1px solid #dddddd; border-bottom: dashed 1px black; border-right: none } .grid TD { padding-left: 3px; padding-right: 3px; empty-cells: show; border: 1px solid #cccccc; border-bottom: none; border-right: none } + +.inv table { border: none } +.inv TH { border: none } +.inv TD { border: none } + </STYLE> <TABLE CLASS="grid" CELLSPACING=<%= $opt{cellspacing} %> CELLPADDING=<%= $opt{cellpadding} %> BORDER=1 BORDERCOLOR="#000000" STYLE="border: solid 1px black; empty-cells: show"> 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'; |