summaryrefslogtreecommitdiff
path: root/httemplate/browse/inventory_class.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/browse/inventory_class.html')
-rw-r--r--httemplate/browse/inventory_class.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/httemplate/browse/inventory_class.html b/httemplate/browse/inventory_class.html
new file mode 100644
index 0000000..2d85f12
--- /dev/null
+++ b/httemplate/browse/inventory_class.html
@@ -0,0 +1,39 @@
+<% include( 'elements/browse.html',
+ 'title' => 'Inventory Classes',
+ 'name' => 'inventory classes',
+ 'menubar' => $menubar,
+ 'query' => { 'table' => 'inventory_class', },
+ 'count_query' => 'SELECT COUNT(*) FROM inventory_class',
+ 'header' => [ '#', 'Inventory class', 'Inventory' ],
+ 'fields' => [ 'classnum',
+ 'classname',
+ FS::inventory_class->countcell_factory(
+ 'p'=>$p,
+ ),
+ ],
+ 'links' => [ $link,
+ $link,
+ '',
+ ],
+ )
+%>
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+die "access denied"
+ unless $curuser->access_right('Edit inventory')
+ || $curuser->access_right('Edit global inventory')
+ || $curuser->access_right('Configuration');
+
+my $menubar = $curuser->access_right('Configuration')
+ ? [ 'Add a new inventory class' =>
+ $p.'edit/inventory_class.html',
+ ]
+ : [];
+
+my $link = $curuser->access_right('Configuration')
+ ? [ "${p}edit/inventory_class.html?", 'classnum' ]
+ : '';
+
+</%init>