select multiple pkgparts on advanced package report
authorjeff <jeff>
Wed, 25 Oct 2006 04:44:48 +0000 (04:44 +0000)
committerjeff <jeff>
Wed, 25 Oct 2006 04:44:48 +0000 (04:44 +0000)
httemplate/elements/tr-selectmultiple-part_pkg.html [new file with mode: 0644]
httemplate/search/cust_pkg.cgi
httemplate/search/report_cust_pkg.html

diff --git a/httemplate/elements/tr-selectmultiple-part_pkg.html b/httemplate/elements/tr-selectmultiple-part_pkg.html
new file mode 100644 (file)
index 0000000..abf96d7
--- /dev/null
@@ -0,0 +1,23 @@
+%
+%  my( $cust_fields, %opt ) = @_;
+%
+%  use FS::ConfDefaults;
+%  $opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ];
+%
+%
+
+
+<TR>
+  <TD ALIGN="right"><% $opt{'label'} || 'Packages' %></TD>
+  <TD>
+    <% include( '/elements/select-table.html',
+                  'table'     => 'part_pkg',
+                 'name_col'  => 'pkg',
+                 'value'     => '',
+                 'empty_label' => '(none)',
+                 'element_etc' => 'multiple',
+                 %opt,
+              )
+    %>
+  </TD>
+</TR>
index 8dbc600..7a651c4 100755 (executable)
 %#eslaf
 %
 %###
+%# parse part_pkg
+%###
+%
+%my $pkgpart = join (' OR pkgpart=',
+%                    grep {$_} map { /^(\d+)$/; } ($cgi->param('pkgpart')));
+%push @where,  '(pkgpart=' . $pkgpart . ')' if $pkgpart;
+%
+%###
 %# parse magic, legacy, etc.
 %###
 %
index 8fabf10..2193cac 100755 (executable)
@@ -18,7 +18,7 @@
                    'empty_label' => '(empty class)',
                )
     %>
-% #include( '/elements/tr-selectmultiple-part_pkg.html' ) 
+    <% include( '/elements/tr-selectmultiple-part_pkg.html' ) %> 
 
     <TR>
       <TD ALIGN="right" VALIGN="center">Next bill date</TD>