diff options
author | ivan <ivan> | 2010-05-21 23:35:47 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-05-21 23:35:47 +0000 |
commit | 42ed7ef03700fb17467bfeedead3639da9efc4a4 (patch) | |
tree | ac9ac209fee11c0a0fd4b122b8554e4d58c15037 /httemplate/browse | |
parent | 4eae5a24723dd6cbac93bb646284a4fdf1553e73 (diff) |
reporting on agent inventory, RT#7010
Diffstat (limited to 'httemplate/browse')
-rw-r--r-- | httemplate/browse/inventory_class.html | 70 |
1 files changed, 3 insertions, 67 deletions
diff --git a/httemplate/browse/inventory_class.html b/httemplate/browse/inventory_class.html index 4ad72a2ea..2d85f1234 100644 --- a/httemplate/browse/inventory_class.html +++ b/httemplate/browse/inventory_class.html @@ -7,54 +7,9 @@ 'header' => [ '#', 'Inventory class', 'Inventory' ], 'fields' => [ 'classnum', 'classname', - sub { - #my $inventory_class = shift; - my $i_c = shift; - - my $link = - $p. 'search/inventory_item.html?'. - 'classnum='. $i_c->classnum; - - my %actioncol = (); - foreach ( keys %inv_action_link ) { - my($label, $baseurl, $method) = - @{ $inv_action_link{$_} }; - my $url = $baseurl. $i_c->$method(); - $actioncol{$_} = - '<FONT SIZE="-1">'. - '('. - '<A HREF="'.$url.'">'. - $label. - '</A>'. - ')'. - '</FONT>'; - } - - my %num = map { - $_ => $i_c->$_(); - } keys %labels; - - [ map { - [ - { - 'data' => '<B>'. $num{$_}. '</B>', - 'align' => 'right', - }, - { - 'data' => $labels{$_}, - 'align' => 'left', - 'link' => ( $num{$_} - ? $link.$link{$_} - : '' - ), - }, - { 'data' => $actioncol{$_}, - 'align' => 'left', - }, - ] - } keys %labels - ]; - }, + FS::inventory_class->countcell_factory( + 'p'=>$p, + ), ], 'links' => [ $link, $link, @@ -71,25 +26,6 @@ die "access denied" || $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>', - '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 $menubar = $curuser->access_right('Configuration') ? [ 'Add a new inventory class' => $p.'edit/inventory_class.html', |