[freeside-commits] freeside/httemplate/search cust_main.cgi, 1.65, 1.66 cust_pkg.cgi, 1.37, 1.38

Ivan,,, ivan at wavetail.420.am
Tue Jul 25 01:33:48 PDT 2006


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail:/tmp/cvs-serv29002/httemplate/search

Modified Files:
	cust_main.cgi cust_pkg.cgi 
Log Message:
this should finish adding the "inactive" status, i think?

Index: cust_main.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_main.cgi,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -d -r1.65 -r1.66
--- cust_main.cgi	19 Jun 2006 06:03:18 -0000	1.65
+++ cust_main.cgi	25 Jul 2006 08:33:46 -0000	1.66
@@ -109,6 +109,7 @@
   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 @@
 
     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 ( $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;
+        <% if ( @custom_priorities ) { %>
 
-            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>";
+             <TD CLASS="inv" BGCOLOR="<%= $bgcolor %>" ROWSPAN=<%= $rowspan || 1 %> ALIGN=right><FONT SIZE=-1>
 
-          }
-          print '<TR><TD BGCOLOR="#000000" COLSPAN=2></TD></TR>'.
-                '<TR><TD ALIGN=right><FONT SIZE=-1>';
-        }
+               <TABLE CLASS="inv" CELLSPACING=0 CELLPADDING=0>
 
-        my $ahref = '';
-        $ahref = '<A HREF="'.
-                    FS::TicketSystem->href_customer_tickets($custnum).
-                    '">'
-          if $cust_main->get($addl_col);
+               <% foreach my $priority ( @custom_priorities, '' ) { %>
 
-        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;
+                 <%
+                    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>
+   
+               <% } %>
 
-      } else {
-        print $cust_main->get($addl_col);
+             <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)='';

Index: cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_pkg.cgi,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- cust_pkg.cgi	19 Jun 2006 02:33:52 -0000	1.37
+++ cust_pkg.cgi	25 Jul 2006 08:33:46 -0000	1.38
@@ -24,6 +24,12 @@
 
   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 @@
 #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 @@
 } else {
 
   if ( $cgi->param('magic') &&
-       $cgi->param('magic') =~ /^(active|suspended|cancell?ed)$/
+       $cgi->param('magic') =~ /^(active|inactive|suspended|cancell?ed)$/
   ) {
 
     $orderby = 'ORDER BY pkgnum';



More information about the freeside-commits mailing list