Bug 16963 - Remove the use of "onclick" from subscription add template
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / showpredictionpattern.tt
1 [% USE KohaDates %]
2
3 <h2>Prediction pattern</h1>
4 [% IF (not_consistent_end_date) %]
5   <p><em>End date is not consistent with subscription length.</em></p>
6 [% END %]
7 [% IF (ask_for_irregularities) %]
8     <p><em>Please check issues that are NOT published (irregularities)</em></p>
9     [% IF (daily_options) %]
10         <script type="text/javascript">
11         //<![CDATA[
12         function Check_boxes(dow) {
13             if($(":checkbox[data-dow='"+dow+"']:first").is(':checked')) {
14                 $("#predictionst :checkbox[data-dow='"+dow+"']").each(function(){
15                     $(this).prop('checked', true);
16                 });
17             } else {
18                 $("#predictionst :checkbox[data-dow='"+dow+"']").each(function(){
19                     $(this).prop('checked', false);
20                 });
21             }
22         }
23         $(document).ready(function(){
24             $(".skipday").on("change",function(){
25                 Check_boxes( $(this).data("dow"));
26             });
27         });
28         //]]>
29         </script>
30         <p><em>
31             If there is a day (or more) in the week where issues are never
32             published, you can check corresponding boxes below.
33         </em></p>
34         <input type="checkbox" id="monday" data-dow="1" class="skipday" />
35         <label for="monday">Monday</label>
36         <input type="checkbox" id="tuesday" data-dow="2" class="skipday" />
37         <label for="tuesday">Tuesday</label>
38         <input type="checkbox" id="wednesday" data-dow="3" class="skipday" />
39         <label for="wednesday">Wednesday</label>
40         <input type="checkbox" id="thursday" data-dow="4" class="skipday" />
41         <label for="thursday">Thursday</label>
42         <input type="checkbox" id="friday" data-dow="5" class="skipday" />
43         <label for="friday">Friday</label>
44         <input type="checkbox" id="saturday" data-dow="6" class="skipday" />
45         <label for="saturday">Saturday</label>
46         <input type="checkbox" id="sunday" data-dow="7" class="skipday" />
47         <label for="sunday">Sunday</label>
48     [% END %]
49 [% END %]
50 [% IF (predictions_loop) %]
51 <table id="predictionst">
52   <thead>
53     <tr>
54       <th>Number</th>
55       <th>Publication date</th>
56       [% IF (ask_for_irregularities) %]
57       <th>Not published</th>
58       [% END %]
59     </tr>
60   </thead>
61   <tbody>
62     [% FOREACH prediction IN predictions_loop %]
63       <tr>
64         <td>
65             [% IF ( matches = prediction.number.match('(.*)Spring(.*)') ) %]
66                 [% matches.0 %]Spring[% matches.1 %]
67             [% ELSIF ( matches = prediction.number.match('(.*)Summer(.*)') ) %]
68                 [% matches.0 %]Summer[% matches.1 %]
69             [% ELSIF ( matches = prediction.number.match('(.*)Fall(.*)') ) %]
70                 [% matches.0 %]Fall[% matches.1 %]
71             [% ELSIF ( matches = prediction.number.match('(.*)Winter(.*)') ) %]
72                 [% matches.0 %]Winter[% matches.1 %]
73             [% ELSE %]
74                 [% prediction.number %]
75             [% END %]
76         </td>
77         <td>
78           [% IF (prediction.publicationdate) %]
79             [% prediction.publicationdate | $KohaDates %]
80           [% ELSE %]
81             unknown
82           [% END %]
83         </td>
84         [% IF (ask_for_irregularities) %]
85          <td style="text-align:center">
86          [% UNLESS (loop.first) %]
87           [% IF (prediction.not_published) %]
88             <input type="checkbox" name="irregularity" value="[% prediction.issuenumber %]" data-dow="[% prediction.dow %]" checked="checked" />
89           [% ELSE %]
90             <input type="checkbox" name="irregularity" value="[% prediction.issuenumber %]" data-dow="[% prediction.dow %]" />
91           [% END %]
92          </td>
93          [% END %]
94         [% END %]
95       </tr>
96     [% END %]
97   </tbody>
98 </table>
99 [% END %]