Greek intranet updates
[koha.git] / reports / itemslost.pl
index 07b6e3c..406fbbf 100755 (executable)
@@ -56,27 +56,20 @@ if ( $get_items ) {
     my %where;
     $where{'homebranch'}       = $branchfilter    if defined $branchfilter;
     $where{'barcode'}          = $barcodefilter   if defined $barcodefilter;
-    $where{'itemtype'}         = $itemtypesfilter if defined $itemtypesfilter;
     $where{'authorised_value'} = $loststatusfilter if defined $loststatusfilter;
+    
+    my $itype = C4::Context->preference('item-level_itypes') ? "itype" : "itemtype";
+    $where{$itype}            = $itemtypesfilter if defined $itemtypesfilter;
 
     my $items = GetLostItems( \%where, $orderbyfilter ); 
     $template->param(
-        total     => scalar @$items,
-        itemsloop => $items,
-                 get_items => $get_items
-    );
+                     total       => scalar @$items,
+                     itemsloop   => $items,
+                     get_items   => $get_items,
+                     itype_level => C4::Context->preference('item-level_itypes'),
+                 );
 }
 
-# Get the Lost colletion codes
-#my $fw = GetFrameworkCode($biblionumber);
-#$item = GetAuthorisedValues(GetAuthValCode('items.itemlost',$fw),$item->{itemlost}) if GetAuthValCode('items.itemlost',$fw);
-#if ($item->{damaged}) {
-#    $item->{itemdamagedloop}= GetAuthorisedValues(GetAuthValCode('items.damaged',$fw),$item->{damaged}) if GetAuthValCode('items.damaged',$fw);
-#}
-#get collection code description, too
-#my $ccodes = GetAuthorisedValueDesc('','',   'ccode' ,'','','ccode');
-
-
 # getting all branches.
 my $branches = GetBranches;
 my $branch   = C4::Context->userenv->{"branchname"};