Bug 13618: Add html filters to all the variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / serials-collection.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE AuthorisedValues %]
4 [% USE Branches %]
5 [% USE KohaDates %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha &rsaquo; Serials &rsaquo; Serial collection information for [% bibliotitle | html %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 [% Asset.css("css/datatables.css") | $raw %]
11 </head>
12
13 <body id="ser_serials-collection" class="ser">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'serials-search.inc' %]
16
17 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Serial collection information for  <i>[% bibliotitle | html %]</i></div>
18
19 <div id="doc3" class="yui-t2">
20    
21    <div id="bd">
22         <div id="yui-main">
23         <div class="yui-b">
24
25     [% INCLUDE 'modals/serials_multi_receiving.inc' %]
26
27 [% UNLESS ( popup ) %]
28         [% INCLUDE 'serials-toolbar.inc' %]
29
30         <h1>Serial collection information for  <i>[% bibliotitle | html %]</i>
31         [% IF location %] ([% AuthorisedValues.GetByCode( 'LOC', location ) | html %]) [% END %]
32                 [% IF ( callnumber ) %]callnumber: [% callnumber | html %][% END %]</h1>
33 [% END %]
34
35 [% IF ( subscriptions ) %]
36 <table>
37 [% IF ( subscriptions.size == 1 ) %]
38 <caption> Subscription summary</caption>
39 [% ELSE %]
40 <caption> Subscription summaries</caption>
41 [% END %]
42 <tr>
43   <th>Subscription num.</th>
44   <th>Frequency</th>
45   <th>Numbering pattern</th>
46   <th>Library</th>
47   <th>Call number</th>
48   <th>Notes</th>
49   <th>&nbsp;</th>
50 </tr>
51 [% FOREACH subscription IN subscriptions %]
52     <tr>
53         <td><a href="subscription-detail.pl?subscriptionid=[% subscription.subscriptionid | html %]"># [% subscription.subscriptionid | html %]</a> </td>
54         <td>[% subscription.frequency.description | html %]</td>
55         <td>[% subscription.numberpattern.label | html %]</td>
56         <td>[% IF subscription.branchcode %][% Branches.GetName( subscription.branchcode ) | html %][% END %]</td>
57         <td> [% subscription.callnumber | html %]</td>
58         <td> [% subscription.notes | html %]
59             [% UNLESS subscription.closed %]
60                 [% IF ( subscription.subscriptionexpired ) %]
61                     <br /><span class="problem"> Subscription expired</span>
62                 [% END %]
63             [% ELSE %]
64                 <br /> Subscription closed
65             [% END %]
66         </td>
67         [% IF ( subscription.abouttoexpire ) || ( subscription.subscriptionexpired ) %]<td class="problem actions">[% ELSE %]<td class="actions">[% END %]
68         [% UNLESS subscription.closed %]
69             [% IF ( routing && CAN_user_serials_routing ) %]
70                 [% IF ( subscription.hasRouting ) %]
71                     <a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid | html %]"><i class="fa fa-pencil"></i> Edit routing list</a>
72                 [% ELSE %]
73                     <a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid | html %]&amp;op=new"><i class="fa fa-plus"></i> Create routing list</a>
74                 [% END %]
75             [% END %]
76             [% IF ( subscription.abouttoexpire ) %]<a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid | html %]" onclick="popup([% subscription.subscriptionid | html %]); return false;"><i class="fa fa-refresh"></i> Renew</a>
77             [% ELSE %]
78                 [% IF ( subscription.subscriptionexpired ) %]<a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid | html %]" onclick="popup([% subscription.subscriptionid | html %]); return false;"><i class="fa fa-refresh"></i> Renew</a>
79                 [% ELSE %]
80                     &nbsp;
81                 [% END %]
82             [% END %]
83         [% ELSE %]
84             &nbsp;
85         [% END %]
86         </td>
87       </tr>
88 [% END %]
89 [% IF ( subscr ) %]
90 [% IF ( subscriptioncount > 1 ) %]
91 <tr ><td colspan="8">  <a href="serials-collection.pl?biblionumber=[% biblionumber | html %]">See any subscription attached to this biblio</a></td>
92 </tr>
93 [% END %]
94 [% END %]
95 </table>
96 [% END %]
97
98
99 [% IF ( years ) %]<form name="edition" action="serials-edit.pl" method="post">
100 <div id="subscription_years" class="toptabs numbered">
101 <ul>
102         [% FOREACH year IN years %]
103         [% IF ( year.year ) %]
104             [% IF year.year == 'manage' %]
105                 <li><a href="#subscription-year-manage">Manage</a></li>
106             [% ELSE %]
107                 <li><a href="#subscription-year-[% year.year | html %]">[% year.year | html %]</a></li>
108             [% END %]
109         [% END %]
110     [% END %]
111 </ul>
112
113  [% FOREACH year IN years %]
114 <div id="subscription-year-[% year.year | html %]">
115     [% IF ( CAN_user_serials_receive_serials ) %]
116         <p>
117             <div class="btn-group"><input type="submit" value="Edit serials" class="btn btn-default btn-sm" /></div>
118             [% UNLESS subscription.closed %]
119                 <div class="btn-group"><input type="button" value="Generate next" onclick="javascription:generateNext([% subscriptionidlist | html %])" class="btn btn-default btn-sm" /></div>
120                 [% IF ( subscriptions.size == 1 and !serialsadditems ) %]&nbsp;
121                     <div class="btn-group"><input type="button" value="Multi receiving" href="#multi_receiving" class="btn btn-default btn-sm" data-toggle="modal"></div>
122                 [% END %]
123             [% END %]
124         </p>
125     [% END %]
126       <span class="checkall">
127         <a class="CheckAll" href="#" onclick="CheckAll('subscription-year-[% year.year | html %]'); return false;">Select all</a>
128       </span> |
129       <span class="clearall">
130         <a class="CheckNone" href="#" onclick="CheckNone('subscription-year-[% year.year | html %]'); return false;">Clear all</a>
131       </span>
132         <table class="subscription-year-table">
133           <thead>
134             <tr>
135                 [% IF ( CAN_user_serials_receive_serials ) %]<th>Edit</th>[% END %]
136 [% IF ( subscriptions.size > 1 ) %]
137                 <th># Subs</th>
138 [% END %]
139                 <th class="title-string">Date published
140                 </th>
141                 <th class="title-string">Date published (text)
142                 </th>
143                 <th class="title-string">Date received
144                 </th>
145                 <th>Number
146                 </th>
147                 <th>Status
148                 </th>
149                 <th>Notes
150                 </th>
151                 <th>Library
152                 </th>
153                 [% IF ( routing ) %]<th>Routing</th>[% END %]
154             </tr>
155           </thead>
156           <tbody>
157       [% FOREACH serial IN year.serials %]
158         <tr>
159             [% IF ( CAN_user_serials_receive_serials ) %]
160                 <td>
161                   [% UNLESS CAN_user_serials_receive_serials %]
162                     disabled
163                   [% ELSE %]
164                     [% IF ( serial.subscriptionexpired ) %]
165                     <input type="checkbox" name="serialid" value="[% serial.serialid | html %]" disabled="disabled" />
166                     [% ELSE %]
167                       [% IF ( serial.checked ) %]
168                     <input type="checkbox" class="checkboxed" name="serialid" checked="checked" value="[% serial.serialid | html %]" />
169                       [% ELSE %]
170                     <input type="checkbox" class="checkboxed" name="serialid" value="[% serial.serialid | html %]" />
171                       [% END %]
172                     [% END %]
173                   [% END %]
174                 </td>
175             [% END %]
176 [% IF ( subscriptions.size > 1 ) %]
177                  <td><a href="serials-collection.pl?subscriptionid=[% serial.subscriptionid | html %]">[% serial.subscriptionid | html %]</a></td>
178 [% END %]
179                 <td>
180                     <span title="[% serial.publisheddate | html %]">
181                       [% IF serial.publisheddate %]
182                         [% serial.publisheddate | $KohaDates %]
183                       [% ELSE %]
184                         Unknown
185                       [% END %]
186                     </span>
187                 </td>
188                 <td>
189                    [% IF serial.publisheddatetext %]
190                       <span title="[% serial.publisheddatetext | html %]">
191                         [% serial.publisheddatetext | html %]
192                       </span>
193                    [% END %]
194                 </td>
195                 <td>
196                     <span title="[% serial.planneddate | html %]">
197                       [% IF serial.planneddate %]
198                         [% serial.planneddate | $KohaDates %]
199                       [% ELSE %]
200                         Unknown
201                       [% END %]
202                     </span>
203                 </td>
204                 <td>
205                     [% IF ( matches = serial.serialseq.match('(.*)Spring(.*)') ) %]
206                         [% matches.0 | html %]Spring[% matches.1 | html %]
207                     [% ELSIF ( matches = serial.serialseq.match('(.*)Summer(.*)') ) %]
208                         [% matches.0 | html %]Summer[% matches.1 | html %]
209                     [% ELSIF ( matches = serial.serialseq.match('(.*)Fall(.*)') ) %]
210                         [% matches.0 | html %]Fall[% matches.1 | html %]
211                     [% ELSIF ( matches = serial.serialseq.match('(.*)Winter(.*)') ) %]
212                         [% matches.0 | html %]Winter[% matches.1 | html %]
213                     [% ELSIF ( matches = prediction.number.match('(.*)Spr(.*)') ) %]
214                         [% matches.0 | html %]Spr[% matches.1 | html %]
215                     [% ELSIF ( matches = prediction.number.match('(.*)Sum(.*)') ) %]
216                         [% matches.0 | html %]Sum[% matches.1 | html %]
217                     [% ELSIF ( matches = prediction.number.match('(.*)Fal(.*)') ) %]
218                         [% matches.0 | html %]Fal[% matches.1 | html %]
219                     [% ELSIF ( matches = prediction.number.match('(.*)Win(.*)') ) %]
220                         [% matches.0 | html %]Win[% matches.1 | html %]
221                     [% ELSE %]
222                         [% serial.serialseq | html %]
223                     [% END %]
224                 </td>
225                 <td>
226                     [% IF ( serial.status1 ) %]Expected[% END %]
227                     [% IF ( serial.status2 ) %]Arrived[% END %]
228                     [% IF ( serial.status3 ) %]Late[% END %]
229                     [% IF ( serial.status4 ) %]Missing[% END %]
230                     [% IF ( serial.status41 ) %]Missing (never received)[% END %]
231                     [% IF ( serial.status42 ) %]Missing (sold out)[% END %]
232                     [% IF ( serial.status43 ) %]Missing (damaged)[% END %]
233                     [% IF ( serial.status44 ) %]Missing (lost)[% END %]
234                     [% IF ( serial.status5 ) %]Not issued[% END %]
235                     [% IF ( serial.status6 ) %]Delete[% END %]
236                     [% IF ( serial.status7 ) %]Claimed[% END %]
237                     [% IF ( serial.status8 ) %]Stopped[% END %]
238                 </td>
239                 <td>
240                     [% serial.notes | html %]
241                 </td>
242                 <td>
243                     [% Branches.GetName( serial.branchcode ) | html %]
244                 </td>
245                 [% IF ( routing ) %]
246                 <td class="actions">
247                     <a href="" onclick="print_slip([% serial.subscriptionid | html %], '[% serial.serialseq.replace("'", "\\'") | html %] ([% serial.publisheddate | $KohaDates %])'); return false" class="btn btn-default btn-xs"><i class="fa fa-print"></i> Print list</a>
248                 </td>
249                 [% END %]
250             </tr>
251           [% END %]
252         </tbody>
253       </table>
254     </div>
255     [% END %]
256   <input type="hidden" name="subscriptionid" value="[% subscriptionidlist | html %]" />
257
258 </div>
259 </form>
260 [% END %]
261
262 </div>
263 </div>
264
265 <div class="yui-b">
266 [% INCLUDE 'serials-menu.inc' %]
267 </div>
268 </div>
269
270 [% MACRO jsinclude BLOCK %]
271     [% INCLUDE 'datatables.inc' %]
272     <script type="text/javascript">
273         var subscriptionid = "[% subscriptionid | html %]";
274         var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?");
275         var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?");
276         var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
277     </script>
278     [% Asset.js("js/serials-toolbar.js") | $raw %]
279     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
280
281     <script type="text/javascript">
282
283         function print_slip(subscriptionid,issue){
284             var myurl = 'routing-preview.pl?ok=1&subscriptionid='+subscriptionid+'&issue='+issue;
285             window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
286         }
287
288         function popup(subscriptionid) {
289             newin=window.open('subscription-renew.pl?mode=popup&subscriptionid='+subscriptionid,'popup','width=500,height=400,toolbar=false,scrollbars=yes');
290         }
291
292         function generateNext(subscriptionid) {
293             if(confirm(_("Do you really want to generate next serial?"))){
294                 document.location = 'serials-collection.pl?op=gennext&subscriptionid='+subscriptionid;
295             }
296         }
297
298         function CheckAll( node ) {
299             $("#"+node).checkCheckboxes();
300             return false;
301         }
302         function CheckNone( node ) {
303             $("#"+node).unCheckCheckboxes();
304             return false;
305         }
306         $(document).ready(function() {
307             $('#subscription_years').tabs();
308             $(".subscription-year-table").dataTable($.extend(true, {}, dataTablesDefaults, {
309                 "aoColumnDefs": [
310                     { "aTargets": [ 0,-1 ], "bSortable": false, "bSearchable": false },
311                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
312                 ],
313                 "aaSorting": [[0, 'desc']],
314                 "sDom": 't',
315                 "bAutoWidth": false,
316                 "bPaginate": false,
317                 "bInfo": false,
318                 "bFilter": false,
319             } ));
320
321             $('#multi_receiving').on('show', function () {
322                $(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML);
323             });
324
325             $("form[name='edition']").on('submit', function(e){
326                 if ( $(this).find("input[name='serialid']:checked").size() == 0 ) {
327                     e.preventDefault();
328                     alert(_("You must select at least one serial to edit"));
329                     return 0;
330                 }
331                 return 1;
332             });
333         });
334
335     </script>
336 [% END %]
337
338 [% INCLUDE 'intranet-bottom.inc' %]