From 84a01ff22a7ef8063c390fc6cda7bcd89fe25778 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 1 Feb 2024 13:57:14 +0000 Subject: [PATCH] Bug 34478: Changes for opac-reserve Signed-off-by: Jonathan Druart --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 2 +- opac/opac-reserve.pl | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt index 900b8f5a4c..58f1397012 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -146,7 +146,7 @@
[% INCLUDE 'csrf-token.inc' %] Hold requests - + diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index fb1fcfe345..783b95f027 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -45,6 +45,7 @@ use List::MoreUtils qw( uniq ); my $maxreserves = C4::Context->preference("maxreserves"); my $query = CGI->new; +my $op = $query->param('op') // q{}; # if OPACHoldRequests (for placing holds) is disabled, leave immediately if ( ! C4::Context->preference('OPACHoldRequests') ) { @@ -86,8 +87,8 @@ if (! $biblionumbers) { $biblionumbers = $query->param('biblionumber'); } -if ((! $biblionumbers) && (! $query->param('place_reserve'))) { - $template->param(message=>1, no_biblionumber=>1); +if ( !$biblionumbers && $op ne 'cud-place_reserve' ) { + $template->param( message => 1, no_biblionumber => 1 ); output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; exit; } @@ -98,7 +99,7 @@ $template->param( biblionumbers => $biblionumbers ); # Each biblio number is suffixed with '/', e.g. "1/2/3/" my @biblionumbers = split /\//, $biblionumbers; -if (($#biblionumbers < 0) && (! $query->param('place_reserve'))) { +if ( $#biblionumbers < 0 && $op ne 'cud-place_reserve' ) { # TODO: New message? $template->param(message=>1, no_biblionumber=>1); output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; @@ -179,7 +180,7 @@ $template->param( branch => $branch ); # with a specific item for each biblionumber. # # -if ( $query->param('place_reserve') ) { +if ( $op eq 'cud-place_reserve' ) { my $reserve_cnt = 0; if ($maxreserves) { $reserve_cnt = $patron->holds->count; -- 2.39.5