during upgrade, fix broken tax links on old voided invoices, #72777
[freeside.git] / httemplate / browse / inventory_class.html
1 <% include( 'elements/browse.html',
2                  'title'       => 'Inventory Classes',
3                  'name'        => 'inventory classes',
4                  'menubar'     => $menubar,
5                  'query'       => { 'table' => 'inventory_class', },
6                  'count_query' => 'SELECT COUNT(*) FROM inventory_class',
7                  'header'      => [ '#', 'Inventory class', 'Inventory' ],
8                  'fields'      => [ 'classnum',
9                                     'classname',
10                                     FS::inventory_class->countcell_factory(
11                                       'p'=>$p,
12                                     ),
13                                   ],
14                  'links'       => [ $link,
15                                     $link,
16                                     '',
17                                   ],
18              )
19 %>
20 <%init>
21
22 my $curuser = $FS::CurrentUser::CurrentUser;
23
24 die "access denied"
25   unless $curuser->access_right('Edit inventory')
26       || $curuser->access_right('Edit global inventory')
27       || $curuser->access_right('Configuration');
28
29 my $menubar = $curuser->access_right('Configuration')
30                 ? [ 'Add a new inventory class' =>
31                       $p.'edit/inventory_class.html',
32                   ]
33                 : [];
34
35 my $link = $curuser->access_right('Configuration')
36              ? [ "${p}edit/inventory_class.html?", 'classnum' ]
37              : '';
38
39 </%init>