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

(-)a/C4/Reserves.pm (-1 / +1 lines)
Lines 172-178 sub AddReserve { Link Here
172
172
173
    $expdate = output_pref({ str => $expdate, dateonly => 1, dateformat => 'iso' });
173
    $expdate = output_pref({ str => $expdate, dateonly => 1, dateformat => 'iso' });
174
174
175
    # if we have an item selectionned, and the pickup branch is the same as the holdingbranch
175
    # if we have an item selected, and the pickup branch is the same as the holdingbranch
176
    # of the document, we force the value $priority and $found .
176
    # of the document, we force the value $priority and $found .
177
    if ( $checkitem and not C4::Context->preference('ReservesNeedReturns') ) {
177
    if ( $checkitem and not C4::Context->preference('ReservesNeedReturns') ) {
178
        $priority = 0;
178
        $priority = 0;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-3 / +3 lines)
Lines 316-324 Link Here
316
                        Hold must be record level
316
                        Hold must be record level
317
                    </span>
317
                    </span>
318
                [% ELSIF ( itemloo.available ) %]
318
                [% ELSIF ( itemloo.available ) %]
319
                    <input type="checkbox" name="checkitem" value="[% itemloo.itemnumber %]" />
319
                    <input type="checkbox" name="checkitem" value="[% itemloo.itemnumber | html %]" />
320
                [% ELSIF ( itemloo.override ) %]
320
                [% ELSIF ( itemloo.override ) %]
321
                    <input type="checkbox" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber %]" />
321
                    <input type="checkbox" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber | html %]" />
322
                    <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" alt="Requires override of hold policy"/></i>
322
                    <i class="fa fa-exclamation-triangle fa-lg" style="color:gold" alt="Requires override of hold policy"/></i>
323
                [% ELSE %]
323
                [% ELSE %]
324
                    <span class="error">
324
                    <span class="error">
Lines 671-677 Link Here
671
        };
671
        };
672
        var MSG_NO_ITEMS_AVAILABLE = _("A hold cannot be requested on any of these items.");
672
        var MSG_NO_ITEMS_AVAILABLE = _("A hold cannot be requested on any of these items.");
673
        var MSG_EXCEEDED_HOLDS_PER_RECORD = _("Patron has exceeded the number of holds for this record.");
673
        var MSG_EXCEEDED_HOLDS_PER_RECORD = _("Patron has exceeded the number of holds for this record.");
674
        var remainingHolds = "[% remaining_holds_for_record %]";
674
        var remainingHolds = "[% remaining_holds_for_record | html %]";
675
675
676
        $(document).ready(function() {
676
        $(document).ready(function() {
677
            function ToggleHoldsToPlace() {
677
            function ToggleHoldsToPlace() {
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-27 / +27 lines)
Lines 150-161 Link Here
150
150
151
                                [% FOREACH bibitemloo IN bibitemloop %]
151
                                [% FOREACH bibitemloo IN bibitemloop %]
152
                                    <div class="holdrow">
152
                                    <div class="holdrow">
153
                                        <input id="remaining_holds_[% bibitemloo.biblionumber %]" type="hidden" value="[% bibitemloo.remaining_holds_for_record %]"/>
153
                                        <input id="remaining_holds_[% bibitemloo.biblionumber | html %]" type="hidden" value="[% bibitemloo.remaining_holds_for_record | html %]"/>
154
                                        <p>
154
                                        <p>
155
                                            [% IF ( bibitemloo.holdable ) %]
155
                                            [% IF ( bibitemloo.holdable ) %]
156
                                                <span title="[% bibitemloo.biblionumber %]" style="padding:.3em">
156
                                                <span title="[% bibitemloo.biblionumber | html %]" style="padding:.3em">
157
                                                    <label>
157
                                                    <label>
158
                                                        <input class="biblionumbers" name="biblionumbers" type="checkbox" value="[% bibitemloo.biblionumber %]" checked="checked">
158
                                                        <input class="biblionumbers" name="biblionumbers" type="checkbox" value="[% bibitemloo.biblionumber | html %]" checked="checked">
159
                                                        Place a hold on
159
                                                        Place a hold on
160
                                                    </label>
160
                                                    </label>
161
                                                </span>
161
                                                </span>
Lines 224-230 Link Here
224
                                                            <li class="branch">
224
                                                            <li class="branch">
225
                                                                <label for="branch_[% bibitemloo.biblionumber | html %]">Pick up location:</label>
225
                                                                <label for="branch_[% bibitemloo.biblionumber | html %]">Pick up location:</label>
226
                                                                [% UNLESS ( bibitemloo.holdable ) %]
226
                                                                [% UNLESS ( bibitemloo.holdable ) %]
227
                                                                    <select name="branch_[% bibitemloo.biblionumber %]" id="branch_[% bibitemloo.biblionumber | html %]" disabled="disabled">
227
                                                                    <select name="branch_[% bibitemloo.biblionumber | html %]" id="branch_[% bibitemloo.biblionumber | html %]" disabled="disabled">
228
                                                                        [% PROCESS options_for_libraries libraries => Branches.all({ search_params => { pickup_location => 1 }, selected => branch }) %]
228
                                                                        [% PROCESS options_for_libraries libraries => Branches.all({ search_params => { pickup_location => 1 }, selected => branch }) %]
229
                                                                    </select>
229
                                                                    </select>
230
                                                                [% ELSE %]
230
                                                                [% ELSE %]
Lines 300-315 Link Here
300
300
301
                                                        <!-- ITEM HOLDS -->
301
                                                        <!-- ITEM HOLDS -->
302
                                                        <li class="lradio place_on_type" style="display:none;">
302
                                                        <li class="lradio place_on_type" style="display:none;">
303
                                                                <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
303
                                                                <label class="radio inline" for="reqany_[% bibitemloo.biblionumber | html %]">Next available item</label>
304
                                                                <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
304
                                                                <input type="radio" name="reqtype_[% bibitemloo.biblionumber | html %]"
305
                                                                        id="reqany_[% bibitemloo.biblionumber %]"
305
                                                                        id="reqany_[% bibitemloo.biblionumber | html %]"
306
                                                                        class="selectany"
306
                                                                        class="selectany"
307
                                                                        value="Any"
307
                                                                        value="Any"
308
                                                                        checked="checked"
308
                                                                        checked="checked"
309
                                                                />
309
                                                                />
310
                                                            <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
310
                                                            <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber | html %]">A specific item</label>
311
                                                            <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
311
                                                            <input type="radio" name="reqtype_[% bibitemloo.biblionumber | html %]"
312
                                                                   id="reqspecific_[% bibitemloo.biblionumber %]"
312
                                                                   id="reqspecific_[% bibitemloo.biblionumber | html %]"
313
                                                                   class="selectspecific"
313
                                                                   class="selectspecific"
314
                                                                   value="Specific"
314
                                                                   value="Specific"
315
                                                            />
315
                                                            />
Lines 318-337 Link Here
318
318
319
                                                    [% IF bibitemloo.remaining_holds_for_record > 1 %]
319
                                                    [% IF bibitemloo.remaining_holds_for_record > 1 %]
320
                                                        [% SET count = 1 %]
320
                                                        [% SET count = 1 %]
321
                                                        <div id="holds_to_place_[% bibitemloo.biblionumber %]" class="hold-options holds-to-place">
321
                                                        <div id="holds_to_place_[% bibitemloo.biblionumber | html %]" class="hold-options holds-to-place">
322
                                                            <label>Holds to place (count)</label>
322
                                                            <label>Holds to place (count)</label>
323
                                                            <select name="holds_to_place_count_[% bibitemloo.biblionumber %]">
323
                                                            <select name="holds_to_place_count_[% bibitemloo.biblionumber | html %]">
324
                                                            [% WHILE count <= bibitemloo.remaining_holds_for_record %]
324
                                                            [% WHILE count <= bibitemloo.remaining_holds_for_record %]
325
                                                                <option value="[% count %]">[% count %]</option>
325
                                                                <option value="[% count | html %]">[% count | html %]</option>
326
                                                                [% SET count = count + 1 %]
326
                                                                [% SET count = count + 1 %]
327
                                                            [% END %]
327
                                                            [% END %]
328
                                                            </select>
328
                                                            </select>
329
                                                        </div>
329
                                                        </div>
330
                                                    [% ELSE %]
330
                                                    [% ELSE %]
331
                                                        <input type="hidden" name="holds_to_place_count_[% bibitemloo.biblionumber %]" value="1" />
331
                                                        <input type="hidden" name="holds_to_place_count_[% bibitemloo.biblionumber | html %]" value="1" />
332
                                                    [% END %]
332
                                                    [% END %]
333
333
334
                                                        <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
334
                                                        <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber | html %]">
335
                                                            <caption>Select a specific item:</caption>
335
                                                            <caption>Select a specific item:</caption>
336
                                                            <tr>
336
                                                            <tr>
337
                                                                <th>Copy number</th>
337
                                                                <th>Copy number</th>
Lines 357-365 Link Here
357
                                                                <tr class="[% itemLoo.backgroundcolor | html %]">
357
                                                                <tr class="[% itemLoo.backgroundcolor | html %]">
358
                                                                    <td class="copynumber">
358
                                                                    <td class="copynumber">
359
                                                                        [% IF ( itemLoo.available ) %]
359
                                                                        [% IF ( itemLoo.available ) %]
360
                                                                            <input type="checkbox" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
360
                                                                            <input type="checkbox" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" />
361
                                                                        [% ELSE %]
361
                                                                        [% ELSE %]
362
                                                                            <input disabled="disabled" type="checkbox" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]"
362
                                                                            <input disabled="disabled" type="checkbox" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber | html %]"
363
                                                                                   style="display:none;" />
363
                                                                                   style="display:none;" />
364
                                                                            <img src="[% interface | html %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
364
                                                                            <img src="[% interface | html %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
365
                                                                        [% END %]
365
                                                                        [% END %]
Lines 518-536 Link Here
518
        [% FOREACH bibitemloo IN bibitemloop %]
518
        [% FOREACH bibitemloo IN bibitemloop %]
519
            [% IF bibitemloo.force_hold %]
519
            [% IF bibitemloo.force_hold %]
520
                [% IF bibitemloo.force_hold == 'item' %]
520
                [% IF bibitemloo.force_hold == 'item' %]
521
                    $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
521
                    $("#toggle-hold-options-[% bibitemloo.biblionumber | html %]").click();
522
                    $("#reqspecific_[% bibitemloo.biblionumber %]").attr('checked', true);
522
                    $("#reqspecific_[% bibitemloo.biblionumber | html %]").attr('checked', true);
523
                    $("#holds_to_place_[% bibitemloo.biblionumber %]").hide();
523
                    $("#holds_to_place_[% bibitemloo.biblionumber | html %]").hide();
524
                    $("#copiesrow_[% bibitemloo.biblionumber %]").show();
524
                    $("#copiesrow_[% bibitemloo.biblionumber | html %]").show();
525
                [% ELSIF bibitemloo.force_hold == 'record' %]
525
                [% ELSIF bibitemloo.force_hold == 'record' %]
526
                    $("#toggle-hold-options-[% bibitemloo.biblionumber %]").click();
526
                    $("#toggle-hold-options-[% bibitemloo.biblionumber | html %]").click();
527
                    $("#reqany_[% bibitemloo.biblionumber %]").attr('checked', true);
527
                    $("#reqany_[% bibitemloo.biblionumber | html %]").attr('checked', true);
528
                [% END %]
528
                [% END %]
529
                $("#reqany_[% bibitemloo.biblionumber %]").attr('disabled', 'disabled');
529
                $("#reqany_[% bibitemloo.biblionumber | html %]").attr('disabled', 'disabled');
530
                $("#reqspecific_[% bibitemloo.biblionumber %]").attr('disabled', 'disabled');
530
                $("#reqspecific_[% bibitemloo.biblionumber | html %]").attr('disabled', 'disabled');
531
            [% END %]
531
            [% END %]
532
            [% IF bibitemloo.reqholdnotes %]
532
            [% IF bibitemloo.reqholdnotes %]
533
                $("#holdnotes_[% bibitemloo.biblionumber %]").attr( 'required', true );
533
                $("#holdnotes_[% bibitemloo.biblionumber | html %]").attr( 'required', true );
534
            [% END %]
534
            [% END %]
535
        [% END %]
535
        [% END %]
536
536
Lines 613-619 Link Here
613
613
614
        // When 'Place Hold' button is clicked
614
        // When 'Place Hold' button is clicked
615
        $(".placehold").click(function(){
615
        $(".placehold").click(function(){
616
            if (total_requested() + [% reserves_count %] > [% maxreserves %]) {
616
            if (total_requested() + [% reserves_count | html %] > [% maxreserves | html %]) {
617
                alert(MSG_MAX_HOLDS_EXCEEDED);
617
                alert(MSG_MAX_HOLDS_EXCEEDED);
618
                return false;
618
                return false;
619
            }
619
            }
(-)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 267-276 if ( $query->param('place_reserve') ) { Link Here
267
                    $found = 'W'
266
                    $found = 'W'
268
                      unless C4::Context->preference('ReservesNeedReturns');
267
                      unless C4::Context->preference('ReservesNeedReturns');
269
                }
268
                }
270
                warn $itemnumber;
271
                warn $canreserve;
272
                if ($canreserve) {
269
                if ($canreserve) {
273
                    warn $canreserve;
274
                    my $reserve_id = AddReserve(
270
                    my $reserve_id = AddReserve(
275
                        $branch,         $borrowernumber,
271
                        $branch,         $borrowernumber,
276
                        $biblionumber,
272
                        $biblionumber,
Lines 618-624 foreach my $biblioNum (@biblionumbers) { Link Here
618
        }
614
        }
619
    );
615
    );
620
    my $forced_hold_level = $holds->forced_hold_level();
616
    my $forced_hold_level = $holds->forced_hold_level();
621
    warn $forced_hold_level;
622
    if ($forced_hold_level) {
617
    if ($forced_hold_level) {
623
        #$biblioLoopIter{force_hold}   = 1 if $forced_hold_level eq 'item';
618
        #$biblioLoopIter{force_hold}   = 1 if $forced_hold_level eq 'item';
624
        #$biblioLoopIter{itemholdable} = 0 if $forced_hold_level eq 'record';
619
        #$biblioLoopIter{itemholdable} = 0 if $forced_hold_level eq 'record';
625
- 

Return to bug 15565