its all about control
[freeside.git] / httemplate / browse / inventory_class.html
index 4a15bf7..8ce131a 100644 (file)
@@ -1,27 +1,4 @@
-<%
-
-tie my %labels, 'Tie::IxHash',
-  'num_avail' => 'Available', #  <FONT SIZE="-1"><A HREF="eventually">(upload batch)</A></FONT>',
-  'num_used'  => 'In use', #'Used', #'Allocated',
-  'num_total' => 'Total',
-;
-
-my %link = (
-  'num_avail' => ';avail=1',
-  'num_used'  => ';used=1',
-  'num_total' => '',
-);
-
-my %inv_action_link = (
-  'num_avail' => [ 'upload batch',
-                   $p.'misc/inventory_item-import.html?classnum=',
-                   'classnum'
-                 ],
-);
-
-my $link = [ "${p}edit/inventory_class.html?", 'classnum' ];
-
-%><%= include( 'elements/browse.html',
+<% include( 'elements/browse.html',
                  'title'       => 'Inventory Classes',
                  'name'        => 'inventory classes',
                  'menubar'     => [ 'Add a new inventory class' =>
@@ -87,3 +64,30 @@ my $link = [ "${p}edit/inventory_class.html?", 'classnum' ];
                                   ],
              )
 %>
+<%init>
+
+die "access denied"
+  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+tie my %labels, 'Tie::IxHash',
+  'num_avail' => 'Available', #  <FONT SIZE="-1"><A HREF="eventually">(upload batch)</A></FONT>',
+  'num_used'  => 'In use', #'Used', #'Allocated',
+  'num_total' => 'Total',
+;
+
+my %link = (
+  'num_avail' => ';avail=1',
+  'num_used'  => ';used=1',
+  'num_total' => '',
+);
+
+my %inv_action_link = (
+  'num_avail' => [ 'upload batch',
+                   $p.'misc/inventory_item-import.html?classnum=',
+                   'classnum'
+                 ],
+);
+
+my $link = [ "${p}edit/inventory_class.html?", 'classnum' ];
+
+</%init>