fix various quick payment entry problems, #17356
[freeside.git] / httemplate / edit / usage_class.html
1 <% include( 'elements/edit.html',
2               'name_singular' => 'Usage Class',
3               'table'         => 'usage_class',
4               'fields'        => [
5                                    'classname',
6                                    'weight',
7                                    { field => 'format',
8                                      type  => $useformat ? 'select' : 'hidden',
9                                      ( $useformat
10                                        ? ( 'options' => [ keys %labels ],
11                                            'labels'  => \%labels,
12                                          )
13                                        : ()
14                                      ),
15                                    },
16                                    { field => 'disabled',
17                                      type  => 'checkbox',
18                                      value => 'Y',
19                                    },
20                                  ],
21               'labels'        => { 
22                                    'classnum'  => 'Class number',
23                                    'classname' => 'Class name',
24                                    'weight'    => 'Weight',
25                                    'format'    => 'Format',
26                                    'disabled'  => 'Disable class',
27                                  },
28               'viewall_dir'   => 'browse',
29            )
30           
31 %>
32 <%init>
33
34 die "access denied"
35   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
36
37 my $conf = new FS::Conf;
38 my $useformat = $conf->exists('usage_class_as_a_section');
39
40 my %labels = &FS::usage_class::summary_formats_labelhash();
41
42 </%init>