random nits for grandstream provisioning :UI, docs, java path, s/system/IPC::Run...
[freeside.git] / httemplate / edit / part_device.html
1 <% include( 'elements/edit.html',
2                  'name'   => 'Phone device type',
3                  'table'  => 'part_device',
4                  'labels' => { 
5                                'devicepart' => 'Part number',
6                                'devicename' => 'Device name',
7                              },
8                  'viewall_dir' => 'browse',
9                  'html_bottom' => $html_bottom_sub,
10            )
11 %>
12 <%init>
13
14 die "access denied"
15   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
16
17 my $extra_sql =
18   join( ' OR ', map { "exporttype = '$_'" }
19                 keys %{FS::part_export::export_info('part_device')}
20       );
21 $extra_sql = $extra_sql ? " WHERE ( $extra_sql ) " : " WHERE 0 = 1 ";
22
23 warn $extra_sql;
24
25 my $html_bottom_sub = sub {
26   my $part_device = shift;
27
28   '<BR>'.
29   '<FONT SIZE="+1">Exports</FONT><BR>'.
30
31   '<TABLE BGCOLOR="#cccccc" WIDTH=100%>'.
32   '<TR><TD>'.
33   include( '/elements/checkboxes-table.html',
34              'source_obj'    => $part_device,
35              'link_table'    => 'export_device',
36              'target_table'  => 'part_export',
37              'extra_sql'     => $extra_sql,
38              'name_callback' => sub { my $o = shift;
39                                       $o->exporttype. ' to '. $o->machine;
40                                     },
41          ).
42   '</TD></TR></TABLE>';
43
44 };
45
46 </%init>
47