X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_pkg.cgi;h=9705bd658594430cfd45585d293ee7d4e188f503;hp=dabcf46fbe1c2188f9846647fc84239b96bc62ba;hb=1fd6d8cf5d7854860ef4fd10ed89828e0c04ec39;hpb=bcff88b04574a882c3b44f55f64d15a8f0136498 diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi index dabcf46fb..9705bd658 100755 --- a/httemplate/search/cust_pkg.cgi +++ b/httemplate/search/cust_pkg.cgi @@ -1,38 +1,22 @@ + <% -# -use strict; -use vars qw ( $cgi @cust_pkg $sortby $query %part_pkg - $conf $maxrecords $limit $offset ); -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(dbh cgisuidsetup); -use FS::Conf; -use FS::Record qw(qsearch qsearchs dbdef); -use FS::CGI qw(header eidiot popurl table); -use FS::cust_pkg; -use FS::pkg_svc; -use FS::cust_svc; -use FS::cust_main; - -$cgi = new CGI; -&cgisuidsetup($cgi); - -$conf = new FS::Conf; -$maxrecords = $conf->config('maxsearchrecordsperpage'); +my $conf = new FS::Conf; +my $maxrecords = $conf->config('maxsearchrecordsperpage'); my %part_pkg = map { $_->pkgpart => $_ } qsearch('part_pkg', {}); -$limit = ''; +my $limit = ''; $limit .= "LIMIT $maxrecords" if $maxrecords; -$offset = $cgi->param('offset') || 0; +my $offset = $cgi->param('offset') || 0; $limit .= " OFFSET $offset" if $offset; my $total; my $unconf = ''; -($query) = $cgi->keywords; +my($query) = $cgi->keywords; +my $sortby; if ( $query eq 'pkgnum' ) { $sortby=\*pkgnum_sort; @@ -86,7 +70,7 @@ $sth->execute or die "Error executing \"$statement\": ". $sth->errstr; $total = $sth->fetchrow_arrayref->[0]; -@cust_pkg = qsearch('cust_pkg',{}, '', "$unconf ORDER BY pkgnum $limit" ); +my @cust_pkg = qsearch('cust_pkg',{}, '', "$unconf ORDER BY pkgnum $limit" ); if ( scalar(@cust_pkg) == 1 ) {