diff options
author | levinse <levinse> | 2011-01-22 20:03:50 +0000 |
---|---|---|
committer | levinse <levinse> | 2011-01-22 20:03:50 +0000 |
commit | e87a701dd25a5d20218924057aa0d38def2eefc1 (patch) | |
tree | cff56e9aa5bccc7f75f93b98d4e778edb2c79d2d /httemplate/edit/part_device.html | |
parent | 0259db6a5f67fa8837c18bbaed3e424cccf7a3e0 (diff) |
populate MAC address from inventory for svc_phone devices, RT7794
Diffstat (limited to 'httemplate/edit/part_device.html')
-rw-r--r-- | httemplate/edit/part_device.html | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/httemplate/edit/part_device.html b/httemplate/edit/part_device.html index 146070fd9..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,6 +22,24 @@ 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', + { field => 'inventory_classnum', + type => 'select', + options => \@inventory_classnums, + labels => \%inventory_classnum_labels, + }; + my $html_bottom_sub = sub { my $part_device = shift; |