5 [% USE AdditionalContents %]
6 [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
7 [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
8 [% USE AuthorisedValues %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Full subscription history for [% bibliotitle | html %] › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
11 [% INCLUDE 'doc-head-close.inc' %]
12 [% BLOCK cssinclude %]
27 border: 1px solid #CCC;
30 text-decoration: none;
53 background-color: #FFC;
59 [% INCLUDE 'bodytag.inc' bodyid='opac-full-serial-issues' bodyclass='scrollto' %]
60 [% INCLUDE 'masthead.inc' %]
63 [% WRAPPER breadcrumbs %]
64 [% WRAPPER breadcrumb_item %]
65 <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | uri %]">Details for [% bibliotitle | html %]</a>
67 [% WRAPPER breadcrumb_item bc_active= 1 %]
68 <span>Full subscription history</span>
70 [% END #/ WRAPPER breadcrumbs %]
72 <div class="container-fluid">
74 <div class="col-lg-2">
75 <div id="searchfacetscontainer">
76 <div id="search-facets">
77 <form method="get" action="/cgi-bin/koha/opac-serial-issues.pl" id="filterform">
78 <legend><h2><a href="#" class="menu-collapse-toggle">Refine your search</a></h2></legend>
79 <ul class="menu-collapse">
81 <label for="libraryfilter">Library: </label>
82 <select id="libraryfilter" name="libraryfilter"></select>
83 <label for="subscriptionidfilter">Subscription: </label>
84 <select id="subscriptionidfilter" name="subscriptionfilter" disabled="disabled"></select>
87 <input type="reset" id="reset" class="btn btn-primary" value="Clear" />
91 </div> <!-- / #search-facets -->
92 </div> <!-- / #searchfacetscontainer -->
94 [% INCLUDE 'navigation.inc' %]
96 </div> <!-- / .col-lg-2 -->
97 <div class="col-10 order-first order-md-first order-lg-2">
98 <div id="fullserialissues" class="maincontent">
99 [% UNLESS ( popup ) %]
100 <h1>Full subscription history for [% bibliotitle | html %]</h1>
102 <span class="view"><a id="Normalview" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | html %]">Normal view</a></span>
103 <span class="view"><a id="Briefhistory" href="/cgi-bin/koha/opac-serial-issues.pl?biblionumber=[% biblionumber | html %]&selectview=small">Brief history</a></span>
104 <span class="view"><span id="Fullhistory">Full history</span></span>
109 <strong>Show year: </strong>
110 [% FOREACH year IN years %]
111 [% IF ( year.year ) %]
112 <a class="tabsubs" href="#" data-year="[% year.year | html %]">[% year.year | html %]</a>
117 [% FOREACH year IN years %]
119 <div class="yeardata tabsub" id="show[% year.year | html %]" style="display:block">
121 <div class="yeardata tabsub" id="show[% year.year | html %]" style="display:none">
123 <table class="subscriptionstclass table table-bordered table-striped">
124 <caption class="sr-only">Subscriptions</caption>
131 <th>Date received</th>
134 <th>Subscription</th>
138 [% FOREACH serial IN year.serials %]
140 <td data-order="[% serial.publisheddate | html %]">
141 [% IF ( serial.publisheddate ) %]
142 [% IF serial.publisheddatetext %]
143 [% serial.publisheddatetext | html %]
145 [% serial.publisheddate | $KohaDates %]
151 <td class="libraryfilterclass">[% Branches.GetName( serial.branchcode ) | html %]</td>
152 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => serial.location, opac => 1 ) | html %]</td>
153 <td>[% serial.notes | html %]</td>
154 [% IF ( serial.status2 && serial.planneddate ) %]
155 <td data-order="[% serial.planneddate | html %]">
156 [% serial.planneddate | $KohaDates %]
158 <td data-order="9999-12-31">
162 <td>[% serial.serialseq | html %]</td>
164 [% INCLUDE 'serial-status.inc' serial = serial %]
166 <td class="subscriptionidfilterclass">[% serial.subscriptionid | html %]</td>
171 </div> <!-- / .yeardata tabsub -->
172 [% END # / FOREACH year %]
173 </div> <!-- / #fullserialissues -->
174 </div> <!-- / .col-10 -->
175 </div> <!-- / .row -->
176 </div> <!-- / .container-fluid -->
177 </div> <!-- / .main -->
179 [% INCLUDE 'opac-bottom.inc' %]
180 [% BLOCK jsinclude %]
181 [% INCLUDE 'datatables.inc' %]
183 $(document).ready(function(){
184 showlayer([% yearmin | html %]);
185 $("a.tabsubs:first").addClass("currentsubtab");
186 $("#filterform").submit(function(){
190 $("#libraryfilter").change(function(){
193 $("#subscriptionidfilter").change(function(){
194 filterBySubscriptionId();
196 $("#reset").click(function(){
199 $("a.tabsubs").on("click", function(e){
201 let year = $(this).data("year");
202 $("a.tabsubs").removeClass("currentsubtab");
203 $(this).addClass("currentsubtab");
206 $(".subscriptionstclass").dataTable($.extend(true, {}, dataTablesDefaults, {
207 "order": [[ 0, "desc" ]]
211 // Filters initialization
212 function initFilters() {
213 // Deleting everything from the library filter
214 $("#libraryfilter option").remove();
216 // Getting each branchcode from the currently displayed tab
218 $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.libraryfilterclass").each(function() {
219 if (subarray.indexOf($(this).text()) == -1) { subarray.push($(this).text()); }
222 // Setting the option values with branchcodes
223 $("#libraryfilter").append('<option value="all">'+_("(All)")+'</option>');
224 for (var i = 0; i < subarray.length; i++) {
225 $("#libraryfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + '</option>');
230 function filterByLibrary() {
232 selectedStatus = $("#libraryfilter").val();
234 // Reset the filters but keeps the selected library
237 if (selectedStatus != 'all') {
239 // We hide everything
240 $("table.subscriptionstclass tbody tr").hide();
242 // Then show the lines that match the currently selected library
243 $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedStatus + ")").parent().show();
246 // We then prepare the subscription filter :
248 // Getting subscription id's for the selected library
250 $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.subscriptionidfilterclass").each(function() {
251 if (subarray.indexOf($(this).text()) == -1) { subarray.push($(this).text()); }
253 // Setting the option values with subscription id's
254 $("#subscriptionidfilter").append('<option value="all">'+_("(All)")+'</option>');
255 for (var i = 0; i < subarray.length; i++) {
256 $("#subscriptionidfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + '</option>');
259 // Subscription filtering is now ready
260 $("#subscriptionidfilter").removeAttr("disabled");
264 // Filter by subscription id
265 function filterBySubscriptionId() {
267 selectedSubscription = $("#subscriptionidfilter").val();
268 selectedLibrary = $("#libraryfilter").val();
270 if (selectedSubscription == "all") {
275 // We hide everything
276 $("table.subscriptionstclass tbody tr").hide();
278 // Then show the lines that match the currently selected library
279 $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedLibrary + ")").parent().show();
281 // Then hide the lines where the subscription id does not match the selected one
282 $("table.subscriptionstclass tbody tr td.subscriptionidfilterclass").not(
283 $("table.subscriptionstclass tbody tr td.subscriptionidfilterclass:contains(" + selectedSubscription + ")")
288 // Clears filters : reset everything
289 // (Though preserves the selected library if the keeplibrary parameter is set to true)
290 function clearFilters(keeplibrary) {
292 $("table.subscriptionstclass tbody tr").show();
294 // Remove old subscription options
295 $("#subscriptionidfilter option").remove();
296 $("#subscriptionidfilter option").append('<option value="all">'+_("(All)")+'</option>');
297 $("#subscriptionidfilter").attr("disabled", "disabled");
299 if (keeplibrary != true) {
300 // Reinit library options
302 $("#libraryfilter option[value=all]").attr("selected", "selected");
306 function showlayer(numlayer){
307 $(".yeardata").each(function(){
308 ong = $(this).attr("id");
309 if(ong == "show"+numlayer){