4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Full subscription history for [% bibliotitle | html %] › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
6 [% INCLUDE 'doc-head-close.inc' %]
22 border: 1px solid #CCC;
25 text-decoration: none;
48 background-color: #FFC;
54 [% INCLUDE 'bodytag.inc' bodyid='opac-full-serial-issues' bodyclass='scrollto' %]
55 [% INCLUDE 'masthead.inc' %]
58 <nav aria-label="breadcrumb">
59 <ul class="breadcrumb">
60 <li class="breadcrumb-item">
61 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
63 <li class="breadcrumb-item">
64 <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | uri %]">Details for [% bibliotitle | html %]</a>
66 <li class="breadcrumb-item active" aria-current="page">
67 <a href="#">Full subscription history</a>
72 <div class="container-fluid">
74 <div class="col-lg-2">
75 <div id="searchfacetscontainer">
76 <div id="search-facets">
77 <form action="/cgi-bin/koha/opac-serial-issues.pl" id="filterform">
78 <h2><a href="#" class="menu-collapse-toggle">Refine your search</a></h2>
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="#" onclick="showlayer([% year.year | html %]); return false;">[% 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">
129 <th>Date received</th>
132 <th>Subscription</th>
136 [% FOREACH serial IN year.serials %]
138 <td data-order="[% serial.publisheddate | html %]">
139 [% IF ( serial.publisheddate ) %]
140 [% IF serial.publisheddatetext %]
141 [% serial.publisheddatetext | html %]
143 [% serial.publisheddate | $KohaDates %]
149 <td class="libraryfilterclass">[% Branches.GetName( serial.branchcode ) | html %]</td>
150 <td>[% serial.notes | html %]</td>
151 [% IF ( serial.status2 && serial.planneddate ) %]
152 <td data-order="[% serial.planneddate | html %]">
153 [% serial.planneddate | $KohaDates %]
155 <td data-order="9999-12-31">
159 <td>[% serial.serialseq | html %]</td>
161 [% IF ( serial.status1 ) %]Expected[% END %]
162 [% IF ( serial.status2 ) %]Arrived[% END %]
163 [% IF ( serial.status3 ) %]Late[% END %]
164 [% IF ( serial.status4 ) %]Missing[% END %]
165 [% IF ( serial.status41 ) %]Missing (never received)[% END %]
166 [% IF ( serial.status42 ) %]Missing (sold out)[% END %]
167 [% IF ( serial.status43 ) %]Missing (damaged)[% END %]
168 [% IF ( serial.status44 ) %]Missing (lost)[% END %]
169 [% IF ( serial.status5 ) %]Not available[% END %]
170 [% IF ( serial.status6 ) %]Delete[% END %]
171 [% IF ( serial.status7 ) %]Claimed[% END %]
172 [% IF ( serial.status8 ) %]Stopped[% END %]
174 <td class="subscriptionidfilterclass">[% serial.subscriptionid | html %]</td>
179 </div> <!-- / .yeardata tabsub -->
180 [% END # / FOREACH year %]
181 </div> <!-- / #fullserialissues -->
182 </div> <!-- / .col-10 -->
183 </div> <!-- / .row -->
184 </div> <!-- / .container-fluid -->
185 </div> <!-- / .main -->
187 [% INCLUDE 'opac-bottom.inc' %]
188 [% BLOCK jsinclude %]
189 [% INCLUDE 'datatables.inc' %]
191 $(document).ready(function(){
192 showlayer([% yearmin | html %]);
193 $("a.tabsubs:first").addClass("currentsubtab");
194 $("#filterform").submit(function(){
198 $("#libraryfilter").change(function(){
201 $("#subscriptionidfilter").change(function(){
202 filterBySubscriptionId();
204 $("#reset").click(function(){
207 $("a.tabsubs").click(function(){
208 $("a.tabsubs").removeClass("currentsubtab");
209 $(this).addClass("currentsubtab");
211 $(".subscriptionstclass").dataTable($.extend(true, {}, dataTablesDefaults, {
212 "order": [[ 0, "desc" ]]
216 // Filters initialization
217 function initFilters() {
218 // Deleting everything from the library filter
219 $("#libraryfilter option").remove();
221 // Getting each branchcode from the currently displayed tab
223 $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.libraryfilterclass").each(function() {
224 if (subarray.indexOf($(this).text()) == -1) { subarray.push($(this).text()); }
227 // Setting the option values with branchcodes
228 $("#libraryfilter").append('<option value="all">'+_("(All)")+'</option>');
229 for (var i = 0; i < subarray.length; i++) {
230 $("#libraryfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + '</option>');
235 function filterByLibrary() {
237 selectedStatus = $("#libraryfilter").val();
239 // Reset the filters but keeps the selected library
242 if (selectedStatus != 'all') {
244 // We hide everything
245 $("table.subscriptionstclass tbody tr").hide();
247 // Then show the lines that match the currently selected library
248 $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedStatus + ")").parent().show();
251 // We then prepare the subscription filter :
253 // Getting subscription id's for the selected library
255 $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.subscriptionidfilterclass").each(function() {
256 if (subarray.indexOf($(this).text()) == -1) { subarray.push($(this).text()); }
258 // Setting the option values with subscription id's
259 $("#subscriptionidfilter").append('<option value="all">'+_("(All)")+'</option>');
260 for (var i = 0; i < subarray.length; i++) {
261 $("#subscriptionidfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + '</option>');
264 // Subscription filtering is now ready
265 $("#subscriptionidfilter").removeAttr("disabled");
269 // Filter by subscription id
270 function filterBySubscriptionId() {
272 selectedSubscription = $("#subscriptionidfilter").val();
273 selectedLibrary = $("#libraryfilter").val();
275 if (selectedSubscription == "all") {
280 // We hide everything
281 $("table.subscriptionstclass tbody tr").hide();
283 // Then show the lines that match the currently selected library
284 $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedLibrary + ")").parent().show();
286 // Then hide the lines where the subscription id does not match the selected one
287 $("table.subscriptionstclass tbody tr td.subscriptionidfilterclass").not(
288 $("table.subscriptionstclass tbody tr td.subscriptionidfilterclass:contains(" + selectedSubscription + ")")
293 // Clears filters : reset everything
294 // (Though preserves the selected library if the keeplibrary parameter is set to true)
295 function clearFilters(keeplibrary) {
297 $("table.subscriptionstclass tbody tr").show();
299 // Remove old subscription options
300 $("#subscriptionidfilter option").remove();
301 $("#subscriptionidfilter option").append('<option value="all">'+_("(All)")+'</option>');
302 $("#subscriptionidfilter").attr("disabled", "disabled");
304 if (keeplibrary != true) {
305 // Reinit library options
307 $("#libraryfilter option[value=all]").attr("selected", "selected");
311 function showlayer(numlayer){
312 $(".yeardata").each(function(){
313 ong = $(this).attr("id");
314 if(ong == "show"+numlayer){