<% include( 'elements/browse.html', 'title' => 'Inventory Classes', 'name' => 'inventory classes', 'menubar' => $menubar, 'query' => { 'table' => 'inventory_class', }, 'count_query' => 'SELECT COUNT(*) FROM inventory_class', 'header' => [ '#', 'Inventory class', 'Inventory' ], 'fields' => [ 'classnum', 'classname', FS::inventory_class->countcell_factory( 'p'=>$p, ), ], 'links' => [ $link, $link, '', ], ) %> <%init> my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" unless $curuser->access_right('Edit inventory') || $curuser->access_right('Edit global inventory') || $curuser->access_right('Configuration'); my $menubar = $curuser->access_right('Configuration') ? [ 'Add a new inventory class' => $p.'edit/inventory_class.html', ] : []; my $link = $curuser->access_right('Configuration') ? [ "${p}edit/inventory_class.html?", 'classnum' ] : '';