From cd6989b0380bb289bffac0b947a3bfa6eb8c773e Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 25 Jan 1999 12:19:11 +0000 Subject: [PATCH] yet more mod_perl stuff --- htdocs/edit/process/cust_main_county-expand.cgi | 16 +++++++++++----- htdocs/edit/process/cust_main_county.cgi | 15 +++++++++++---- htdocs/edit/process/cust_pay.cgi | 17 +++++++++++------ htdocs/edit/process/cust_pkg.cgi | 10 +++++++--- htdocs/search/cust_main.cgi | 12 ++++++++---- 5 files changed, 48 insertions(+), 22 deletions(-) diff --git a/htdocs/edit/process/cust_main_county-expand.cgi b/htdocs/edit/process/cust_main_county-expand.cgi index 94aa8547e..7e618c7b8 100755 --- a/htdocs/edit/process/cust_main_county-expand.cgi +++ b/htdocs/edit/process/cust_main_county-expand.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: cust_main_county-expand.cgi,v 1.5 1999-01-19 05:13:51 ivan Exp $ +# $Id: cust_main_county-expand.cgi,v 1.6 1999-01-25 12:19:07 ivan Exp $ # # ivan@sisd.com 97-dec-16 # @@ -15,7 +15,10 @@ # ivan@sisd.com 98-sep-2 # # $Log: cust_main_county-expand.cgi,v $ -# Revision 1.5 1999-01-19 05:13:51 ivan +# Revision 1.6 1999-01-25 12:19:07 ivan +# yet more mod_perl stuff +# +# Revision 1.5 1999/01/19 05:13:51 ivan # for mod_perl: no more top-level my() variables; use vars instead # also the last s/create/new/; # @@ -35,12 +38,11 @@ use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup datasrc); use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(eidiot popurl); +use FS::CGI qw(popurl); use FS::cust_main_county; use FS::cust_main; $cgi = new CGI; - &cgisuidsetup($cgi); $cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!"; @@ -57,7 +59,11 @@ if ( $cgi->param('delim') eq 'n' ) { } @expansion=map { - /^\s*([\w\- ]+)\s*$/ or eidiot("Illegal expansion"); + 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; + } $1; } @expansion; diff --git a/htdocs/edit/process/cust_main_county.cgi b/htdocs/edit/process/cust_main_county.cgi index 3b0cdebe9..0fc1708c5 100755 --- a/htdocs/edit/process/cust_main_county.cgi +++ b/htdocs/edit/process/cust_main_county.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: cust_main_county.cgi,v 1.5 1999-01-19 05:13:52 ivan Exp $ +# $Id: cust_main_county.cgi,v 1.6 1999-01-25 12:19:08 ivan Exp $ # # ivan@sisd.com 97-dec-16 # @@ -10,7 +10,10 @@ # lose background, FS::CGI ivan@sisd.com 98-sep-2 # # $Log: cust_main_county.cgi,v $ -# Revision 1.5 1999-01-19 05:13:52 ivan +# Revision 1.6 1999-01-25 12:19:08 ivan +# yet more mod_perl stuff +# +# Revision 1.5 1999/01/19 05:13:52 ivan # for mod_perl: no more top-level my() variables; use vars instead # also the last s/create/new/; # @@ -29,7 +32,7 @@ use vars qw( $cgi ); use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); -use FS::CGI qw(eidiot); +use FS::CGI qw(popurl); use FS::Record qw(qsearch qsearchs); use FS::cust_main_county; @@ -46,7 +49,11 @@ foreach ( $cgi->param ) { $hash{tax}=$cgi->param("tax$taxnum"); my($new)=new FS::cust_main_county \%hash; my($error)=$new->replace($old); - eidiot($error) if $error; + if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string ); + exit; + } } print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi"); diff --git a/htdocs/edit/process/cust_pay.cgi b/htdocs/edit/process/cust_pay.cgi index 21431f48d..0bd9acab4 100755 --- a/htdocs/edit/process/cust_pay.cgi +++ b/htdocs/edit/process/cust_pay.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: cust_pay.cgi,v 1.5 1999-01-19 05:13:53 ivan Exp $ +# $Id: cust_pay.cgi,v 1.6 1999-01-25 12:19:09 ivan Exp $ # # Usage: post form to: # http://server.name/path/cust_pay.cgi @@ -15,7 +15,10 @@ # bmccane@maxbaud.net 98-apr-3 # # $Log: cust_pay.cgi,v $ -# Revision 1.5 1999-01-19 05:13:53 ivan +# Revision 1.6 1999-01-25 12:19:09 ivan +# yet more mod_perl stuff +# +# Revision 1.5 1999/01/19 05:13:53 ivan # for mod_perl: no more top-level my() variables; use vars instead # also the last s/create/new/; # @@ -34,7 +37,7 @@ use vars qw( $cgi $invnum $new $error ); use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); -use FS::CGI qw(idiot popurl); +use FS::CGI qw(popurl); use FS::Record qw(fields); use FS::cust_pay; @@ -53,9 +56,11 @@ $new = new FS::cust_pay ( { $error=$new->insert; -if ($error) { #error! - idiot($error); -} else { #no errors! +if ($error) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string ); + exit; +} else { print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$invnum"); } diff --git a/htdocs/edit/process/cust_pkg.cgi b/htdocs/edit/process/cust_pkg.cgi index e8493b2de..639b2f140 100755 --- a/htdocs/edit/process/cust_pkg.cgi +++ b/htdocs/edit/process/cust_pkg.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: cust_pkg.cgi,v 1.3 1999-01-19 05:13:54 ivan Exp $ +# $Id: cust_pkg.cgi,v 1.4 1999-01-25 12:19:10 ivan Exp $ # # this is for changing packages around, not for editing things within the # package @@ -21,7 +21,10 @@ # bmccane@maxbaud.net 98-apr-3 # # $Log: cust_pkg.cgi,v $ -# Revision 1.3 1999-01-19 05:13:54 ivan +# Revision 1.4 1999-01-25 12:19:10 ivan +# yet more mod_perl stuff +# +# Revision 1.3 1999/01/19 05:13:54 ivan # for mod_perl: no more top-level my() variables; use vars instead # also the last s/create/new/; # @@ -60,7 +63,8 @@ foreach $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) { $error = FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums); if ($error) { - idiot($error); + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "cust_pkg.cgi?". $cgi->query_string ); } else { print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum#cust_pkg"); } diff --git a/htdocs/search/cust_main.cgi b/htdocs/search/cust_main.cgi index a50cee88f..55139e9a8 100755 --- a/htdocs/search/cust_main.cgi +++ b/htdocs/search/cust_main.cgi @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: cust_main.cgi,v 1.6 1999-01-19 05:14:12 ivan Exp $ +# $Id: cust_main.cgi,v 1.7 1999-01-25 12:19:11 ivan Exp $ # # Usage: post form to: # http://server.name/path/cust_main.cgi @@ -19,7 +19,10 @@ # display total, use FS::CGI ivan@sisd.com 98-jul-17 # # $Log: cust_main.cgi,v $ -# Revision 1.6 1999-01-19 05:14:12 ivan +# Revision 1.7 1999-01-25 12:19:11 ivan +# yet more mod_perl stuff +# +# Revision 1.6 1999/01/19 05:14:12 ivan # for mod_perl: no more top-level my() variables; use vars instead # also the last s/create/new/; # @@ -73,7 +76,7 @@ if ( $cgi->keywords ) { &companysearch if ( $cgi->param('company_on') && $cgi->param('company_text') ); } -%ncancelled_pkgs = map { $_->custnum => [ $_->ncancelled_pkgs ] } @cust_main; +#%ncancelled_pkgs = map { $_->custnum => [ $_->ncancelled_pkgs ] } @cust_main; %all_pkgs = map { $_->custnum => [ $_->all_pkgs ] } @cust_main; if ( scalar(@cust_main) == 1 ) { @@ -129,12 +132,13 @@ END foreach ( @{$all_pkgs{$custnum}} ) { my($pkgnum) = ($_->pkgnum); my($pkg) = $_->part_pkg->pkg; + my $comment = $_->part_pkg->comment; my($pkgview) = popurl(2). "/view/cust_pkg.cgi?$pkgnum"; #my(@cust_svc) = shift @lol_cust_svc; my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } ); my($rowspan) = scalar(@cust_svc) || 1; - print $n1, qq!$pkg!; + print $n1, qq!$pkg - $comment!; my($n2)=''; foreach my $cust_svc ( @cust_svc ) { my($label, $value, $svcdb) = $cust_svc->label; -- 2.11.0