Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-holdshistory.tt
Owen 8473254ec3 Bug 24224: Convert OpacNavBottom system preference to additional content
This patch builds on Bug 22318 to move the OpacNavBottom system
preference into the "Additional contents" system, making it possible to
have language- and library-specific content.

To test you should have some content in the OpacNavBottom system
preference. To make testing easier it's also a good idea to have content
in the OpacNav preference.

- Apply the patch and run the database update process.
- In the staff client, go to Tools -> HTML customizations and verify
  that the content from OpacNavBottom is now stored there. When you
  edit the entry you should see content from the OpacNavBottom system
  preference under the "default" tab.
  - The publication date for the entry should be today's date.
  - Confirm that the previous contents of OpacNavBottom were added
    correctly.
- Go to Administration -> System preferences -> OPAC and verify that
  the OpacNavBottom preference has been removed.
- Update and reinstall active translations (for instance fr-FR):
  - cd misc/translator/
  - perl translate update fr-FR
  - perl translate install fr-FR
- View the OPAC and confirm that the contents of the OpacNavBottom
  system preference displays in the left-hand sidebar.
- Test as many pages as possible to confirm that wherever the
  OpacNavBottom content is displayed, OpacNavBottom is also displayed.
- Test also using the updated translation.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-11-08 11:41:48 +01:00

200 lines
10 KiB
Text

[% USE raw %]
[% USE Koha %]
[% USE Branches %]
[% USE KohaDates %]
[% USE TablesSettings %]
[% USE ItemTypes %]
[% USE AdditionalContents %]
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Your holds history &rsaquo; [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %]
<style>
.controls .paginate_button {
font-family: 'FontAwesome';
text-decoration: none;
}
.controls .paginate_button:not(.disabled) {
cursor: pointer;
}
.controls .paginate_button.disabled {
color: grey;
}
.controls .previous:before {
content: "\f104";
padding-right: .5em;
}
.controls .next:after {
content: "\f105";
padding-left: .5em;
}
</style>
[% END %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='opac-holdshistory' %]
[% INCLUDE 'masthead.inc' %]
<div class="main">
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-main.pl">Home</a>
</li>
<li class="breadcrumb-item">
<a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a>
</li>
<li class="breadcrumb-item active">
<a href="#" aria-current="page">Your holds history</a>
</li>
</ol>
</nav> <!-- /#breadcrumbs -->
<div class="container-fluid">
<div class="row">
<div class="col col-lg-2 order-2 order-lg-1">
<div id="navigation">
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
<div class="col-md-12 col-lg-10 order-1">
<div id="userholdshistory">
<h1>Holds history</h1>
[% IF !holds %]
You have never placed a hold from this library.
[% ELSE %]
[% SET show_itemtype_column = Koha.Preference('AllowHoldItemTypeSelection') %]
<div id="opac-user-holdsrec">
<div id="tabs-container">
<div class="controls">
<div class="resultscontrol resort">
<form id="sortform" action="/cgi-bin/koha/opac-holdshistory.pl" method="get">
[% IF ( unlimit ) %]<input type="hidden" name="unlimit" value="1" />[% END %]
<select name="sort" id="sort">
[% IF ( sort == 'reservedate' ) %]<option value="reservedate" selected="selected">Order by date</option>[% ELSE %]<option value="reservedate">Order by date</option>[% END %]
[% IF ( sort == 'biblio.title' ) %]<option value="biblio.title" selected="selected">Order by title</option>[% ELSE %]<option value="biblio.title">Order by title</option>[% END %]
[% IF ( sort == 'biblio.author' ) %]<option value="biblio.author" selected="selected">Order by author</option>[% ELSE %]<option value="biblio.author">Order by author</option>[% END %]
</select>
<input type="submit" value="Go" id="sortsubmit" class="submit clearfix" />
</form>
</div>
[% UNLESS unlimit %]
<p>
Showing 50 items. <a href="/cgi-bin/koha/opac-holdshistory.pl?unlimit=1[% IF ( sort ) %]&amp;sort=[% sort | url %][% END %]">Show all items</a>
</p>
[% ELSE %]
<p>
Showing all items. <a href="/cgi-bin/koha/opac-holdshistory.pl[% IF ( sort ) %]?sort=[% sort | url %][% END %]">Show 50 items</a>
</p>
[% END %]
</div>
<table id="table_holdshistory" class="table table-bordered table-striped">
<caption class="sr-only">Holds history</caption>
<thead>
<tr>
<th class="anti-the">Title</th>
<th>Author</th>
<th>Barcode</th>
<th>Library</th>
<th>Hold date</th>
<th>Expiration date</th>
<th>Waiting date</th>
<th>Cancellation date</th>
[% IF show_itemtype_column %]
<th>Requested item type</th>
[% END %]
<th>Status</th>
</tr>
</thead>
<tbody>
[% FOREACH hold IN holds %]
<tr>
<td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% hold.biblio.biblionumber | uri %]">[% INCLUDE 'biblio-title.inc' biblio=hold.biblio %]</a></td>
<td>[% hold.biblio.author | html %]</td>
<td>[% hold.item.barcode | html %]</td>
<td>[% Branches.GetName( hold.branchcode ) | html %]</td>
<td data-order="[% hold.reservedate | html %]">[% hold.reservedate | $KohaDates %]</td>
<td data-order="[% hold.expirationdate | html %]">
[% IF hold.expirationdate %]
[% hold.expirationdate | $KohaDates %]
[% END %]
</td>
<td data-order="[% hold.waitingdate | html %]">
[% IF hold.waitingdate %]
[% hold.waitingdate | $KohaDates %]
[% END %]
</td>
<td data-order="[% hold.cancellationdate | html %]">
[% IF hold.cancellationdate %]
[% hold.cancellationdate | $KohaDates %]
[% END %]
</td>
[% IF show_itemtype_column %]
<td>
[% IF hold.itemtype %]
[% ItemTypes.GetDescription( hold.itemtype ) | html %]
[% ELSE %]
<span>Any item type</span>
[% END %]
</td>
[% END %]
<td>
[% IF hold.found == 'F' %]
Fulfilled
[% ELSIF hold.cancellationdate %]
Cancelled
[% ELSIF hold.found == 'W' %]
Waiting
[% ELSIF hold.found == 'T' %]
In transit
[% ELSE %]
Pending
[% END %]
</td>
</tr>
[% END %]
</tbody>
</table>
</div> <!-- / .tabs-container -->
</div> <!-- / .opac-user-holdsrec -->
[% END # / IF old_holds_count %]
</div> <!-- / .userholdshistory -->
</div> <!-- / .span10 -->
</div> <!-- / .row-fluid -->
</div> <!-- / .container-fluid -->
</div> <!-- / .main -->
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
<script>
$(document).ready(function() {
$('#sort').change(function() {
$('#sortform').submit();
});
var columns_settings = []; // Empty because there are no columns we want to be configurable
var table = KohaTable("#table_holdshistory", {
"dom": '<"top"<"table_entries"i><"table_controls"fB>>t',
"autoWidth": false,
"sorting": [[4, 'desc']],
"columnDefs": [
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] }
],
"language": {
"search": "_INPUT_",
"searchPlaceholder": _("Search")
}
}, columns_settings);
});
</script>
[% END %]