Bug 17600: Standardize our EXPORT_OK
[srvgit] / C4 / ILSDI / Services.pm
index 3a1d084..54ef783 100644 (file)
@@ -21,19 +21,17 @@ use strict;
 use warnings;
 
 use C4::Members;
-use C4::Items;
-use C4::Circulation;
+use C4::Items qw( get_hostitemnumbers_of );
+use C4::Circulation qw( CanBookBeRenewed barcodedecode CanBookBeIssued AddRenewal );
 use C4::Accounts;
-use C4::Biblio;
-use C4::Reserves qw(AddReserve CanBookBeReserved CanItemBeReserved IsAvailableForItemLevelRequest);
+use C4::Biblio qw( GetMarcBiblio );
+use C4::Reserves qw( CanBookBeReserved IsAvailableForItemLevelRequest CalculatePriority AddReserve CanItemBeReserved );
 use C4::Context;
-use C4::AuthoritiesMarc;
-use XML::Simple;
-use HTML::Entities;
+use C4::Auth;
 use CGI qw ( -utf8 );
 use DateTime;
 use C4::Auth;
-use Koha::DateUtils;
+use Koha::DateUtils qw( dt_from_string );
 
 use Koha::Biblios;
 use Koha::Checkouts;
@@ -235,6 +233,9 @@ sub GetRecords {
                 '+as'     => ['barcode'],
             }
         )->unblessed;
+        foreach my $checkout (@$checkouts) {
+            delete $checkout->{'borrowernumber'};
+        }
         my @items            = $biblio->items->as_list;
 
         $biblioitem->{items}->{item} = [];
@@ -725,9 +726,13 @@ sub HoldTitle {
     my $patron = Koha::Patrons->find( $borrowernumber );
     return { code => 'PatronNotFound' } unless $patron;
 
+
     # If borrower is restricted return an error code
     return { code => 'PatronRestricted' } if $patron->is_debarred;
 
+    # Check for patron expired, category and syspref settings
+    return { code => 'PatronExpired' } if ($patron->category->effective_BlockExpiredPatronOpacActions && $patron->is_expired);
+
     # Get the biblio record, or return an error code
     my $biblionumber = $cgi->param('bib_id');
     my $biblio = Koha::Biblios->find( $biblionumber );
@@ -836,6 +841,9 @@ sub HoldItem {
     # If borrower is restricted return an error code
     return { code => 'PatronRestricted' } if $patron->is_debarred;
 
+    # Check for patron expired, category and syspref settings
+    return { code => 'PatronExpired' } if ($patron->category->effective_BlockExpiredPatronOpacActions && $patron->is_expired);
+
     # Get the biblio or return an error code
     my $biblionumber = $cgi->param('bib_id');
     my $biblio = Koha::Biblios->find( $biblionumber );