summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorjeff <jeff>2008-06-19 03:18:19 +0000
committerjeff <jeff>2008-06-19 03:18:19 +0000
commitf13afe5e228a220311557e1ca6dacbf847c26baf (patch)
tree9cd6b6e511234d72dfa9e8dd8278a721e5ad03eb /httemplate/edit
parent795a85c10d898120a2a6341c4df32fb60b069a64 (diff)
package categories (meta package classes) and grouping invoices by them
Diffstat (limited to 'httemplate/edit')
-rw-r--r--httemplate/edit/elements/edit.html3
-rw-r--r--httemplate/edit/pkg_category.html22
-rw-r--r--httemplate/edit/pkg_class.html5
-rw-r--r--httemplate/edit/process/pkg_category.html11
4 files changed, 40 insertions, 1 deletions
diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html
index 04ca81c72..86eb2b3c7 100644
--- a/httemplate/edit/elements/edit.html
+++ b/httemplate/edit/elements/edit.html
@@ -106,7 +106,7 @@ Example:
'new_callback' => sub { my( $cgi, $object, $fields_listref ) = @_; },
#run before display to return a different value
- 'value_callback' => sub { my( $columname, $value } ) = @_; },
+ 'value_callback' => sub { my( $columname, $value ) = @_; },
#XXX describe
'field_callback' => sub { },
@@ -212,6 +212,7 @@ Example:
% #select(-*)
% 'options' => $f->{'options'},
% 'labels' => $f->{'labels'},
+% 'empty_label' => $f->{'empty_label'},
% 'multiple' => $f->{'multiple'},
% 'disable_empty' => $f->{'disable_empty'},
% #select-reason
diff --git a/httemplate/edit/pkg_category.html b/httemplate/edit/pkg_category.html
new file mode 100644
index 000000000..fdc8da638
--- /dev/null
+++ b/httemplate/edit/pkg_category.html
@@ -0,0 +1,22 @@
+<% include( 'elements/edit.html',
+ 'name' => 'Package Category',
+ 'table' => 'pkg_category',
+ 'fields' => [
+ 'categoryname',
+ { field=>'disabled', type=>'checkbox', value=>'Y', },
+ ],
+ 'labels' => {
+ 'categorynum' => 'Category number',
+ 'categoryname' => 'Category name',
+ 'disabled' => 'Disable category',
+ },
+ 'viewall_dir' => 'browse',
+ )
+
+%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
diff --git a/httemplate/edit/pkg_class.html b/httemplate/edit/pkg_class.html
index eddbfc16e..2e4e9d1cd 100644
--- a/httemplate/edit/pkg_class.html
+++ b/httemplate/edit/pkg_class.html
@@ -3,6 +3,10 @@
'table' => 'pkg_class',
'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' => {
@@ -19,4 +23,5 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+my @category = qsearch('pkg_category', { 'disabled' => '' });
</%init>
diff --git a/httemplate/edit/process/pkg_category.html b/httemplate/edit/process/pkg_category.html
new file mode 100644
index 000000000..50cd5cb29
--- /dev/null
+++ b/httemplate/edit/process/pkg_category.html
@@ -0,0 +1,11 @@
+<% include( 'elements/process.html',
+ 'table' => 'pkg_category',
+ 'viewall_dir' => 'browse',
+ )
+%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>