[freeside-commits] freeside/httemplate/browse inventory_class.html, 1.4, 1.5
Ivan,,,
ivan at wavetail.420.am
Thu May 20 15:48:44 PDT 2010
Update of /home/cvs/cvsroot/freeside/httemplate/browse
In directory wavetail.420.am:/tmp/cvs-serv27688/httemplate/browse
Modified Files:
inventory_class.html
Log Message:
agent virt inventory, RT#7010
Index: inventory_class.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/inventory_class.html,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -w -d -r1.4 -r1.5
--- inventory_class.html 30 Jan 2007 20:59:13 -0000 1.4
+++ inventory_class.html 20 May 2010 22:48:42 -0000 1.5
@@ -1,9 +1,7 @@
<% include( 'elements/browse.html',
'title' => 'Inventory Classes',
'name' => 'inventory classes',
- 'menubar' => [ 'Add a new inventory class' =>
- $p.'edit/inventory_class.html',
- ],
+ 'menubar' => $menubar,
'query' => { 'table' => 'inventory_class', },
'count_query' => 'SELECT COUNT(*) FROM inventory_class',
'header' => [ '#', 'Inventory class', 'Inventory' ],
@@ -66,8 +64,12 @@
%>
<%init>
+my $curuser = $FS::CurrentUser::CurrentUser;
+
die "access denied"
- unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+ unless $curuser->access_right('Edit inventory')
+ || $curuser->access_right('Edit global inventory')
+ || $curuser->access_right('Configuration');
tie my %labels, 'Tie::IxHash',
'num_avail' => 'Available', # <FONT SIZE="-1"><A HREF="eventually">(upload batch)</A></FONT>',
@@ -88,6 +90,14 @@
],
);
-my $link = [ "${p}edit/inventory_class.html?", 'classnum' ];
+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>
More information about the freeside-commits
mailing list