summaryrefslogtreecommitdiff
path: root/httemplate/edit/elements/class_Common.html
diff options
context:
space:
mode:
authorivan <ivan>2009-10-29 01:08:33 +0000
committerivan <ivan>2009-10-29 01:08:33 +0000
commit9d77a21db3642ca66d9a0e545b804b7e6b4090ee (patch)
tree8323e01c8e25420222c97b4e0ea87f89b73203fd /httemplate/edit/elements/class_Common.html
parentf274814c7cde3681578ca594a2b00475370e4c92 (diff)
customer classification, RT#6376
Diffstat (limited to 'httemplate/edit/elements/class_Common.html')
-rw-r--r--httemplate/edit/elements/class_Common.html32
1 files changed, 32 insertions, 0 deletions
diff --git a/httemplate/edit/elements/class_Common.html b/httemplate/edit/elements/class_Common.html
new file mode 100644
index 000000000..b5f493991
--- /dev/null
+++ b/httemplate/edit/elements/class_Common.html
@@ -0,0 +1,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>