diff options
Diffstat (limited to 'httemplate/search')
-rw-r--r-- | httemplate/search/elements/search.html | 5 | ||||
-rw-r--r-- | httemplate/search/inventory_item.html | 17 |
2 files changed, 18 insertions, 4 deletions
diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html index 0dc417052..636885edc 100644 --- a/httemplate/search/elements/search.html +++ b/httemplate/search/elements/search.html @@ -121,6 +121,7 @@ Example: #handling agent virtualization 'agent_virt' => 1, # set true if this search should be # agent-virtualized + 'agent_null' => 1, # set true to view global records always 'agent_null_right' => 'Access Right', # optional right to view global # records 'agent_null_right_link' => 'Access Right' # optional right to link to @@ -235,7 +236,9 @@ if ( $opt{'agent_virt'} ) { || $opt{'agent_null_right'} ); my $agentnums_sql = $curuser->agentnums_sql( - 'null_right' => $opt{'agent_null_right'} + 'null' => $opt{'agent_null'}, + 'null_right' => $opt{'agent_null_right'}, + 'table' => $opt{'query'}{'table'}, ); $opt{'query'}{'extra_sql'} .= diff --git a/httemplate/search/inventory_item.html b/httemplate/search/inventory_item.html index 55fef9432..80810caf9 100644 --- a/httemplate/search/inventory_item.html +++ b/httemplate/search/inventory_item.html @@ -1,8 +1,11 @@ <% include( 'elements/search.html', 'title' => $title, - #less lame to use Lingua:: something to pluralize - 'name' => $inventory_class->classname. 's', + 'menubar' => [ 'View inventory classes' => + $p.'browse/inventory_class.html', + ], + + 'name' => PL($inventory_class->classname), 'query' => { 'table' => 'inventory_item', @@ -19,6 +22,10 @@ 'count_query' => $count_query, + 'agent_virt' => 1, + 'agent_null' => 1, + 'agent_pos' => 2, + 'header' => [ '#', $inventory_class->classname, @@ -74,8 +81,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'); my $classnum = $cgi->param('classnum'); $classnum =~ /^(\d+)$/ or errorpage("illegal classnum $classnum"); |