From b1f912afdb22b59e8849cc4db7c6d46a8a49c124 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 12 Jun 2013 15:04:52 -0700 Subject: [PATCH] add package class selection to package summary report, RT#23555 --- httemplate/search/cust_pkg_summary.cgi | 9 +++++++++ httemplate/search/cust_pkg_summary.html | 11 ++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/httemplate/search/cust_pkg_summary.cgi b/httemplate/search/cust_pkg_summary.cgi index fbeeb92ce..d3274894f 100644 --- a/httemplate/search/cust_pkg_summary.cgi +++ b/httemplate/search/cust_pkg_summary.cgi @@ -71,6 +71,15 @@ my $agentnums_sql = $curuser->agentnums_sql( my $extra_sql = " WHERE $agentnums_sql"; +#tiny bit of false laziness w/cust_pkg.pm::search +if ( grep { $_ eq 'classnum' } $cgi->param ) { + if ( $cgi->param('classnum') eq '' ) { + $extra_sql .= ' AND part_pkg.classnum IS NULL'; + } elsif ( $cgi->param('classnum') =~ /^(\d+)$/ && $1 ne '0' ) { + $extra_sql .= " AND part_pkg.classnum = $1 "; + } +} + foreach my $part_pkg (qsearch({ 'table' => 'part_pkg', 'hashref' => {}, 'extra_sql' => $extra_sql, diff --git a/httemplate/search/cust_pkg_summary.html b/httemplate/search/cust_pkg_summary.html index 8c05f7382..18a5690d0 100644 --- a/httemplate/search/cust_pkg_summary.html +++ b/httemplate/search/cust_pkg_summary.html @@ -1,4 +1,4 @@ -<% include( '/elements/header.html', 'Package Summary Report' ) %> +<& /elements/header.html, 'Package Summary Report' &>
@@ -10,7 +10,12 @@ - <% include ('/elements/tr-input-beginning_ending.html') %> + <& /elements/tr-input-beginning_ending.html &> + + <& /elements/tr-select-pkg_class.html, + 'pre_options' => [ '0' => 'all' ], + 'empty_label' => '(empty class)', + &> @@ -19,7 +24,7 @@
-<% include('/elements/footer.html') %> +<& /elements/footer.html &> <%init> die "access denied" -- 2.11.0