X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=htdocs%2Fsearch%2Fcust_pkg.cgi;h=6685aea70e634e2456febaaffc04e57b2292a658;hb=c116ce940c33dcd7e37a87a8eb2936e17cc68b11;hp=967068f5e0cab02e0a72c32a108fc72473704d7a;hpb=923026c5b05d9715523a6d9e28586c0fea53070d;p=freeside.git diff --git a/htdocs/search/cust_pkg.cgi b/htdocs/search/cust_pkg.cgi index 967068f5e..6685aea70 100755 --- a/htdocs/search/cust_pkg.cgi +++ b/htdocs/search/cust_pkg.cgi @@ -1,22 +1,40 @@ #!/usr/bin/perl -Tw # -# cust_pkg.cgi: search/browse for packages +# $Id: cust_pkg.cgi,v 1.6 1999-01-19 05:14:13 ivan Exp $ # # based on search/svc_acct.cgi ivan@sisd.com 98-jul-17 +# +# $Log: cust_pkg.cgi,v $ +# Revision 1.6 1999-01-19 05:14:13 ivan +# for mod_perl: no more top-level my() variables; use vars instead +# also the last s/create/new/; +# +# Revision 1.5 1999/01/18 09:41:38 ivan +# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl +# (good idea anyway) +# +# Revision 1.4 1999/01/18 09:22:33 ivan +# changes to track email addresses for email invoicing +# +# Revision 1.3 1998/12/23 03:05:59 ivan +# $cgi->keywords instead of $cgi->query_string +# +# Revision 1.2 1998/12/17 09:41:09 ivan +# s/CGI::(Base|Request)/CGI.pm/; +# use strict; -use CGI::Request; +use vars qw ( $cgi @cust_pkg $sortby $query ); +use CGI; use CGI::Carp qw(fatalsToBrowser); use FS::UID qw(cgisuidsetup); use FS::Record qw(qsearch qsearchs); -use FS::CGI qw(header idiot); +use FS::CGI qw(header idiot popurl); -my($req)=new CGI::Request; -&cgisuidsetup($req->cgi); +$cgi = new CGI; +&cgisuidsetup($cgi); -my(@cust_pkg,$sortby); - -my($query)=$req->cgi->var('QUERY_STRING'); +($query) = $cgi->keywords; #this tree is a little bit redundant if ( $query eq 'pkgnum' ) { $sortby=\*pkgnum_sort; @@ -50,15 +68,14 @@ if ( $query eq 'pkgnum' ) { if ( scalar(@cust_pkg) == 1 ) { my($pkgnum)=$cust_pkg[0]->pkgnum; - $req->cgi->redirect("../view/cust_pkg.cgi?$pkgnum"); + print $cgi->redirect(popurl(2). "view/cust_pkg.cgi?$pkgnum"); exit; } elsif ( scalar(@cust_pkg) == 0 ) { #error &idiot("No packages found"); exit; } else { my($total)=scalar(@cust_pkg); - CGI::Base::SendHeaders(); # one guess - print header('Package Search Results',''), <header( '-expires' => 'now' ), header('Package Search Results',''), < @@ -69,8 +86,6 @@ if ( scalar(@cust_pkg) == 1 ) { END - my($lines)=16; - my($lcount)=$lines; my(%saw,$cust_pkg); foreach $cust_pkg ( sort $sortby grep(!$saw{$_->pkgnum}++, @cust_pkg) @@ -90,20 +105,7 @@ END $company END - if ($lcount-- == 0) { # lots of little tables instead of one big one - $lcount=$lines; - print < - - - - - - - -END - } + } print <
Package #Customer #NameCompany -