[freeside-commits] branch master updated. 944834c9a2595d57fe6ec600d353f0f688c3fe21

Christopher Burger burgerc at 420.am
Mon Oct 23 11:01:54 PDT 2017


The branch, master has been updated
       via  944834c9a2595d57fe6ec600d353f0f688c3fe21 (commit)
      from  d86acb18972bc027888cf2db0c2a6a34b7da2f55 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 944834c9a2595d57fe6ec600d353f0f688c3fe21
Author: Christopher Burger <burgerc at freeside.biz>
Date:   Mon Oct 23 14:01:23 2017 -0400

    RT# 77332 - Fixed error where all packages updated with new next bill date, instead of just selected ones.

diff --git a/httemplate/misc/bulk_pkg_increment_bill.cgi b/httemplate/misc/bulk_pkg_increment_bill.cgi
index fc9bbc8..85f05de 100755
--- a/httemplate/misc/bulk_pkg_increment_bill.cgi
+++ b/httemplate/misc/bulk_pkg_increment_bill.cgi
@@ -36,10 +36,10 @@
 % foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel active )) {
 % 
   <INPUT TYPE="hidden" NAME="<% $field %>_null" VALUE="<% $cgi->param("${field}_null") |h %>">
-  <INPUT TYPE="hidden" NAME="<% $field %>begin" VALUE="<% $cgi->param("${field}.begin") |h %>">
-  <INPUT TYPE="hidden" NAME="<% $field %>beginning" VALUE="<% $cgi->param("${field}beginning") |h %>">
-  <INPUT TYPE="hidden" NAME="<% $field %>end" VALUE="<% $cgi->param("${field}.end") |h %>">
-  <INPUT TYPE="hidden" NAME="<% $field %>ending" VALUE="<% $cgi->param("${field}.ending") |h %>">
+  <INPUT TYPE="hidden" NAME="<% $field %>_begin" VALUE="<% $cgi->param("${field}_begin") |h %>">
+  <INPUT TYPE="hidden" NAME="<% $field %>_beginning" VALUE="<% $cgi->param("${field}_beginning") |h %>">
+  <INPUT TYPE="hidden" NAME="<% $field %>_end" VALUE="<% $cgi->param("${field}_end") |h %>">
+  <INPUT TYPE="hidden" NAME="<% $field %>_ending" VALUE="<% $cgi->param("${field}_ending") |h %>">
 % }
 
 <% ntable('#cccccc') %>
diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi
index df1d7e5..16e16c3 100755
--- a/httemplate/search/cust_pkg.cgi
+++ b/httemplate/search/cust_pkg.cgi
@@ -4,6 +4,7 @@
                   'name'        => 'packages',
                   'query'       => $sql_query,
                   'count_query' => $count_query,
+                  'search_string' => $search_string,
                   'header'      => [ emt('#'),
                                      emt('Quan.'),
                                      emt('Package'),
@@ -150,6 +151,7 @@ my $conf = new FS::Conf;
 my $money_char = $conf->config('money_char') || '$';
 
 my %search_hash = ();
+my $search_string;
 
 #some false laziness w/misc/bulk_change_pkg.cgi
   
@@ -162,26 +164,31 @@ for (qw( agentnum cust_status cust_main_salesnum salesnum custnum magic status
     )) 
 {
   $search_hash{$_} = $cgi->param($_) if length($cgi->param($_));
+  $search_string .= '&'.$_.'='.$cgi->param($_) if length($cgi->param($_));
 }
 
 #arrays
 for my $param (qw( pkgpart classnum refnum towernum )) {
   $search_hash{$param} = [ $cgi->param($param) ]
     if grep { $_ eq $param } $cgi->param;
+  $search_string .= '&'.$param.'='.$cgi->param($param) if grep { $_ eq $param } $cgi->param;
 }
 
 #scalars that need to be passed if empty
 for my $param (qw( censustract censustract2 )) {
   $search_hash{$param} = $cgi->param($param) || ''
     if grep { $_ eq $param } $cgi->param;
+  $search_string .= '&'.$param.'='.$cgi->param($param) if grep { $_ eq $param } $cgi->param;
 }
 
 #location flags (checkboxes)
 my @loc = grep /^\w+$/, $cgi->param('loc');
 $search_hash{"location_$_"} = 1 foreach @loc;
+$search_string .= '&location_'.$_.'=1' foreach @loc;
 
 my $report_option = $cgi->param('report_option');
 $search_hash{report_option} = $report_option if $report_option;
+$search_string .= '&report_option='.$report_option if $report_option;
 
 for my $param (grep /^report_option_any/, $cgi->param) {
   $search_hash{$param} = $cgi->param($param);
@@ -204,6 +211,7 @@ my %disable = (
 foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel active )) {
 
   $search_hash{$field.'_null'} = scalar( $cgi->param($field.'_null') );
+  $search_string .= '&'.$field.'_null='.scalar( $cgi->param($field.'_null') );
 
   my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi, $field);
 
@@ -211,6 +219,7 @@ foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end cha
        or $disable{$cgi->param('status')}->{$field};
 
   $search_hash{$field} = [ $beginning, $ending ];
+  $search_string .= '&'.$field.'_begin='.$beginning.'&'.$field.'_end='.$ending;
 
 }
 
diff --git a/httemplate/search/elements/search-html.html b/httemplate/search/elements/search-html.html
index 3ea38ae..87bdbab 100644
--- a/httemplate/search/elements/search-html.html
+++ b/httemplate/search/elements/search-html.html
@@ -62,7 +62,7 @@
 
         <% defined($opt{'html_init'}) 
               ? ( ref($opt{'html_init'})
-                    ? &{$opt{'html_init'}}()
+                    ? &{$opt{'html_init'}}($opt{search_string})
                     : $opt{'html_init'}
                 )
               : ''

-----------------------------------------------------------------------

Summary of changes:
 httemplate/misc/bulk_pkg_increment_bill.cgi |    8 ++++----
 httemplate/search/cust_pkg.cgi              |    9 +++++++++
 httemplate/search/elements/search-html.html |    2 +-
 3 files changed, 14 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list