[freeside-commits] branch master updated. 79c8be3bd0c5db42794b36bf5b5dd25addba67cb

Ivan Kohler ivan at freeside.biz
Mon Oct 21 12:35:15 PDT 2019


The branch, master has been updated
       via  79c8be3bd0c5db42794b36bf5b5dd25addba67cb (commit)
      from  0bd6fd8b74c3cb6a7abf01ba5974d2d9399da3ab (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 79c8be3bd0c5db42794b36bf5b5dd25addba67cb
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Mon Oct 21 12:33:06 2019 -0700

    common element for cust_pkg search form fields

diff --git a/httemplate/misc/bulk_unsuspend_pkg.cgi b/httemplate/elements/cust_pkg-search-form_input.html
similarity index 71%
copy from httemplate/misc/bulk_unsuspend_pkg.cgi
copy to httemplate/elements/cust_pkg-search-form_input.html
index 8fbc41841..c2dbbe5c3 100644
--- a/httemplate/misc/bulk_unsuspend_pkg.cgi
+++ b/httemplate/elements/cust_pkg-search-form_input.html
@@ -1,12 +1,3 @@
-<% include('/elements/header-popup.html', "Unsuspend Packages") %>
-
-% if ( $cgi->param('error') ) {
-  <FONT SIZE="+1" COLOR="#ff0000">Error: <% $cgi->param('error') %></FONT>
-  <BR><BR>
-% }
-
-<FORM ACTION="<% $p %>misc/process/bulk_unsuspend_pkg.cgi" METHOD=POST>
-
 %# some false laziness w/search/cust_pkg.cgi
 
 <INPUT TYPE="hidden" NAME="query" VALUE="<% $cgi->keywords |h %>">
@@ -42,25 +33,9 @@
   <INPUT TYPE="hidden" NAME="<% $field %>_ending" VALUE="<% $cgi->param("${field}_ending") |h %>">
 % }
 
-<% ntable('#cccccc') %>
-
-  <TR>
-    <TD><INPUT TYPE="checkbox" NAME="confirm"></TD>
-    <TD>Confirm Unsuspend Packages</TD>
-  </TR>
-
-</TABLE>
-
-<BR>
-<INPUT TYPE="submit" VALUE="Unsuspend Packages">
-
-</FORM>
-</BODY>
-</HTML>
-
 <%init>
 
-die "access denied"
-  unless $FS::CurrentUser::CurrentUser->access_right('Bulk change customer packages');
+my( $cgi ) = @_;
+#my( $cgi, %opt ) = @_;
 
 </%init>
diff --git a/httemplate/misc/bulk_cancel_pkg.cgi b/httemplate/misc/bulk_cancel_pkg.cgi
index 5499af19d..373ec35ba 100644
--- a/httemplate/misc/bulk_cancel_pkg.cgi
+++ b/httemplate/misc/bulk_cancel_pkg.cgi
@@ -11,40 +11,7 @@
       onSubmit = "document.OneTrueForm.submit.disabled=true;"
 >
 
-%# some false laziness w/search/cust_pkg.cgi
-
-<INPUT TYPE="hidden" NAME="query" VALUE="<% $cgi->keywords |h %>">
-% for my $param (
-%   qw(
-%     agentnum cust_status cust_main_salesnum salesnum custnum magic status
-%     custom pkgbatch zip reasonnum
-%     477part 477rownum date
-%     report_option
-%   ),
-%   grep { /^location_\w+$/ || /^report_option_any/ } $cgi->param
-% ) {
-  <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $cgi->param($param) |h %>">
-% }
-%
-% for my $param (qw( censustract censustract2 ) ) {
-%   next unless grep { $_ eq $param } $cgi->param;
-  <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $cgi->param($param) |h %>">
-% }
-%
-% for my $param (qw( pkgpart classnum refnum towernum )) {
-%   foreach my $value ($cgi->param($param)) {
-      <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $value |h %>">
-%   }
-% }
-%
-% 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 %>">
-% }
+<& /elements/cust_pkg-search-form_input.html, $cgi &>
 
 <% ntable('#cccccc') %>
 
diff --git a/httemplate/misc/bulk_change_pkg.cgi b/httemplate/misc/bulk_change_pkg.cgi
index 6ed272fb8..2c8c17914 100755
--- a/httemplate/misc/bulk_change_pkg.cgi
+++ b/httemplate/misc/bulk_change_pkg.cgi
@@ -7,40 +7,7 @@
 
 <FORM ACTION="<% $p %>misc/process/bulk_change_pkg.cgi" METHOD=POST>
 
-%# some false laziness w/search/cust_pkg.cgi
-
-<INPUT TYPE="hidden" NAME="query" VALUE="<% $cgi->keywords |h %>">
-% for my $param (
-%   qw(
-%     agentnum cust_status cust_main_salesnum salesnum custnum magic status
-%     custom pkgbatch zip
-%     477part 477rownum date
-%     report_option
-%   ),
-%   grep { /^location_\w+$/ || /^report_option_any/ } $cgi->param
-% ) {
-  <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $cgi->param($param) |h %>">
-% }
-%
-% for my $param (qw( censustract censustract2 ) ) {
-%   next unless grep { $_ eq $param } $cgi->param;
-  <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $cgi->param($param) |h %>">
-% }
-%
-% for my $param (qw( pkgpart classnum refnum towernum )) {
-%   foreach my $value ($cgi->param($param)) {
-      <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $value |h %>">
-%   }
-% }
-%
-% 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 %>">
-% }
+<& /elements/cust_pkg-search-form_input.html, $cgi &>
 
 <% ntable('#cccccc') %>
 
diff --git a/httemplate/misc/bulk_suspend_pkg.cgi b/httemplate/misc/bulk_suspend_pkg.cgi
index e41ea2b1a..9b2bd62e4 100644
--- a/httemplate/misc/bulk_suspend_pkg.cgi
+++ b/httemplate/misc/bulk_suspend_pkg.cgi
@@ -7,40 +7,7 @@
 
 <FORM ACTION="<% $p %>misc/process/bulk_suspend_pkg.cgi" METHOD=POST>
 
-%# some false laziness w/search/cust_pkg.cgi
-
-<INPUT TYPE="hidden" NAME="query" VALUE="<% $cgi->keywords |h %>">
-% for my $param (
-%   qw(
-%     agentnum cust_status cust_main_salesnum salesnum custnum magic status
-%     custom pkgbatch zip reasonnum
-%     477part 477rownum date
-%     report_option
-%   ),
-%   grep { /^location_\w+$/ || /^report_option_any/ } $cgi->param
-% ) {
-  <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $cgi->param($param) |h %>">
-% }
-%
-% for my $param (qw( censustract censustract2 ) ) {
-%   next unless grep { $_ eq $param } $cgi->param;
-  <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $cgi->param($param) |h %>">
-% }
-%
-% for my $param (qw( pkgpart classnum refnum towernum )) {
-%   foreach my $value ($cgi->param($param)) {
-      <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $value |h %>">
-%   }
-% }
-%
-% 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 %>">
-% }
+<& /elements/cust_pkg-search-form_input.html, $cgi &>
 
 <% ntable('#cccccc') %>
 
@@ -91,4 +58,4 @@ my $date_format = $conf->config('date_format') || '%m/%d/%Y';
 
 my $date = time;
 
-</%init>
\ No newline at end of file
+</%init>
diff --git a/httemplate/misc/bulk_unsuspend_pkg.cgi b/httemplate/misc/bulk_unsuspend_pkg.cgi
index 8fbc41841..97c6c55e3 100644
--- a/httemplate/misc/bulk_unsuspend_pkg.cgi
+++ b/httemplate/misc/bulk_unsuspend_pkg.cgi
@@ -7,40 +7,7 @@
 
 <FORM ACTION="<% $p %>misc/process/bulk_unsuspend_pkg.cgi" METHOD=POST>
 
-%# some false laziness w/search/cust_pkg.cgi
-
-<INPUT TYPE="hidden" NAME="query" VALUE="<% $cgi->keywords |h %>">
-% for my $param (
-%   qw(
-%     agentnum cust_status cust_main_salesnum salesnum custnum magic status
-%     custom pkgbatch zip reasonnum
-%     477part 477rownum date
-%     report_option
-%   ),
-%   grep { /^location_\w+$/ || /^report_option_any/ } $cgi->param
-% ) {
-  <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $cgi->param($param) |h %>">
-% }
-%
-% for my $param (qw( censustract censustract2 ) ) {
-%   next unless grep { $_ eq $param } $cgi->param;
-  <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $cgi->param($param) |h %>">
-% }
-%
-% for my $param (qw( pkgpart classnum refnum towernum )) {
-%   foreach my $value ($cgi->param($param)) {
-      <INPUT TYPE="hidden" NAME="<% $param %>" VALUE="<% $value |h %>">
-%   }
-% }
-%
-% 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 %>">
-% }
+<& /elements/cust_pkg-search-form_input.html, $cgi &>
 
 <% ntable('#cccccc') %>
 

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

Summary of changes:
 .../cust_pkg-search-form_input.html}               | 29 ++---------------
 httemplate/misc/bulk_cancel_pkg.cgi                | 35 +-------------------
 httemplate/misc/bulk_change_pkg.cgi                | 35 +-------------------
 httemplate/misc/bulk_suspend_pkg.cgi               | 37 ++--------------------
 httemplate/misc/bulk_unsuspend_pkg.cgi             | 35 +-------------------
 5 files changed, 7 insertions(+), 164 deletions(-)
 copy httemplate/{misc/bulk_unsuspend_pkg.cgi => elements/cust_pkg-search-form_input.html} (71%)




More information about the freeside-commits mailing list