Merge branch 'bug_9900' into 3.12-master
[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").attr("checked") == 'checked') {
14                 $("#predictionst :checkbox[data-dow='"+dow+"']").each(function(){
15                     $(this).attr('checked', true);
16                 });
17             } else {
18                 $("#predictionst :checkbox[data-dow='"+dow+"']").each(function(){
19                     $(this).attr('checked', false);
20                 });
21             }
22         }
23         //]]>
24         </script>
25         <p><em>
26             If there is a day (or more) in the week where issues are never
27             published, you can check corresponding boxes below.
28         </em></p>
29         <input type="checkbox" id="monday" data-dow="1" onchange="Check_boxes(1);" />
30         <label for="monday">Monday</label>
31         <input type="checkbox" id="tuesday" data-dow="2" onchange="Check_boxes(2);" />
32         <label for="tuesday">Tuesday</label>
33         <input type="checkbox" id="wednesday" data-dow="3" onchange="Check_boxes(3);" />
34         <label for="wednesday">Wednesday</label>
35         <input type="checkbox" id="thursday" data-dow="4" onchange="Check_boxes(4);" />
36         <label for="thursday">Thursday</label>
37         <input type="checkbox" id="friday" data-dow="5" onchange="Check_boxes(5);" />
38         <label for="friday">Friday</label>
39         <input type="checkbox" id="saturday" data-dow="6" onchange="Check_boxes(6);" />
40         <label for="saturday">Saturday</label>
41         <input type="checkbox" id="sunday" data-dow="7" onchange="Check_boxes(7);" />
42         <label for="sunday">Sunday</label>
43     [% END %]
44 [% END %]
45 [% IF (predictions_loop) %]
46 <table id="predictionst">
47   <thead>
48     <tr>
49       <th>Number</th>
50       <th>Publication Date</th>
51       [% IF (ask_for_irregularities) %]
52       <th>Not published</th>
53       [% END %]
54     </tr>
55   </thead>
56   <tbody>
57     [% FOREACH prediction IN predictions_loop %]
58       <tr>
59         <td>[% prediction.number %]</td>
60         <td>
61           [% IF (prediction.publicationdate) %]
62             [% prediction.publicationdate | $KohaDates %]
63           [% ELSE %]
64             unknown
65           [% END %]
66         </td>
67         [% IF (ask_for_irregularities) %]
68          <td style="text-align:center">
69          [% UNLESS (loop.first) %]
70           [% IF (prediction.not_published) %]
71             <input type="checkbox" name="irregularity" value="[% prediction.issuenumber %]" data-dow="[% prediction.dow %]" checked="checked" />
72           [% ELSE %]
73             <input type="checkbox" name="irregularity" value="[% prediction.issuenumber %]" data-dow="[% prediction.dow %]" />
74           [% END %]
75          </td>
76          [% END %]
77         [% END %]
78       </tr>
79     [% END %]
80   </tbody>
81 </table>
82 [% END %]