4 [% USE AdditionalContents %]
5 [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
6 [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode, blocktitle => 0 ) %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Full subscription history for [% bibliotitle | html %] › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% BLOCK cssinclude %]
25 border: 1px solid #CCC;
28 text-decoration: none;
51 background-color: #FFC;
57 [% INCLUDE 'bodytag.inc' bodyid='opac-full-serial-issues' bodyclass='scrollto' %]
58 [% INCLUDE 'masthead.inc' %]
61 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
62 <ol class="breadcrumb">
63 <li class="breadcrumb-item">
64 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
66 <li class="breadcrumb-item">
67 <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | uri %]">Details for [% bibliotitle | html %]</a>
69 <li class="breadcrumb-item active">
70 <a href="#" aria-current="page">Full subscription history</a>
73 </nav> <!-- /#breadcrumbs -->
75 <div class="container-fluid">
77 <div class="col-lg-2">
78 <div id="searchfacetscontainer">
79 <div id="search-facets">
80 <form action="/cgi-bin/koha/opac-serial-issues.pl" id="filterform">
81 <legend><h2><a href="#" class="menu-collapse-toggle">Refine your search</a></h2></legend>
82 <ul class="menu-collapse">
84 <label for="libraryfilter">Library: </label>
85 <select id="libraryfilter" name="libraryfilter"></select>
86 <label for="subscriptionidfilter">Subscription: </label>
87 <select id="subscriptionidfilter" name="subscriptionfilter" disabled="disabled"></select>
90 <input type="reset" id="reset" class="btn btn-primary" value="Clear" />
94 </div> <!-- / #search-facets -->
95 </div> <!-- / #searchfacetscontainer -->
97 [% INCLUDE 'navigation.inc' %]
99 </div> <!-- / .col-lg-2 -->
100 <div class="col-10 order-first order-md-first order-lg-2">
101 <div id="fullserialissues" class="maincontent">
102 [% UNLESS ( popup ) %]
103 <h1>Full subscription history for [% bibliotitle | html %]</h1>
105 <span class="view"><a id="Normalview" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | html %]">Normal view</a></span>
106 <span class="view"><a id="Briefhistory" href="/cgi-bin/koha/opac-serial-issues.pl?biblionumber=[% biblionumber | html %]&selectview=small">Brief history</a></span>
107 <span class="view"><span id="Fullhistory">Full history</span></span>
112 <strong>Show year: </strong>
113 [% FOREACH year IN years %]
114 [% IF ( year.year ) %]
115 <a class="tabsubs" href="#" onclick="showlayer([% year.year | html %]); return false;">[% year.year | html %]</a>
120 [% FOREACH year IN years %]
122 <div class="yeardata tabsub" id="show[% year.year | html %]" style="display:block">
124 <div class="yeardata tabsub" id="show[% year.year | html %]" style="display:none">
126 <table class="subscriptionstclass table table-bordered table-striped">
127 <caption class="sr-only">Subscriptions</caption>
133 <th>Date received</th>
136 <th>Subscription</th>
140 [% FOREACH serial IN year.serials %]
142 <td data-order="[% serial.publisheddate | html %]">
143 [% IF ( serial.publisheddate ) %]
144 [% IF serial.publisheddatetext %]
145 [% serial.publisheddatetext | html %]
147 [% serial.publisheddate | $KohaDates %]
153 <td class="libraryfilterclass">[% Branches.GetName( serial.branchcode ) | html %]</td>
154 <td>[% serial.notes | html %]</td>
155 [% IF ( serial.status2 && serial.planneddate ) %]
156 <td data-order="[% serial.planneddate | html %]">
157 [% serial.planneddate | $KohaDates %]
159 <td data-order="9999-12-31">
163 <td>[% serial.serialseq | html %]</td>
165 [% IF ( serial.status1 ) %]Expected[% END %]
166 [% IF ( serial.status2 ) %]Arrived[% END %]
167 [% IF ( serial.status3 ) %]Late[% END %]
168 [% IF ( serial.status4 ) %]Missing[% END %]
169 [% IF ( serial.status41 ) %]Missing (never received)[% END %]
170 [% IF ( serial.status42 ) %]Missing (sold out)[% END %]
171 [% IF ( serial.status43 ) %]Missing (damaged)[% END %]
172 [% IF ( serial.status44 ) %]Missing (lost)[% END %]
173 [% IF ( serial.status5 ) %]Not available[% END %]
174 [% IF ( serial.status6 ) %]Delete[% END %]
175 [% IF ( serial.status7 ) %]Claimed[% END %]
176 [% IF ( serial.status8 ) %]Stopped[% END %]
178 <td class="subscriptionidfilterclass">[% serial.subscriptionid | html %]</td>
183 </div> <!-- / .yeardata tabsub -->
184 [% END # / FOREACH year %]
185 </div> <!-- / #fullserialissues -->
186 </div> <!-- / .col-10 -->
187 </div> <!-- / .row -->
188 </div> <!-- / .container-fluid -->
189 </div> <!-- / .main -->
191 [% INCLUDE 'opac-bottom.inc' %]
192 [% BLOCK jsinclude %]
193 [% INCLUDE 'datatables.inc' %]
195 $(document).ready(function(){
196 showlayer([% yearmin | html %]);
197 $("a.tabsubs:first").addClass("currentsubtab");
198 $("#filterform").submit(function(){
202 $("#libraryfilter").change(function(){
205 $("#subscriptionidfilter").change(function(){
206 filterBySubscriptionId();
208 $("#reset").click(function(){
211 $("a.tabsubs").click(function(){
212 $("a.tabsubs").removeClass("currentsubtab");
213 $(this).addClass("currentsubtab");
215 $(".subscriptionstclass").dataTable($.extend(true, {}, dataTablesDefaults, {
216 "order": [[ 0, "desc" ]]
220 // Filters initialization
221 function initFilters() {
222 // Deleting everything from the library filter
223 $("#libraryfilter option").remove();
225 // Getting each branchcode from the currently displayed tab
227 $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.libraryfilterclass").each(function() {
228 if (subarray.indexOf($(this).text()) == -1) { subarray.push($(this).text()); }
231 // Setting the option values with branchcodes
232 $("#libraryfilter").append('<option value="all">'+_("(All)")+'</option>');
233 for (var i = 0; i < subarray.length; i++) {
234 $("#libraryfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + '</option>');
239 function filterByLibrary() {
241 selectedStatus = $("#libraryfilter").val();
243 // Reset the filters but keeps the selected library
246 if (selectedStatus != 'all') {
248 // We hide everything
249 $("table.subscriptionstclass tbody tr").hide();
251 // Then show the lines that match the currently selected library
252 $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedStatus + ")").parent().show();
255 // We then prepare the subscription filter :
257 // Getting subscription id's for the selected library
259 $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.subscriptionidfilterclass").each(function() {
260 if (subarray.indexOf($(this).text()) == -1) { subarray.push($(this).text()); }
262 // Setting the option values with subscription id's
263 $("#subscriptionidfilter").append('<option value="all">'+_("(All)")+'</option>');
264 for (var i = 0; i < subarray.length; i++) {
265 $("#subscriptionidfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + '</option>');
268 // Subscription filtering is now ready
269 $("#subscriptionidfilter").removeAttr("disabled");
273 // Filter by subscription id
274 function filterBySubscriptionId() {
276 selectedSubscription = $("#subscriptionidfilter").val();
277 selectedLibrary = $("#libraryfilter").val();
279 if (selectedSubscription == "all") {
284 // We hide everything
285 $("table.subscriptionstclass tbody tr").hide();
287 // Then show the lines that match the currently selected library
288 $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedLibrary + ")").parent().show();
290 // Then hide the lines where the subscription id does not match the selected one
291 $("table.subscriptionstclass tbody tr td.subscriptionidfilterclass").not(
292 $("table.subscriptionstclass tbody tr td.subscriptionidfilterclass:contains(" + selectedSubscription + ")")
297 // Clears filters : reset everything
298 // (Though preserves the selected library if the keeplibrary parameter is set to true)
299 function clearFilters(keeplibrary) {
301 $("table.subscriptionstclass tbody tr").show();
303 // Remove old subscription options
304 $("#subscriptionidfilter option").remove();
305 $("#subscriptionidfilter option").append('<option value="all">'+_("(All)")+'</option>');
306 $("#subscriptionidfilter").attr("disabled", "disabled");
308 if (keeplibrary != true) {
309 // Reinit library options
311 $("#libraryfilter option[value=all]").attr("selected", "selected");
315 function showlayer(numlayer){
316 $(".yeardata").each(function(){
317 ong = $(this).attr("id");
318 if(ong == "show"+numlayer){