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 369-389 Link Here
369
                                                    </thead>
370
                                                    </thead>
370
                                                    <tbody>
371
                                                    <tbody>
371
372
373
                                                    [% SET unholdable_items = 0 %]
372
                                                    [% FOREACH itemLoo IN bibitemloo.itemLoop %]
374
                                                    [% FOREACH itemLoo IN bibitemloo.itemLoop %]
373
                                                        <tr class="[% itemLoo.backgroundcolor | html %]">
375
                                                        [% IF ( itemLoo.available ) %]
374
                                                            <td class="copynumber">
376
                                                            [% IF ( itemLoo.onloan ) %]
375
                                                                [% IF ( itemLoo.available ) %]
377
                                                                <tr class="holdable onloan">
376
                                                                    <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" />
378
                                                            [% ELSE %]
377
                                                                [% ELSE %]
379
                                                                <tr class="holdable">
378
                                                                    <input disabled="disabled" type="radio" aria-label="Cannot be put on hold" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber | html %]"
380
                                                            [% END %]
381
                                                                    <td class="copynumber">
382
                                                                        <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" />
383
                                                        [% ELSE %]
384
                                                            [% SET unholdable_items = 1 %]
385
                                                            [% IF ( itemLoo.onloan ) %]
386
                                                                <tr class="unholdable onloan" style="display:none;">
387
                                                            [% ELSE %]
388
                                                                <tr class="unholdable" style="display:none;">
389
                                                            [% END %]
390
                                                                    <td class="copynumber">
391
                                                                        <input disabled="disabled" type="radio" aria-label="Cannot be put on hold" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber | html %]"
379
                                                                           style="display:none;" />
392
                                                                           style="display:none;" />
380
                                                                    <i class="fa fa-remove danger" aria-hidden="true" title="Cannot be put on hold"></i>
393
                                                                    <i class="fa fa-remove danger" aria-hidden="true" title="Cannot be put on hold"></i>
381
                                                                [% END %]
394
                                                        [% END %]
382
383
                                                                [% IF ( itemLoo.copynumber ) %]
395
                                                                [% IF ( itemLoo.copynumber ) %]
384
                                                                    [% itemLoo.copynumber | html %]
396
                                                                    [% itemLoo.copynumber | html %]
385
                                                                [% END %]
397
                                                                [% END %]
386
                                                            </td>
398
                                                            </td> [%# copynumber %]
387
399
388
                                                            [% IF ( item_level_itypes ) %]
400
                                                            [% IF ( item_level_itypes ) %]
389
                                                                <td class="itype">
401
                                                                <td class="itype">
Lines 456-461 Link Here
456
                                                    [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
468
                                                    [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
457
                                                    </tbody>
469
                                                    </tbody>
458
                                                </table> <!-- / #copiesrow_[% bibitemloo.biblionumber | html %] -->
470
                                                </table> <!-- / #copiesrow_[% bibitemloo.biblionumber | html %] -->
471
                                                [% IF unholdable_items %]
472
                                                <button id="show_unholdable" class="btn btn-primary toggle_unholdable unholdable">Show unholdable items</button>
473
                                                <button id="hide_unholdable" class="btn btn-primary toggle_unholdable unholdable" style="display:none;">Hide unholdable items</button>
474
                                                [% END %]
475
                                                </div>
459
                                            [% END # / IF ( bibitemloo.itemholdable )%]
476
                                            [% END # / IF ( bibitemloo.itemholdable )%]
460
                                        </div> <!-- / #hold-options-[% bibitemloo.biblionumber | html %] -->
477
                                        </div> <!-- / #hold-options-[% bibitemloo.biblionumber | html %] -->
461
                                    </fieldset>
478
                                    </fieldset>
Lines 492-497 Link Here
492
    }
509
    }
493
510
494
    $(document).ready(function() {
511
    $(document).ready(function() {
512
513
        $(".toggle_unholdable").click(function(e){
514
            e.preventDefault();
515
            $(".unholdable").toggle();
516
        });
517
495
        $("#hold-request-form").preventDoubleFormSubmit();
518
        $("#hold-request-form").preventDoubleFormSubmit();
496
        var copiesRowId = null;
519
        var copiesRowId = null;
497
        var wasSpecific = false;
520
        var wasSpecific = false;
Lines 579-586 Link Here
579
602
580
        // If the user is *allowed* to choose a specific item
603
        // If the user is *allowed* to choose a specific item
581
        // The first one is preselected
604
        // The first one is preselected
582
        $("table.copiesrow").each(function(){
605
        $(".copiesrow table").each(function(){
583
            var id = suffixOf($(this).attr("id"), "_");
606
            var id = suffixOf($(this).closest('div').attr("id"), "_");
584
            select_first_available(id);
607
            select_first_available(id);
585
        });
608
        });
586
609
(-)a/opac/opac-reserve.pl (-2 / +1 lines)
Lines 508-514 foreach my $biblioNum (@biblionumbers) { Link Here
508
        my $issue = Koha::Checkouts->find( { itemnumber => $itemNum } );
508
        my $issue = Koha::Checkouts->find( { itemnumber => $itemNum } );
509
        if ( $issue ) {
509
        if ( $issue ) {
510
            $itemLoopIter->{dateDue} = output_pref({ dt => dt_from_string($issue->date_due, 'sql'), as_due_date => 1 });
510
            $itemLoopIter->{dateDue} = output_pref({ dt => dt_from_string($issue->date_due, 'sql'), as_due_date => 1 });
511
            $itemLoopIter->{backgroundcolor} = 'onloan';
511
            $itemLoopIter->{onloan} = 'onloan';
512
        }
512
        }
513
513
514
        # checking reserve
514
        # checking reserve
515
- 

Return to bug 29706