X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_device.html;h=75e6b0aa5dfc9fe770908832e9370ced611b6db1;hb=0bca43616911f2b48d9a0617e70a3bf0f30b92db;hp=4f2fe93b4eb256c1de55de53b2e3400ae74df99d;hpb=665067cef48a5516e0bfb2dd79d99b8495e25ee5;p=freeside.git
diff --git a/httemplate/edit/part_device.html b/httemplate/edit/part_device.html
index 4f2fe93b4..75e6b0aa5 100644
--- a/httemplate/edit/part_device.html
+++ b/httemplate/edit/part_device.html
@@ -4,8 +4,12 @@
'labels' => {
'devicepart' => 'Part number',
'devicename' => 'Device name',
+ 'inventory_classnum' => 'Inventory class',
+ 'title' => 'External name',
},
+ 'fields' => \@fields,
'viewall_dir' => 'browse',
+ 'html_bottom' => $html_bottom_sub,
)
%>
<%init>
@@ -13,4 +17,51 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+my $extra_sql =
+ join( ' OR ', map { "exporttype = '$_'" }
+ keys %{FS::part_export::export_info('part_device')}
+ );
+$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;
+
+ '
'.
+ 'Exports
'.
+
+ '
'. + include( '/elements/checkboxes-table.html', + 'source_obj' => $part_device, + 'link_table' => 'export_device', + 'target_table' => 'part_export', + 'extra_sql' => $extra_sql, + 'name_callback' => sub { my $o = shift; + $o->exporttype. ' to '. $o->machine; + }, + ). + ' |