diff options
author | ivan <ivan> | 2002-02-09 18:24:02 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-02-09 18:24:02 +0000 |
commit | 0bdec843e4a9bb7f947c9ba980a40f7bf37020fb (patch) | |
tree | 091a5f2de8c7b85362fd68eff63f111788c1b45c /httemplate/edit/process | |
parent | 4609bb519b7fdf0eace6523fee49752cdb82a1ef (diff) |
no more exit() in templates
Diffstat (limited to 'httemplate/edit/process')
-rwxr-xr-x | httemplate/edit/process/agent_type.cgi | 52 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_main_county-expand.cgi | 4 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_main_county.cgi | 4 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_pay.cgi | 3 | ||||
-rwxr-xr-x | httemplate/edit/process/part_pkg.cgi | 6 |
5 files changed, 34 insertions, 35 deletions
diff --git a/httemplate/edit/process/agent_type.cgi b/httemplate/edit/process/agent_type.cgi index 2d1159708..4e98cf113 100755 --- a/httemplate/edit/process/agent_type.cgi +++ b/httemplate/edit/process/agent_type.cgi @@ -1,4 +1,4 @@ -<!-- $Id: agent_type.cgi,v 1.3 2002-01-30 14:18:08 ivan Exp $ --> +<!-- $Id: agent_type.cgi,v 1.4 2002-02-09 18:24:01 ivan Exp $ --> <% my $typenum = $cgi->param('typenum'); @@ -21,35 +21,35 @@ if ( $typenum ) { if ( $error ) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string ); - exit; -} +} else { + + foreach my $part_pkg (qsearch('part_pkg',{})) { + my($pkgpart)=$part_pkg->getfield('pkgpart'); -foreach my $part_pkg (qsearch('part_pkg',{})) { - my($pkgpart)=$part_pkg->getfield('pkgpart'); - - my($type_pkgs)=qsearchs('type_pkgs',{ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, - }); - if ( $type_pkgs && ! $cgi->param("pkgpart$pkgpart") ) { - my($d_type_pkgs)=$type_pkgs; #need to save $type_pkgs for below. - $error=$d_type_pkgs->delete; - die $error if $error; - - } elsif ( $cgi->param("pkgpart$pkgpart") - && ! $type_pkgs - ) { - #ok to clobber it now (but bad form nonetheless?) - $type_pkgs=new FS::type_pkgs ({ - 'typenum' => $typenum, - 'pkgpart' => $pkgpart, + my($type_pkgs)=qsearchs('type_pkgs',{ + 'typenum' => $typenum, + 'pkgpart' => $pkgpart, }); - $error= $type_pkgs->insert; - die $error if $error; + if ( $type_pkgs && ! $cgi->param("pkgpart$pkgpart") ) { + my($d_type_pkgs)=$type_pkgs; #need to save $type_pkgs for below. + $error=$d_type_pkgs->delete; + die $error if $error; + + } elsif ( $cgi->param("pkgpart$pkgpart") + && ! $type_pkgs + ) { + #ok to clobber it now (but bad form nonetheless?) + $type_pkgs=new FS::type_pkgs ({ + 'typenum' => $typenum, + 'pkgpart' => $pkgpart, + }); + $error= $type_pkgs->insert; + die $error if $error; + } + } + print $cgi->redirect(popurl(3). "browse/agent_type.cgi"); } -print $cgi->redirect(popurl(3). "browse/agent_type.cgi"); - %> diff --git a/httemplate/edit/process/cust_main_county-expand.cgi b/httemplate/edit/process/cust_main_county-expand.cgi index b16fab4fe..342779048 100755 --- a/httemplate/edit/process/cust_main_county-expand.cgi +++ b/httemplate/edit/process/cust_main_county-expand.cgi @@ -1,4 +1,4 @@ -<!-- $Id: cust_main_county-expand.cgi,v 1.4 2002-01-30 14:18:09 ivan Exp $ --> +<!-- $Id: cust_main_county-expand.cgi,v 1.5 2002-02-09 18:24:01 ivan Exp $ --> <% $cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!"; @@ -19,7 +19,7 @@ if ( $cgi->param('delim') eq 'n' ) { unless ( /^\s*([\w\- ]+)\s*$/ ) { $cgi->param('error', "Illegal item in expansion"); print $cgi->redirect(popurl(2). "cust_main_county-expand.cgi?". $cgi->query_string ); - exit; + myexit(); } $1; } @expansion; diff --git a/httemplate/edit/process/cust_main_county.cgi b/httemplate/edit/process/cust_main_county.cgi index 0f0246b73..e9d130897 100755 --- a/httemplate/edit/process/cust_main_county.cgi +++ b/httemplate/edit/process/cust_main_county.cgi @@ -1,4 +1,4 @@ -<!-- $Id: cust_main_county.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ --> +<!-- $Id: cust_main_county.cgi,v 1.4 2002-02-09 18:24:01 ivan Exp $ --> <% foreach ( $cgi->param ) { @@ -14,7 +14,7 @@ foreach ( $cgi->param ) { if ( $error ) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string ); - exit; + myexit(); } } diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index c75e53280..953ff3edb 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -1,4 +1,4 @@ -<!-- $Id: cust_pay.cgi,v 1.6 2002-01-30 14:18:09 ivan Exp $ --> +<!-- $Id: cust_pay.cgi,v 1.7 2002-02-09 18:24:01 ivan Exp $ --> <% $cgi->param('linknum') =~ /^(\d+)$/ @@ -22,7 +22,6 @@ my $error = $new->insert; if ($error) { $cgi->param('error', $error); print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string ); - exit; } elsif ( $link eq 'invnum' ) { print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$linknum"); } elsif ( $link eq 'custnum' ) { diff --git a/httemplate/edit/process/part_pkg.cgi b/httemplate/edit/process/part_pkg.cgi index 2ba1cbeb0..5240d8cc2 100755 --- a/httemplate/edit/process/part_pkg.cgi +++ b/httemplate/edit/process/part_pkg.cgi @@ -1,4 +1,4 @@ -<!-- $Id: part_pkg.cgi,v 1.7 2002-01-30 14:18:09 ivan Exp $ --> +<!-- $Id: part_pkg.cgi,v 1.8 2002-02-09 18:24:01 ivan Exp $ --> <% my $dbh = dbh; @@ -34,7 +34,7 @@ foreach my $part_svc ( qsearch('part_svc', {} ) ) { unless ( $quantity =~ /^(\d+)$/ ) { $cgi->param('error', "Illegal quantity" ); print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string ); - exit; + myexit(); } } @@ -58,7 +58,7 @@ if ( $error ) { $dbh->rollback; $cgi->param('error', $error ); print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string ); - exit; + myexit(); } foreach $part_svc (qsearch('part_svc',{})) { |