Partial fix for Bug 1578: detect material type and don't load COinS unless the materi...
[koha_fer] / reports / itemslost.pl
index 3844dd6..33fbfef 100755 (executable)
@@ -15,7 +15,6 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-#$Id$
 
 =head1 itemslost
 
@@ -27,7 +26,8 @@ use strict;
 use CGI;
 use C4::Auth;
 use C4::Output;
-use C4::Biblio;    # GetLostItems
+use C4::Biblio;
+use C4::Items;
 use C4::Koha;                  # GetItemTypes
 use C4::Branch; # GetBranches
 
@@ -38,14 +38,15 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         query           => $query,
         type            => "intranet",
         authnotrequired => 0,
-        flagsrequired   => { reportss => 1 },
+        flagsrequired   => { reports => 1 },
         debug           => 1,
     }
 );
 
 my $params = $query->Vars;
+my $get_items = $params->{'get_items'};
 
-if ( $params->{'get_items'} ) {
+if ( $get_items ) {
     my $orderbyfilter   = $params->{'orderbyfilter'}   || undef;
     my $branchfilter    = $params->{'branchfilter'}    || undef;
     my $barcodefilter   = $params->{'barcodefilter'}   || undef;
@@ -59,7 +60,8 @@ if ( $params->{'get_items'} ) {
     my $items = GetLostItems( \%where, $orderbyfilter );
     $template->param(
         total     => scalar @$items,
-        itemsloop => $items
+        itemsloop => $items,
+               get_items => $get_items
     );
 }