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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt (-9 / +13 lines)
Lines 454-459 Link Here
454
    [% Asset.js("js/mana.js") | $raw %]
454
    [% Asset.js("js/mana.js") | $raw %]
455
    [% INCLUDE 'datatables.inc' %]
455
    [% INCLUDE 'datatables.inc' %]
456
    [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
456
    [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
457
458
    <script>
459
        var table_settings = [% TablesSettings.GetTableSettings( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
460
        const has_orders = [% orders_grouped.size ? 1 : 0 | html %];
461
        const print_routing_list_issue = "[% print_routing_list_issue | uri %]";
462
    </script>
463
457
    <script>
464
    <script>
458
        // the english words used in display purposes
465
        // the english words used in display purposes
459
        var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose hemisphere:"),_("Northern"),_("Southern",
466
        var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose hemisphere:"),_("Northern"),_("Southern",
Lines 461-471 Link Here
461
        $(document).ready(function() {
468
        $(document).ready(function() {
462
469
463
            $("#renewsub").click(function(){
470
            $("#renewsub").click(function(){
464
                popup("[% subscriptionid | html %]");
471
                popup(subscriptionid);
465
                return false;
472
                return false;
466
            })
473
            })
467
474
468
            var table_settings = [% TablesSettings.GetTableSettings( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
469
            var table = $("#orders").kohaTable(
475
            var table = $("#orders").kohaTable(
470
                {
476
                {
471
                    columnDefs: [
477
                    columnDefs: [
Lines 479-485 Link Here
479
                table_settings
485
                table_settings
480
            );
486
            );
481
487
482
            [% IF orders_grouped.size %]
488
            if (has_orders){
483
                $(table).treetable({
489
                $(table).treetable({
484
                    expandable: true,
490
                    expandable: true,
485
                    initialState: 'expanded',
491
                    initialState: 'expanded',
Lines 494-501 Link Here
494
                    e.preventDefault();
500
                    e.preventDefault();
495
                    $(table).treetable('collapseAll');
501
                    $(table).treetable('collapseAll');
496
                });
502
                });
497
503
            }
498
            [% END %]
499
504
500
            let table_dt = table.DataTable();
505
            let table_dt = table.DataTable();
501
            $("#hide_received_orders").click(function(e){
506
            $("#hide_received_orders").click(function(e){
Lines 508-517 Link Here
508
            });
513
            });
509
            $("#show_all_orders").click();
514
            $("#show_all_orders").click();
510
515
511
            [% IF print_routing_list_issue %]
516
            if (print_routing_list_issue){
512
                var myurl = "/cgi-bin/koha/serials/routing-preview.pl?op=print&subscriptionid=[% subscriptionid | uri %]&issue=[% print_routing_list_issue | uri %]";
517
                var myurl = `/cgi-bin/koha/serials/routing-preview.pl?op=print&subscriptionid=${subscriptionid}&issue=${print_routing_list_issue}";
513
                window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
518
                window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
514
            [% END %]
519
            }
515
520
516
        });
521
        });
517
522
518
- 

Return to bug 41578