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