Bug 22556: Add ability to quickly filter funds/budgets by library on the Acquisitions...
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / acqui-home.tt
index 5195d3d..f20c54c 100644 (file)
@@ -64,7 +64,7 @@
 
 [% IF ( loop_budget ) %]
 
-            <h3>All available funds[% IF LoginBranchname %] for [% LoginBranchname | html %][% END %]</h3>
+    <h3>All available funds[% IF LoginBranchname %] for [% LoginBranchname | html %][% END %]</h3>
 
     <div id="BudgetsAndFunds">
     <table id="accounts">
           <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>
+          | <a href="#" id="show_inactive">Show inactive budgets</a>
+          | <select id="library-filter">
+              <option value="">Filter by library</option>
+              [% FOREACH b IN Branches.all %]
+                <option value="[% b.branchname | html %]">[% b.branchname | html %]</option>
+              [% END %]
+            </select>
+        </span>
+
         </caption>
 
         <thead>
             });
             $("#hide_inactive").click();
 
+            $("#library-filter").change(function(){
+                $("#accounts").DataTable().search(this.value);
+                $("#accounts").DataTable().draw();
+            });
+
         });
     </script>
 [% END %]