X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_device.html;h=1317c8d1c2823706402fa882757fe3dde68a3cca;hb=8d534e61d74e561a15f0863a835cda4af639a9ea;hp=da090dfa23439d28ad1268bbdb50b4f1ed747cc3;hpb=0907d7eb5c2b65c9b9a797b92802a21e618d8b96;p=freeside.git diff --git a/httemplate/edit/part_device.html b/httemplate/edit/part_device.html index da090dfa2..1317c8d1c 100644 --- a/httemplate/edit/part_device.html +++ b/httemplate/edit/part_device.html @@ -4,7 +4,9 @@ 'labels' => { 'devicepart' => 'Part number', 'devicename' => 'Device name', + 'inventory_classnum' => 'Inventory class', }, + 'fields' => \@fields, 'viewall_dir' => 'browse', 'html_bottom' => $html_bottom_sub, ) @@ -20,7 +22,23 @@ my $extra_sql = ); $extra_sql = $extra_sql ? " WHERE ( $extra_sql ) " : " WHERE 0 = 1 "; -warn $extra_sql; +my @inventory_classnums; +push @inventory_classnums, ''; +my %inventory_classnum_labels; +$inventory_classnum_labels{''} = ''; +my @inventory_classes = qsearch('inventory_class', {} ); +foreach my $inventory_class ( @inventory_classes ) { + push @inventory_classnums, $inventory_class->classnum; + $inventory_classnum_labels{$inventory_class->classnum} = $inventory_class->classname; +} + +my @fields; +push @fields, 'devicename', + { field => 'inventory_classnum', + type => 'select', + options => \@inventory_classnums, + labels => \%inventory_classnum_labels, + }; my $html_bottom_sub = sub { my $part_device = shift;