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

(-)a/admin/columns_settings.yml (+26 lines)
Lines 2241-2246 modules: Link Here
2241
            -
2241
            -
2242
              columnname: link
2242
              columnname: link
2243
2243
2244
    opac_holds:
2245
      opac_holds_items:
2246
        columns:
2247
            -
2248
              cannot_be_toggled: 1
2249
              cannot_be_modified: 1
2250
              columnname: selection
2251
            -
2252
              columnname: copy_number
2253
            -
2254
              columnname: itemtype
2255
            -
2256
              columnname: barcode
2257
            -
2258
              columnname: home_library
2259
            -
2260
              columnname: current_library
2261
            -
2262
              columnname: collection
2263
            -
2264
              columnname: call_number
2265
            -
2266
              columnname: notes
2267
            -
2268
              columnname: information
2269
2244
  serials:
2270
  serials:
2245
    subscription-detail:
2271
    subscription-detail:
2246
      orders:
2272
      orders:
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-118 / +134 lines)
Lines 5-10 Link Here
5
[% USE Price %]
5
[% USE Price %]
6
[% USE ItemTypes %]
6
[% USE ItemTypes %]
7
[% USE AuthorisedValues %]
7
[% USE AuthorisedValues %]
8
[% USE TablesSettings %]
8
[% SET reserve_input_type = 'radio' %]
9
[% SET reserve_input_type = 'radio' %]
9
[% IF ( Koha.Preference('DisplayMultiItemHolds') ) %]
10
[% IF ( Koha.Preference('DisplayMultiItemHolds') ) %]
10
    [% SET reserve_input_type = 'checkbox' %]
11
    [% SET reserve_input_type = 'checkbox' %]
Lines 378-500 Link Here
378
379
379
                                            [% IF bibitemloo.itemholdable %]
380
                                            [% IF bibitemloo.itemholdable %]
380
                                                <div id="copiesrow_[% bibitemloo.biblionumber | html %]" class="copiesrow">
381
                                                <div id="copiesrow_[% bibitemloo.biblionumber | html %]" class="copiesrow">
381
                                                <table class="table table-bordered table-striped itemstable">
382
                                                    <table class="table table-bordered table-striped itemstable">
382
                                                    <caption>Select a specific item:</caption>
383
                                                        <caption>Select a specific item:</caption>
383
                                                    <thead>
384
                                                        <thead>
384
                                                        <tr>
385
                                                            <tr>
385
                                                        <th>Copy number</th>
386
                                                                <th class="NoSort">Choose</th>
386
                                                        [% IF ( item_level_itypes ) %]
387
                                                                <th>Copy number</th>
387
                                                            <th>Item type</th>
388
                                                                [% IF ( item_level_itypes ) %]
388
                                                        [% END %]
389
                                                                    <th>Item type</th>
389
                                                        <th>Barcode</th>
390
                                                                [% END %]
390
                                                        [% UNLESS ( singleBranchMode ) %]
391
                                                                <th>Barcode</th>
391
                                                            <th>Home library</th>
392
                                                                [% UNLESS ( singleBranchMode ) %]
392
                                                            <th>Last location</th>
393
                                                                    <th>Home library</th>
393
                                                        [% END %]
394
                                                                    <th>Last location</th>
394
                                                        [% IF ( itemdata_ccode ) %]
395
                                                                [% END %]
395
                                                            <th>Collection</th>
396
                                                                [% IF ( itemdata_ccode ) %]
396
                                                        [% END %]
397
                                                                    <th>Collection</th>
397
                                                        <th>Call number</th>
398
                                                                [% END %]
398
                                                        [% IF ( itemdata_enumchron ) %]
399
                                                                <th>Call number</th>
399
                                                            <th>Vol info</th>
400
                                                                [% IF ( itemdata_enumchron ) %]
400
                                                        [% END %]
401
                                                                    <th>Vol info</th>
401
                                                        <th>Notes</th>
402
                                                                [% END %]
402
                                                        <th>Information</th>
403
                                                                <th>Notes</th>
403
                                                        </tr>
404
                                                                <th>Information</th>
404
                                                    </thead>
405
                                                                <th></th>
405
                                                    <tbody>
406
                                                            </tr>
406
407
                                                        </thead>
407
                                                    [% SET unholdable_items = 0 %]
408
                                                        <tbody>
408
                                                    [% FOREACH itemLoo IN bibitemloo.itemLoop %]
409
409
                                                        [% IF ( itemLoo.available ) %]
410
                                                            [% SET unholdable_items = 0 %]
410
                                                            [% IF ( itemLoo.checkout ) %]
411
                                                            [% FOREACH itemLoo IN bibitemloo.itemLoop %]
411
                                                                <tr class="holdable onloan">
412
                                                                [% IF ( itemLoo.available ) %]
412
                                                            [% ELSE %]
413
                                                                    [% IF ( itemLoo.checkout ) %]
413
                                                                <tr class="holdable">
414
                                                                        <tr class="holdable onloan">
414
                                                            [% END %]
415
                                                                    [% ELSE %]
415
                                                                    <td class="copynumber" data-order="[% itemLoo.copynumber | html %]">
416
                                                                        <tr class="holdable">
416
                                                                        <input type="[% reserve_input_type | html %]" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" />
417
                                                                    [% END %]
417
                                                        [% ELSE %]
418
                                                                        <td class="checkbox">
418
                                                            [% SET unholdable_items = 1 %]
419
                                                                            <input type="[% reserve_input_type | html %]" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" />
419
                                                            [% IF ( itemLoo.checkout ) %]
420
                                                                        </td>
420
                                                                <tr class="unholdable onloan" style="display:none;">
421
                                                                [% ELSE %]
421
                                                            [% ELSE %]
422
                                                                    [% SET unholdable_items = 1 %]
422
                                                                <tr class="unholdable" style="display:none;">
423
                                                                    [% IF ( itemLoo.checkout ) %]
423
                                                            [% END %]
424
                                                                        <tr class="unholdable onloan" style="display:none;">
424
                                                                    <td class="copynumber">
425
                                                                    [% ELSE %]
425
                                                                        <input disabled="disabled" type="radio" aria-label="Cannot be put on hold" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber | html %]"
426
                                                                        <tr class="unholdable" style="display:none;">
426
                                                                           style="display:none;" />
427
                                                                    [% END %]
427
                                                                    <i class="fa fa-times danger" aria-hidden="true" title="Cannot be put on hold"></i>
428
                                                                        <td class="checkbox">
428
                                                        [% END %]
429
                                                                            <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber | html %]" style="display:none;" />
429
                                                                [% IF ( itemLoo.copynumber ) %]
430
                                                                            <i class="fa fa-times danger" aria-hidden="true"></i>
430
                                                                    [% itemLoo.copynumber | html %]
431
                                                                            <span class="fa-sr-only">Cannot be put on hold</span>
432
                                                                        </td>
431
                                                                [% END %]
433
                                                                [% END %]
432
                                                            </td> [%# copynumber %]
433
434
434
                                                            [% IF ( item_level_itypes ) %]
435
                                                                    <td class="copynumber" data-order="[% itemLoo.copynumber | html %]">
435
                                                                <td class="itype">
436
                                                                        [% IF ( itemLoo.copynumber ) %]
436
                                                                    [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
437
                                                                            [% itemLoo.copynumber | html %]
437
                                                                        [% IF ( itemLoo.imageurl ) %]
438
                                                                            <img class="itemtype-image" src="[% itemLoo.imageurl | html %]" alt="" />
439
                                                                        [% END %]
438
                                                                        [% END %]
439
                                                                    </td> [%# copynumber %]
440
441
                                                                    [% IF ( item_level_itypes ) %]
442
                                                                        <td class="itype">
443
                                                                            [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %]
444
                                                                                [% IF ( itemLoo.imageurl ) %]
445
                                                                                    <img class="itemtype-image" src="[% itemLoo.imageurl | html %]" alt="" />
446
                                                                                [% END %]
447
                                                                            [% END %]
448
                                                                            <span class="itypetext">[% itemLoo.translated_description | html %]</span>
449
                                                                        </td>
440
                                                                    [% END %]
450
                                                                    [% END %]
441
                                                                    <span class="itypetext">[% itemLoo.translated_description | html %]</span>
442
                                                                </td>
443
                                                            [% END %]
444
451
445
                                                            <td class="barcode">[% itemLoo.barcode | html %]</td>
452
                                                                    <td class="barcode">[% itemLoo.barcode | html %]</td>
446
                                                            [% UNLESS ( singleBranchMode ) %]
453
                                                                    [% UNLESS ( singleBranchMode ) %]
447
                                                                <td class="homebranch">[% Branches.GetName( itemLoo.homebranch) | html %]</td>
454
                                                                        <td class="homebranch">[% Branches.GetName( itemLoo.homebranch) | html %]</td>
448
                                                                <td class="holdingbranch">[% Branches.GetName( itemLoo.holdingbranch ) | html %]</td>
455
                                                                        <td class="holdingbranch">[% Branches.GetName( itemLoo.holdingbranch ) | html %]</td>
449
                                                            [% END %]
456
                                                                    [% END %]
450
                                                            [% IF ( itemdata_ccode ) %]
457
                                                                    [% IF ( itemdata_ccode ) %]
451
                                                                <td class="ccode"> [% IF ( itemLoo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemLoo.ccode, opac => 1 ) | html %][% END %]</td>
458
                                                                        <td class="ccode"> [% IF ( itemLoo.ccode ) %][% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => itemLoo.ccode, opac => 1 ) | html %][% END %]</td>
452
                                                            [% END %]
459
                                                                    [% END %]
453
                                                            <td class="call_no">[% itemLoo.itemcallnumber | html %]</td>
460
                                                                    <td class="call_no">[% itemLoo.itemcallnumber | html %]</td>
454
                                                            [% IF ( itemdata_enumchron ) %]
461
                                                                    [% IF ( itemdata_enumchron ) %]
455
                                                                <td class="vol_info">[% itemLoo.enumchron | html %]</td>
462
                                                                        <td class="vol_info">[% itemLoo.enumchron | html %]</td>
456
                                                            [% END %]
463
                                                                    [% END %]
457
                                                            <td class="itemnotes">
464
                                                                    <td class="itemnotes">
458
                                                                [% itemLoo.itemnotes | html %]
465
                                                                        [% itemLoo.itemnotes | html %]
459
                                                            </td>
466
                                                                    </td>
460
                                                            <td class="information">
467
                                                                    <td class="information">
461
                                                                [% IF ( itemLoo.checkout.date_due) %]
468
                                                                        [% IF ( itemLoo.checkout.date_due) %]
462
                                                                    <span class="checkedout">Due [% itemLoo.checkout.date_due| $KohaDates as_due_date => 1 %]</span>
469
                                                                            <span class="checkedout">Due [% itemLoo.checkout.date_due| $KohaDates as_due_date => 1 %]</span>
463
                                                                [% ELSIF ( itemLoo.transfertwhen ) %]
470
                                                                        [% ELSIF ( itemLoo.transfertwhen ) %]
464
                                                                    <span class="intransit">In transit from [% Branches.GetName( itemLoo.transfertfrom ) | html %] to [% Branches.GetName( itemLoo.transfertto ) | html %] since [% itemLoo.transfertwhen | $KohaDates %]</span>
471
                                                                            <span class="intransit">In transit from [% Branches.GetName( itemLoo.transfertfrom ) | html %] to [% Branches.GetName( itemLoo.transfertto ) | html %] since [% itemLoo.transfertwhen | $KohaDates %]</span>
465
                                                                [% END %]
472
                                                                        [% END %]
466
473
467
                                                                [% IF ( itemLoo.itemlost == 1 || itemLoo.itemlost == 2 ) %] [%# FIXME Why only for 1 or 2? Shouldn't we test for withdrawn as well? %]
474
                                                                        [% IF ( itemLoo.itemlost == 1 || itemLoo.itemlost == 2 ) %] [%# FIXME Why only for 1 or 2? Shouldn't we test for withdrawn as well? %]
468
                                                                    <span class="lost">Unavailable (lost or missing)</span>
475
                                                                            <span class="lost">Unavailable (lost or missing)</span>
469
                                                                [% END %]
476
                                                                        [% END %]
470
477
471
                                                                [% IF ( itemLoo.notforloan ) %]
478
                                                                        [% IF ( itemLoo.notforloan ) %]
472
                                                                    <span class="notforloan">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemLoo.notforloan ) %])</span>
479
                                                                            <span class="notforloan">Not for loan ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => itemLoo.notforloan ) %])</span>
473
                                                                [% END %]
480
                                                                        [% END %]
474
481
475
                                                                [% IF ( itemLoo.first_hold ) %]
482
                                                                        [% IF ( itemLoo.first_hold ) %]
476
                                                                    <span class="waiting">
483
                                                                            <span class="waiting">
477
                                                                        [% IF ( itemLoo.waitingdate ) %]
484
                                                                                [% IF ( itemLoo.waitingdate ) %]
478
                                                                            <span>Waiting for patron at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.waitingdate | $KohaDates %]</span>
485
                                                                                    <span>Waiting for patron at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.waitingdate | $KohaDates %]</span>
479
                                                                        [% ELSIF ( itemLoo.reservedate ) %]
486
                                                                                [% ELSIF ( itemLoo.reservedate ) %]
480
                                                                            <span>On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.reservedate | $KohaDates %]</span>
487
                                                                                    <span>On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %] since [% itemLoo.reservedate | $KohaDates %]</span>
488
                                                                                [% ELSE %]
489
                                                                                    <span>On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %]</span>
490
                                                                                [% END %]
491
                                                                            </span>
481
                                                                        [% ELSE %]
492
                                                                        [% ELSE %]
482
                                                                            <span>On hold for patron expected at [% Branches.GetName( itemLoo.ExpectedAtLibrary ) | html %]</span>
493
                                                                            <span class="notonhold">Not on hold</span>
483
                                                                        [% END %]
494
                                                                        [% END # / IF ( itemLoo.first_hold )%]
484
                                                                    </span>
495
                                                                    </td>
485
                                                                [% ELSE %]
496
                                                                    <td></td>
486
                                                                    <span class="notonhold">Not on hold</span>
497
                                                                </tr>
487
                                                                [% END # / IF ( itemLoo.first_hold )%]
498
                                                            [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
488
                                                            </td>
499
                                                        </tbody>
489
                                                        </tr>
500
                                                    </table> <!-- / #copiesrow_[% bibitemloo.biblionumber | html %] -->
490
                                                    [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
501
                                                    [% IF unholdable_items %]
491
                                                    </tbody>
502
                                                        <button id="show_unholdable" class="btn btn-primary toggle_unholdable unholdable">Show unholdable items</button>
492
                                                </table> <!-- / #copiesrow_[% bibitemloo.biblionumber | html %] -->
503
                                                        <button id="hide_unholdable" class="btn btn-primary toggle_unholdable unholdable" style="display:none;">Hide unholdable items</button>
493
                                                [% IF unholdable_items %]
504
                                                    [% END %]
494
                                                <button id="show_unholdable" class="btn btn-primary toggle_unholdable unholdable">Show unholdable items</button>
505
                                                </div> <!-- /.copiesrow -->
495
                                                <button id="hide_unholdable" class="btn btn-primary toggle_unholdable unholdable" style="display:none;">Hide unholdable items</button>
496
                                                [% END %]
497
                                                </div>
498
                                            [% END # / IF ( bibitemloo.itemholdable )%]
506
                                            [% END # / IF ( bibitemloo.itemholdable )%]
499
                                        </div> <!-- / #hold-options-[% bibitemloo.biblionumber | html %] -->
507
                                        </div> <!-- / #hold-options-[% bibitemloo.biblionumber | html %] -->
500
                                    </fieldset>
508
                                    </fieldset>
Lines 516-521 Link Here
516
[% BLOCK jsinclude %]
524
[% BLOCK jsinclude %]
517
[% INCLUDE 'calendar.inc' %]
525
[% INCLUDE 'calendar.inc' %]
518
[% INCLUDE 'datatables.inc' %]
526
[% INCLUDE 'datatables.inc' %]
527
[% INCLUDE 'columns_settings.inc' %]
519
<script>
528
<script>
520
    $(document).ready(function() {
529
    $(document).ready(function() {
521
530
Lines 737-751 Link Here
737
746
738
            return true;
747
            return true;
739
        });
748
        });
740
        $(".itemstable").each(function(){
749
741
            $(this).DataTable({
750
        columns_settings = [% TablesSettings.GetColumns( 'opac', 'opac_holds', 'opac_holds_items', 'json' ) | $raw %];
742
                dom: "t",
751
        KohaTable(".itemstable", {
743
                initComplete: function() {
752
            "order": [[ 1, "desc" ]],
744
                    this.find("input:radio").first().prop("checked", true );
753
            "dom": 't',
745
                },
754
            "autoWidth": false,
746
                paging: false
755
            "responsive": {
747
            });
756
                "details": { "type": 'column',"target": -1 }
748
        });
757
            },
758
            "aoColumnDefs": [
759
                { "targets": [ 0 ], "sortable": false, "searchable": false },
760
                { "className": 'dtr-control', "orderable": false, "targets": -1 },
761
            ],
762
            initComplete: function() {
763
                this.find("input:radio").first().prop("checked", true );
764
            },
765
        }, columns_settings );
749
    });
766
    });
750
</script>
767
</script>
751
[% END %]
768
[% END %]
752
- 

Return to bug 37219