1 <% include( 'elements/browse.html',
2 'title' => 'Hardware Classes and Types',
3 'name' => 'hardware classes',
5 'query' => { 'table' => 'hardware_class' },
6 'count_query' => 'SELECT COUNT(*) FROM hardware_class',
7 'header' => [ '#', 'Hardware class', '', 'Device types' ],
8 'fields' => [ 'classnum',
13 'links' => [ $class_link,
22 my $curuser = $FS::CurrentUser::CurrentUser;
25 unless $curuser->access_right('Configuration');
28 [ 'Hardware statuses' => $p.'browse/hardware_status.html',
29 'Add a hardware class' => $p.'edit/hardware_class.html',
30 'Add a device type', => $p.'edit/hardware_type.html', ];
33 my $hardware_class = shift;
35 my $type_link = $p.'edit/hardware_type.html?'.$_->typenum;
36 my $num_svcs = FS::svc_hardware->count("typenum = ".$_->typenum);
37 $num_svcs = $num_svcs > 0 ?
38 mt('<B>[_1]</B> [numerate,_1,service]',$num_svcs) : '';
39 my $search_link = $p.'search/svc_hardware.cgi?typenum='.$_->typenum;
42 { 'data' => $_->model, 'link' => $type_link },
43 { 'data' => $_->revision, 'link' => $type_link },
44 { 'data' => $num_svcs, 'link' => $search_link, 'size' => -1 }
47 } $hardware_class->hardware_type;
52 my $class_link = [ "${p}edit/hardware_class.html?", 'classnum' ];