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

(-)a/C4/Reserves.pm (-1 / +1 lines)
Lines 173-179 sub AddReserve { Link Here
173
173
174
    $expdate = output_pref({ str => $expdate, dateonly => 1, dateformat => 'iso' });
174
    $expdate = output_pref({ str => $expdate, dateonly => 1, dateformat => 'iso' });
175
175
176
    # if we have an item selectionned, and the pickup branch is the same as the holdingbranch
176
    # if we have an item selected, and the pickup branch is the same as the holdingbranch
177
    # of the document, we force the value $priority and $found .
177
    # of the document, we force the value $priority and $found .
178
    if ( $checkitem and not C4::Context->preference('ReservesNeedReturns') ) {
178
    if ( $checkitem and not C4::Context->preference('ReservesNeedReturns') ) {
179
        $priority = 0;
179
        $priority = 0;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-3 / +3 lines)
Lines 317-325 Link Here
317
                        Hold must be record level
317
                        Hold must be record level
318
                    </span>
318
                    </span>
319
                [% ELSIF ( itemloo.available ) %]
319
                [% ELSIF ( itemloo.available ) %]
320
                    <input type="checkbox" name="checkitem" value="[% itemloo.itemnumber %]" />
320
                    <input type="checkbox" name="checkitem" value="[% itemloo.itemnumber | html %]" />
321
                [% ELSIF ( itemloo.override ) %]
321
                [% ELSIF ( itemloo.override ) %]
322
                    <input type="checkbox" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber %]" />
322
                    <input type="checkbox" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
323
                    <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" alt="Requires override of hold policy"/></i>
323
                    <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" alt="Requires override of hold policy"/></i>
324
                [% ELSE %]
324
                [% ELSE %]
325
                    <span class="error">
325
                    <span class="error">
Lines 672-678 Link Here
672
        };
672
        };
673
        var MSG_NO_ITEMS_AVAILABLE = _("A hold cannot be requested on any of these items.");
673
        var MSG_NO_ITEMS_AVAILABLE = _("A hold cannot be requested on any of these items.");
674
        var MSG_EXCEEDED_HOLDS_PER_RECORD = _("Patron has exceeded the number of holds for this record.");
674
        var MSG_EXCEEDED_HOLDS_PER_RECORD = _("Patron has exceeded the number of holds for this record.");
675
        var remainingHolds = "[% remaining_holds_for_record %]";
675
        var remainingHolds = "[% remaining_holds_for_record | html %]";
676
676
677
        $(document).ready(function() {
677
        $(document).ready(function() {
678
            function ToggleHoldsToPlace() {
678
            function ToggleHoldsToPlace() {
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-25 / +25 lines)
Lines 155-161 Link Here
155
155
156
                                [% FOREACH bibitemloo IN bibitemloop %]
156
                                [% FOREACH bibitemloo IN bibitemloop %]
157
                                    <div class="holdrow">
157
                                    <div class="holdrow">
158
                                        <input id="remaining_holds_[% bibitemloo.biblionumber %]" type="hidden" value="[% bibitemloo.remaining_holds_for_record %]"/>
158
                                        <input id="remaining_holds_[% bibitemloo.biblionumber | html %]" type="hidden" value="[% bibitemloo.remaining_holds_for_record | html %]"/>
159
                                        <p>
159
                                        <p>
160
                                            [% IF ( bibitemloo.holdable ) %]
160
                                            [% IF ( bibitemloo.holdable ) %]
161
                                                <span title="[% bibitemloo.biblionumber %]" style="padding:.3em">
161
                                                <span title="[% bibitemloo.biblionumber %]" style="padding:.3em">
Lines 228-234 Link Here
228
                                                            <li class="branch">
228
                                                            <li class="branch">
229
                                                                <label for="branch_[% bibitemloo.biblionumber | html %]">Pick up location:</label>
229
                                                                <label for="branch_[% bibitemloo.biblionumber | html %]">Pick up location:</label>
230
                                                                [% UNLESS ( bibitemloo.holdable ) %]
230
                                                                [% UNLESS ( bibitemloo.holdable ) %]
231
                                                                    <select name="branch_[% bibitemloo.biblionumber %]" id="branch_[% bibitemloo.biblionumber | html %]" disabled="disabled">
231
                                                                    <select name="branch_[% bibitemloo.biblionumber | html %]" id="branch_[% bibitemloo.biblionumber | html %]" disabled="disabled">
232
                                                                        [% PROCESS options_for_libraries libraries => Branches.pickup_locations( biblio => bibitemloo.biblionumber, selected => branch ) %]
232
                                                                        [% PROCESS options_for_libraries libraries => Branches.pickup_locations( biblio => bibitemloo.biblionumber, selected => branch ) %]
233
                                                                    </select>
233
                                                                    </select>
234
                                                                [% ELSE %]
234
                                                                [% ELSE %]
Lines 304-319 Link Here
304
304
305
                                                        <!-- ITEM HOLDS -->
305
                                                        <!-- ITEM HOLDS -->
306
                                                        <li class="lradio place_on_type" style="display:none;">
306
                                                        <li class="lradio place_on_type" style="display:none;">
307
                                                                <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
307
                                                                <label class="radio inline" for="reqany_[% bibitemloo.biblionumber | html %]">Next available item</label>
308
                                                                <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
308
                                                                <input type="radio" name="reqtype_[% bibitemloo.biblionumber | html %]"
309
                                                                        id="reqany_[% bibitemloo.biblionumber %]"
309
                                                                        id="reqany_[% bibitemloo.biblionumber | html %]"
310
                                                                        class="selectany"
310
                                                                        class="selectany"
311
                                                                        value="Any"
311
                                                                        value="Any"
312
                                                                        checked="checked"
312
                                                                        checked="checked"
313
                                                                />
313
                                                                />
314
                                                            <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
314
                                                            <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber | html %]">A specific item</label>
315
                                                            <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
315
                                                            <input type="radio" name="reqtype_[% bibitemloo.biblionumber | html %]"
316
                                                                   id="reqspecific_[% bibitemloo.biblionumber %]"
316
                                                                   id="reqspecific_[% bibitemloo.biblionumber | html %]"
317
                                                                   class="selectspecific"
317
                                                                   class="selectspecific"
318
                                                                   value="Specific"
318
                                                                   value="Specific"
319
                                                            />
319
                                                            />
Lines 322-341 Link Here
322
322
323
                                                    [% IF bibitemloo.remaining_holds_for_record > 1 %]
323
                                                    [% IF bibitemloo.remaining_holds_for_record > 1 %]
324
                                                        [% SET count = 1 %]
324
                                                        [% SET count = 1 %]
325
                                                        <div id="holds_to_place_[% bibitemloo.biblionumber %]" class="hold-options holds-to-place">
325
                                                        <div id="holds_to_place_[% bibitemloo.biblionumber | html %]" class="hold-options holds-to-place">
326
                                                            <label>Holds to place (count)</label>
326
                                                            <label>Holds to place (count)</label>
327
                                                            <select name="holds_to_place_count_[% bibitemloo.biblionumber %]">
327
                                                            <select name="holds_to_place_count_[% bibitemloo.biblionumber | html %]">
328
                                                            [% WHILE count <= bibitemloo.remaining_holds_for_record %]
328
                                                            [% WHILE count <= bibitemloo.remaining_holds_for_record %]
329
                                                                <option value="[% count %]">[% count %]</option>
329
                                                                <option value="[% count | html %]">[% count | html %]</option>
330
                                                                [% SET count = count + 1 %]
330
                                                                [% SET count = count + 1 %]
331
                                                            [% END %]
331
                                                            [% END %]
332
                                                            </select>
332
                                                            </select>
333
                                                        </div>
333
                                                        </div>
334
                                                    [% ELSE %]
334
                                                    [% ELSE %]
335
                                                        <input type="hidden" name="holds_to_place_count_[% bibitemloo.biblionumber %]" value="1" />
335
                                                        <input type="hidden" name="holds_to_place_count_[% bibitemloo.biblionumber | html %]" value="1" />
336
                                                    [% END %]
336
                                                    [% END %]
337
337
338
                                                        <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
338
                                                        <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber | html %]">
339
                                                            <caption>Select a specific item:</caption>
339
                                                            <caption>Select a specific item:</caption>
340
                                                            <tr>
340
                                                            <tr>
341
                                                                <th>Copy number</th>
341
                                                                <th>Copy number</th>
Lines 361-369 Link Here
361
                                                                <tr class="[% itemLoo.backgroundcolor | html %]">
361
                                                                <tr class="[% itemLoo.backgroundcolor | html %]">
362
                                                                    <td class="copynumber">
362
                                                                    <td class="copynumber">
363
                                                                        [% IF ( itemLoo.available ) %]
363
                                                                        [% IF ( itemLoo.available ) %]
364
                                                                            <input type="checkbox" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
364
                                                                            <input type="checkbox" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" />
365
                                                                        [% ELSE %]
365
                                                                        [% ELSE %]
366
                                                                            <input disabled="disabled" type="checkbox" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]"
366
                                                                            <input disabled="disabled" type="checkbox" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber | html %]"
367
                                                                                   style="display:none;" />
367
                                                                                   style="display:none;" />
368
                                                                            <img src="[% interface | html %]/lib/famfamfam/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
368
                                                                            <img src="[% interface | html %]/lib/famfamfam/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
369
                                                                        [% END %]
369
                                                                        [% END %]
Lines 522-540 Link Here
522
        [% FOREACH bibitemloo IN bibitemloop %]
522
        [% FOREACH bibitemloo IN bibitemloop %]
523
            [% IF bibitemloo.force_hold %]
523
            [% IF bibitemloo.force_hold %]
524
                [% IF bibitemloo.force_hold == 'item' %]
524
                [% IF bibitemloo.force_hold == 'item' %]
525
                    $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
525
                    $("#toggle-hold-options-[% bibitemloo.biblionumber | html %]").click();
526
                    $("#reqspecific_[% bibitemloo.biblionumber %]").attr('checked', true);
526
                    $("#reqspecific_[% bibitemloo.biblionumber | html %]").attr('checked', true);
527
                    $("#holds_to_place_[% bibitemloo.biblionumber %]").hide();
527
                    $("#holds_to_place_[% bibitemloo.biblionumber | html %]").hide();
528
                    $("#copiesrow_[% bibitemloo.biblionumber %]").show();
528
                    $("#copiesrow_[% bibitemloo.biblionumber | html %]").show();
529
                [% ELSIF bibitemloo.force_hold == 'record' %]
529
                [% ELSIF bibitemloo.force_hold == 'record' %]
530
                    $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
530
                    $("#toggle-hold-options-[% bibitemloo.biblionumber | html %]").click();
531
                    $("#reqany_[% bibitemloo.biblionumber %]").attr('checked', true);
531
                    $("#reqany_[% bibitemloo.biblionumber | html %]").attr('checked', true);
532
                [% END %]
532
                [% END %]
533
                $("#reqany_[% bibitemloo.biblionumber %]").attr('disabled', 'disabled');
533
                $("#reqany_[% bibitemloo.biblionumber | html %]").attr('disabled', 'disabled');
534
                $("#reqspecific_[% bibitemloo.biblionumber %]").attr('disabled', 'disabled');
534
                $("#reqspecific_[% bibitemloo.biblionumber | html %]").attr('disabled', 'disabled');
535
            [% END %]
535
            [% END %]
536
            [% IF bibitemloo.reqholdnotes %]
536
            [% IF bibitemloo.reqholdnotes %]
537
                $("#holdnotes_[% bibitemloo.biblionumber %]").attr( 'required', true );
537
                $("#holdnotes_[% bibitemloo.biblionumber | html %]").attr( 'required', true );
538
            [% END %]
538
            [% END %]
539
        [% END %]
539
        [% END %]
540
540
Lines 617-623 Link Here
617
617
618
        // When 'Place Hold' button is clicked
618
        // When 'Place Hold' button is clicked
619
        $(".placehold").click(function(){
619
        $(".placehold").click(function(){
620
            if (total_requested() + [% reserves_count %] > [% maxreserves %]) {
620
            if (total_requested() + [% reserves_count | html %] > [% maxreserves | html %]) {
621
                alert(MSG_MAX_HOLDS_EXCEEDED);
621
                alert(MSG_MAX_HOLDS_EXCEEDED);
622
                return false;
622
                return false;
623
            }
623
            }
(-)a/opac/opac-reserve.pl (-6 lines)
Lines 44-50 use Koha::Libraries; Link Here
44
use Koha::Patrons;
44
use Koha::Patrons;
45
use Date::Calc qw/Today Date_to_Days/;
45
use Date::Calc qw/Today Date_to_Days/;
46
use List::MoreUtils qw/uniq/;
46
use List::MoreUtils qw/uniq/;
47
use Data::Dumper;
48
47
49
my $maxreserves = C4::Context->preference("maxreserves");
48
my $maxreserves = C4::Context->preference("maxreserves");
50
49
Lines 268-277 if ( $query->param('place_reserve') ) { Link Here
268
                    $found = 'W'
267
                    $found = 'W'
269
                      unless C4::Context->preference('ReservesNeedReturns');
268
                      unless C4::Context->preference('ReservesNeedReturns');
270
                }
269
                }
271
                warn $itemnumber;
272
                warn $canreserve;
273
                if ($canreserve) {
270
                if ($canreserve) {
274
                    warn $canreserve;
275
                    my $reserve_id = AddReserve(
271
                    my $reserve_id = AddReserve(
276
                        $branch,         $borrowernumber,
272
                        $branch,         $borrowernumber,
277
                        $biblionumber,
273
                        $biblionumber,
Lines 625-631 foreach my $biblioNum (@biblionumbers) { Link Here
625
        }
621
        }
626
    );
622
    );
627
    my $forced_hold_level = $holds->forced_hold_level();
623
    my $forced_hold_level = $holds->forced_hold_level();
628
    warn $forced_hold_level;
629
    if ($forced_hold_level) {
624
    if ($forced_hold_level) {
630
        #$biblioLoopIter{force_hold}   = 1 if $forced_hold_level eq 'item';
625
        #$biblioLoopIter{force_hold}   = 1 if $forced_hold_level eq 'item';
631
        #$biblioLoopIter{itemholdable} = 0 if $forced_hold_level eq 'record';
626
        #$biblioLoopIter{itemholdable} = 0 if $forced_hold_level eq 'record';
632
- 

Return to bug 15565