Bug 16829: Add 'interface' to the log viewer
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / tools / batchMod-del.tt
index c71ab9a..8014d9e 100644 (file)
@@ -1,24 +1,26 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Tools &rsaquo; Batch item deletion</title>
 [% INCLUDE 'doc-head-close.inc' %]
-[% INCLUDE 'background-job.inc' %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/pages/batchMod.css" />
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
-<script src="[% themelang %]/lib/yui/cookie/cookie-min.js"></script>
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
+<script type="text/javascript" src="[% interface %]/[% theme %]/js/pages/batchMod.js"></script>
+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
 <script type="text/javascript">
 //<![CDATA[
 
 // Prepare array of all column headers, incrementing each index by
-// two to accomodate control and title columns
+// two to accommodate control and title columns
 var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
-console.log(allColumns);
 for( x=0; x<allColumns.length; x++ ){
   allColumns[x] = Number(allColumns[x]) + 2;
 }
+$(document).ready(function(){
+    $("#mainformsubmit").on("click",function(){
+        return submitBackgroundJob(this.form);
+    });
+});
 //]]>
 </script>
-<script type="text/javascript" src="[% themelang %]/js/pages/batchMod.js"></script>
 <!--[if IE]>
 <style type="text/css">#selections { display: none; }</style>
 <![endif]-->
@@ -39,8 +41,8 @@ for( x=0; x<allColumns.length; x++ ){
                 [% IF ( show ) %]<h1>Batch item deletion</h1>[% ELSE %]<h1>Batch item deletion results</h1>[% END %]
            [% IF ( barcode_not_unique ) %]<div class="dialog alert"><strong>Error saving item</strong>: Barcode must be unique.</div>[% END %]
            [% IF ( no_next_barcode ) %]<div class="dialog alert"><strong>Error saving items</strong>: Unable to automatically determine values for barcodes. No item has been inserted.</div>[% END %]
-           [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot Delete</strong>: item is checked out.</div>[% END %]
-           [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot Delete</strong>: item has a waiting hold.</div>[% END %]
+        [% IF ( book_on_loan ) %]<div class="dialog alert"><strong>Cannot delete</strong>: item is checked out.</div>[% END %]
+        [% IF ( book_reserved ) %]<div class="dialogalert"><strong>Cannot delete</strong>: item has a waiting hold.</div>[% END %]
 
     [% UNLESS ( action ) %]
 
@@ -67,12 +69,17 @@ for( x=0; x<allColumns.length; x++ ){
 
 
 <form name="f" action="batchMod.pl" method="post">
+     <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber %]" />
      <input type="hidden" name="op" value="[% op %]" />
      <input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
      <input type="hidden" name="completedJobID" id="completedJobID" value="" />
+     <input type="hidden" name="src" id="src" value="[% src %]" />
+     [% IF biblionumber %]
+        <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber %]" />
+     [% END %]
 
 [% IF ( item_loop ) %]
-       [% IF ( show ) %]<div id="toolbar"><a id="selectallbutton" href="#">Select All</a> | <a id="clearallbutton" href="#">Clear All</a></div>[% END %]
+    [% IF ( show ) %]<div id="toolbar"><a id="selectallbutton" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="clearallbutton" href="#"><i class="fa fa-remove"></i> Clear all</a></div>[% END %]
        <div id="cataloguing_additem_itemlist">
 
        <p id="selections"><strong>Show/hide columns:</strong> <span class="selected"><input type="checkbox" checked="checked" id="showall"/><label for="showall">Show all columns</label></span> <span><input type="checkbox" id="hideall"/><label for="hideall">Hide all columns</label></span>
@@ -85,14 +92,14 @@ for( x=0; x<allColumns.length; x++ ){
                    <thead>
                        <tr>
                            [% IF ( show ) %]<th>&nbsp;</th>[% END %]
-                       <th>Title</th>
+                <th class="anti-the">Title</th>
                            [% FOREACH item_header_loo IN item_header_loop %]
                            <th> [% item_header_loo.header_value %] </th>
                            [% END %]
                        </tr>
                    </thead>
                    <tbody>
-                   [% FOREACH item_loo IN item_loop %] <tr> [% IF ( show ) %][% IF ( item_loo.nomod ) %] <td class="error">Cannot Edit</td>[% ELSE %]<td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber %]" id="row[% item_loo.itemnumber %]" checked="checked" /></td>[% END %][% END %]
+            [% FOREACH item_loo IN item_loop %] <tr> [% IF ( show ) %][% IF ( item_loo.nomod ) %] <td class="error">Cannot edit</td>[% ELSE %]<td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber %]" id="row[% item_loo.itemnumber %]" checked="checked" /></td>[% END %][% END %]
                    <td><label for="row[% item_loo.itemnumber %]"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item_loo.biblionumber %]">[% item_loo.title %]</a>[% IF ( item_loo.author ) %], by [% item_loo.author %][% END %]</label></td>
                        [% FOREACH item_valu IN item_loo.item_value %] <td>[% item_valu.field |html %]</td> 
                                        [% END %] </tr>
@@ -117,8 +124,8 @@ for( x=0; x<allColumns.length; x++ ){
 
 [% IF ( too_many_items ) %]
     <p>Too many items ([% too_many_items %]) to display individually.</p>
-    [% FOREACH itemnumbers_hashre IN itemnumbers_hashref %]
-  <input type="hidden" name="itemnumber" value="[% itemnumbers_hashre.itemnumber %]" />
+    [% FOREACH itemnumber IN itemnumbers_array %]
+        <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
     [% END %]
 [% END %]   
 
@@ -128,13 +135,12 @@ for( x=0; x<allColumns.length; x++ ){
             <p>This will delete [% IF ( too_many_items ) %]all the[% ELSE %]the selected[% END %] items.</p>
             <input type="hidden" name="del" value="1" />
             <fieldset class="action">    
-               <div id="jobpanel">
-                   <div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
-                   <div id="jobfailed"></div>
-               </div>
-               [% IF ( too_many_items ) %]<input type="submit" name="mainformsubmit" value="Delete ALL submitted items" onclick="return submitBackgroundJob(this.form);" />[% ELSE %]
-               <input type="checkbox" name="del_records" id="del_records" /> <label for="del_records">Delete records if no items remain.</label><p>
-               <input type="submit" name="mainformsubmit" value="Delete selected items" onclick="return submitBackgroundJob(this.form);" />[% END %]
+        <input type="checkbox" name="del_records" id="del_records" /> <label for="del_records">Delete records if no items remain.</label>
+        [% IF too_many_items %]
+            <input type="submit" name="mainformsubmit" value="Delete ALL submitted items" />
+        [% ELSE %]
+            <input type="submit" name="mainformsubmit" value="Delete selected items" />
+        [% END %]
 
                <a href="/cgi-bin/koha/tools/batchMod.pl?del=1" class="cancel">Cancel</a>
            </fieldset>
@@ -150,6 +156,13 @@ for( x=0; x<allColumns.length; x++ ){
        <div class="dialog message">
             <p>[% deleted_items %] item(s) deleted.</p>
             [% IF delete_records %] <p>[% deleted_records %] record(s) deleted.</p> [% END %]
+            [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
+                <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Return to the record</a>
+            [% ELSIF src %]
+                <a href="[% src %]">Return to where you were</a>
+            [% ELSE %]
+                <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
+            [% END %]
         </div>
        [% IF ( not_deleted_items ) %]
        <div style="width:55%;margin:auto;">
@@ -177,7 +190,15 @@ for( x=0; x<allColumns.length; x++ ){
        </div>
        [% END %]
 
-       <p><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a></p>
+    <p>
+        [% IF src == 'CATALOGUING' # from catalogue/detail.pl > Delete items in a batch%]
+           <a class="btn" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]"><i class="fa fa-check-square-o"></i> Return to the record</a>
+        [% ELSIF src %]
+           <a class="btn" href="[% src %]"><i class="fa fa-check-square-o"></i> Return to where you were</a>
+        [% ELSE %]
+           <a class="btn" href="/cgi-bin/koha/tools/batchMod.pl?del=1"><i class="fa fa-check-square-o"></i> Return to batch item deletion</a>
+        [% END %]
+    </p>
 [% END %]
     </div>
     </div>