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