View | Details | Raw Unified | Return to bug 6976
Collapse All | Expand All

(-)a/opac/opac-reserve.pl (-7 / +30 lines)
Lines 164-170 foreach my $biblioNumber (@biblionumbers) { Link Here
164
#
164
#
165
if ( $query->param('place_reserve') ) {
165
if ( $query->param('place_reserve') ) {
166
    my $notes = $query->param('notes');
166
    my $notes = $query->param('notes');
167
	my $canreserve=0;
167
    my $reserve_cnt;
168
    if ( $MAXIMUM_NUMBER_OF_RESERVES ) {
169
        my @res = GetReservesFromBorrowernumber( $borrowernumber );
170
        $reserve_cnt = @res;
171
    }
172
    else {
173
        $reserve_cnt = 0;
174
    }
168
175
169
    # List is composed of alternating biblio/item/branch
176
    # List is composed of alternating biblio/item/branch
170
    my $selectedItems = $query->param('selecteditems');
177
    my $selectedItems = $query->param('selecteditems');
Lines 197-202 if ( $query->param('place_reserve') ) { Link Here
197
        my $itemNum   = shift(@selectedItems);
204
        my $itemNum   = shift(@selectedItems);
198
        my $branch    = shift(@selectedItems); # i.e., branch code, not name
205
        my $branch    = shift(@selectedItems); # i.e., branch code, not name
199
206
207
        my $canreserve = 0;
208
200
        my $singleBranchMode = $template->param('singleBranchMode');
209
        my $singleBranchMode = $template->param('singleBranchMode');
201
        if ($singleBranchMode || ! $OPACChooseBranch) { # single branch mode or disabled user choosing
210
        if ($singleBranchMode || ! $OPACChooseBranch) { # single branch mode or disabled user choosing
202
            $branch = $borr->{'branchcode'};
211
            $branch = $borr->{'branchcode'};
Lines 241-249 if ( $query->param('place_reserve') ) { Link Here
241
            $itemNum = undef;
250
            $itemNum = undef;
242
        }
251
        }
243
252
253
        if (   $MAXIMUM_NUMBER_OF_RESERVES
254
            && $reserve_cnt >= $MAXIMUM_NUMBER_OF_RESERVES )
255
        {
256
            $canreserve = 0;
257
        }
258
244
        # Here we actually do the reserveration. Stage 3.
259
        # Here we actually do the reserveration. Stage 3.
245
        AddReserve($branch, $borrowernumber, $biblioNum, 'a', [$biblioNum], $rank, $startdate, $expiration_date, $notes,
260
        if ($canreserve) {
246
                   $biblioData->{'title'}, $itemNum, $found) if ($canreserve);
261
            AddReserve(
262
                $branch,      $borrowernumber,
263
                $biblioNum,   'a',
264
                [$biblioNum], $rank,
265
                $startdate,   $expiration_date,
266
                $notes,       $biblioData->{title},
267
                $itemNum,     $found
268
            );
269
            ++$reserve_cnt;
270
        }
247
    }
271
    }
248
272
249
    print $query->redirect("/cgi-bin/koha/opac-user.pl#opac-user-holds");
273
    print $query->redirect("/cgi-bin/koha/opac-user.pl#opac-user-holds");
Lines 264-284 if ( $borr->{'amountoutstanding'} && ($borr->{'amountoutstanding'} > $maxoutstan Link Here
264
    $noreserves = 1;
288
    $noreserves = 1;
265
    $template->param( too_much_oweing => $amount );
289
    $template->param( too_much_oweing => $amount );
266
}
290
}
267
if ( $borr->{gonenoaddress} && ($borr->{gonenoaddress} eq 1) ) {
291
if ( $borr->{gonenoaddress} && ($borr->{gonenoaddress} == 1) ) {
268
    $noreserves = 1;
292
    $noreserves = 1;
269
    $template->param(
293
    $template->param(
270
                     message => 1,
294
                     message => 1,
271
                     GNA     => 1
295
                     GNA     => 1
272
                    );
296
                    );
273
}
297
}
274
if ( $borr->{lost} && ($borr->{lost} eq 1) ) {
298
if ( $borr->{lost} && ($borr->{lost} == 1) ) {
275
    $noreserves = 1;
299
    $noreserves = 1;
276
    $template->param(
300
    $template->param(
277
                     message => 1,
301
                     message => 1,
278
                     lost    => 1
302
                     lost    => 1
279
                    );
303
                    );
280
}
304
}
281
if ( $borr->{debarred} && ($borr->{debarred} eq 1) ) {
305
if ( $borr->{debarred} && ($borr->{debarred} == 1) ) {
282
    $noreserves = 1;
306
    $noreserves = 1;
283
    $template->param(
307
    $template->param(
284
                     message  => 1,
308
                     message  => 1,
285
- 

Return to bug 6976