Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt
Julian Maurice ed7543287b Bug 20538: Remove the need of writing [% KOHA_VERSION %] everywhere
Having to write [% KOHA_VERSION %] for each url is bad because:
- It's easily forgettable when adding new <script> or <link>
- It prevents grep'ing for the full filename
- It violates the DRY principle
- If at some point we want to change the "force js and css reload"
  mechanism, it will be tedious

This patch:
- adds a Template::Toolkit plugin that generates <script> and
  <link> tags for JS and CSS files, and inserts automatically the Koha
  version in the filename
- use the new plugin to remove all occurences of [% KOHA_VERSION %]
- remove the code that was adding KOHA_VERSION as a template variable

Test plan:
1. Apply patch
2. Go to several different pages in Koha (opac and intranet) while
   checking your browser's dev tools (there should be no 404 for JS and
   CSS files, and the Koha version should appear in filenames) and the
   server logs (there should be no "File not found")
3. `git grep KOHA_VERSION` should return nothing
4. prove t/db_dependent/Koha/Template/Plugin/Asset.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

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

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2018-04-13 11:49:44 -03:00

225 lines
12 KiB
Text

[% USE Asset %]
[% USE Koha %]
[% USE KohaDates %]
[% USE Branches %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Circulation &rsaquo; Holds awaiting pickup</title>
[% INCLUDE 'doc-head-close.inc' %]
[% Asset.css("css/datatables.css") %]
</head>
<body id="circ_waitingreserves" 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; <a href="/cgi-bin/koha/circ/waitingreserves.pl">Holds awaiting pickup</a>
</div>
[% IF Koha.Preference('CircSidebar') %]<div id="doc3" class="yui-t2">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
<div id="bd">
<div id="yui-main">
[% IF Koha.Preference('CircSidebar') %]<div class="yui-b">[% END %]
<div class="yui-g">
<h2>Holds awaiting pickup for your library on: [% show_date | $KohaDates %]
[% IF ( all_branches_link ) %]
<span style="margin-left:20px"><a href="[% all_branches_link %]">
View all libraries</a></span>
[% END %]
</h2>
[% IF ( cancel_result ) %]
[% FOREACH cancel_result %]
[% IF ( messagetransfert ) %]
<div class="dialog message">
<h2>This item is on hold for pick-up at [% Branches.GetName( branchname ) %]</h2>
<p><strong>[% nextreservtitle %]</strong> is on hold for <strong> [% nextreservsurname %], [% nextreservfirstname %]</strong>.
Please retain this item and check it in to process the hold.
</p>
<form name="cancelReservewithtransfert" action="waitingreserves.pl#[% tab %]" method="post">
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
</form>
</div>
[% END %]
[% IF ( waiting ) %]
<div class="dialog message">
<h2>This item is on hold for pick-up at your library</h2>
<p><strong>[% nextreservtitle %]</strong> is on hold for <strong>[% nextreservsurname %], [% nextreservfirstname %]</strong>.
Please retain this item and check it in to process the hold.
</p>
<form name="cancelReservewithwaiting" action="waitingreserves.pl#[% tab %]" method="post">
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> OK</button>
</form>
</div>
[% END %]
[% END %]
[% ELSE %]
<div id="resultlist" class="toptabs">
<ul>
<li><a href="#holdswaiting">Holds waiting: [% reservecount %]</a></li>
<li>
<a href="#holdsover">
Holds waiting over [% ReservesMaxPickUpDelay %] days: [% overcount %]
</a>
</li>
</ul>
<div id="holdswaiting">
[% IF ( reserveloop ) %]
<table id="holdst">
<thead><tr>
<th class="title-string">Waiting since</th>
<th class="title-string">Date hold placed</th>
<th class="anti-the">Title</th>
<th>Patron</th>
<th>Home branch</th>
<th>Current location</th>
<th>Call number</th>
<th>Copy number</th>
<th>Enumeration</th>
<th>Action</th>
</tr></thead>
<tbody>[% FOREACH reserveloo IN reserveloop %]
<tr>
<td><span title="[% reserveloo.waitingdate %]">[% reserveloo.waitingdate | $KohaDates %]</span></td>
<td><span title="[% reserveloo.reservedate %]">[% reserveloo.reservedate | $KohaDates %]</span></td>
<td>[% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
[% reserveloo.title |html %] [% FOREACH subtitl IN reserveloo.subtitle %] [% subtitl.subfield %][% END %]
</a>
[% UNLESS ( item_level_itypes ) %][% IF ( reserveloo.itemtype ) %]&nbsp; (<b>[% reserveloo.itemtype %]</b>)[% END %][% END %]
<br />Barcode: [% reserveloo.barcode %]
</td>
<td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.patron.borrowernumber %]">[% reserveloo.patron.surname%], [% reserveloo.patron.firstname %]</a>
[% IF ( reserveloo.patron.phone ) %]<br />[% reserveloo.patron.phone %][% END %]
[% IF ( reserveloo.patron.first_valid_email_address ) %]<br /><a href="mailto:[% reserveloo.patron.first_valid_email_address %]?subject=Hold waiting: [% reserveloo.title %]">
[% reserveloo.patron.first_valid_email_address %]</a>[% END %]
</td>
<td>[% Branches.GetName( reserveloo.homebranch ) %]</td>
<td>[% Branches.GetName( reserveloo.holdingbranch ) %]</td>
<td>[% reserveloo.itemcallnumber %]</td>
<td>[% reserveloo.copynumber %]</td>
<td>[% reserveloo.enumchron %]</td>
<td>
<form name="cancelReserve" action="waitingreserves.pl" method="post">
<input type="hidden" name="borrowernumber" value="[% reserveloo.borrowernum %]" />
<input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber %]" />
<input type="hidden" name="fbr" value="[% reserveloo.holdingbranch %]" />
<input type="hidden" name="tbr" value="[% reserveloo.homebranch %]" />
<input type="hidden" name="tab" value="holdswaiting">
[% IF ( reserveloo.dotransfer ) %]
<input type="submit" value="Cancel hold and return to : [% Branches.GetName( reserveloo.homebranch ) %]" />
[% ELSE %]
<input type="submit" value="Cancel hold" />
[% END %]
</form>
</td>
</tr>
[% END %]</tbody>
</table>
[% ELSE %]
<div class="dialog message">No holds found.</div>
[% END %]
</div>
<div id="holdsover">
[% IF ( ReservesMaxPickUpDelay ) %]<p>Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay %] days.</p>[% END %]
[% IF ( overloop ) %]
<form name="cancelAllReserve" action="waitingreserves.pl" method="post">
<input type="hidden" name="cancelall" value="1" />
<input type="hidden" name="allbranches" value="[% allbranches %]" />
<input type="hidden" name="tab" value="holdsover">
[% IF TransferWhenCancelAllWaitingHolds %]
<input type="submit" value="Cancel and Transfer all" />
[% ELSE %]
<input type="submit" value="Cancel all" />
[% END %]
</form>
[% UNLESS TransferWhenCancelAllWaitingHolds %]
Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds sypref)
[% END %]
<table id="holdso">
<thead><tr>
<th class="title-string">Waiting since</th>
<th class="title-string">Date hold placed</th>
<th class="anti-the">Title</th>
<th>Patron</th>
<th>Home branch</th>
<th>Current location</th>
<th>Call number</th>
<th>Copy number</th>
<th>Enumeration</th>
<th>Action</th>
</tr></thead>
<tbody>[% FOREACH overloo IN overloop %]
<tr>
<td><span title="[% overloo.waitingdate %]">[% overloo.waitingdate | $KohaDates %]</span></td>
<td><span title="[% overloo.reservedate %]">[% overloo.reservedate | $KohaDates %]</span></td>
<td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overloo.biblionumber %][% overloo.title |html %]
[% FOREACH subtitl IN overloo.subtitle %] [% subtitl.subfield %][% END %]
</a>
[% UNLESS ( item_level_itypes ) %][% IF ( overloo.itemtype ) %]&nbsp; (<b>[% overloo.itemtype %]</b>)[% END %][% END %]
<br />Barcode: [% overloo.barcode %]
</td>
<td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% overloo.patron.borrowernumber %]">[% overloo.patron.surname %], [% overloo.patron.firstname %]</a><br />[% overloo.patron.phone %]<br />
[% IF ( overloo.patron.first_valid_email_address ) %]<a href="mailto:[% overloo.patron.first_valid_email_address %]?subject=Reservation: [% overloo.title |url %]">
[% overloo.patron.first_valid_email_address %]</a>[% END %]
</td>
<td>[% Branches.GetName( overloo.homebranch ) %]</td>
<td>[% Branches.GetName( overloo.holdingbranch ) %]</td>
<td>[% overloo.itemcallnumber %]</td>
<td>[% overloo.copynumber %]</td>
<td>[% overloo.enumchron %]</td>
<td><form name="cancelReserve" action="waitingreserves.pl" method="post">
<input type="hidden" name="borrowernumber" value="[% overloo.borrowernum %]" />
<input type="hidden" name="itemnumber" value="[% overloo.itemnumber %]" />
<input type="hidden" name="fbr" value="[% overloo.holdingbranch %]" />
<input type="hidden" name="tbr" value="[% overloo.homebranch %]" />
<input type="hidden" name="tab" value="holdsover">
[% IF ( overloo.dotransfer ) %]
<input type="submit" value="Cancel hold and return to : [% Branches.GetName( overloo.homebranch ) %]" />
[% ELSE %]
<input type="submit" value="Cancel hold" />
[% END %]
</form>
</td>
</tr>
[% END %]</tbody>
</table>
[% ELSE %]
<div class="dialog message">No holds found.</div>
[% END %]
</div>
</div>
[% END %]
</div>
</div>
[% IF Koha.Preference('CircSidebar') %]
</div>
<div class="yui-b noprint">
[% INCLUDE 'circ-nav.inc' %]
</div>
[% END %]
</div>
[% MACRO jsinclude BLOCK %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
$(document).ready(function() {
$('#resultlist').tabs();
$("th a").hide();
$("#holdst,#holdso").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] },
{ "sType": "title-string", "aTargets" : [ "title-string" ] }
],
"sPaginationType": "four_button"
}));
});
</script>
[% END %]
[% INCLUDE 'intranet-bottom.inc' %]