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

(-)a/C4/Reserves.pm (-1 / +6 lines)
Lines 23-28 package C4::Reserves; Link Here
23
23
24
use strict;
24
use strict;
25
#use warnings; FIXME - Bug 2505
25
#use warnings; FIXME - Bug 2505
26
26
use C4::Context;
27
use C4::Context;
27
use C4::Biblio;
28
use C4::Biblio;
28
use C4::Members;
29
use C4::Members;
Lines 42-47 use Koha::Calendar; Link Here
42
use Koha::Database;
43
use Koha::Database;
43
44
44
use List::MoreUtils qw( firstidx any );
45
use List::MoreUtils qw( firstidx any );
46
use Carp;
47
use Readonly;
48
49
Readonly our $ALREADY_ON_HOLD => -1;
45
50
46
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
51
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
47
52
Lines 162-168 sub AddReserve { Link Here
162
    );
167
    );
163
    if ( $count > 0 ) {
168
    if ( $count > 0 ) {
164
        carp("AddReserve: borrower $borrowernumber already has $count holds for biblionumber $biblionumber");
169
        carp("AddReserve: borrower $borrowernumber already has $count holds for biblionumber $biblionumber");
165
        return;
170
        return $ALREADY_ON_HOLD;
166
    }
171
    }
167
172
168
    my $fee =
173
    my $fee =
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (+7 lines)
Lines 48-53 Link Here
48
48
49
                    [% IF ( patronupdate ) %]<div class="alert alert-info"><h3>Thank you!</h3><p>Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.</p></div>[% END %]
49
                    [% IF ( patronupdate ) %]<div class="alert alert-info"><h3>Thank you!</h3><p>Your corrections have been submitted to the library, and a staff member will update your record as soon as possible.</p></div>[% END %]
50
50
51
                    [% IF already_on_hold %]
52
                        <div class="alert alert-info">
53
                            <h3>Notice:</h3>
54
                            <p>One or more holds were not placed due to existing holds.</p>
55
                        </div>
56
                    [% END %]
57
51
                    [% IF ( BORROWER_INF.warndeparture ) %]
58
                    [% IF ( BORROWER_INF.warndeparture ) %]
52
                        <div class="alert" id="warndeparture">
59
                        <div class="alert" id="warndeparture">
53
                            <strong>Please note:</strong><span> Your card will expire on <span id="warndeparture_date">[% BORROWER_INF.warndeparture | $KohaDates %]</span>. Please contact the library for more information.</span>
60
                            <strong>Please note:</strong><span> Your card will expire on <span id="warndeparture_date">[% BORROWER_INF.warndeparture | $KohaDates %]</span>. Please contact the library for more information.</span>
(-)a/opac/opac-reserve.pl (-2 / +4 lines)
Lines 215-220 if ( $query->param('place_reserve') ) { Link Here
215
        &get_out($query, $cookie, $template->output);
215
        &get_out($query, $cookie, $template->output);
216
    }
216
    }
217
217
218
    my $already_on_hold;
218
    while (@selectedItems) {
219
    while (@selectedItems) {
219
        my $biblioNum = shift(@selectedItems);
220
        my $biblioNum = shift(@selectedItems);
220
        my $itemNum   = shift(@selectedItems);
221
        my $itemNum   = shift(@selectedItems);
Lines 277-283 if ( $query->param('place_reserve') ) { Link Here
277
278
278
        # Here we actually do the reserveration. Stage 3.
279
        # Here we actually do the reserveration. Stage 3.
279
        if ($canreserve) {
280
        if ($canreserve) {
280
            AddReserve(
281
            my $ret = AddReserve(
281
                $branch,      $borrowernumber,
282
                $branch,      $borrowernumber,
282
                $biblioNum,   'a',
283
                $biblioNum,   'a',
283
                [$biblioNum], $rank,
284
                [$biblioNum], $rank,
Lines 285-295 if ( $query->param('place_reserve') ) { Link Here
285
                $notes,       $biblioData->{title},
286
                $notes,       $biblioData->{title},
286
                $itemNum,     $found
287
                $itemNum,     $found
287
            );
288
            );
289
            $already_on_hold++ if $ret == $C4::Reserves::ALREADY_ON_HOLD;
288
            ++$reserve_cnt;
290
            ++$reserve_cnt;
289
        }
291
        }
290
    }
292
    }
291
293
292
    print $query->redirect("/cgi-bin/koha/opac-user.pl#opac-user-holds");
294
    print $query->redirect("/cgi-bin/koha/opac-user.pl?already_on_hold=$already_on_hold#opac-user-holds");
293
    exit;
295
    exit;
294
}
296
}
295
297
(-)a/opac/opac-user.pl (-11 / +8 lines)
Lines 383-399 if ( $borr->{'opacnote'} ) { Link Here
383
}
383
}
384
384
385
$template->param(
385
$template->param(
386
    bor_messages_loop    => GetMessages( $borrowernumber, 'B', 'NONE' ),
386
    userview                 => 1,
387
    waiting_count      => $wcount,
387
    waiting_count            => $wcount,
388
    patronupdate => $patronupdate,
388
    patronupdate             => $patronupdate,
389
    OpacRenewalAllowed => C4::Context->preference("OpacRenewalAllowed"),
389
    already_on_hold          => $query->param('already_on_hold'),
390
    userview => 1,
390
    bor_messages_loop        => GetMessages( $borrowernumber, 'B', 'NONE' ),
391
);
391
    OpacRenewalAllowed       => C4::Context->preference("OpacRenewalAllowed"),
392
392
    SuspendHoldsOpac         => C4::Context->preference('SuspendHoldsOpac'),
393
$template->param(
394
    SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'),
395
    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
393
    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
396
    OpacHoldNotes => C4::Context->preference('OpacHoldNotes'),
394
    OpacHoldNotes            => C4::Context->preference('OpacHoldNotes'),
397
);
395
);
398
396
399
output_html_with_http_headers $query, $cookie, $template->output;
397
output_html_with_http_headers $query, $cookie, $template->output;
400
- 

Return to bug 5144