Bug 34478: Changes for opac-reserve
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
55b5b51532
commit
84a01ff22a
|
|
@ -146,7 +146,7 @@
|
|||
<form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<legend class="sr-only">Hold requests</legend>
|
||||
<input type="hidden" name="place_reserve" value="1"/>
|
||||
<input type="hidden" name="op" value="cud-place_reserve" />
|
||||
<!-- These values are set dynamically by js -->
|
||||
<input type="hidden" name="biblionumbers" id="biblionumbers"/>
|
||||
<input type="hidden" name="selecteditems" id="selections"/>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue