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