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