summaryrefslogtreecommitdiff
path: root/httemplate/edit/elements/class_Common.html
blob: b5f49399156b0c32555f81bfa0ab73b34ee59daf (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
<% include( 'edit.html',
              'fields' => [
                            'classname',
                            (scalar(@category)
                              ? { field=>'categorynum', type=>'select-table', 'empty_label'=>'(none)', 'table'=>'pkg_category', 'name_col'=>'categoryname' }
                              : { field=>'categorynum', type=>'hidden' }
                            ),
                            { field=>'disabled', type=>'checkbox', value=>'Y', },
                          ],
              'labels' => { 
                            'classnum'    => 'Class number',
                            'classname'   => 'Class name',
                            'categorynum' => 'Category',
                            'disabled'    => 'Disable class',
                          },
              'viewall_dir' => 'browse',
              %opt,
           )
          
%>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');

my %opt = @_;

my $table = $opt{'table'};
( my $category_table = $table ) =~ s/class/category/ or die;

my @category = qsearch($category_table, { 'disabled' => '' });
</%init>