X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Finventory_item.html;h=086c8e92d40c525a5ce7a4149621e50eaea037ba;hb=ea3ce8d7f076e7fecff4be7ae63bc413adb0adf5;hp=80810caf9bb01100d2404ac53c4c34d118a4582b;hpb=f1cd7f98b487e74aa60b6c41d3377cc60f7ac25a;p=freeside.git diff --git a/httemplate/search/inventory_item.html b/httemplate/search/inventory_item.html index 80810caf9..086c8e92d 100644 --- a/httemplate/search/inventory_item.html +++ b/httemplate/search/inventory_item.html @@ -3,6 +3,9 @@ 'menubar' => [ 'View inventory classes' => $p.'browse/inventory_class.html', + 'Upload '. PL($inventory_class->classname)=> + $p.'misc/inventory_item-import.html?'. + "classnum=$classnum" ], 'name' => PL($inventory_class->classname), @@ -31,6 +34,7 @@ $inventory_class->classname, 'Service', FS::UI::Web::cust_header(), + '', # checkbox column ], 'fields' => [ @@ -53,6 +57,7 @@ }, \&FS::UI::Web::cust_fields, + $sub_checkbox, ], 'align' => 'rll'.FS::UI::Web::cust_aligns(), @@ -76,7 +81,12 @@ '', FS::UI::Web::cust_styles(), ], - + 'html_form' => + qq! +
+ +', #' + 'html_foot' => $sub_foot, ) %> <%init> @@ -100,6 +110,12 @@ my $inventory_class = qsearchs( { my $title = $inventory_class->classname. ' Inventory'; +if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { + $extra_sql .= " AND inventory_item.agentnum = $1 "; + my $agent = qsearchs('agent', { 'agentnum' => $1 }) or die "unknown agentnum"; + $title = $agent->agent. " $title"; +} + #little false laziness with SQL fragments in inventory_class.pm if ( $cgi->param('avail') ) { $extra_sql .= ' AND ( svcnum IS NULL OR svcnum = 0 )'; @@ -142,5 +158,41 @@ my $addl_from = ' LEFT JOIN cust_svc USING ( svcnum ) '. ' LEFT JOIN part_svc USING ( svcpart ) '. ' LEFT JOIN cust_pkg USING ( pkgnum ) '. ' LEFT JOIN cust_main USING ( custnum ) '; +my $areboxes = 0; + +my $sub_checkbox = sub { + my $item = $_[0]; + my $itemnum = $item->itemnum; + #return '' if $item->svcnum; + $areboxes = 1; + return qq!!; +}; + +my $sub_foot = sub { + return if !$areboxes; + my $foot = +'
+ +
+ +'; + $foot; +}; + + +