Bug 25236: Fix semantic heading for opac-full-serial-issues.tt
[srvgit] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-full-serial-issues.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% USE Branches %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo;  Full subscription history for [% bibliotitle | html %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
7 [% BLOCK cssinclude %]
8     <style>
9         #search-facets fieldset { border: 0; margin: 0;padding:0;}#search-facets ol{padding:.3em;}#search-facets li {list-style-type:none;padding:4px 4px;}#search-facets label{font-weight:bold;display:block;margin:.2em 0;}#search-facets fieldset.action {padding-left:4px;margin:.3em;}div.tabsub { clear:both;}#subtabs a { display:block;float:left;border:1px solid #CCC;padding:.2em .4em;margin:.3em;text-decoration:none;font-size:115%;}#subtabs strong { display:block; float: left; font-size:115%;padding:.2em .4em; margin: 0.3em 0;}#subtabs { margin-top : 1em; }a.currentsubtab { background-color:#FFC;}
10     </style>
11 [% END %]
12 </head>
13 [% INCLUDE 'bodytag.inc' bodyid='opac-full-serial-issues' bodyclass='scrollto' %]
14 [% INCLUDE 'masthead.inc' %]
15
16     <div class="main">
17         <ul class="breadcrumb">
18             <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
19             <li><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | uri %]">Details for [% bibliotitle | html %]</a> <span class="divider">&rsaquo;</span></li>
20             <li><a href="#">Full subscription history</a></li>
21         </ul>
22
23         <div class="container-fluid">
24             <div class="row-fluid">
25                 <div class="span2">
26                     <div id="searchfacetscontainer">
27                         <div id="search-facets">
28                             <form action="/cgi-bin/koha/opac-serial-issues.pl" id="filterform">
29                             <h2><a href="#" class="menu-collapse-toggle">Refine your search</a></h2>
30                             <ul class="menu-collapse">
31                                 <li>
32                                     <label for="libraryfilter">Library: </label>
33                                     <select id="libraryfilter" name="libraryfilter" style="width:10em;"></select>
34                                     <label for="subscriptionidfilter">Subscription: </label>
35                                     <select id="subscriptionidfilter" name="subscriptionfilter" style="width:10em;" disabled="disabled"></select>
36                                 </li>
37                                 <li class="action">
38                                     <input type="reset" id="reset" class="btn" value="Clear" />
39                                 </li>
40                             </ul>
41                             </form>
42                         </div> <!-- / #search-facets -->
43                     </div> <!-- / #searchfacetscontainer -->
44                     <div id="navigation">
45                         [% INCLUDE 'navigation.inc' %]
46                     </div>
47                 </div> <!-- / .span2 -->
48                 <div class="span10">
49                     <div id="fullserialissues" class="maincontent">
50                         [% UNLESS ( popup ) %]
51                             <h2>Full subscription history for [% bibliotitle | html %]</h2>
52                             <div id="views">
53                                 <span class="view"><a id="Normalview" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | html %]">Normal view</a></span>
54                                 <span class="view"><a id="Briefhistory" href="/cgi-bin/koha/opac-serial-issues.pl?biblionumber=[% biblionumber | html %]&amp;selectview=small">Brief history</a></span>
55                                 <span class="view"><span id="Fullhistory">Full history</span></span>
56                             </div>
57                         [% END %]
58
59                         <div id="subtabs">
60                             <strong>Show year: </strong>
61                             [% FOREACH year IN years %]
62                                 [% IF ( year.year ) %]
63                                     <a class="tabsubs" href="#" onclick="showlayer([% year.year | html %]); return false;">[% year.year | html %]</a>
64                                 [% END %]
65                             [% END %]
66                         </div>
67
68                         [% FOREACH year IN years %]
69                             [% IF loop.first %]
70                                 <div class="yeardata tabsub" id="show[% year.year | html %]" style="display:block">
71                             [% ELSE %]
72                                 <div class="yeardata tabsub" id="show[% year.year | html %]" style="display:none">
73                             [% END %]
74                                 <table class="subscriptionstclass table table-bordered table-striped">
75                                     <thead>
76                                         <tr>
77                                             <th>Date</th>
78                                             <th>Library</th>
79                                             <th>Notes</th>
80                                             <th>Date received</th>
81                                             <th>Number</th>
82                                             <th>Status</th>
83                                             <th>Subscription</th>
84                                         </tr>
85                                     </thead>
86                                     <tbody>
87                                         [% FOREACH serial IN year.serials %]
88                                             <tr>
89                                                 <td>
90                                                     [% IF ( serial.publisheddate ) %]
91                                                         <span title="[% serial.publisheddate | html %]">
92                                                             [% IF serial.publisheddatetext %]
93                                                                 [% serial.publisheddatetext | html %]
94                                                             [% ELSE %]
95                                                                 [% serial.publisheddate | $KohaDates %]
96                                                             [% END %]
97                                                         </span>
98                                                     [% ELSE %]
99                                                         &nbsp;
100                                                     [% END %]
101                                                 </td>
102                                                 <td class="libraryfilterclass">[% Branches.GetName( serial.branchcode ) | html %]</td>
103                                                 <td>[% serial.notes | html %]</td>
104                                                 <td>
105                                                     [% IF ( serial.status2 && serial.planneddate ) %]
106                                                         <span title="[% serial.planneddate | html %]">[% serial.planneddate | $KohaDates %]</span>
107                                                     [% ELSE %]
108                                                         <span title="9999-12-31">&nbsp;</span>
109                                                     [% END %]
110                                                 </td>
111                                                 <td>[% serial.serialseq | html %]</td>
112                                                 <td>
113                                                     [% IF ( serial.status1 ) %]Expected[% END %]
114                                                     [% IF ( serial.status2 ) %]Arrived[% END %]
115                                                     [% IF ( serial.status3 ) %]Late[% END %]
116                                                     [% IF ( serial.status4 ) %]Missing[% END %]
117                                                         [% IF ( serial.status41 ) %]Missing (never received)[% END %]
118                                                         [% IF ( serial.status42 ) %]Missing (sold out)[% END %]
119                                                         [% IF ( serial.status43 ) %]Missing (damaged)[% END %]
120                                                         [% IF ( serial.status44 ) %]Missing (lost)[% END %]
121                                                     [% IF ( serial.status5 ) %]Not available[% END %]
122                                                     [% IF ( serial.status6 ) %]Delete[% END %]
123                                                     [% IF ( serial.status7 ) %]Claimed[% END %]
124                                                     [% IF ( serial.status8 ) %]Stopped[% END %]
125                                                 </td>
126                                                 <td class="subscriptionidfilterclass">[% serial.subscriptionid | html %]</td>
127                                             </tr>
128                                         [% END %]
129                                     </tbody>
130                                 </table>
131                             </div> <!-- / .yeardata tabsub -->
132                         [% END # / FOREACH year %]
133                     </div> <!-- / #fullserialissues -->
134                 </div> <!-- / .span10 -->
135             </div> <!-- / .row-fluid -->
136         </div> <!-- / .container-fluid -->
137     </div> <!-- / .main -->
138
139 [% INCLUDE 'opac-bottom.inc' %]
140 [% BLOCK jsinclude %]
141 [% INCLUDE 'datatables.inc' %]
142 <script>
143     //<![CDATA[
144         $(document).ready(function(){
145             showlayer([% yearmin | html %]);
146             $("a.tabsubs:first").addClass("currentsubtab");
147             $("#filterform").submit(function(){
148                 filterByLibrary();
149                 return false;
150             });
151             $("#libraryfilter").change(function(){
152                 filterByLibrary();
153             });
154             $("#subscriptionidfilter").change(function(){
155                 filterBySubscriptionId();
156             });
157             $("#reset").click(function(){
158                 clearFilters();
159             });
160             $("a.tabsubs").click(function(){
161                 $("a.tabsubs").removeClass("currentsubtab");
162                 $(this).addClass("currentsubtab");
163             });
164             $(".subscriptionstclass").dataTable($.extend(true, {}, dataTablesDefaults, {
165                 "order": [[ 0, "desc" ]],
166                 "columns": [
167                     { "type": "title-string" },
168                     null,
169                     null,
170                     { "type": "title-string" },
171                     null,
172                     null,
173                     null
174                 ]
175             }));
176         });
177
178         // Filters initialization
179         function initFilters() {
180             // Deleting everything from the library filter
181             $("#libraryfilter option").remove();
182
183             // Getting each branchcode from the currently displayed tab
184             var subarray = [];
185             $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.libraryfilterclass").each(function() {
186                 if (subarray.indexOf($(this).text()) == -1) { subarray.push($(this).text()); }
187             });
188
189             // Setting the option values with branchcodes
190             $("#libraryfilter").append('<option value="all">'+_("(All)")+'</option>');
191             for (var i = 0; i < subarray.length; i++) {
192                 $("#libraryfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + '</option>');
193             }
194         }
195
196         // Filter by Library
197
198         function filterByLibrary() {
199
200             selectedStatus = $("#libraryfilter").val();
201
202             // Reset the filters but keeps the selected library
203             clearFilters(true);
204
205             if (selectedStatus != 'all') {
206
207                 // We hide everything
208             $("table.subscriptionstclass tbody tr").hide();
209
210             // Then show the lines that match the currently selected library
211             $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedStatus + ")").parent().show();
212
213
214             // We then prepare the subscription filter :
215
216             // Getting subscription id's for the selected library
217             var subarray = [];
218             $("div#" + currentYear + " table.subscriptionstclass tbody tr:visible td.subscriptionidfilterclass").each(function() {
219                 if (subarray.indexOf($(this).text()) == -1) { subarray.push($(this).text()); }
220             });
221             // Setting the option values with subscription id's
222             $("#subscriptionidfilter").append('<option value="all">'+_("(All)")+'</option>');
223             for (var i = 0; i < subarray.length; i++) {
224                 $("#subscriptionidfilter").append('<option value="' + subarray[i] + '">' + subarray[i] + '</option>');
225             }
226
227             // Subscription filtering is now ready
228             $("#subscriptionidfilter").removeAttr("disabled");
229             }
230         }
231
232         // Filter by subscription id
233         function filterBySubscriptionId() {
234
235             selectedSubscription = $("#subscriptionidfilter").val();
236             selectedLibrary      = $("#libraryfilter").val();
237
238             if (selectedSubscription == "all") {
239             clearFilters(true);
240             filterByLibrary();
241             } else {
242
243             // We hide everything
244             $("table.subscriptionstclass tbody tr").hide();
245
246             // Then show the lines that match the currently selected library
247             $("table.subscriptionstclass tbody tr td.libraryfilterclass:contains(" + selectedLibrary + ")").parent().show();
248
249             // Then hide the lines where the subscription id does not match the selected one
250             $("table.subscriptionstclass tbody tr td.subscriptionidfilterclass").not(
251                 $("table.subscriptionstclass tbody tr td.subscriptionidfilterclass:contains(" + selectedSubscription + ")")
252             ).parent().hide();
253             }
254         }
255
256         // Clears filters : reset everything
257         // (Though preserves the selected library if the keeplibrary parameter is set to true)
258         function clearFilters(keeplibrary) {
259
260             // Show all content
261             $("table.subscriptionstclass tbody tr").show();
262
263             // Remove old subscription options
264             $("#subscriptionidfilter option").remove();
265             $("#subscriptionidfilter option").append('<option value="all">'+_("(All)")+'</option>');
266             $("#subscriptionidfilter").attr("disabled", "disabled");
267
268             if (keeplibrary != true) {
269             // Reinit library options
270             initFilters();
271             $("#libraryfilter option[value=all]").attr("selected", "selected");
272             }
273         }
274         function showlayer(numlayer){
275             $(".yeardata").each(function(){
276                 ong = $(this).attr("id");
277                 if(ong == "show"+numlayer){
278                     $(this).show();
279                     currentYear = ong;
280                 } else  {
281                     $(this).hide();
282                 }
283             });
284             clearFilters();
285         }
286     //]]>
287 </script>
288 [% END %]