-For the selected table, you can give fields default or fixed (unchangeable)
-values, or select an inventory class to manually or automatically fill in
-that field.
+
+%# include export selection
+<& export_svc.html,
+ part_svc => $part_svc,
+ svcdb => $svcdb
+&>
+
+Fields
<& /elements/table-grid.html, cellpadding => 4 &>
Field
Label
Modifier
+
<% $manual_require ? 'Required?' : '' %>
% $part_svc->set('svcpart' => $opt{'clone'}) if $opt{'clone'}; # for now
% my $i = 0;
@@ -155,7 +140,8 @@ that field.
'value_col' => $def->{'select_key'},
'order_by' => dbdef->table($def->{'select_table'})->primary_key,
'multiple' => $def->{'multiple'},
- 'disable_empty' => 1,
+ 'disable_empty' => $def->{'select_allow_empty'} ? undef : 1,
+ 'empty_label' => $def->{'select_allow_empty'} ? ' ' : undef,
'curr_value' => $value,
# these can be switched between multiple and singular,
# so put the complete curr_value in an attribute
@@ -183,8 +169,8 @@ that field.
'curr_value' => $value,
&>
% }
-% } elsif ( $def->{'type'} =~ /select-(.*?).html/ ) {
- <& '/elements/'.$def->{'type'},
+% } elsif ( $def->{'type'} =~ /^select-(.*?)(.html)?$/ && $1 ne 'hardware' ) {
+ <& "/elements/select-$1.html",
'field' => $name,
'id' => $name.'_select',
'multiple' => $def->{'multiple'},
@@ -207,21 +193,36 @@ that field.
NAME="<%$name%>"
ID="<%$name%>"
VALUE="<%$value%>">
-% # inventory class selection
+% my $mode = 'inventory';
+% my $multiple = 1;
+% if ( $def->{'type'} eq 'select-hardware' ) {
+% $mode = 'hardware';
+% $multiple = 0;
+% }
<& /elements/select-table.html,
'field' => $name.'_classnum',
'id' => $name.'_select',
- 'table' => 'inventory_class',
+ 'table' => $mode.'_class',
'name_col' => 'classname',
'curr_value' => $value,
- 'empty_label' => 'Select inventory class',
- 'multiple' => 1,
+ 'empty_label' => "Select $mode class",
+ 'multiple' => $multiple,
&>
+% }
+
+