Bug 11578: (follow-up) hide filters if a budget (budgetperiod) is chosen
authorJonathan Druart <jonathan.druart@biblibre.com>
Tue, 22 Apr 2014 14:03:33 +0000 (16:03 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Sat, 3 May 2014 18:15:28 +0000 (18:15 +0000)
If a budget_period_id is given, the filters should not be displayed.
Moreover, it does not make sense to display the links for
displaying/hiding inactive budgets in this case.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tt

index 9f96af5..880ce2e 100644 (file)
@@ -202,19 +202,21 @@ var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget")
             $(oTable).treetable('collapseAll');
         });
 
-        $("#hide_inactive").click(function(e){
+        [% UNLESS budget_period_id %]
+          $("#hide_inactive").click(function(e){
             e.preventDefault();
             oTable.fnFilter( 0, 0 ); // Hide active=0
-        });
-        $("#show_inactive").click(function(e){
+          });
+          $("#show_inactive").click(function(e){
             e.preventDefault();
             oTable.fnFilter( '', 0 );
-        });
+          });
+          $("#hide_inactive").click();
+        [% END %]
 
         $("#filterbutton").click(function() {
             $("#fundfilters").slideToggle(0);
         });
-        $("#hide_inactive").click();
     });
 //]]>
 </script>
@@ -264,12 +266,14 @@ var MSG_PARENT_BENEATH_BUDGET = "- " + _("New budget-parent is beneath budget")
 [% IF budgets %]
 
 <table id="budgeth">
-    <caption>
+    [% UNLESS budget_period_id %]
+      <caption>
         <span class="actions"><a href="#" id="expand_all">Expand all</a>
         | <a href="#" id="collapse_all">Collapse all</a>
         | <a href="#" id="hide_inactive">Hide inactive budgets</a>
         | <a href="#" id="show_inactive">Show inactive budgets</a></span>
-    </caption>
+      </caption>
+    [% END %]
     <thead>
         <tr>
             <th>Active</th>