yet more mod_perl stuff
authorivan <ivan>
Mon, 25 Jan 1999 12:19:11 +0000 (12:19 +0000)
committerivan <ivan>
Mon, 25 Jan 1999 12:19:11 +0000 (12:19 +0000)
htdocs/edit/process/cust_main_county-expand.cgi
htdocs/edit/process/cust_main_county.cgi
htdocs/edit/process/cust_pay.cgi
htdocs/edit/process/cust_pkg.cgi
htdocs/search/cust_main.cgi

index 94aa854..7e618c7 100755 (executable)
@@ -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
 #
 # 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;
 
index 3b0cdeb..0fc1708 100755 (executable)
@@ -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
 #
 # 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");
index 21431f4..0bd9aca 100755 (executable)
@@ -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
 #       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");
 }
 
index e8493b2..639b2f1 100755 (executable)
@@ -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
 #       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");
 }
index a50cee8..55139e9 100755 (executable)
@@ -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
 # 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!<TD ROWSPAN=$rowspan><A HREF="$pkgview"><FONT SIZE=-1>$pkg</FONT></A></TD>!;
+      print $n1, qq!<TD ROWSPAN=$rowspan><A HREF="$pkgview"><FONT SIZE=-1>$pkg - $comment</FONT></A></TD>!;
       my($n2)='';
       foreach my $cust_svc ( @cust_svc ) {
          my($label, $value, $svcdb) = $cust_svc->label;