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