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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-12 / +35 lines)
Lines 343-349 Link Here
343
                                            </ul>
343
                                            </ul>
344
344
345
                                            [% IF bibitemloo.itemholdable %]
345
                                            [% IF bibitemloo.itemholdable %]
346
                                                <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber | html %]">
346
                                                <div id="copiesrow_[% bibitemloo.biblionumber | html %]" class="copiesrow">
347
                                                <table class="table table-bordered table-striped">
347
                                                    <caption>Select a specific item:</caption>
348
                                                    <caption>Select a specific item:</caption>
348
                                                    <thead>
349
                                                    <thead>
349
                                                        <tr>
350
                                                        <tr>
Lines 368-388 Link Here
368
                                                    </thead>
369
                                                    </thead>
369
                                                    <tbody>
370
                                                    <tbody>
370
371
372
                                                    [% SET unholdable_items = 0 %]
371
                                                    [% FOREACH itemLoo IN bibitemloo.itemLoop %]
373
                                                    [% FOREACH itemLoo IN bibitemloo.itemLoop %]
372
                                                        <tr class="[% itemLoo.backgroundcolor | html %]">
374
                                                        [% IF ( itemLoo.available ) %]
373
                                                            <td class="copynumber">
375
                                                            [% IF ( itemLoo.onloan ) %]
374
                                                                [% IF ( itemLoo.available ) %]
376
                                                                <tr class="holdable onloan">
375
                                                                    <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" />
377
                                                            [% ELSE %]
376
                                                                [% ELSE %]
378
                                                                <tr class="holdable">
377
                                                                    <input disabled="disabled" type="radio" aria-label="Cannot be put on hold" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber | html %]"
379
                                                            [% END %]
380
                                                                    <td class="copynumber">
381
                                                                        <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" />
382
                                                        [% ELSE %]
383
                                                            [% SET unholdable_items = 1 %]
384
                                                            [% IF ( itemLoo.onloan ) %]
385
                                                                <tr class="unholdable onloan" style="display:none;">
386
                                                            [% ELSE %]
387
                                                                <tr class="unholdable" style="display:none;">
388
                                                            [% END %]
389
                                                                    <td class="copynumber">
390
                                                                        <input disabled="disabled" type="radio" aria-label="Cannot be put on hold" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber | html %]"
378
                                                                           style="display:none;" />
391
                                                                           style="display:none;" />
379
                                                                    <i class="fa fa-remove danger" aria-hidden="true" title="Cannot be put on hold"></i>
392
                                                                    <i class="fa fa-remove danger" aria-hidden="true" title="Cannot be put on hold"></i>
380
                                                                [% END %]
393
                                                        [% END %]
381
382
                                                                [% IF ( itemLoo.copynumber ) %]
394
                                                                [% IF ( itemLoo.copynumber ) %]
383
                                                                    [% itemLoo.copynumber | html %]
395
                                                                    [% itemLoo.copynumber | html %]
384
                                                                [% END %]
396
                                                                [% END %]
385
                                                            </td>
397
                                                            </td> [%# copynumber %]
386
398
387
                                                            [% IF ( item_level_itypes ) %]
399
                                                            [% IF ( item_level_itypes ) %]
388
                                                                <td class="itype">
400
                                                                <td class="itype">
Lines 452-457 Link Here
452
                                                    [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
464
                                                    [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
453
                                                    </tbody>
465
                                                    </tbody>
454
                                                </table> <!-- / #copiesrow_[% bibitemloo.biblionumber | html %] -->
466
                                                </table> <!-- / #copiesrow_[% bibitemloo.biblionumber | html %] -->
467
                                                [% IF unholdable_items %]
468
                                                <button id="show_unholdable" class="btn btn-primary toggle_unholdable unholdable">Show unholdable items</button>
469
                                                <button id="hide_unholdable" class="btn btn-primary toggle_unholdable unholdable" style="display:none;">Hide unholdable items</button>
470
                                                [% END %]
471
                                                </div>
455
                                            [% END # / IF ( bibitemloo.itemholdable )%]
472
                                            [% END # / IF ( bibitemloo.itemholdable )%]
456
                                        </div> <!-- / #hold-options-[% bibitemloo.biblionumber | html %] -->
473
                                        </div> <!-- / #hold-options-[% bibitemloo.biblionumber | html %] -->
457
                                    </fieldset>
474
                                    </fieldset>
Lines 489-494 Link Here
489
    }
506
    }
490
507
491
    $(document).ready(function() {
508
    $(document).ready(function() {
509
510
        $(".toggle_unholdable").click(function(e){
511
            e.preventDefault();
512
            $(".unholdable").toggle();
513
        });
514
492
        $("#hold-request-form").preventDoubleFormSubmit();
515
        $("#hold-request-form").preventDoubleFormSubmit();
493
        var copiesRowId = null;
516
        var copiesRowId = null;
494
        var wasSpecific = false;
517
        var wasSpecific = false;
Lines 590-597 Link Here
590
613
591
        // If the user is *allowed* to choose a specific item
614
        // If the user is *allowed* to choose a specific item
592
        // The first one is preselected
615
        // The first one is preselected
593
        $("table.copiesrow").each(function(){
616
        $(".copiesrow table").each(function(){
594
            var id = suffixOf($(this).attr("id"), "_");
617
            var id = suffixOf($(this).closest('div').attr("id"), "_");
595
            select_first_available(id);
618
            select_first_available(id);
596
        });
619
        });
597
620
(-)a/opac/opac-reserve.pl (-2 / +1 lines)
Lines 499-505 foreach my $biblioNum (@biblionumbers) { Link Here
499
        my $issue = Koha::Checkouts->find( { itemnumber => $itemNum } );
499
        my $issue = Koha::Checkouts->find( { itemnumber => $itemNum } );
500
        if ( $issue ) {
500
        if ( $issue ) {
501
            $itemLoopIter->{dateDue} = output_pref({ dt => dt_from_string($issue->date_due, 'sql'), as_due_date => 1 });
501
            $itemLoopIter->{dateDue} = output_pref({ dt => dt_from_string($issue->date_due, 'sql'), as_due_date => 1 });
502
            $itemLoopIter->{backgroundcolor} = 'onloan';
502
            $itemLoopIter->{onloan} = 'onloan';
503
        }
503
        }
504
504
505
        # checking reserve
505
        # checking reserve
506
- 

Return to bug 29706