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
41
42
43
44
|
<% include( 'elements/browse.html',
'title' => 'Hardware Classes and Types',
'name' => 'hardware classes',
'menubar' => $menubar,
'query' => { 'table' => 'hardware_class' },
'count_query' => 'SELECT COUNT(*) FROM hardware_class',
'header' => [ '#', 'Hardware class', '', 'Device types' ],
'fields' => [ 'classnum',
'classname',
'',
$types_sub,
],
'links' => [ $class_link,
$class_link,
'',
'',
],
)
%>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
die "access denied"
unless $curuser->access_right('Configuration');
my $menubar =
[ 'Hardware statuses' => $p.'browse/hardware_status.html',
'Add a hardware class' => $p.'edit/hardware_class.html',
'Add a device type', => $p.'edit/hardware_type.html', ];
my $types_sub = sub {
my $hardware_class = shift;
my @rows = map {
my $type_link = $p.'edit/hardware_type.html?'.$_->typenum;
[ { 'data' => $_->model, 'link' => $type_link }, ]
} $hardware_class->hardware_type;
\@rows;
};
my $class_link = [ "${p}edit/hardware_class.html?", 'classnum' ];
</%init>
|