summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/pkg_category.html10
-rw-r--r--httemplate/edit/usage_class.html23
2 files changed, 27 insertions, 6 deletions
diff --git a/httemplate/edit/pkg_category.html b/httemplate/edit/pkg_category.html
index a07dc5842..20e109383 100644
--- a/httemplate/edit/pkg_category.html
+++ b/httemplate/edit/pkg_category.html
@@ -4,21 +4,25 @@
'fields' => [
'categoryname',
'weight',
+ { field=>'condense', type=>'checkbox', value=>'Y', },
{ field=>'disabled', type=>'checkbox', value=>'Y', },
],
- 'labels' => {
+ 'labels' => {
'categorynum' => 'Category number',
'categoryname' => 'Category name',
'weight' => 'Weight',
- 'disabled' => 'Disable category',
+ 'condense' => 'Collapse identical items to one',
+ 'disabled' => 'Disable category',
},
'viewall_dir' => 'browse',
+ %opt,
)
-
%>
<%init>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+my %opt = @_;
+
</%init>
diff --git a/httemplate/edit/usage_class.html b/httemplate/edit/usage_class.html
index ef4b1fff4..be01d2e67 100644
--- a/httemplate/edit/usage_class.html
+++ b/httemplate/edit/usage_class.html
@@ -3,14 +3,26 @@
'table' => 'usage_class',
'fields' => [
'classname',
- { field=>'disabled',
- type=>'checkbox',
- value=>'Y',
+ 'weight',
+ { field => 'format',
+ type => $useformat ? 'select' : 'hidden',
+ ( $useformat
+ ? ( 'options' => [ keys %labels ],
+ 'labels' => \%labels,
+ )
+ : ()
+ ),
+ },
+ { field => 'disabled',
+ type => 'checkbox',
+ value => 'Y',
},
],
'labels' => {
'classnum' => 'Class number',
'classname' => 'Class name',
+ 'weight' => 'Weight',
+ 'format' => 'Format',
'disabled' => 'Disable class',
},
'viewall_dir' => 'browse',
@@ -22,4 +34,9 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+my $conf = new FS::Conf;
+my $useformat = $conf->exists('usage_class_as_a_section');
+
+my %labels = &FS::usage_class::summary_formats_labelhash();
+
</%init>