Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt
Owen Leonard 247dca3064
Bug 23013: Upgrade DataTables in the staff client
This patch upgrades DataTables and makes some style changes to the
default DataTables toolbar style. DataTables assets are now combined and
minified using their download customizer, bundling together these
elements:

 - JSZip 2.5.0
 - pdfmake 0.1.36
 - DataTables 1.10.18
 - Buttons 1.5.6
 - Column visibility 1.5.6
 - HTML5 export 1.5.6
 - Print view 1.5.6
 - FixedHeader 3.1.4

DataTables assets have been moved from lib/jquery/plugins to
lib/datatables. The global header and footer include files are updated
correspondingly.

This patch removes the custom "four_button" pagination configuration and
updates pages which used it to use the built-in "full" type instead.
This is done for the sake of consistency and upgradability. This change
touches a lot of files.

Table-specific CSS has been moved from staff-global.scss to a new
include, _tables.scss. A second common include, _mixins.scss has some
variable definitions used in both files.

Many images have been made obsolete by this change and have been
removed.

To test, apply the patch and regenerate the staff client CSS. View
various pages in the staff client with tables:

 - Not formatted by DataTables:
   - Reports -> Most circulated items
   - Catalog -> Search results
 - Formatted by DataTables without column configuration
   - Acquisitions -> Vendor search
   - Lists
 - Formatted by DataTables with column configuration
   - Administration -> Libraries
   - Administration -> Item types
   - Reports -> Saved SQL reports
 - Non-standard DataTables configurations:
   - Circulation -> Checkouts
   - Administration -> System preferences
   - Reports -> Lost items

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-08-22 15:23:19 +01:00

191 lines
7 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE KohaDates %]
[% USE AuthorisedValues %]
[% USE Branches %]
[% USE ItemTypes %]
[% USE ColumnsSettings %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Circulation &rsaquo; Hold ratios</title>
[% INCLUDE 'doc-head-close.inc' %]
<style>
.sql { display: none; }
.ulined { text-decoration: underline; }
.ratiolimit:link { color: blue; cursor: pointer; }
.ratiolimit:hover { color: blue; text-decoration: underline; }
#holdst ul li { list-style: outside url("[% interface | html %]/[% theme | html %]/img/item-bullet.gif") disc; }
</style>
</head>
<body id="circ_reserveratios" 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; Hold ratios</div>
<div class="main container-fluid">
<div class="row">
<div class="col-sm-10 col-sm-push-2">
<main>
<h1>Hold ratios to calculate items needed</h1>
<h3>Calculated on [% todaysdate | $KohaDates %]. From [% from | $KohaDates %]
to [% to | $KohaDates %]</h3>
<p>These items have a hold ratio &ge; [% ratio | html %].</p>
<div class="sql">[% sql | html %]</div>
[% IF ( reserveloop ) %]
<table id="holdst">
<thead>
<tr>
<th>Holds</th>
<th>Items</th>
<th>Hold ratio</th>
<th>Title</th>
<th>Home libraries</th>
<th>Holding libraries</th>
<th>Location</th>
<th>Itype</th>
<th>Call numbers</th>
<th>Items needed</th>
</tr>
</thead>
<tbody>
[% FOREACH reserveloo IN reserveloop %]
<tr>
<td><p>[% reserveloo.reservecount | html %]</p></td>
<td><p>[% reserveloo.itemcount | html %]</p></td>
<td><a href="#" class="ratiolimit">[% reserveloo.thisratio | html %]</a></td>
<td> [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %][% INCLUDE 'biblio-title.inc' biblio=reserveloo %]</a>[% IF ( reserveloo.author ) %] by [% reserveloo.author | html %][% END %]
</td>
<td>
<ul>
[% FOREACH homebranch IN reserveloo.homebranch_list %]
<li>[% Branches.GetName ( homebranch ) | html %]</li>
[% END %]
</ul>
</td>
<td>
<ul>
[% FOREACH holdingbranch IN reserveloo.holdingbranch_list %]
<li>[% Branches.GetName ( holdingbranch ) | html %]</li>
[% END %]
</ul>
</td>
<td>
<ul>
[% FOREACH location IN reserveloo.location %]
<li>[% AuthorisedValues.GetByCode( 'LOC', location ) | html %]</li>
[% END %]
</ul>
</td>
<td>
<ul>
[% FOREACH itype IN reserveloo.itype %]
<li>[% ItemTypes.GetDescription( itype ) | html %]</li>
[% END %]
</ul>
</td>
<td>
<ul>
[% FOREACH listcall IN reserveloo.listcall %]
<li>[% listcall | html %]</li>
[% END %]
</ul>
</td>
<td class="actions">
<p>
[% IF ( reserveloo.thisratio_atleast1 ) %]
[% IF ( CAN_user_acquisition && basketno && booksellerid ) %]<!-- [% reserveloo.ratiocalc | html %] -->
<a href="/cgi-bin/koha/acqui/neworderempty.pl?biblionumber=[% reserveloo.biblionumber | uri %]&amp;booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;rr_quantity_to_order=[% reserveloo.ratiocalc | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% reserveloo.ratiocalc | html %] to order</a>
[% ELSE %]
<b>[% reserveloo.ratiocalc | html %] to order</b>
[% END %]
[% IF ( reserveloo.pendingorders ) %]<br><b>[% reserveloo.pendingorders | html %] pending</b>[% END %]
[% ELSE %]
0 to order
[% END %]
</p>
</td>
</tr>
[% END %]
</tbody>
</table>
[% ELSE %]
<b>No items found.</b>
[% END %]
</main>
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
<form action="/cgi-bin/koha/circ/reserveratios.pl" method="post" >
<fieldset class="brief">
<h4>Refine results:</h4>
<ol>
<li>
<label for="ratio">Hold ratio:</label>
<input type="text" size="5" id="ratio" name="ratio" value="[% ratio | html %]" />
<li>
<li>
<label for="include_ordered">Included ordered:</label>
[% IF include_ordered %]
<input id="include_ordered" name="include_ordered" type="checkbox" checked="checked"/>
[% ELSE %]
<input id="include_ordered" name="include_ordered" type="checkbox"/>
[% END %]
<li>
<li>
<label for="from">Start date:</label>
<input type="text" size="10" id="from" name="from" value="[% from | $KohaDates %]" class="datepickerfrom" />
</li>
<li>
<label for="to">End date:</label>
<input size="10" id="to" name="to" value="[% to | $KohaDates %]" type="text" class="datepickerto" />
</li>
</ol>
(inclusive)
<fieldset class="action"><input type="submit" value="Go" class="submit"/></fieldset>
</fieldset>
[% IF ( CAN_user_acquisition && basketno && booksellerid ) %]
<input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
<input type="hidden" name="basketno" value="[% basketno | html %]" />
[% END %]
</form>
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
<script>
var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'holdsratios', 'holds-ratios', 'json' ) | $raw %];
$(document).ready(function() {
$(".ratiolimit").on("click", function(e) {
e.preventDefault();
$("#ratio").val($(this).html());
});
KohaTable("holdst", {
"aaSorting": [ [2,'desc'], [3,'asc'] ],
"aoColumnDefs": [
{ "aTargets": [ 0,1,2,8 ], "sType": "natural" },
{ "aTargets": [ 3 ], "sType": "anti-the" },
],
"sPaginationType": "full",
"autoWidth": false
}, columns_settings);
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]