summaryrefslogtreecommitdiff
path: root/httemplate/browse/inventory_class.html
blob: 2d85f1234cb8eadf981ccd7d265cabd14c5fcb9a (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
<% 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' ]
             : '';

</%init>