diff options
author | ivan <ivan> | 1999-02-07 09:59:44 +0000 |
---|---|---|
committer | ivan <ivan> | 1999-02-07 09:59:44 +0000 |
commit | e0da34d97b1463b55a334e8dae10cd55796e2312 (patch) | |
tree | 5a329798830cd2e894abbf6e4ad28bad106dc4d5 /htdocs/edit/process/part_referral.cgi | |
parent | 899b323ee2feeaf78afdb40526eb75995fe72cad (diff) |
more mod_perl fixes, and bugfixes Peter Wemm sent via email
Diffstat (limited to 'htdocs/edit/process/part_referral.cgi')
-rwxr-xr-x | htdocs/edit/process/part_referral.cgi | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/htdocs/edit/process/part_referral.cgi b/htdocs/edit/process/part_referral.cgi index 9886015f9..cde27ede1 100755 --- a/htdocs/edit/process/part_referral.cgi +++ b/htdocs/edit/process/part_referral.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: part_referral.cgi,v 1.5 1999-01-19 05:13:56 ivan Exp $ +# $Id: part_referral.cgi,v 1.6 1999-02-07 09:59:28 ivan Exp $ # # ivan@sisd.com 98-feb-23 # @@ -10,7 +10,10 @@ # lose background, FS::CGI ivan@sisd.com 98-sep-2 # # $Log: part_referral.cgi,v $ -# Revision 1.5 1999-01-19 05:13:56 ivan +# Revision 1.6 1999-02-07 09:59:28 ivan +# more mod_perl fixes, and bugfixes Peter Wemm sent via email +# +# Revision 1.5 1999/01/19 05:13:56 ivan # for mod_perl: no more top-level my() variables; use vars instead # also the last s/create/new/; # @@ -25,13 +28,13 @@ # use strict; -use vars qw( $cgi $refnum $new ); +use vars qw( $cgi $refnum $new $error ); use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); use FS::Record qw(qsearchs fields); use FS::part_referral; -use FS::CGI qw(popurl eidiot); +use FS::CGI qw(popurl); $cgi = new CGI; &cgisuidsetup($cgi); @@ -45,15 +48,18 @@ $new = new FS::part_referral ( { } ); if ( $refnum ) { - my($old)=qsearchs('part_referral',{'refnum'=>$refnum}); - eidiot("(Old) Record not found!") unless $old; - my($error)=$new->replace($old); - eidiot($error) if $error; + my $old = qsearchs( 'part_referral', { 'refnum' =>$ refnum } ); + die "(Old) Record not found!" unless $old; + $error = $new->replace($old); } else { - my($error)=$new->insert; - eidiot($error) if $error; + $error = $new->insert; } +$refnum=$new->refnum; -$refnum=$new->getfield('refnum'); -print $cgi->redirect(popurl(3). "browse/part_referral.cgi"); +if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "part_referral.cgi?". $cgi->query_string ); +} else { + print $cgi->redirect(popurl(3). "browse/part_referral.cgi"); +} |