From: ivan Date: Fri, 30 Oct 2009 00:02:52 +0000 (+0000) Subject: bulk tax changes, RT#6445 X-Git-Tag: freeside_1_9_2~263 X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=1a71a9d6cb7f847947b1e95a61f49cf16b92ab6a;p=freeside.git bulk tax changes, RT#6445 --- diff --git a/httemplate/browse/cust_main_county.cgi b/httemplate/browse/cust_main_county.cgi index 232e6883c..14bdfff38 100755 --- a/httemplate/browse/cust_main_county.cgi +++ b/httemplate/browse/cust_main_county.cgi @@ -262,7 +262,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, @@ -295,7 +295,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") %>