X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_device.html;h=75e6b0aa5dfc9fe770908832e9370ced611b6db1;hp=aa626b3797a869929ee1893e3c328738e7e140b2;hb=3f2a7b01b59902faed5767d81e2959e131bdbdfd;hpb=d0221fabd4656b3a04251ca6168cc45f54d23574 diff --git a/httemplate/edit/part_device.html b/httemplate/edit/part_device.html index aa626b379..75e6b0aa5 100644 --- a/httemplate/edit/part_device.html +++ b/httemplate/edit/part_device.html @@ -4,7 +4,10 @@ 'labels' => { 'devicepart' => 'Part number', 'devicename' => 'Device name', + 'inventory_classnum' => 'Inventory class', + 'title' => 'External name', }, + 'fields' => \@fields, 'viewall_dir' => 'browse', 'html_bottom' => $html_bottom_sub, ) @@ -20,6 +23,25 @@ my $extra_sql = ); $extra_sql = $extra_sql ? " WHERE ( $extra_sql ) " : " WHERE 0 = 1 "; +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', + 'title', + { field => 'inventory_classnum', + type => 'select', + options => \@inventory_classnums, + labels => \%inventory_classnum_labels, + }; + my $html_bottom_sub = sub { my $part_device = shift; @@ -37,7 +59,6 @@ my $html_bottom_sub = sub { $o->exporttype. ' to '. $o->machine; }, ). - '
'. ''; };