Lines 112-118
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_l
Link Here
|
112 |
|
112 |
|
113 |
# Coming from opac-search biblionumbers param is a string, coming from |
113 |
# Coming from opac-search biblionumbers param is a string, coming from |
114 |
# opac-reserve, it's an array. |
114 |
# opac-reserve, it's an array. |
115 |
my @biblionumbers = ref($query->param('biblionumbers')) eq 'Array' |
115 |
|
|
|
116 |
my @biblionumbers = ref($query->multi_param('biblionumbers')) eq 'Array' |
116 |
? $query->param('biblionumbers') |
117 |
? $query->param('biblionumbers') |
117 |
: split(/\//, $query->param('biblionumbers')); |
118 |
: split(/\//, $query->param('biblionumbers')); |
118 |
|
119 |
|
Lines 120-125
unless (@biblionumbers) {
Link Here
|
120 |
push(@biblionumbers, $query->multi_param('biblionumber')); |
121 |
push(@biblionumbers, $query->multi_param('biblionumber')); |
121 |
} |
122 |
} |
122 |
|
123 |
|
|
|
124 |
my $multiBibHolds; |
125 |
if (scalar(@biblionumbers) > 1) { |
126 |
$multiBibHolds = 1; |
127 |
} |
128 |
|
123 |
# Pass the numbers to the page so they can be fed back |
129 |
# Pass the numbers to the page so they can be fed back |
124 |
# when the hold is confirmed. TODO: Not necessary? |
130 |
# when the hold is confirmed. TODO: Not necessary? |
125 |
$template->param( biblionumbers => @biblionumbers ); |
131 |
$template->param( biblionumbers => @biblionumbers ); |
Lines 137-142
$template->param( branch => $branch );
Link Here
|
137 |
|
143 |
|
138 |
my %biblioDataHash; # Hash of biblionumber to biblio/biblioitems record. |
144 |
my %biblioDataHash; # Hash of biblionumber to biblio/biblioitems record. |
139 |
my %itemInfoHash; # Hash of itemnumber to item info. |
145 |
my %itemInfoHash; # Hash of itemnumber to item info. |
|
|
146 |
|
140 |
foreach my $biblioNumber (@biblionumbers) { |
147 |
foreach my $biblioNumber (@biblionumbers) { |
141 |
|
148 |
|
142 |
my $biblioData = GetBiblioData($biblioNumber); |
149 |
my $biblioData = GetBiblioData($biblioNumber); |
Lines 159-165
foreach my $biblioNumber (@biblionumbers) {
Link Here
|
159 |
foreach my $itemInfo (@itemInfos) { |
166 |
foreach my $itemInfo (@itemInfos) { |
160 |
$itemInfoHash{$itemInfo->{itemnumber}} = $itemInfo; |
167 |
$itemInfoHash{$itemInfo->{itemnumber}} = $itemInfo; |
161 |
} |
168 |
} |
162 |
|
|
|
163 |
# Compute the priority rank. |
169 |
# Compute the priority rank. |
164 |
my $biblio = Koha::Biblios->find( $biblioNumber ); |
170 |
my $biblio = Koha::Biblios->find( $biblioNumber ); |
165 |
my $holds = $biblio->holds; |
171 |
my $holds = $biblio->holds; |
Lines 190-200
if ( $query->param('place_reserve') ) {
Link Here
|
190 |
} |
196 |
} |
191 |
|
197 |
|
192 |
my $failed_holds = 0; |
198 |
my $failed_holds = 0; |
|
|
199 |
|
193 |
foreach my $biblioNum (@biblionumbers) { |
200 |
foreach my $biblioNum (@biblionumbers) { |
194 |
my $itemNum = $query->param("checkitem_$biblioNum"); |
201 |
my $itemNum = $query->param("checkitem_$biblioNum"); |
195 |
my @itemnumbers = $query->param("checkitem_$biblioNum"); |
202 |
my @itemnumbers = $query->param("checkitem_$biblioNum"); |
196 |
my $branch = $query->param("branch"); |
203 |
my $branch = $query->param("branch"); |
197 |
my $reqtype = $query->param("reqtype_$biblioNum"); |
204 |
my $reqtype = $query->param("reqtype_$biblioNum"); |
|
|
205 |
|
198 |
if (!$reqtype) { |
206 |
if (!$reqtype) { |
199 |
#If no $reqtype value has been passed from the form this means both reqany and reqspecific radio buttons are disabled because a hold has been placed on this biblio previously and so a forced_hold_level exists. |
207 |
#If no $reqtype value has been passed from the form this means both reqany and reqspecific radio buttons are disabled because a hold has been placed on this biblio previously and so a forced_hold_level exists. |
200 |
# Determine what the forced_hold_level is. |
208 |
# Determine what the forced_hold_level is. |
Lines 283-290
if ( $query->param('place_reserve') ) {
Link Here
|
283 |
++$reserve_cnt; |
291 |
++$reserve_cnt; |
284 |
} |
292 |
} |
285 |
} |
293 |
} |
286 |
print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( $failed_holds ? "failed_holds=$failed_holds" : q|| ) . "#opac-user-holds"); |
294 |
|
287 |
exit; |
295 |
# $multiBibHolds indicates if holds on multiple biblio records has been placed |
|
|
296 |
# If not set then can exit and re-direct out of loop otherwise loop through other biblionumbers in @biblionumbers |
297 |
if (!$multiBibHolds) { |
298 |
print $query->redirect("/cgi-bin/koha/opac-user.pl?" . ( $failed_holds ? "failed_holds=$failed_holds" : q|| ) . "#opac-user-holds"); |
299 |
exit; |
300 |
} |
288 |
} |
301 |
} |
289 |
$canreserve = 0 unless CanBookBeReserved( $borrowernumber, $biblioNum )->{status} eq 'OK'; |
302 |
$canreserve = 0 unless CanBookBeReserved( $borrowernumber, $biblioNum )->{status} eq 'OK'; |
290 |
unless ( $can_place_hold_if_available_at_pickup ) { |
303 |
unless ( $can_place_hold_if_available_at_pickup ) { |
291 |
- |
|
|