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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt (-7 / +14 lines)
Lines 676-684 Link Here
676
    [% ELSIF op == 'list' %]
676
    [% ELSIF op == 'list' %]
677
        [% INCLUDE 'datatables.inc' %]
677
        [% INCLUDE 'datatables.inc' %]
678
        [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
678
        [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
679
        <script>
679
        [% IF budgets %]
680
            $(document).ready(function() {
680
            <script>
681
                [% IF budgets %]
681
                const budget_period_id = [% budget_period_id || 'null' | html %];
682
            </script>
683
684
            <script>
685
                $(document).ready(function() {
682
                    var oTable = $("#budgeth").kohaTable({
686
                    var oTable = $("#budgeth").kohaTable({
683
                        drawCallback: function ( oSettings ) {
687
                        drawCallback: function ( oSettings ) {
684
                            if ( oSettings.aiDisplay.length == 0 )
688
                            if ( oSettings.aiDisplay.length == 0 )
Lines 734-740 Link Here
734
                        $(oTable).treetable('collapseAll');
738
                        $(oTable).treetable('collapseAll');
735
                    });
739
                    });
736
740
737
                    [% UNLESS budget_period_id %]
741
                    if (!budget_period_id){
738
                      $("#hide_inactive").click(function(e){
742
                      $("#hide_inactive").click(function(e){
739
                        e.preventDefault();
743
                        e.preventDefault();
740
                        table_dt.columns(0).search(1).draw(); // Show only active=1
744
                        table_dt.columns(0).search(1).draw(); // Show only active=1
Lines 744-752 Link Here
744
                        table_dt.columns(0).search("").draw(); // Show only active=1
748
                        table_dt.columns(0).search("").draw(); // Show only active=1
745
                      });
749
                      });
746
                      $("#hide_inactive").click();
750
                      $("#hide_inactive").click();
747
                    [% END %]
751
                    }
748
                [% END %]
752
                });
753
            </script>
754
        [% END %]
749
755
756
        <script>
757
            $(document).ready(function() {
750
                $(".deletefund-disabled").on("click", function(e){
758
                $(".deletefund-disabled").on("click", function(e){
751
                    e.preventDefault();
759
                    e.preventDefault();
752
                    alert(_("This fund has sub funds. It cannot be deleted."));
760
                    alert(_("This fund has sub funds. It cannot be deleted."));
753
- 

Return to bug 41564