Bug 18327: Same change for serials-edit
[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     [% INCLUDE 'modals/serials_multi_receiving.inc' %]
25
26 [% UNLESS ( popup ) %]
27         [% INCLUDE 'serials-toolbar.inc' %]
28
29         <h1>Serial collection information for  <i>[% bibliotitle %]</i>
30         [% IF location %] ([% AuthorisedValues.GetByCode( 'LOC', location ) %]) [% END %]
31                 [% IF ( callnumber ) %]callnumber: [% callnumber %][% END %]</h1>
32 [% END %]
33
34 [% IF ( subscriptions ) %]
35 <table>
36 [% IF ( subscriptions.size == 1 ) %]
37 <caption> Subscription summary</caption>
38 [% ELSE %]
39 <caption> Subscription summaries</caption>
40 [% END %]
41 <tr>
42   <th>Subscription num.</th>
43   <th>Frequency</th>
44   <th>Numbering pattern</th>
45   <th>Library</th>
46   <th>Call number</th>
47   <th>Notes</th>
48   <th>&nbsp;</th>
49 </tr>
50 [% FOREACH subscription IN subscriptions %]
51     <tr>
52         <td><a href="subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]"># [% subscription.subscriptionid %]</a> </td>
53         <td>[% subscription.frequency.description %]</td>
54         <td>[% subscription.numberpattern.label %]</td>
55         <td>[% IF subscription.branchcode %][% Branches.GetName( subscription.branchcode ) %][% END %]</td>
56         <td> [% subscription.callnumber %]</td>
57         <td> [% subscription.notes %]
58             [% UNLESS subscription.closed %]
59                 [% IF ( subscription.subscriptionexpired ) %]
60                     <br /><span class="problem"> Subscription expired</span>
61                 [% END %]
62             [% ELSE %]
63                 <br /> Subscription closed
64             [% END %]
65         </td>
66         [% IF ( subscription.abouttoexpire ) || ( subscription.subscriptionexpired ) %]<td class="problem actions">[% ELSE %]<td class="actions">[% END %]
67         [% UNLESS subscription.closed %]
68             [% IF ( routing && CAN_user_serials_routing ) %]
69                 [% IF ( subscription.hasRouting ) %]
70                     <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>
71                 [% ELSE %]
72                     <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>
73                 [% END %]
74             [% END %]
75             [% 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>
76             [% ELSE %]
77                 [% 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>
78                 [% ELSE %]
79                     &nbsp;
80                 [% END %]
81             [% END %]
82         [% ELSE %]
83             &nbsp;
84         [% END %]
85         </td>
86       </tr>
87 [% END %]
88 [% IF ( subscr ) %]
89 [% IF ( subscriptioncount > 1 ) %]
90 <tr ><td colspan="8">  <a href="serials-collection.pl?biblionumber=[% biblionumber %]">See any subscription attached to this biblio</a></td>
91 </tr>
92 [% END %]
93 [% END %]
94 </table>
95 [% END %]
96
97
98 [% IF ( years ) %]<form name="edition" action="serials-edit.pl" method="post">
99 <div id="subscription_years" class="toptabs numbered">
100 <ul>
101         [% FOREACH year IN years %]
102         [% IF ( year.year ) %]
103             [% IF year.year == 'manage' %]
104                 <li><a href="#subscription-year-manage">Manage</a></li>
105             [% ELSE %]
106                 <li><a href="#subscription-year-[% year.year %]">[% year.year %]</a></li>
107             [% END %]
108         [% END %]
109     [% END %]
110 </ul>
111
112  [% FOREACH year IN years %]
113 <div id="subscription-year-[% year.year %]">
114     [% IF ( CAN_user_serials_receive_serials ) %]
115         <p>
116             <div class="btn-group"><input type="submit" value="Edit serials" class="btn btn-default btn-sm" /></div>
117             [% UNLESS subscription.closed %]
118                 <div class="btn-group"><input type="button" value="Generate next" onclick="javascription:generateNext([% subscriptionidlist %])" class="btn btn-default btn-sm" /></div>
119                 [% IF ( subscriptions.size == 1 and !serialsadditems ) %]&nbsp;
120                     <div class="btn-group"><a href="#multi_receiving" role="button" class="btn btn-default btn-sm" data-toggle="modal"><i class="fa fa-plus"></i> Multi receiving</a></div>
121                 [% END %]
122             [% END %]
123         </p>
124     [% END %]
125       <span class="checkall">
126         <a class="CheckAll" href="#" onclick="CheckAll('subscription-year-[% year.year %]'); return false;">Select all</a>
127       </span> |
128       <span class="clearall">
129         <a class="CheckNone" href="#" onclick="CheckNone('subscription-year-[% year.year %]'); return false;">Clear all</a>
130       </span>
131         <table class="subscription-year-table">
132           <thead>
133             <tr>
134                 [% IF ( CAN_user_serials_receive_serials ) %]<th>Edit</th>[% END %]
135 [% IF ( subscriptions.size > 1 ) %]
136                 <th># Subs</th>
137 [% END %]
138                 <th class="title-string">Date published
139                 </th>
140                 <th class="title-string">Date published (text)
141                 </th>
142                 <th class="title-string">Date received
143                 </th>
144                 <th>Number
145                 </th>
146                 <th>Status
147                 </th>
148                 <th>Notes
149                 </th>
150                 <th>Library
151                 </th>
152                 [% IF ( routing ) %]<th>Routing</th>[% END %]
153             </tr>
154           </thead>
155           <tbody>
156       [% FOREACH serial IN year.serials %]
157         <tr>
158             [% IF ( CAN_user_serials_receive_serials ) %]
159                 <td>
160                   [% UNLESS CAN_user_serials_receive_serials %]
161                     disabled
162                   [% ELSE %]
163                     [% IF ( serial.subscriptionexpired ) %]
164                     <input type="checkbox" name="serialid" value="[% serial.serialid %]" disabled="disabled" />
165                     [% ELSE %]
166                       [% IF ( serial.checked ) %]
167                     <input type="checkbox" class="checkboxed" name="serialid" checked="checked" value="[% serial.serialid %]" />
168                       [% ELSE %]
169                     <input type="checkbox" class="checkboxed" name="serialid" value="[% serial.serialid %]" />
170                       [% END %]
171                     [% END %]
172                   [% END %]
173                 </td>
174             [% END %]
175 [% IF ( subscriptions.size > 1 ) %]
176                  <td><a href="serials-collection.pl?subscriptionid=[% serial.subscriptionid %]">[% serial.subscriptionid %]</a></td>
177 [% END %]
178                 <td>
179                     <span title="[% serial.publisheddate %]">
180                       [% IF serial.publisheddate %]
181                         [% serial.publisheddate | $KohaDates %]
182                       [% ELSE %]
183                         Unknown
184                       [% END %]
185                     </span>
186                 </td>
187                 <td>
188                    [% IF serial.publisheddatetext %]
189                       <span title="[% serial.publisheddatetext %]">
190                         [% serial.publisheddatetext %]
191                       </span>
192                    [% END %]
193                 </td>
194                 <td>
195                     <span title="[% serial.planneddate %]">
196                       [% IF serial.planneddate %]
197                         [% serial.planneddate | $KohaDates %]
198                       [% ELSE %]
199                         Unknown
200                       [% END %]
201                     </span>
202                 </td>
203                 <td>
204                     [% IF ( matches = serial.serialseq.match('(.*)Spring(.*)') ) %]
205                         [% matches.0 %]Spring[% matches.1 %]
206                     [% ELSIF ( matches = serial.serialseq.match('(.*)Summer(.*)') ) %]
207                         [% matches.0 %]Summer[% matches.1 %]
208                     [% ELSIF ( matches = serial.serialseq.match('(.*)Fall(.*)') ) %]
209                         [% matches.0 %]Fall[% matches.1 %]
210                     [% ELSIF ( matches = serial.serialseq.match('(.*)Winter(.*)') ) %]
211                         [% matches.0 %]Winter[% matches.1 %]
212                     [% ELSIF ( matches = prediction.number.match('(.*)Spr(.*)') ) %]
213                         [% matches.0 %]Spr[% matches.1 %]
214                     [% ELSIF ( matches = prediction.number.match('(.*)Sum(.*)') ) %]
215                         [% matches.0 %]Sum[% matches.1 %]
216                     [% ELSIF ( matches = prediction.number.match('(.*)Fal(.*)') ) %]
217                         [% matches.0 %]Fal[% matches.1 %]
218                     [% ELSIF ( matches = prediction.number.match('(.*)Win(.*)') ) %]
219                         [% matches.0 %]Win[% matches.1 %]
220                     [% ELSE %]
221                         [% serial.serialseq %]
222                     [% END %]
223                 </td>
224                 <td>
225                     [% IF ( serial.status1 ) %]Expected[% END %]
226                     [% IF ( serial.status2 ) %]Arrived[% END %]
227                     [% IF ( serial.status3 ) %]Late[% END %]
228                     [% IF ( serial.status4 ) %]Missing[% END %]
229                     [% IF ( serial.status41 ) %]Missing (never received)[% END %]
230                     [% IF ( serial.status42 ) %]Missing (sold out)[% END %]
231                     [% IF ( serial.status43 ) %]Missing (damaged)[% END %]
232                     [% IF ( serial.status44 ) %]Missing (lost)[% END %]
233                     [% IF ( serial.status5 ) %]Not issued[% END %]
234                     [% IF ( serial.status6 ) %]Delete[% END %]
235                     [% IF ( serial.status7 ) %]Claimed[% END %]
236                     [% IF ( serial.status8 ) %]Stopped[% END %]
237                 </td>
238                 <td>
239                     [% serial.notes %]
240                 </td>
241                 <td>
242                     [% Branches.GetName( serial.branchcode ) %]
243                 </td>
244                 [% IF ( routing ) %]
245                 <td class="actions">
246                     <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>
247                 </td>
248                 [% END %]
249             </tr>
250           [% END %]
251         </tbody>
252       </table>
253     </div>
254     [% END %]
255   <input type="hidden" name="subscriptionid" value="[% subscriptionidlist %]" />
256
257 </div>
258 </form>
259 [% END %]
260
261 </div>
262 </div>
263
264 <div class="yui-b">
265 [% INCLUDE 'serials-menu.inc' %]
266 </div>
267 </div>
268
269 [% MACRO jsinclude BLOCK %]
270     [% INCLUDE 'datatables.inc' %]
271     <script type="text/javascript">
272         var subscriptionid = "[% subscriptionid %]";
273         var MSG_CLOSE_SUBSCRIPTION = _("Are you sure you want to close this subscription?");
274         var MSG_REOPEN_SUBSCRIPTION = _("Are you sure you want to reopen this subscription?");
275         var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
276     </script>
277     [% Asset.js("js/serials-toolbar.js") %]
278     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") %]
279
280     <script type="text/javascript">
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             $('#multi_receiving').on('show', function () {
321                $(this).find(".modal-body").html($(".serials_multi_receiving")[0].outerHTML);
322             });
323         });
324
325     </script>
326 [% END %]
327
328 [% INCLUDE 'intranet-bottom.inc' %]