[Koha-patches] [PATCH] Bug 11734 - Use new DataTables include in batch modification templates

Owen Leonard oleonard at myacpl.org
Mon Feb 10 18:37:26 CET 2014


Bug 10649 introduced a new include file for adding DataTables-related
JavaScript assets. This patch adds use of this include file to the
batch modification and batch deletion pages.

Minor text changes: Corrected capitalization.

Apply the patch and test the following:

- On batch modification and batch deletion, submit multiple barcodes or
  item numbers. On the results page the title column has been configured
  to use the "anti-the" filter to exclude articles from sorting. Sorting
  on all columns should work correctly.
---
 .../intranet-tmpl/prog/en/js/pages/batchMod.js     |    3 ++-
 .../prog/en/modules/tools/batchMod-del.tt          |   10 ++++------
 .../prog/en/modules/tools/batchMod-edit.tt         |    9 +++------
 3 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js
index 38f971e..19abef3 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js
+++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js
@@ -100,7 +100,8 @@ function hideAllColumns(){
     $("#itemst").dataTable($.extend(true, {}, dataTablesDefaults, {
         "sDom": 't',
         "aoColumnDefs": [
-            { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false }
+            { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
+            { "sType": "anti-the", "aTargets" : [ "anti-the" ] }
         ],
         "bPaginate": false,
     }));
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt
index f93509a..9cd4d33 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt
@@ -3,10 +3,8 @@
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
 <script type="text/javascript" src="[% themelang %]/js/pages/batchMod.js"></script>
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
-[% INCLUDE 'datatables-strings.inc' %]
-<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
 <script type="text/javascript">
 //<![CDATA[
@@ -77,7 +75,7 @@ for( x=0; x<allColumns.length; x++ ){
      [% 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="#">Select all</a> | <a id="clearallbutton" href="#">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>
@@ -90,14 +88,14 @@ for( x=0; x<allColumns.length; x++ ){
 		    <thead>
 			<tr>
 			    [% IF ( show ) %]<th> </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>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt
index 3c3dfda..bec4cdd 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt
@@ -4,11 +4,8 @@
 <script type="text/javascript" src="[% themelang %]/js/background-job-progressbar.js"></script>
 <script type="text/javascript" src="[% themelang %]/js/cataloging.js"></script>
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
 <script type="text/javascript" src="[% themelang %]/js/pages/batchMod.js"></script>
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
-[% INCLUDE 'datatables-strings.inc' %]
-<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
 <script type="text/javascript">
 //<![CDATA[
 
@@ -115,7 +112,7 @@ $(document).ready(function(){
       <thead>
     <tr>
         <th> </th>
-        <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 %] 
@@ -126,7 +123,7 @@ $(document).ready(function(){
               <tr>
                 [% IF show %]
                   [% IF item_loo.nomod %]
-                    <td class="error">Cannot Edit</td>
+                    <td class="error">Cannot edit</td>
                   [% ELSE %]
                     <td><input type="checkbox" name="itemnumber" value="[% item_loo.itemnumber %]" id="row[% item_loo.itemnumber %]" checked="checked" data-is-onloan="[% item_loo.onloan %]" /></td>
                   [% END %]
-- 
1.7.9.5


More information about the Koha-patches mailing list