Bug 15758: Koha::Libraries - Remove GetBranches
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / cleanborrowers.tt
index 9e68141..ae7df4e 100644 (file)
@@ -1,5 +1,6 @@
 [% USE Koha %]
 [% USE KohaDates %]
+[% USE Branches %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Tools &rsaquo; Batch patron deletion/anonymization [% IF step == 2 %]&rsaquo; Confirm[% END %][% IF step == 3 %]&rsaquo; Finished[% END %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
           function checkForm2(form) {
               return true;
           }
+
+          $(document).ready(function() {
+              $('#selectlibrary').find("input:submit").hide();
+              $('#branch').change(function() {
+                $('#selectlibrary').submit();
+              });
+          });
      // ]]>
 </script>
 
    <div id="bd">
     <div id="yui-main">
     <div class="yui-b">
+[% IF !Branches.OnlyMine %]
+    <form method="get" action="/cgi-bin/koha/tools/cleanborrowers.pl" id="selectlibrary">
+    Select a library :
+        <select name="branch" id="branch" style="width:20em;">
+            <option value="*">All libraries</option>
+        [% FOREACH branch IN Branches.all( selected => current_branch ) %]
+          [% IF branch.selected %]
+            <option value="[% branch.branchcode %]" selected="selected">[% branch.branchname %]</option>
+          [% ELSE %]
+            <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
+          [% END %]
+        [% END %]
+        </select>
+    </form>
+  [% IF current_branch == '*' %]
+    <h1>Batch patron deletion/anonymization</h1>
+  [% ELSE %]
+    <h1>Batch patron deletion/anonymization for [% Branches.GetName( current_branch ) %]</h1>
+  [% END %]
+[% ELSE %]
+    <h1>Batch patron deletion/anonymization for [% Branches.GetName( Branches.GetLoggedInBranchcode ) %]</h1>
+[% END %]
+
+[% IF step == 1 %]
+<!-- step 1 START -->
 
-<h1>Batch patron deletion/anonymization</h1>
 <div class="help">
     <p>This tool allows you to delete patrons and anonymize checkout history. For deleting patrons, any combination of limits can be used.</p>
 </div>
-[% IF step == 1 %]
-<!-- step 1 START -->
 <div id="step1">
     <form name="f1" onsubmit="return checkForm(this);" action="/cgi-bin/koha/tools/cleanborrowers.pl" method="post">
     <fieldset>
 
             <!-- hidden here -->
             <input type="hidden" name="step" value="2" />
+            <input type="hidden" name="branch" value="[% current_branch %]" />
             </fieldset>
             <fieldset class="action"><input type="submit" value="Next &gt;&gt;" /></fieldset>
     </form>
             <input type="hidden" name="borrower_dateexpiry" value="[% borrower_dateexpiry | $KohaDates %]" />
             <input type="hidden" name="borrower_categorycode" value="[% borrower_categorycode %]" />
             <input type="hidden" name="patron_list_id" value="[% patron_list_id %]" />
+            <input type="hidden" name="branch" value="[% current_branch %]" />
     </fieldset>
     <fieldset class="action"><input type="submit" value="Finish" /> <a class="cancel" href="/cgi-bin/koha/tools/cleanborrowers.pl">Cancel</a></fieldset>
         </form>