Koha/koha-tmpl/opac-tmpl/prog/en/modules/opac-topissues.tt
Galen Charlton 1b6452bc54 Bug 9916: (follow-up) restore default sort order for OPAC "most popular" page
Set the primary default sort order to descending number of checkouts,
matching the situation prior to the introduction of DataTables. This
patch also sets the default secondary sort to ascending title.

To test:

[1] Ensure that OpacTopissue is ON.
[2] Go to the OPAC "most popular" page.
[3] Verify that the items are sorted in order of descending
    checkout count.  If two items have the same number of
    checkouts, verify that they are sorted in ascending
    title order.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
2013-08-19 14:39:24 +00:00

155 lines
7.5 KiB
Text

[% USE Koha %]
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Most popular titles
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
//<![CDATA[
$(function() {
$("#topissuest").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
[% IF ( opacuserlogin ) %]{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }[% END %]
],
"aaSorting": [ [2, "desc"], [0, "asc"] ],
"aoColumns": [
{ "sType": "anti-the" },
null,
null,
[% IF ( opacuserlogin ) %]null,[% END %]
]
}));
});
function Dopop(link) {
newin=window.open(link,'width=500,height=400,toolbar=false,scrollbars=yes');
}
//]]>
</script>
<style type="text/css">
#search-facets fieldset { border: 0; margin: 0;padding:0;}#search-facets ol{padding:.3em;}#search-facets li {list-style-type:none;padding:4px 4px;}#search-facets label{font-weight:bold;display:block;margin:.2em 0;}#search-facets fieldset.action {padding-left:4px;margin:.3em;};
</style>
</head>
<body id="opac-topissues">
[% IF ( results_loop ) %]
<div id="doc3" class="yui-t1">
[% ELSE %]
[% IF ( OpacNav ) %]
<div id="doc3" class="yui-t1">
[% ELSE %]
<div id="doc3" class="yui-t7">
[% END %]
[% END %]
<div id="bd">
[% INCLUDE 'masthead.inc' %]
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
<div id="topissues" class="container">
[% IF ( results_loop ) %]
<table id="topissuest">
<caption>The [% limit %] most checked-out
[% IF ( itemtype ) %]
[% itemtype %]
[% END %]
[% IF ( branch ) %]
at
[% branch %]
[% END %]
[% IF ( timeLimitFinite ) %]
in the past [% timeLimitFinite %] months
[% ELSE %] of all time[% END %]
</caption>
<thead><tr>
<th>Title</th>
<th>[% IF ( ccodesearch ) %]Collection[% ELSE %]Item type[% END %]</th>
<th>Checkouts</th>
[% IF ( opacuserlogin ) %]<th>&nbsp;</th>[% END %]
</tr></thead>
<tbody>[% FOREACH results_loo IN results_loop %]
<tr>
<td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% results_loo.biblionumber %]">[% results_loo.title |html %]</a><p>[% results_loo.author %]
[% IF ( results_loo.publicationyear ) %] - [% results_loo.publicationyear %][% END %]
[% IF ( results_loo.publishercode ) %]- [% results_loo.publishercode %][% END %] [% IF ( results_loo.seriestitle ) %]([% results_loo.seriestitle %])[% END %]
[% IF ( results_loo.place ) %] ; [% results_loo.place %][% END %]
[% IF ( results_loo.pages ) %] - [% results_loo.pages %][% END %]
[% IF ( results_loo.size ) %] ; [% results_loo.size %][% END %]</p>
</td>
<td>[% results_loo.description %]</td>
<td>[% results_loo.tot %]</td>
[% IF ( opacuserlogin ) %]<td>[% IF ( RequestOnOpac ) %][% UNLESS ( results_loo.norequests ) %]<a href="/cgi-bin/koha/opac-reserve.pl?biblionumber=[% results_loo.biblionumber %]">Place hold</a>[% END %][% END %]</td>[% END %]
</tr>
[% END %]</tbody>
</table>
[% ELSE %]
<form method="post" action="/cgi-bin/koha/opac-topissues.pl">
<fieldset class="rows">
<legend>See the most popular titles</legend>
<ol> <li><label for="limit">Show the top </label> <select name="limit" id="limit">
[% IF ( limit == 10 ) %]<option value ="10" selected="selected">10 titles</option>[% ELSE %]<option value="10">10 titles</option>[% END %]
[% IF ( limit == 15 ) %]<option value ="15" selected="selected">15 titles</option>[% ELSE %]<option value="15">15 titles</option>[% END %]
[% IF ( limit == 20 ) %]<option value ="20" selected="selected">20 titles</option>[% ELSE %]<option value="20">20 titles</option>[% END %]
[% IF ( limit == 30 ) %]<option value ="30" selected="selected">30 titles</option>[% ELSE %]<option value="30">30 titles</option>[% END %]
[% IF ( limit == 40 ) %]<option value ="40" selected="selected">40 titles</option>[% ELSE %]<option value="40">40 titles</option>[% END %]
[% IF ( limit == 50 ) %]<option value ="50" selected="selected">50 titles</option>[% ELSE %]<option value="50">50 titles</option>[% END %]
[% IF ( limit == 100 ) %]<option value ="100" selected="selected">100 titles</option>[% ELSE %]<option value="100">100 titles</option>[% END %]
</select>
</li>
<li>
<label for="branch">From: </label>
<select name="branch" id="branch">
<option value="">All libraries</option>
[% FOREACH branchloo IN branchloop %]
[% IF ( branchloo.selected ) %]
<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
[% ELSE %]
<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
[% END %]
[% END %]
</select>
</li>
<li><label for="itemtype">Limit to: </label>
<select name="itemtype" id="itemtype">
[% IF ( ccodesearch ) %]<option value="">All collections</option>[% ELSE %]<option value="">All item types</option>[% END %]
[% FOREACH itemtypeloo IN itemtypeloop %]
[% IF ( itemtypeloo.selected ) %]<option value="[% itemtypeloo.value %]" selected="selected">[% ELSE %]<option value="[% itemtypeloo.value %]">[% END %]
[% itemtypeloo.description %]
</option>
[% END %]
</select></li>
<li>
<label for="timeLimit">of the last:</label> <select name="timeLimit" id="timeLimit">
[% IF ( timeLimit == 3 ) %]<option value="3" selected="selected">3 months</option>[% ELSE %]<option value="3">3 months</option>[% END %]
[% IF ( timeLimit == 6 ) %]<option value="6" selected="selected">6 months</option>[% ELSE %]<option value="6">6 months</option>[% END %]
[% IF ( timeLimit == 12 ) %]<option value="12" selected="selected">12 months</option>[% ELSE %]<option value="12">12 months</option>[% END %]
[% IF ( timeLimit == 999 ) %]<option value="999" selected="selected">No limit</option>[% ELSE %]<option value="999">No limit</option>[% END %]
</select>
</li></ol>
<input type="hidden" name="do_it" value="1" />
</fieldset>
<fieldset class="action">
<input type="submit" value="Submit" /></fieldset>
</form>
[% END %]
</div>
</div>
</div>
</div>
[% IF ( results_loop ) %]
<div class="yui-b"><div id="usertopissues" class="container">
[% INCLUDE 'opac-topissues.inc' %]
[% IF ( OpacNav ) %][% INCLUDE 'navigation.inc' %][% END %]
</div></div>
[% ELSE %]
[% IF ( OpacNav ) %]
<div class="yui-b"><div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' %]
</div></div>
[% END %]
[% END %]
</div>
[% INCLUDE 'opac-bottom.inc' %]