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',
10 'viewall_dir' => 'browse',
11 'html_bottom' => $html_bottom_sub,
17 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
20 join( ' OR ', map { "exporttype = '$_'" }
21 keys %{FS::part_export::export_info('part_device')}
23 $extra_sql = $extra_sql ? " WHERE ( $extra_sql ) " : " WHERE 0 = 1 ";
25 my @inventory_classnums;
26 push @inventory_classnums, '';
27 my %inventory_classnum_labels;
28 $inventory_classnum_labels{''} = '';
29 my @inventory_classes = qsearch('inventory_class', {} );
30 foreach my $inventory_class ( @inventory_classes ) {
31 push @inventory_classnums, $inventory_class->classnum;
32 $inventory_classnum_labels{$inventory_class->classnum} = $inventory_class->classname;
36 push @fields, 'devicename',
37 { field => 'inventory_classnum',
39 options => \@inventory_classnums,
40 labels => \%inventory_classnum_labels,
43 my $html_bottom_sub = sub {
44 my $part_device = shift;
47 '<FONT SIZE="+1">Exports</FONT><BR>'.
49 '<TABLE BGCOLOR="#cccccc" WIDTH=100%>'.
51 include( '/elements/checkboxes-table.html',
52 'source_obj' => $part_device,
53 'link_table' => 'export_device',
54 'target_table' => 'part_export',
55 'extra_sql' => $extra_sql,
56 'name_callback' => sub { my $o = shift;
57 $o->exporttype. ' to '. $o->machine;