add svc_forward, depriciate svc_acct_sm
[freeside.git] / htdocs / edit / process / cust_main_county.cgi
1 #!/usr/bin/perl -Tw
2 #
3 # $Id: cust_main_county.cgi,v 1.6 1999-01-25 12:19:08 ivan Exp $
4 #
5 # ivan@sisd.com 97-dec-16
6 #
7 # Changes to allow page to work at a relative position in server
8 #       bmccane@maxbaud.net     98-apr-3
9 #
10 # lose background, FS::CGI ivan@sisd.com 98-sep-2
11 #
12 # $Log: cust_main_county.cgi,v $
13 # Revision 1.6  1999-01-25 12:19:08  ivan
14 # yet more mod_perl stuff
15 #
16 # Revision 1.5  1999/01/19 05:13:52  ivan
17 # for mod_perl: no more top-level my() variables; use vars instead
18 # also the last s/create/new/;
19 #
20 # Revision 1.4  1999/01/18 22:47:53  ivan
21 # s/create/new/g; and use fields('table_name')
22 #
23 # Revision 1.3  1998/12/17 08:40:21  ivan
24 # s/CGI::Request/CGI.pm/; etc
25 #
26 # Revision 1.2  1998/11/18 09:01:41  ivan
27 # i18n! i18n!
28 #
29
30 use strict;
31 use vars qw( $cgi );
32 use CGI;
33 use CGI::Carp qw(fatalsToBrowser);
34 use FS::UID qw(cgisuidsetup);
35 use FS::CGI qw(popurl);
36 use FS::Record qw(qsearch qsearchs);
37 use FS::cust_main_county;
38
39 $cgi = new CGI;
40 &cgisuidsetup($cgi);
41
42 foreach ( $cgi->param ) {
43   /^tax(\d+)$/ or die "Illegal form $_!";
44   my($taxnum)=$1;
45   my($old)=qsearchs('cust_main_county',{'taxnum'=>$taxnum})
46     or die "Couldn't find taxnum $taxnum!";
47   next unless $old->getfield('tax') ne $cgi->param("tax$taxnum");
48   my(%hash)=$old->hash;
49   $hash{tax}=$cgi->param("tax$taxnum");
50   my($new)=new FS::cust_main_county \%hash;
51   my($error)=$new->replace($old);
52   if ( $error ) {
53     $cgi->param('error', $error);
54     print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string );
55     exit;
56   }
57 }
58
59 print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi");
60