Bug 11734 - Use new DataTables include in batch modification templates
authorOwen Leonard <oleonard@myacpl.org>
Mon, 10 Feb 2014 17:26:34 +0000 (12:26 -0500)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 8 Apr 2014 23:51:47 +0000 (23:51 +0000)
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.

Edit: Put back checkboxes plugin which was accidentally removed.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes all tests and QA script.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-del.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchMod-edit.tt

index 38f971e..19abef3 100644 (file)
@@ -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,
     }));
index f93509a..9cd4d33 100644 (file)
@@ -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>&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>
index 3c3dfda..2a24ec7 100644 (file)
@@ -4,11 +4,9 @@
 <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" />
-<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>
+[% INCLUDE 'datatables.inc' %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
+<script type="text/javascript" src="[% themelang %]/js/pages/batchMod.js"></script>
 <script type="text/javascript">
 //<![CDATA[
 
@@ -115,7 +113,7 @@ $(document).ready(function(){
       <thead>
     <tr>
         <th>&nbsp;</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 +124,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 %]