From 65f3079c363672d728147b30348925d495748cd6 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 30 Oct 2009 00:02:51 +0000 Subject: [PATCH] bulk tax changes, RT#6445 --- httemplate/browse/cust_main_county.cgi | 9 ++++++--- httemplate/edit/bulk-cust_main_county.html | 22 ++++++++++------------ httemplate/edit/process/bulk-cust_main_county.html | 9 ++++++--- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index d94e892ef..811fbd660 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -291,7 +291,7 @@ $html_posttotal .= ' )'; my $bulk_popup_link = include( '/elements/popup_link_onclick.html', - 'action' => "${p}edit/bulk-cust_main_county.html?MAGIC_taxnum_MAGIC", + 'action' => "${p}edit/bulk-cust_main_county.html?taxnum=MAGIC_taxnum_MAGIC", 'actionlabel' => 'Bulk add new tax', 'nofalse' => 1, 'height' => 420, @@ -324,7 +324,7 @@ my $html_foot = <unselect all | toggle all

-Add new tax to selected +Add new tax to selected +| +Bulk edit selected END diff --git a/httemplate/edit/bulk-cust_main_county.html b/httemplate/edit/bulk-cust_main_county.html index 93d9444b8..8e447e54f 100644 --- a/httemplate/edit/bulk-cust_main_county.html +++ b/httemplate/edit/bulk-cust_main_county.html @@ -1,7 +1,8 @@ -<% include('/elements/header-popup.html', 'Bulk Tax rate') %> +<% include('/elements/header-popup.html', $title ) %>
" METHOD="POST"> + @@ -68,7 +69,7 @@
- + <%init> @@ -78,16 +79,13 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); my @taxnum; -if ( $cgi->param('error') ) { - $cgi->param('taxnum') =~ /^([\d,]+)$/ - or die "no taxnum, but error: ". $cgi->param('error'); - @taxnum = split(',', $1); -} else { - my($query) = $cgi->keywords; - $query =~ /^([\d,]+)$/ - or $m->comp('/elements/errorpage-popup.html', 'Nothing selected'); - @taxnum = split(',', $1); -} +$cgi->param('taxnum') =~ /^([\d,]+)$/ + or $m->comp('/elements/errorpage-popup.html', $cgi->param('error') || 'Nothing selected'); +my @taxnum = split(',', $1); + +$cgi->param('action') =~ /^(add|edit)$/ or die "unknown action"; +my $action = $1; +my $title = "Bulk $action tax rate"; my @cust_main_county = map { diff --git a/httemplate/edit/process/bulk-cust_main_county.html b/httemplate/edit/process/bulk-cust_main_county.html index e05192e96..af9e49500 100644 --- a/httemplate/edit/process/bulk-cust_main_county.html +++ b/httemplate/edit/process/bulk-cust_main_county.html @@ -1,6 +1,6 @@ % if ( $error ) { #better to redirect back to %# <% $cgi->redirect("$url?". $cgi->query_string ) %> - <% include('/elements/header-popup.html', 'Error adding taxes' ) %> + <% include('/elements/header-popup.html', "Error ${action}ing taxes" ) %> Error: <% $error |h %>

@@ -9,7 +9,7 @@ % } else { - <% include('/elements/header-popup.html', 'Taxes added') %> + <% include('/elements/header-popup.html', "Taxes ${action}ed") %>