Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt
Owen Leonard 6c7c97f67c Bug 22015: Move DataTables CSS to global include
DataTables are used on enough pages in the staff client that it
doesn't make sense to put inclusion of the CSS into each template
where it is needed. This patch moves includes of datatables.css from
individual templates into the global header file.

To test, apply the patch and view various pages which have DataTables.
View various styles of DataTables, e.g.

 - Full pagination, like item search results
 - Four-button, like Saved SQL reports

Everything should look the same as it was.

Signed-off-by: Jose-Mario Monteiro-Santos <jose-mario.monteiro-santos@inLibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-02-19 19:40:35 +00:00

242 lines
9.4 KiB
Text

[% USE raw %]
[% USE Asset %]
[% USE Koha %]
[% USE KohaDates %]
[% USE ItemTypes %]
[% USE Branches %]
[% USE AuthorisedValues %]
[% USE ColumnsSettings %]
[% USE Koha %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Circulation &rsaquo; Holds queue</title>
[% INCLUDE 'doc-head-close.inc' %]
<style> p { margin-top: 0; }</style>
</head>
<body id="circ_view_holdsqueue" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-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; <a href="/cgi-bin/koha/circ/view_holdsqueue.pl">Holds queue</a>
[% IF ( run_report ) %] &rsaquo; Results[% END %]
</div>
<div class="main container-fluid">
<div class="row">
<div class="col-sm-12">
<main>
<div class="row">
[% IF Koha.Preference('CircSidebar') %]
<div class="col-sm-10 col-sm-push-2">
[% ELSE %]
<div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
[% END %]
<h1>Holds queue</h1>
[% IF ( run_report ) %]
[% IF ( total ) %]
<div class="results">[% total | html %] items found for
[% IF ( branchlimit ) %][% Branches.GetName( branchlimit ) | html %][% ELSE %]All libraries[% END %]
</div>
[% ELSE %]
<div class="dialog message">No items found.</div>
[% END %]
[% IF ( itemsloop ) %]
<table id="holdst">
<thead>
<tr>
<th class="hq-title">Title</th>
<th class="hq-collection">Collection</th>
<th class="hq-itemtype">Item type</th>
<th class="hq-callnumber">Call number</th>
<th class="hq-copynumber">Copy number</th>
<th class="hq-enumchron">Enumeration</th>
<th class="hq-barcode">Barcode</th>
<th class="hq-patron">Patron</th>
<th class="hq-sendto">Send to</th>
<th class="hq-date">Date</th>
<th class="hq-notes">Notes</th>
</tr>
<tr>
<td class="hq-title">
<span class="filter_column filter_text">
<input class="text_filter" type="text" placeholder="Title">
</span>
</td>
<td class="hq-collection">
<span class="filter_column filter_text">
<input type="text" placeholder="Collection">
</span>
</td>
<td class="hq-itemtype">
<span class="filter_column filter_text">
<input type="text" placeholder="Item type">
</span>
</td>
<td class="hq-callnumber">
<span class="filter_column filter_text">
<input type="text" placeholder="Call number">
</span>
</td>
<td class="hq-copynumber">
<span class="filter_column filter_text">
<input type="text" placeholder="Copy number">
</span>
</td>
<td class="hq-enumchron">
<span class="filter_column filter_text">
<input type="text" placeholder="Enumeration">
</span>
</td>
<td class="hq-barcode">
<span class="filter_column filter_text">
<input type="text" placeholder="Barcode">
</span>
</td>
<td class="hq-patron">
<span class="filter_column filter_text">
<input type="text" placeholder="Patron">
</span>
</td>
<td class="hq-sendto">
<span class="filter_column filter_text">
<input type="text" placeholder="Send to">
</span>
</td>
<td class="hq-date">
<span class="filter_column filter_text">
<input type="text" placeholder="Date">
</span>
</td>
<td class="hq-notes">
<span class="filter_column filter_text">
<input type="text" placeholder="Notes">
</span>
</td>
</tr>
</thead>
<tbody>[% FOREACH itemsloo IN itemsloop %]
<tr>
<td class="hq-title">
<p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itemsloo.biblionumber | uri %]"><strong>[% itemsloo.title | html %]</strong> [% FOREACH s IN itemsloo.subtitle %] [% s | html %][% END %]</a></p>
<p>
<div class="hq-biblionumber content_hidden">[% itemsloo.biblionumber | html %]</div>
<div class="hq-author">[% itemsloo.author | html %]</div>
<div class="hq-pubdata">
[% IF ( itemsloo.publishercode ) %][% itemsloo.publishercode | html %][% END %]
[% IF ( itemsloo.publicationyear ) %]
, [% itemsloo.publicationyear | html %]
[% ELSIF ( itemsloo.copyrightdate ) %]
, [% itemsloo.copyrightdate | html %]
[% END %]
[% IF ( itemsloo.pages ) %]: [% itemsloo.pages | html %] [% END %]
[% IF ( itemsloo.item('size') ) %][% itemsloo.item('size') | html %][% END %]
[% IF ( itemsloo.isbn ) %]ISBN: [% itemsloo.isbn | html %][% END %]
</div>
</p>
</td>
<td class="hq-collection">[% AuthorisedValues.GetByCode( 'CCODE', itemsloo.ccode ) | html %]</td>
<td class="hq-itemtype">[% ItemTypes.GetDescription( itemsloo.itype ) | html %]</td>
<td class="hq-callnumber">[% IF ( itemsloo.location ) %]<em>[% AuthorisedValues.GetByCode( 'LOC', itemsloo.location ) | html %]</em> [% END %][% itemsloo.itemcallnumber | html %]</td>
<td class="hq-copynumber">[% itemsloo.copynumber | html %]</td>
<td class="hq-enumchron">[% itemsloo.enumchron | html %]</td>
<td class="hq-barcode">
[% IF ( itemsloo.item_level_request ) %]
<em>Only item:</em> <strong>[% itemsloo.barcode | html %]</strong>
[% ELSE %]
<strong>[% itemsloo.barcode | html %]</strong> <em>or any available</em>
[% END %]
</td>
<td class="hq-patron">
<p>
[% INCLUDE 'patron-title.inc' patron=itemsloo.patron hide_patron_infos_if_needed=1 link_to="circulation_reserves" %]
</p>
[% UNLESS Koha.Preference('HidePatronName') %]
<p>[% itemsloo.patron.phone | html %]</p>
[% END %]
</td>
<td class="hq-sendto">[% Branches.GetName( itemsloo.pickbranch ) | html %]</td>
<td class="hq-date"><span title="[% itemsloo.reservedate | html %]">[% itemsloo.reservedate | $KohaDates %]</span></td>
<td class="hq-notes">[% itemsloo.notes | html %]</td>
</tr>
[% END %]</tbody>
</table>
[% END %]
[% END %]
[% UNLESS ( total ) %]
<form name="f" action="/cgi-bin/koha/circ/view_holdsqueue.pl" method="post">
<fieldset class="rows">
<ol>
<li>
<label for="branchlimit">Library: </label>
<select name="branchlimit" id="branchlimit">
<option value="">All</option>
[% PROCESS options_for_libraries libraries => Branches.all( only_from_group => 1 ) %]
</select>
</li>
</ol></fieldset>
<fieldset class="action"> <input type="submit" value="Submit" />
<input type="hidden" name="run_report" value="1" /></fieldset>
</form>
[% END %]
[% IF Koha.Preference('CircSidebar') %]
</div> <!-- /.col-sm-10.col-sm-push-2 -->
<div class="col-sm-2 col-sm-pull-10">
<aside>
[% INCLUDE 'circ-nav.inc' %]
</aside>
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
</div> <!-- /.row -->
[% END %]
</main>
</div> <!-- /.col-sm-12 -->
</div> <!-- /.row -->
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
<script>
$(document).ready(function() {
var holdst;
// Setup filters before DataTables initialisation, in case some columns are
// hidden by default
var filterColumnTimeoutId;
var filterColumn = function(e) {
clearTimeout(filterColumnTimeoutId);
filterColumnTimeoutId = setTimeout(function() {
var input = $(e.target);
var idx = input.parents('td').index();
holdst.api().column(idx + ':visible').search(input.val()).draw();
}, 200);
};
$('#holdst thead input').on('change keyup keydown', filterColumn);
var columns_settings = [% ColumnsSettings.GetColumns('circ', 'view_holdsqueue', 'holds-table', 'json') | $raw %];
var holdst = KohaTable("holdst", {
"aaSorting": [[ 3, "asc" ]],
"aoColumns": [
{ "sType": "anti-the" },null,null,null,null,null,null,null,null,{ "sType": "title-string" },null
],
"sDom": 'B<"clearfix">t',
"bSortCellsTop": true,
"bPaginate": false
}, columns_settings);
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]