1 <% include( 'elements/edit.html',
2 'name' => 'Phone device type',
3 'table' => 'part_device',
5 'devicepart' => 'Part number',
6 'devicename' => 'Device name',
7 'inventory_classnum' => 'Inventory class',
8 'title' => 'External name',
11 'viewall_dir' => 'browse',
12 'html_bottom' => $html_bottom_sub,
18 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
21 join( ' OR ', map { "exporttype = '$_'" }
22 keys %{FS::part_export::export_info('part_device')}
24 $extra_sql = $extra_sql ? " WHERE ( $extra_sql ) " : " WHERE 0 = 1 ";
26 my @inventory_classnums;
27 push @inventory_classnums, '';
28 my %inventory_classnum_labels;
29 $inventory_classnum_labels{''} = '';
30 my @inventory_classes = qsearch('inventory_class', {} );
31 foreach my $inventory_class ( @inventory_classes ) {
32 push @inventory_classnums, $inventory_class->classnum;
33 $inventory_classnum_labels{$inventory_class->classnum} = $inventory_class->classname;
37 push @fields, 'devicename',
39 { field => 'inventory_classnum',
41 options => \@inventory_classnums,
42 labels => \%inventory_classnum_labels,
45 my $html_bottom_sub = sub {
46 my $part_device = shift;
49 '<FONT SIZE="+1">Exports</FONT><BR>'.
51 '<TABLE BGCOLOR="#cccccc" WIDTH=100%>'.
53 include( '/elements/checkboxes-table.html',
54 'source_obj' => $part_device,
55 'link_table' => 'export_device',
56 'target_table' => 'part_export',
57 'extra_sql' => $extra_sql,
58 'name_callback' => sub { my $o = shift;
59 $o->exporttype. ' to '. $o->machine;