enable CardFortress in test database, #71513
[freeside.git] / httemplate / browse / usage_class.html
1 <% include( 'elements/browse.html',
2                  'title'       => 'Usage classes',
3                  'html_init'   => $html_init,
4                  'name'        => 'usage classes',
5                  'disableable' => 1,
6                  'disabled_statuspos' => 2,
7                  'query'       => { 'table'     => 'usage_class',
8                                     'hashref'   => {},
9                                     'order_by' => 'ORDER BY classnum',
10                                   },
11                  'count_query' => 'SELECT COUNT(*) FROM usage_class',
12                  'header'      => [ '#',
13                                     'Class',
14                                     'Weight',
15                                     ( $useformat ? ('Format') : () ),
16                                   ],
17                  'fields'      => [ 'classnum',
18                                     'classname',
19                                     'weight',
20                                     ( $useformat ? (sub { $labels->{shift->format} } ) : () ),
21                                   ],
22                  'links'       => [ $link,
23                                     $link,
24                                     $link,
25                                     ( $useformat ? ( $link ) : () ),
26                                   ],
27              )
28 %>
29 <%init>
30
31 die "access denied"
32   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
33
34 my $conf = new FS::Conf;
35 my $useformat = $conf->exists('usage_class_as_a_section');
36 my $labels = { &FS::usage_class::summary_formats_labelhash() };
37
38
39 my $html_init = 
40   'Usage classes define groups of usage for taxation purposes.<BR><BR>'.
41   qq!<A HREF="${p}edit/usage_class.html"><I>Add a usage class</I></A><BR><BR>!;
42
43 my $link = [ $p.'edit/usage_class.html?', 'classnum' ];
44
45 </%init>