event refactor, landing on HEAD!
[freeside.git] / httemplate / elements / tr-select-part_pkg.html
diff --git a/httemplate/elements/tr-select-part_pkg.html b/httemplate/elements/tr-select-part_pkg.html
new file mode 100644 (file)
index 0000000..b6d4d4d
--- /dev/null
@@ -0,0 +1,29 @@
+% if ( scalar(@{ $opt{'part_pkg'} }) == 0 ) { 
+
+  <INPUT TYPE="hidden" NAME="<% $opt{'field'} || 'pkgpart' %>" VALUE="">
+
+% } else { 
+
+  <TR>
+    <TD ALIGN="right"><% $opt{'label'} || 'Package definition' %></TD>
+    <TD>
+      <% include( '/elements/select-table.html',
+                    'table'     => 'part_pkg',
+                    'name_col'  => 'pkg',
+                    'multiple'  => 1,
+                    #N/A 'empty_label' => '(none)',
+                    %opt,
+                )
+      %>
+    </TD>
+  </TR>
+
+% } 
+
+<%init>
+
+my( %opt ) = @_;
+
+$opt{'part_pkg'} ||= [ qsearch( 'part_pkg', {} ) ]; # { disabled=>'' } )
+
+</%init>