X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Finventory_item.html;h=80810caf9bb01100d2404ac53c4c34d118a4582b;hb=f1cd7f98b487e74aa60b6c41d3377cc60f7ac25a;hp=3f0288b6c773f81b5e7f2314cdc4609630c936a6;hpb=a1ead42e90dd1f98a5cfd07fcbda7bdab23063f7;p=freeside.git diff --git a/httemplate/search/inventory_item.html b/httemplate/search/inventory_item.html index 3f0288b6c..80810caf9 100644 --- a/httemplate/search/inventory_item.html +++ b/httemplate/search/inventory_item.html @@ -1,14 +1,18 @@ <% 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', 'hashref' => {}, 'select' => join(', ', 'inventory_item.*', + 'part_svc.svcdb', 'cust_main.custnum', FS::UI::Web::cust_sql_fields(), ), @@ -18,6 +22,10 @@ 'count_query' => $count_query, + 'agent_virt' => 1, + 'agent_null' => 1, + 'agent_pos' => 2, + 'header' => [ '#', $inventory_class->classname, @@ -73,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"); @@ -103,7 +115,16 @@ my $count_query = my $link = sub { my $inventory_item = shift; if ( $inventory_item->svcnum ) { - [ "${p}view/svc_acct.cgi?", 'svcnum' ]; + + #[ "${p}view/svc_acct.cgi?", 'svcnum' ]; + my $url = svc_url( + 'm' => $m, + 'action' => 'view', + #'svcdb' => $inventory_item->cust_svc->part_svc->svcdb, + 'svcdb' => $inventory_item->svcdb, #we have it from the joined search + 'query' => '', + ); + [ $url, 'svcnum' ]; } else { ''; }