@@ -, +, @@ -Set Syspref BlockExpiredPatronOpacActions to "ON", -Set a patron's category variable "Block expired patrons" to "Follow SysPref" or -"Block" (ideally test both). -Get the id of a patron from this category (ie : 1234). -Set this patron's expiration date to a date earlier than today. -Get a biblionumber which can be reserved (ie : 5678). --- C4/ILSDI/Services.pm | 7 +++++++ 1 file changed, 7 insertions(+) --- a/C4/ILSDI/Services.pm +++ a/C4/ILSDI/Services.pm @@ -688,9 +688,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 ); @@ -779,6 +783,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 ); --