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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-6 / +16 lines)
Lines 361-367 Link Here
361
        </thead>
361
        </thead>
362
        <tbody>
362
        <tbody>
363
            [% FOREACH item IN items %]
363
            [% FOREACH item IN items %]
364
                <tr id="item_[% item.itemnumber | html %]" data-itemnumber="[% item.itemnumber | html %]">
364
                <tr id="item_[% item.itemnumber | html %]" data-itemnumber="[% item.itemnumber | html %]" data-duedate="[% item.datedue | html %]">
365
                [% IF (StaffDetailItemSelection) %]
365
                [% IF (StaffDetailItemSelection) %]
366
                    <td style="text-align:center;vertical-align:middle">
366
                    <td style="text-align:center;vertical-align:middle">
367
                        <input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" />
367
                        <input type="checkbox" value="[% item.itemnumber | html %]" name="itemnumber" />
Lines 1449-1461 Note that permanent location is a code, and location may be an authval. Link Here
1449
        $(document).ready(function() {
1449
        $(document).ready(function() {
1450
1450
1451
            [% IF bundlesEnabled %] // Bundle handling
1451
            [% IF bundlesEnabled %] // Bundle handling
1452
            function createChild ( row, itemnumber ) {
1452
            function createChild ( row, itemnumber, duedate ) {
1453
1453
1454
                // Toolbar
1454
                // Toolbar
1455
                var bundle_toolbar = $('<div id="toolbar" class="btn-toolbar"></div>');
1455
                var bundle_toolbar = $('<div id="toolbar" class="btn-toolbar"></div>');
1456
                bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#addToBundleModal" data-item="' + itemnumber + '"><i class="fa fa-plus"></i> ' + _("Add to bundle") + '</a>');
1456
                bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#addToBundleModal" data-item="' + itemnumber + '"><i class="fa fa-plus"></i> ' + _("Add to bundle") + '</a>');
1457
                bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#removeFromBundleModal" data-item="' + itemnumber + '"><i class="fa fa-minus"></i> ' + _("Remove from bundle") + '</a>');
1457
                bundle_toolbar.append('<a class="btn btn-default" data-toggle="modal" data-target="#removeFromBundleModal" data-item="' + itemnumber + '"><i class="fa fa-minus"></i> ' + _("Remove from bundle") + '</a>');
1458
1458
1459
                // Disable management if there's a duedate
1460
                if(duedate) {
1461
                    bundle_toolbar.children('.btn').addClass("disabled");
1462
                }
1463
1459
                // This is the table we'll convert into a DataTable
1464
                // This is the table we'll convert into a DataTable
1460
                var bundles_table = $('<table class="display tbundle" data-itemnumber="'+itemnumber+'" id="bundle_table_'+itemnumber+'" width="100%"/>');
1465
                var bundles_table = $('<table class="display tbundle" data-itemnumber="'+itemnumber+'" id="bundle_table_'+itemnumber+'" width="100%"/>');
1461
1466
Lines 1554-1560 Note that permanent location is a code, and location may be an authval. Link Here
1554
                        },
1559
                        },
1555
                        {
1560
                        {
1556
                            "data": function( row, type, val, meta ) {
1561
                            "data": function( row, type, val, meta ) {
1557
                                var result = '<button class="btn btn-default btn-xs remove" role="button" data-itemnumber="'+row.item_id+'"><i class="fa fa-minus" aria-hidden="true"></i> '+_("Remove")+'</button>\n';
1562
                                var result;
1563
                                if (duedate) {
1564
                                    result = '<button class="btn btn-default btn-xs remove disabled" role="button" data-itemnumber="'+row.item_id+'"><i class="fa fa-minus" aria-hidden="true"></i> '+_("Remove")+'</button>\n';
1565
                                } else {
1566
                                    result = '<button class="btn btn-default btn-xs remove" role="button" data-itemnumber="'+row.item_id+'"><i class="fa fa-minus" aria-hidden="true"></i> '+_("Remove")+'</button>\n';
1567
                                }
1558
                                return result;
1568
                                return result;
1559
                            },
1569
                            },
1560
                            "title": _("Actions"),
1570
                            "title": _("Actions"),
Lines 1564-1570 Note that permanent location is a code, and location may be an authval. Link Here
1564
                        }
1574
                        }
1565
                    ]
1575
                    ]
1566
                }, bundle_settings, 1);
1576
                }, bundle_settings, 1);
1567
                $(".tbundle").on("click", ".remove", function(){
1577
                $(".tbundle").on("click", ".remove:not(.disabled)", function(){
1568
                    var bundle_table = $(this).closest('table');
1578
                    var bundle_table = $(this).closest('table');
1569
                    var host_itemnumber = bundle_table.data('itemnumber');
1579
                    var host_itemnumber = bundle_table.data('itemnumber');
1570
                    var component_itemnumber = $(this).data('itemnumber');
1580
                    var component_itemnumber = $(this).data('itemnumber');
Lines 1746-1751 Note that permanent location is a code, and location may be an authval. Link Here
1746
                    var dTable = $(this).closest('table').DataTable({ 'retrieve': true });
1756
                    var dTable = $(this).closest('table').DataTable({ 'retrieve': true });
1747
1757
1748
                    var itemnumber = tr.data('itemnumber');
1758
                    var itemnumber = tr.data('itemnumber');
1759
                    var duedate = tr.data('duedate');
1749
                    var row = dTable.row( tr );
1760
                    var row = dTable.row( tr );
1750
1761
1751
                    if ( row.child.isShown() ) {
1762
                    if ( row.child.isShown() ) {
Lines 1755-1761 Note that permanent location is a code, and location may be an authval. Link Here
1755
                    }
1766
                    }
1756
                    else {
1767
                    else {
1757
                        // Open this row
1768
                        // Open this row
1758
                        createChild(row, itemnumber);
1769
                        createChild(row, itemnumber, duedate);
1759
                        tr.addClass('shown');
1770
                        tr.addClass('shown');
1760
                    }
1771
                    }
1761
                } );
1772
                } );
1762
- 

Return to bug 28854