Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt
Josef Moravec 5fc8c03b59 Bug 19438: Fix sorting by date due in overdues.pl
Test plan:
0) Do not apply the patch
1) Have some overdued checkouts in your database
2) Go to circulation -> overdues (overdues.pl)
3) Try to sort the overdues table by due date and notice it is sorted
alphabetically, not by date
4) Apply the patch
5) Try again and confirm, it is sorted by date

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-10-13 13:58:04 -03:00

265 lines
11 KiB
Text

[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Circulation &rsaquo; Items overdue as of [% todaysdate %]</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'datatables.inc' %]
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
[%- USE Branches -%]
<script type="text/javascript">
//<![CDATA[
function clone_parent(node) {
var parent = node.parentNode;
var clone = parent.cloneNode(true);
parent.parentNode.insertBefore(clone, parent.nextSibling);
$("a", clone).attr("style", "visibility: visible");
$("input", clone).attr("value", "");
var theid = $("span", clone).attr("id") || "";
var theid = $("span", clone).attr("id") || "";
var parts = theid.match(/^pattrodue-getready-(.*)$/);
if (parts && parts.length > 1)
{
var appendid = "-" + Math.floor(Math.random()*1000+1);
$("span", clone).attr("id",theid+appendid);
theid = $("input", clone).attr("id");
$("input", clone).attr("id",theid+appendid);
theid = $("div[id]", clone).attr("id");
$("div[id]", clone).attr("id",theid+appendid);
var attrcode = $("script", clone).attr("x-code");
var newsuffix = parts[1] + appendid;
create_auto_completion_responder(newsuffix,attrcode);
}
}
function delete_parent(node) {
var parent = node.parentNode;
parent.parentNode.removeChild(parent);
}
function create_auto_completion_responder(uniqueid,attrcode) {
$("#pattrodue-getready-" + uniqueid).ready(function(){
$( "#pattrodue-input-" + uniqueid ).autocomplete({
source: "/cgi-bin/koha/circ/ypattrodue-attr-search-authvalue.pl/"+attrcode,
select: function( event, ui ) {
$( "#pattrodue-input-"+uniqueid ).val( ui.item.description );
return false;
}
})
.data( "ui-autocomplete" )._renderItem = function( ul, item ) {
return $( "<li></li>" )
.data( "ui-autocomplete-item", item )
.append( "<a>" + item.description + " (" + item.authorised_value + ")</a>" )
.appendTo( ul )
.css("font-size","90%").css("width","13em");
};
});
}
$(document).ready(function(){
$("#overduest").dataTable($.extend(true, {}, dataTablesDefaults, {
"sPaginationType": "four_button",
"aaSorting": [[0, 'asc']],
"aoColumnDefs": [
{ "sType": "title-string", "aTargets": [ "title-string" ] }
]
}));
});
//]]>
</script>
<style type="text/css">
.sql {display:none;}
</style>
</head>
<body id="circ_overdue" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Overdues as of [% todaysdate %]</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
[% IF ( noreport ) %]
<h2>Overdue report</h2>
<p>Please choose one or more filters to proceed.</p>
[% ELSE %]
[% IF ( overdueloop ) %]
<h2>[% nnoverdue %] [% IF ( noverdue_is_plural ) %]Items[% ELSE %]Item[% END %] overdue as of [% todaysdate %][% IF ( isfiltered ) %] <span style="font-size:70%;">(Filtered. <a href="/cgi-bin/koha/circ/overdue.pl">Reset filter</a>)</span>[% END %]</h2>
<p>
[% IF ( isfiltered ) %]
<a href="overdue.pl?op=csv&amp;[% csv_param_string |html %]">Download file of displayed overdues</a>
[% ELSE %]
<a href="overdue.pl?op=csv">Download file of all overdues</a>
[% END %]
</p>
<div class="sql"><pre>[% sql |html %]</pre></div>
<div class="searchresults">
<table id="overduest">
<thead>
<tr>
<th class="title-string">Due date</th>
<th>Patron</th>
<th>Library</th>
<th>Title</th>
<th>Barcode</th>
<th>Call number</th>
<th>Price</th>
</tr>
</thead>
[%- BLOCK subject -%]Overdue:[%- END -%]
<tbody>
[% FOREACH overdueloo IN overdueloop %]
<tr>
<td><span title="[% overdueloo.duedate %]">[% overdueloo.duedate | $KohaDates %]</span></td>
<td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% overdueloo.borrowernumber %]">[% overdueloo.surname %][% IF (overdueloo.firstname) %], [% overdueloo.firstname %][% END %] ([% overdueloo.cardnumber %])</a>
[% IF ( overdueloo.email ) %][<a href="mailto:[% overdueloo.email %]?subject=[% INCLUDE subject %] [% overdueloo.title |html %]">email</a>][% END %]
[% IF ( overdueloo.phone ) %]([% overdueloo.phone %])[% ELSIF ( overdueloo.mobile ) %]([% overdueloo.mobile %])[% ELSIF ( overdueloo.phonepro ) %]([% overdueloo.phonepro %])[% END %]</td>
<td>[% IF overdueloo.branchcode %][% Branches.GetName( overdueloo.branchcode ) %][% END %]</td>
<td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overdueloo.biblionumber %][% overdueloo.title |html %] [% overdueloo.subtitle %]</a> [% IF ( overdueloo.author ) %], by [% overdueloo.author %][% END %][% IF ( overdueloo.enumchron ) %], [% overdueloo.enumchron %][% END %]</td>
<td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% overdueloo.biblionumber %]&amp;itemnumber=[% overdueloo.itemnum %]#item[% overdueloo.itemnum %]">[% overdueloo.barcode %]</a></td>
<td>[% overdueloo.itemcallnumber %]</td>
<td>[% overdueloo.replacementprice %]</td>
</tr>
[% END %]
</tbody>
</table>
</div>
[% ELSE %]
<h2>Overdue report</h2>
[% IF ( isfiltered ) %]
<p>There are no overdues matching your search. <a href="/cgi-bin/koha/circ/overdue.pl">Reset filter</a></p>
[% ELSE %]
<p>There are no overdues.</p>
[% END %]
[% END %] <!-- overdueloop -->
[% END %] <!-- noreport -->
</div>
</div>
<div class="yui-b">
<form method="post" action="/cgi-bin/koha/circ/overdue.pl">
<fieldset class="brief">
<h4>Filter on:</h4>
<fieldset><legend>Date due:</legend>
<ol>
<li><label for="from">From:</label>
<input type="text" id="from" name="dateduefrom" size="10" value="[% dateduefrom | $KohaDates %]" class="datepickerfrom" />
</li>
<li>
<label for="to">To:</label>
<input type="text" id="to" name="datedueto" size="10" value="[% datedueto | $KohaDates %]" class="datepickerto" />
</li>
</ol></fieldset>
<ol>
<li><label>Name or cardnumber:</label><input type="text" name="borname" value="[% borname |html %]" /></li>
<li><label>Patron category:</label><select name="borcat" id="borcat"><option value="">Any</option>
[% FOREACH borcatloo IN borcatloop %]
[% IF ( borcatloo.selected ) %]<option value="[% borcatloo.value |html %]" selected="selected">[% borcatloo.catname %]</option>[% ELSE %]<option value="[% borcatloo.value |html %]">[% borcatloo.catname %]</option>[% END %]
[% END %]
</select>
</li>
<li><label>Patron flags:</label>
<select name="borflag" size="1" id="borflag">
<option value="">None</option>
[% IF ( borflag_gonenoaddress ) %]<option value="gonenoaddress" selected="selected">Address in question</option>
[% ELSE %]<option value="gonenoaddress">Address in question</option>[% END %]
[% IF ( borflag_debarred ) %]<option value="debarred" selected="selected">Restricted</option>
[% ELSE %]<option value="debarred">Restricted</option>[% END %]
[% IF ( borflag_lost ) %]<option value="lost" selected="selected">Lost card</option>
[% ELSE %]<option value="lost">Lost card</option>[% END %]
</select>
</li>
[% FOREACH patron_attr_filter_loo IN patron_attr_filter_loop %]
<!-- domid cgivalue ismany isclone ordinal code description repeatable authorised_value_category -->
<li>
<label>[% patron_attr_filter_loo.description %]:</label>
[% IF ( patron_attr_filter_loo.authorised_value_category ) %]
<script type="text/javascript" x-code="[% patron_attr_filter_loo.code |html %]">create_auto_completion_responder([% patron_attr_filter_loo.domid %],"[% patron_attr_filter_loo.code |html %]");</script>
<span id="pattrodue-getready-[% patron_attr_filter_loo.domid %]">
<div class="pattrodue-autocomplete">
<input autocomplete="off" id="pattrodue-input-[% patron_attr_filter_loo.domid %]" name="patron_attr_filter_[% patron_attr_filter_loo.code |html %]" value="[% patron_attr_filter_loo.cgivalue |html %]" class="pattrodue-input" type="text" />
</div>
</span>
[% ELSE %]
<input type="text" name="patron_attr_filter_[% patron_attr_filter_loo.code |html %]" value="[% patron_attr_filter_loo.cgivalue |html %]"/>
[% END %]
[% IF ( patron_attr_filter_loo.repeatable ) %]
<a href="#" onclick="clone_parent(this); return false;">Add</a>
[% IF ( patron_attr_filter_loo.isclone ) %]
<a href="#" onclick="delete_parent(this); return false;" style="visibility: visible">Delete</a>
[% ELSIF ( patron_attr_filter_loo.ismany ) %]
<a href="#" onclick="delete_parent(this); return false;" style="visibility: visible">Delete</a>
[% ELSE %]
<a href="#" onclick="delete_parent(this); return false;" style="visibility: hidden">Delete</a>
[% END %]
[% END %]
</li>
[% END %]
<li><label>Item type:</label><select name="itemtype" id="itemtype"><option value="">Any</option>
[% FOREACH itemtypeloo IN itemtypeloop %][% IF ( itemtypeloo.selected ) %]
<option value="[% itemtypeloo.value |html %]" selected="selected">[% itemtypeloo.itemtypename %]</option>[% ELSE %]
<option value="[% itemtypeloo.value |html %]">[% itemtypeloo.itemtypename %]</option>[% END %]
[% END %]
</select>
</li>
<li>
<label>Item home library:</label>
<select name="homebranch" id="homebranch">
<option value="">Any</option>
[% PROCESS options_for_libraries libraries => Branches.all( selected => homebranchfilter ) %]
</select>
</li>
<li>
<label>Item holding library:</label>
<select name="holdingbranch" id="holdingbranch">
<option value="">Any</option>
[% PROCESS options_for_libraries libraries => Branches.all( selected => holdingbranchfilter ) %]
</select>
</li>
<li>
<label>Library of the patron:</label>
<select name="branch" id="branch">
<option value="">Any</option>
[% PROCESS options_for_libraries libraries => Branches.all( selected => branchfilter ) %]
</select>
</li>
<li class="radio"><label for="showall">Show any items currently checked out:</label>
[% IF ( showall ) %]
<input type="checkbox" id="showall" name="showall" value="show" checked="checked" />
[% ELSE %]
<input type="checkbox" id="showall" name="showall" value="show" />
[% END %]
</li>
</ol>
<fieldset class="action">
<input type="submit" value="Apply filter" class="submit" />
<input type="hidden" name="op" value="apply filter" />
</fieldset>
</fieldset>
</form>
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]