From 79c8be3bd0c5db42794b36bf5b5dd25addba67cb Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Mon, 21 Oct 2019 12:33:06 -0700 Subject: [PATCH] common element for cust_pkg search form fields --- .../elements/cust_pkg-search-form_input.html | 41 ++++++++++++++++++++++ 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, 46 insertions(+), 137 deletions(-) create mode 100644 httemplate/elements/cust_pkg-search-form_input.html diff --git a/httemplate/elements/cust_pkg-search-form_input.html b/httemplate/elements/cust_pkg-search-form_input.html new file mode 100644 index 000000000..c2dbbe5c3 --- /dev/null +++ b/httemplate/elements/cust_pkg-search-form_input.html @@ -0,0 +1,41 @@ +%# some false laziness w/search/cust_pkg.cgi + + +% 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 +% ) { + +% } +% +% for my $param (qw( censustract censustract2 ) ) { +% next unless grep { $_ eq $param } $cgi->param; + +% } +% +% for my $param (qw( pkgpart classnum refnum towernum )) { +% foreach my $value ($cgi->param($param)) { + +% } +% } +% +% foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel active )) { +% + "> + "> + "> + "> + "> +% } + +<%init> + +my( $cgi ) = @_; +#my( $cgi, %opt ) = @_; + + 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 - - -% 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 -% ) { - -% } -% -% for my $param (qw( censustract censustract2 ) ) { -% next unless grep { $_ eq $param } $cgi->param; - -% } -% -% for my $param (qw( pkgpart classnum refnum towernum )) { -% foreach my $value ($cgi->param($param)) { - -% } -% } -% -% foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel active )) { -% - "> - "> - "> - "> - "> -% } +<& /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 @@
-%# some false laziness w/search/cust_pkg.cgi - - -% 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 -% ) { - -% } -% -% for my $param (qw( censustract censustract2 ) ) { -% next unless grep { $_ eq $param } $cgi->param; - -% } -% -% for my $param (qw( pkgpart classnum refnum towernum )) { -% foreach my $value ($cgi->param($param)) { - -% } -% } -% -% foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel active )) { -% - "> - "> - "> - "> - "> -% } +<& /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 @@ -%# some false laziness w/search/cust_pkg.cgi - - -% 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 -% ) { - -% } -% -% for my $param (qw( censustract censustract2 ) ) { -% next unless grep { $_ eq $param } $cgi->param; - -% } -% -% for my $param (qw( pkgpart classnum refnum towernum )) { -% foreach my $value ($cgi->param($param)) { - -% } -% } -% -% foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel active )) { -% - "> - "> - "> - "> - "> -% } +<& /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; - \ No newline at end of file + 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 @@ -%# some false laziness w/search/cust_pkg.cgi - - -% 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 -% ) { - -% } -% -% for my $param (qw( censustract censustract2 ) ) { -% next unless grep { $_ eq $param } $cgi->param; - -% } -% -% for my $param (qw( pkgpart classnum refnum towernum )) { -% foreach my $value ($cgi->param($param)) { - -% } -% } -% -% foreach my $field (qw( setup last_bill bill adjourn susp expire contract_end change_date cancel active )) { -% - "> - "> - "> - "> - "> -% } +<& /elements/cust_pkg-search-form_input.html, $cgi &> <% ntable('#cccccc') %> -- 2.11.0