4 [% USE AdditionalContents %]
5 [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
6 [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
7 [% USE AuthorisedValues %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Full subscription history for [% bibliotitle | html %] › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog</title>
10 [% INCLUDE 'doc-head-close.inc' %]
11 [% BLOCK cssinclude %]
26 border: 1px solid #CCC;
29 text-decoration: none;
52 background-color: #FFC;
58 [% INCLUDE 'bodytag.inc' bodyid='opac-full-serial-issues' bodyclass='scrollto' %]
59 [% INCLUDE 'masthead.inc' %]
62 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumbs">
63 <ol class="breadcrumb">
64 <li class="breadcrumb-item">
65 <a href="/cgi-bin/koha/opac-main.pl">Home</a>
67 <li class="breadcrumb-item">
68 <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | uri %]">Details for [% bibliotitle | html %]</a>
70 <li class="breadcrumb-item active">
71 <a href="#" aria-current="page">Full subscription history</a>
74 </nav> <!-- /#breadcrumbs -->
76 <div class="container-fluid">
78 <div class="col-lg-2">
79 <div id="searchfacetscontainer">
80 <div id="search-facets">
81 <form action="/cgi-bin/koha/opac-serial-issues.pl" id="filterform">
82 <legend><h2><a href="#" class="menu-collapse-toggle">Refine your search</a></h2></legend>
83 <ul class="menu-collapse">
85 <label for="libraryfilter">Library: </label>
86 <select id="libraryfilter" name="libraryfilter"></select>
87 <label for="subscriptionidfilter">Subscription: </label>
88 <select id="subscriptionidfilter" name="subscriptionfilter" disabled="disabled"></select>
91 <input type="reset" id="reset" class="btn btn-primary" value="Clear" />
95 </div> <!-- / #search-facets -->
96 </div> <!-- / #searchfacetscontainer -->
98 [% INCLUDE 'navigation.inc' %]
100 </div> <!-- / .col-lg-2 -->
101 <div class="col-10 order-first order-md-first order-lg-2">
102 <div id="fullserialissues" class="maincontent">
103 [% UNLESS ( popup ) %]
104 <h1>Full subscription history for [% bibliotitle | html %]</h1>
106 <span class="view"><a id="Normalview" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | html %]">Normal view</a></span>
107 <span class="view"><a id="Briefhistory" href="/cgi-bin/koha/opac-serial-issues.pl?biblionumber=[% biblionumber | html %]&selectview=small">Brief history</a></span>
108 <span class="view"><span id="Fullhistory">Full history</span></span>
113 <strong>Show year: </strong>
114 [% FOREACH year IN years %]
115 [% IF ( year.year ) %]
116 <a class="tabsubs" href="#" onclick="showlayer([% year.year | html %]); return false;">[% year.year | html %]</a>
121 [% FOREACH year IN years %]
123 <div class="yeardata tabsub" id="show[% year.year | html %]" style="display:block">
125 <div class="yeardata tabsub" id="show[% year.year | html %]" style="display:none">
127 <table class="subscriptionstclass table table-bordered table-striped">
128 <caption class="sr-only">Subscriptions</caption>
135 <th>Date received</th>
138 <th>Subscription</th>
142 [% FOREACH serial IN year.serials %]
144 <td data-order="[% serial.publisheddate | html %]">
145 [% IF ( serial.publisheddate ) %]
146 [% IF serial.publisheddatetext %]
147 [% serial.publisheddatetext | html %]
149 [% serial.publisheddate | $KohaDates %]
155 <td class="libraryfilterclass">[% Branches.GetName( serial.branchcode ) | html %]</td>
156 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => serial.location, opac => 1 ) | html %]</td>
157 <td>[% serial.notes | html %]</td>
158 [% IF ( serial.status2 && serial.planneddate ) %]
159 <td data-order="[% serial.planneddate | html %]">
160 [% serial.planneddate | $KohaDates %]
162 <td data-order="9999-12-31">
166 <td>[% serial.serialseq | html %]</td>
168 [% IF ( serial.status1 ) %]Expected[% END %]
169 [% IF ( serial.status2 ) %]Arrived[% END %]
170 [% IF ( serial.status3 ) %]Late[% END %]
171 [% IF ( serial.status4 ) %]Missing[% END %]
172 [% IF ( serial.status41 ) %]Missing (never received)[% END %]
173 [% IF ( serial.status42 ) %]Missing (sold out)[% END %]
174 [% IF ( serial.status43 ) %]Missing (damaged)[% END %]
175 [% IF ( serial.status44 ) %]Missing (lost)[% END %]
176 [% IF ( serial.status5 ) %]Not available[% END %]
177 [% IF ( serial.status6 ) %]Delete[% END %]
178 [% IF ( serial.status7 ) %]Claimed[% END %]
179 [% IF ( serial.status8 ) %]Stopped[% END %]
181 <td class="subscriptionidfilterclass">[% serial.subscriptionid | html %]</td>
186 </div> <!-- / .yeardata tabsub -->
187 [% END # / FOREACH year %]
188 </div> <!-- / #fullserialissues -->
189 </div> <!-- / .col-10 -->
190 </div> <!-- / .row -->
191 </div> <!-- / .container-fluid -->
192 </div> <!-- / .main -->
194 [% INCLUDE 'opac-bottom.inc' %]
195 [% BLOCK jsinclude %]
196 [% INCLUDE 'datatables.inc' %]
198 $(document).ready(function(){
199 showlayer([% yearmin | html %]);
200 $("a.tabsubs:first").addClass("currentsubtab");
201 $("#filterform").submit(function(){
205 $("#libraryfilter").change(function(){
208 $("#subscriptionidfilter").change(function(){
209 filterBySubscriptionId();
211 $("#reset").click(function(){
214 $("a.tabsubs").click(function(){
215 $("a.tabsubs").removeClass("currentsubtab");
216 $(this).addClass("currentsubtab");
218 $(".subscriptionstclass").dataTable($.extend(true, {}, dataTablesDefaults, {
219 "order": [[ 0, "desc" ]]
223 // Filters initialization
224 function initFilters() {
225 // Deleting everything from the library filter
226 $("#libraryfilter option").remove();
228 // Getting each branchcode from the currently displayed tab
230 $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.libraryfilterclass").each(function() {
231 if (subarray.indexOf($(this).text()) == -1) { subarray.push($(this).text()); }
234 // Setting the option values with branchcodes
235 $("#libraryfilter").append('<option value="all">'+_("(All)")+'</option>');
236 for (var i = 0; i < subarray.length; i++) {
237 $("#libraryfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + '</option>');
242 function filterByLibrary() {
244 selectedStatus = $("#libraryfilter").val();
246 // Reset the filters but keeps the selected library
249 if (selectedStatus != 'all') {
251 // We hide everything
252 $("table.subscriptionstclass tbody tr").hide();
254 // Then show the lines that match the currently selected library
255 $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedStatus + ")").parent().show();
258 // We then prepare the subscription filter :
260 // Getting subscription id's for the selected library
262 $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.subscriptionidfilterclass").each(function() {
263 if (subarray.indexOf($(this).text()) == -1) { subarray.push($(this).text()); }
265 // Setting the option values with subscription id's
266 $("#subscriptionidfilter").append('<option value="all">'+_("(All)")+'</option>');
267 for (var i = 0; i < subarray.length; i++) {
268 $("#subscriptionidfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + '</option>');
271 // Subscription filtering is now ready
272 $("#subscriptionidfilter").removeAttr("disabled");
276 // Filter by subscription id
277 function filterBySubscriptionId() {
279 selectedSubscription = $("#subscriptionidfilter").val();
280 selectedLibrary = $("#libraryfilter").val();
282 if (selectedSubscription == "all") {
287 // We hide everything
288 $("table.subscriptionstclass tbody tr").hide();
290 // Then show the lines that match the currently selected library
291 $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedLibrary + ")").parent().show();
293 // Then hide the lines where the subscription id does not match the selected one
294 $("table.subscriptionstclass tbody tr td.subscriptionidfilterclass").not(
295 $("table.subscriptionstclass tbody tr td.subscriptionidfilterclass:contains(" + selectedSubscription + ")")
300 // Clears filters : reset everything
301 // (Though preserves the selected library if the keeplibrary parameter is set to true)
302 function clearFilters(keeplibrary) {
304 $("table.subscriptionstclass tbody tr").show();
306 // Remove old subscription options
307 $("#subscriptionidfilter option").remove();
308 $("#subscriptionidfilter option").append('<option value="all">'+_("(All)")+'</option>');
309 $("#subscriptionidfilter").attr("disabled", "disabled");
311 if (keeplibrary != true) {
312 // Reinit library options
314 $("#libraryfilter option[value=all]").attr("selected", "selected");
318 function showlayer(numlayer){
319 $(".yeardata").each(function(){
320 ong = $(this).attr("id");
321 if(ong == "show"+numlayer){