Owen Leonard
0936defa56
The batch modification pages (edit and delete) use the old tablesorter plugin. They should use DataTables instead. This patch makes the following changes: - Remove tablesorter plugin from batchMod.tt where it was unused. - Replace tablesorter assets with DataTables assets on batch edit and batch delete pages. - Replace tablesorter code with DataTables code in batchMod.js, which provides table sorting functionality for both batch templates. - Move position of batchMod.js script inclusion so that DataTables assets are loaded first. - Remove inline table sorting code from batch edit page since it is provided by batchMod.js To test, load barcodes on both the batch edit and batch delete pages. Test JavaScript-based functionality on each results page: - Check/Uncheck all - Hide/show columns - Table sorting on a variety of different kinds of data columns Batch operations should complete normally. There should be no JavaScript error on the batch operation "landing page" (batchMod.tt). Signed-off-by: Melia Meggs <melia@bywatersolutions.com> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> All tests and QA script pass. Checked both patches, no problems found. Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
193 lines
8.4 KiB
Text
193 lines
8.4 KiB
Text
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Tools › Batch item deletion</title>
|
|
[% 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/pages/batchMod.css" />
|
|
<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>
|
|
<script type="text/javascript" src="[% themelang %]/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
|
|
var allColumns = new Array([% FOREACH item_header_loo IN item_header_loop %]'[% loop.count %]'[% UNLESS ( loop.last ) %],[% END %][% END %]);
|
|
for( x=0; x<allColumns.length; x++ ){
|
|
allColumns[x] = Number(allColumns[x]) + 2;
|
|
}
|
|
//]]>
|
|
</script>
|
|
<!--[if IE]>
|
|
<style type="text/css">#selections { display: none; }</style>
|
|
<![endif]-->
|
|
</head>
|
|
<body id="tools_batchMod-del" class="tools">
|
|
[% INCLUDE 'header.inc' %]
|
|
[% INCLUDE 'cat-search.inc' %]
|
|
|
|
<div id="breadcrumbs">
|
|
<a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
|
|
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
|
|
<a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Batch item deletion</a>
|
|
</div>
|
|
|
|
<div id="doc3" class="yui-t7">
|
|
<div id="bd">
|
|
<div id="yui-main">
|
|
[% 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 %]
|
|
|
|
[% UNLESS ( action ) %]
|
|
|
|
[% IF ( notfoundbarcodes ) %]
|
|
<div class="dialog alert">
|
|
[% IF ( itemresults ) %]<p>Warning, the following barcodes were not found:</p>[% ELSE %]<p>Warning: no barcodes were found</p>[% END %]
|
|
</div>
|
|
<table style="margin:auto;">
|
|
<thead>
|
|
<tr>
|
|
<th>Barcode</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH notfoundbarcode IN notfoundbarcodes %]
|
|
<tr><td>[% notfoundbarcode.barcode %]</td></tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
[% UNLESS ( too_many_items ) %]
|
|
[% IF ( item_loop ) %]<h4>The following barcodes were found: </h4>[% END %]
|
|
[% END %]
|
|
[% END %]
|
|
|
|
|
|
<form name="f" action="batchMod.pl" method="post">
|
|
<input type="hidden" name="src" id="src" value="[% src %]" />
|
|
<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="" />
|
|
|
|
[% IF ( item_loop ) %]
|
|
[% 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>
|
|
[% FOREACH item_header_loo IN item_header_loop %]
|
|
<span class="selected"><input id="checkheader[% loop.count %]" type="checkbox" checked="checked" /> <label for="checkheader[% loop.count %]">[% item_header_loo.header_value %]</label> </span>
|
|
[% END %]
|
|
</p>
|
|
|
|
<table id="itemst">
|
|
<thead>
|
|
<tr>
|
|
[% IF ( show ) %]<th> </th>[% END %]
|
|
<th>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 %]
|
|
<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>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
[% END %]
|
|
|
|
[% IF ( simple_items_display ) %]
|
|
<ul>
|
|
[% FOREACH simple_items_displa IN simple_items_display %]
|
|
<li>
|
|
<a href="[% simple_items_displa.itemnumber %]">[% simple_items_displa.barcode %]</a>
|
|
</li>
|
|
[% END %]
|
|
</ul>
|
|
[% END %]
|
|
|
|
|
|
[% IF ( show ) %]
|
|
|
|
[% 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 %]" />
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% IF ( itemresults ) %]
|
|
<div id="cataloguing_additem_newitem">
|
|
<input type="hidden" name="op" value="[% op %]" />
|
|
<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 %]
|
|
|
|
<a href="/cgi-bin/koha/tools/batchMod.pl?del=1" class="cancel">Cancel</a>
|
|
</fieldset>
|
|
</div>
|
|
[% ELSE %]
|
|
<p><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a></p>
|
|
[% END %]
|
|
[% END %]
|
|
</form>
|
|
[% END %]
|
|
|
|
[% IF ( action ) %]
|
|
<div class="dialog message">
|
|
<p>[% deleted_items %] item(s) deleted.</p>
|
|
[% IF delete_records %] <p>[% deleted_records %] record(s) deleted.</p> [% END %]
|
|
</div>
|
|
[% IF ( not_deleted_items ) %]
|
|
<div style="width:55%;margin:auto;">
|
|
<p>[% not_deleted_items %] item(s) could not be deleted: [% FOREACH not_deleted_itemnumber IN not_deleted_itemnumbers %][% not_deleted_itemnumber.itemnumber %][% END %]</p>
|
|
[% IF ( not_deleted_loop ) %]
|
|
<table id="itemst">
|
|
<thead>
|
|
<tr>
|
|
<th>Itemnumber</th>
|
|
<th>Barcode</th>
|
|
<th>Reason</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH not_deleted_loo IN not_deleted_loop %]
|
|
<tr>
|
|
<td>[% not_deleted_loo.itemnumber %]</td>
|
|
<td>[% IF ( CAN_user_editcatalogue_edit_items ) %]<a href="/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber=[% not_deleted_loo.biblionumber %]&itemnumber=[% not_deleted_loo.itemnumber %]">[% not_deleted_loo.barcode %]</a>[% ELSE %][% not_deleted_loo.barcode %][% END %]</td>
|
|
<td>[% IF ( not_deleted_loo.book_on_loan ) %]Item is checked out[% ELSIF ( not_deleted_loo.book_reserved ) %]Item has a waiting hold[% END %]</td>
|
|
</tr>
|
|
[% END %]
|
|
</tbody>
|
|
</table>
|
|
[% END %]
|
|
</div>
|
|
[% END %]
|
|
|
|
<p>
|
|
[% IF ( src == 'CATALOGUING') %]
|
|
<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Done</a>
|
|
[% ELSE %]
|
|
<a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
|
|
[% END %]
|
|
</p>
|
|
[% END %]
|
|
</div>
|
|
</div>
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|