summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/browse/pkg_category.html8
-rw-r--r--httemplate/browse/usage_class.html23
-rw-r--r--httemplate/edit/pkg_category.html27
-rw-r--r--httemplate/edit/usage_class.html23
4 files changed, 69 insertions, 12 deletions
diff --git a/httemplate/browse/pkg_category.html b/httemplate/browse/pkg_category.html
index a156c06da..16da23066 100644
--- a/httemplate/browse/pkg_category.html
+++ b/httemplate/browse/pkg_category.html
@@ -3,15 +3,15 @@
'html_init' => $html_init,
'name' => 'package categories',
'disableable' => 1,
- 'disabled_statuspos' => 2,
+ 'disabled_statuspos' => 3,
'query' => { 'table' => 'pkg_category',
'hashref' => {},
'extra_sql' => 'ORDER BY categorynum',
},
'count_query' => $count_query,
- 'header' => [ '#', 'Category', 'Weight' ],
- 'fields' => [ 'categorynum', 'categoryname', 'weight' ],
- 'links' => [ $link, $link, $link ],
+ 'header' => [ '#', 'Category', 'Weight', 'Condense' ],
+ 'fields' => [ 'categorynum', 'categoryname', 'weight', 'condense' ],
+ 'links' => [ $link, $link, $link, $link ],
)
%>
diff --git a/httemplate/browse/usage_class.html b/httemplate/browse/usage_class.html
index 63fd2c5a2..75223e025 100644
--- a/httemplate/browse/usage_class.html
+++ b/httemplate/browse/usage_class.html
@@ -9,9 +9,21 @@
'extra_sql' => 'ORDER BY classnum',
},
'count_query' => 'SELECT COUNT(*) FROM usage_class',
- 'header' => [ '#', 'Class' ],
- 'fields' => [ 'classnum', 'classname' ],
- 'links' => [ $link, $link ],
+ 'header' => [ '#',
+ 'Class',
+ 'Weight',
+ ( $useformat ? ('Format') : () ),
+ ],
+ 'fields' => [ 'classnum',
+ 'classname',
+ 'weight',
+ ( $useformat ? (sub { $labels->{shift->format} } ) : () ),
+ ],
+ 'links' => [ $link,
+ $link,
+ $link,
+ ( $useformat ? ( $link ) : () ),
+ ],
)
%>
<%init>
@@ -19,6 +31,11 @@
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() };
+
+
my $html_init =
'Usage classes define groups of usage for taxation purposes.<BR><BR>'.
qq!<A HREF="${p}edit/usage_class.html"><I>Add a usage class</I></A><BR><BR>!;
diff --git a/httemplate/edit/pkg_category.html b/httemplate/edit/pkg_category.html
index a244bd53a..20e109383 100644
--- a/httemplate/edit/pkg_category.html
+++ b/httemplate/edit/pkg_category.html
@@ -1,5 +1,28 @@
-<% include( 'elements/category_Common.html',
+<% include( 'elements/edit.html',
'name' => 'Package Category',
'table' => 'pkg_category',
- )
+ 'fields' => [
+ 'categoryname',
+ 'weight',
+ { field=>'condense', type=>'checkbox', value=>'Y', },
+ { field=>'disabled', type=>'checkbox', value=>'Y', },
+ ],
+ 'labels' => {
+ 'categorynum' => 'Category number',
+ 'categoryname' => 'Category name',
+ 'weight' => 'Weight',
+ '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>