summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/cust_main_county-collapse.cgi
diff options
context:
space:
mode:
authorivan <ivan>2011-01-30 06:33:41 +0000
committerivan <ivan>2011-01-30 06:33:41 +0000
commit40b466a6f51f20313f902be0935c0b08653bf1dd (patch)
treec78fb381e2cf7f1654469d9ebc920fa0caf61ccb /httemplate/edit/process/cust_main_county-collapse.cgi
parent6877b0f1447c211f1a992487eeaf9bda787c4b71 (diff)
improve tax edit UI: add more counties & remove individual counties, RT#11144
Diffstat (limited to 'httemplate/edit/process/cust_main_county-collapse.cgi')
-rwxr-xr-xhttemplate/edit/process/cust_main_county-collapse.cgi15
1 files changed, 11 insertions, 4 deletions
diff --git a/httemplate/edit/process/cust_main_county-collapse.cgi b/httemplate/edit/process/cust_main_county-collapse.cgi
index 9608fc919..710e692fe 100755
--- a/httemplate/edit/process/cust_main_county-collapse.cgi
+++ b/httemplate/edit/process/cust_main_county-collapse.cgi
@@ -1,11 +1,15 @@
-<% $cgi->redirect(popurl(3). "browse/cust_main_county.cgi") %>
+<% $cgi->redirect(popurl(3). "browse/cust_main_county.cgi?".
+ "country=". uri_escape($cgi->param('country')).";".
+ 'state='. uri_escape($cgi->param('state')). ';'.
+ 'county='. uri_escape($cgi->param('county'))
+ )
+%>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-my($query) = $cgi->keywords;
-$query =~ /^(\d+)$/ or die "Illegal taxnum!";
+$cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!";
my $taxnum = $1;
my $cust_main_county = qsearchs('cust_main_county', { 'taxnum' => $taxnum } )
or die "Unknown taxnum $taxnum";
@@ -37,9 +41,12 @@ foreach my $delete ( qsearch('cust_main_county', \%search) ) {
$cust_main_county->taxnum('');
if ( $cust_main_county->city ) {
$cust_main_county->city('');
-} else {
+} elsif ( $cust_main_county->county ) {
$cust_main_county->county('');
+} else {
+ die "can't collapse that";
}
+
my $error = $cust_main_county->insert;
die $error if $error;