summaryrefslogtreecommitdiff
path: root/httemplate/browse/part_device.html
blob: 12c19ed90a7b89438cbaf383a94cfad3e2c5b7d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<% include( 'elements/browse.html',
                 'title'       => 'Phone device types',
                 'name'        => 'phone device types',
                 'menubar'     => [ 'Add a new device type' =>
                                      $p.'edit/part_device.html',
                                    'Import device types' =>
                                      $p.'misc/part_device-import.html',
                                  ],
                 'query'       => { 'table' => 'part_device', },
                 'count_query' => 'SELECT COUNT(*) FROM part_device',
                 'header'      => [ '#',
                                    'Device type',
                                    'Inventory Class',
                                    'External name', ],
                 'fields'      => [ 'devicepart',
                                    'devicename',
				    sub {
					my $part_device = shift;
					my $inventory_class = $part_device->inventory_class;
					return $inventory_class->classname 
					    if $inventory_class;
					'';
				    },
                                    'title',
                                  ],
                 'links'       => [ $link,
                                    $link,
				    '',
                                    '',
                                  ],
             )
%>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');

my $link = [ "${p}edit/part_device.html?", 'devicepart' ];

</%init>