projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2a2fa62
)
add suspended package browse (closes: Bug#467)
author
ivan
<ivan>
Tue, 8 Oct 2002 11:10:51 +0000
(11:10 +0000)
committer
ivan
<ivan>
Tue, 8 Oct 2002 11:10:51 +0000
(11:10 +0000)
httemplate/index.html
patch
|
blob
|
history
httemplate/search/cust_pkg.cgi
patch
|
blob
|
history
diff --git
a/httemplate/index.html
b/httemplate/index.html
index
f17639d
..
017a2cc
100644
(file)
--- a/
httemplate/index.html
+++ b/
httemplate/index.html
@@
-119,7
+119,8
@@
</UL>
Packages
<UL>
</UL>
Packages
<UL>
- <LI><A HREF="search/cust_pkg.cgi?pkgnum">packages (by package number)</A>
+ <LI><A HREF="search/cust_pkg.cgi?pkgnum">all packages (by package number)</A>
+ <LI><A HREF="search/cust_pkg.cgi?SUSP_pkgnum">suspended packages (by package number)</A>
<LI><A HREF="search/cust_pkg.cgi?APKG_pkgnum">packages with unconfigured services (by package number)</A>
<LI><A HREF="search/cust_pkg.html">packages (by next bill date range)</A>
</UL>
<LI><A HREF="search/cust_pkg.cgi?APKG_pkgnum">packages with unconfigured services (by package number)</A>
<LI><A HREF="search/cust_pkg.html">packages (by next bill date range)</A>
</UL>
diff --git
a/httemplate/search/cust_pkg.cgi
b/httemplate/search/cust_pkg.cgi
index
5f0782b
..
78a5bb3
100755
(executable)
--- a/
httemplate/search/cust_pkg.cgi
+++ b/
httemplate/search/cust_pkg.cgi
@@
-43,10
+43,16
@@
if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) {
} else {
} else {
- my $
unconf
= '';
+ my $
qual
= '';
if ( $query eq 'pkgnum' ) {
$sortby=\*pkgnum_sort;
if ( $query eq 'pkgnum' ) {
$sortby=\*pkgnum_sort;
+ } elsif ( $query eq 'SUSP_pkgnum' ) {
+
+ $sortby=\*pkgnum_sort;
+
+ $qual = 'WHERE susp IS NOT NULL AND susp != 0';
+
} elsif ( $query eq 'APKG_pkgnum' ) {
$sortby=\*pkgnum_sort;
} elsif ( $query eq 'APKG_pkgnum' ) {
$sortby=\*pkgnum_sort;
@@
-101,12
+107,12
@@
if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) {
AND pkg_svc.quantity != 0;";
$sth = dbh->prepare($query) or die dbh->errstr. " preparing $query";
$sth->execute or die "Error executing \"$query\": ". $sth->errstr;
AND pkg_svc.quantity != 0;";
$sth = dbh->prepare($query) or die dbh->errstr. " preparing $query";
$sth->execute or die "Error executing \"$query\": ". $sth->errstr;
- $
unconf
= " LEFT JOIN temp2_$$ ON cust_pkg.pkgnum = temp2_$$.pkgnum
-
WHERE temp2_$$.pkgnum IS NOT NULL";
+ $
qual
= " LEFT JOIN temp2_$$ ON cust_pkg.pkgnum = temp2_$$.pkgnum
+ WHERE temp2_$$.pkgnum IS NOT NULL";
} else {
} else {
- $
unconf
= "
+ $
qual
= "
WHERE 0 <
( SELECT count(*) FROM pkg_svc
WHERE pkg_svc.pkgpart = cust_pkg.pkgpart
WHERE 0 <
( SELECT count(*) FROM pkg_svc
WHERE pkg_svc.pkgpart = cust_pkg.pkgpart
@@
-120,10
+126,10
@@
if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) {
}
} else {
}
} else {
- die "Empty QUERY_STRING!";
+ die "Empty
or unknown
QUERY_STRING!";
}
}
- my $statement = "SELECT COUNT(*) FROM cust_pkg $
unconf
";
+ my $statement = "SELECT COUNT(*) FROM cust_pkg $
qual
";
my $sth = dbh->prepare($statement) or die dbh->errstr." preparing $statement";
$sth->execute or die "Error executing \"$statement\": ". $sth->errstr;
my $sth = dbh->prepare($statement) or die dbh->errstr." preparing $statement";
$sth->execute or die "Error executing \"$statement\": ". $sth->errstr;
@@
-131,7
+137,7
@@
if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) {
my $tblname = driver_name eq 'mysql' ? 'cust_pkg.' : '';
@cust_pkg =
my $tblname = driver_name eq 'mysql' ? 'cust_pkg.' : '';
@cust_pkg =
- qsearch('cust_pkg',{}, '', "$
unconf
ORDER BY ${tblname}pkgnum $limit" );
+ qsearch('cust_pkg',{}, '', "$
qual
ORDER BY ${tblname}pkgnum $limit" );
if ( driver_name eq 'mysql' ) {
$query = "DROP TABLE temp1_$$,temp2_$$;";
if ( driver_name eq 'mysql' ) {
$query = "DROP TABLE temp1_$$,temp2_$$;";