[freeside-commits] freeside/httemplate/search cust_pkg.cgi, 1.59, 1.60 report_cust_pkg.html, 1.14, 1.15

Ivan,,, ivan at wavetail.420.am
Tue Oct 27 23:13:26 PDT 2009


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail.420.am:/tmp/cvs-serv22667/httemplate/search

Modified Files:
	cust_pkg.cgi report_cust_pkg.html 
Log Message:
customer link to package reports for that customer, RT#6180

Index: report_cust_pkg.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/report_cust_pkg.html,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- report_cust_pkg.html	29 Jun 2009 13:53:25 -0000	1.14
+++ report_cust_pkg.html	28 Oct 2009 06:13:24 -0000	1.15
@@ -1,7 +1,8 @@
-<% include('/elements/header.html', 'Package Report' ) %>
+<% include('/elements/header.html', $title ) %>
 
 <FORM ACTION="cust_pkg.cgi" METHOD="GET">
 <INPUT TYPE="hidden" NAME="magic" VALUE="bill">
+<INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
 
   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
 
@@ -11,11 +12,13 @@
       </TH>
     </TR>
 
+% unless ( $custnum ) {
     <% include( '/elements/tr-select-agent.html',
                    'curr_value'    => scalar( $cgi->param('agentnum') ),
                    'disable_empty' => 0,
                )
     %>
+% }
 
     <% include( '/elements/tr-select-cust_pkg-status.html',
                   'onchange' => 'status_changed(this);',
@@ -155,6 +158,19 @@
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('List packages');
 
+my $title = 'Package Report';
+
+my $custnum = '';
+if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
+  $custnum = $1;
+  my $cust_main = qsearchs({
+    'table'     => 'cust_main', 
+    'hashref'   => { 'custnum' => $custnum },
+    'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
+  }) or die "unknown custnum $custnum";
+  $title .= ': '. $cust_main->name;
+}
+
 </%init>
 <%once>
 

Index: cust_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_pkg.cgi,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- cust_pkg.cgi	12 Aug 2009 02:36:25 -0000	1.59
+++ cust_pkg.cgi	28 Oct 2009 06:13:24 -0000	1.60
@@ -164,7 +164,7 @@
   
 $search_hash{'query'} = $cgi->keywords;
   
-for (qw( agentnum magic status classnum custom )) {
+for (qw( agentnum custnum magic status classnum custom )) {
   $search_hash{$_} = $cgi->param($_) if $cgi->param($_);
 }
 



More information about the freeside-commits mailing list