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