Bug 10855: (follow-up) Search subscriptions by additional fields
[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>[% IF subscription.branchcode %][% Branches.GetName( subscription.branchcode ) %][% END %]</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             [% IF year.year == 'manage' %]
174                 <li><a href="#subscription-year-manage">Manage</a></li>
175             [% ELSE %]
176                 <li><a href="#subscription-year-[% year.year %]">[% year.year %]</a></li>
177             [% END %]
178         [% END %]
179     [% END %]
180 </ul>
181
182  [% FOREACH year IN years %]
183 <div id="subscription-year-[% year.year %]">
184     [% IF ( CAN_user_serials_receive_serials ) %]
185         <p>
186             <input type="submit" value="Edit serials" />&nbsp;
187             [% UNLESS subscription.closed %]
188                 <input type="button" value="Generate next" onclick="javascript:generateNext([% subscriptionidlist %])" />
189                 [% IF ( subscriptions.size == 1 and !serialsadditems ) %]&nbsp;<input type="button" value="Multi receiving" onclick="javascript:generateReceive([% subscriptionidlist %])" />[% END %]
190             [% END %]
191         </p>
192     [% END %]
193       <span class="checkall">
194         <a class="CheckAll" href="#" onclick="CheckAll('subscription-year-[% year.year %]'); return false;">Select all</a>
195       </span> |
196       <span class="clearall">
197         <a class="CheckNone" href="#" onclick="CheckNone('subscription-year-[% year.year %]'); return false;">Clear all</a>
198       </span>
199         <table class="subscription-year-table">
200           <thead>
201             <tr>
202                 [% IF ( CAN_user_serials_receive_serials ) %]<th>Edit</th>[% END %]
203 [% IF ( subscriptions.size > 1 ) %]
204                 <th># Subs</th>
205 [% END %]
206                 <th class="title-string">Date published
207                 </th>
208                 <th class="title-string">Date received
209                 </th>
210                 <th>Number
211                 </th>
212                 <th>Status
213                 </th>
214                 <th>Notes
215                 </th>
216                 <th>Library
217                 </th>
218                 [% IF ( routing ) %]<th>Routing</th>[% END %]
219             </tr>
220           </thead>
221           <tbody>
222       [% FOREACH serial IN year.serials %]
223     [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
224             [% IF ( CAN_user_serials_receive_serials ) %]
225                 <td>
226                   [% UNLESS CAN_user_serials_receive_serials %]
227                     disabled
228                   [% ELSE %]
229                     [% IF ( serial.subscriptionexpired ) %]
230                     <input type="checkbox" name="serialid" value="[% serial.serialid %]" disabled="disabled" />
231                     [% ELSE %]
232                       [% IF ( serial.checked ) %]
233                     <input type="checkbox" class="checkboxed" name="serialid" checked="checked" value="[% serial.serialid %]" />
234                       [% ELSE %]
235                     <input type="checkbox" class="checkboxed" name="serialid" value="[% serial.serialid %]" />
236                       [% END %]
237                     [% END %]
238                   [% END %]
239                 </td>
240             [% END %]
241 [% IF ( subscriptions.size > 1 ) %]
242                  <td><a href="serials-collection.pl?subscriptionid=[% serial.subscriptionid %]">[% serial.subscriptionid %]</a></td>
243 [% END %]
244                 <td>
245                     <span title="[% serial.publisheddate %]">
246                       [% IF serial.publisheddate %]
247                         [% serial.publisheddate | $KohaDates %]
248                       [% ELSE %]
249                         Unknown
250                       [% END %]
251                     </span>
252                 </td>
253                 <td>
254                     <span title="[% serial.planneddate %]">
255                       [% IF serial.planneddate %]
256                         [% serial.planneddate | $KohaDates %]
257                       [% ELSE %]
258                         Unknown
259                       [% END %]
260                     </span>
261                 </td>
262                 <td>
263                     [% IF ( matches = serial.serialseq.match('Spring(.*)') ) %]
264                         Spring[% matches.join("") %]
265                     [% ELSIF ( matches = serial.serialseq.match('Summer(.*)') ) %]
266                         Summer[% matches.join("") %]
267                     [% ELSIF ( matches = serial.serialseq.match('Fall(.*)') ) %]
268                         Fall[% matches.join("") %]
269                     [% ELSIF ( matches = serial.serialseq.match('Winter(.*)') ) %]
270                         Winter[% matches.join("") %]
271                     [% ELSE %]
272                         [% serial.serialseq %]
273                     [% END %]
274                 </td>
275                 <td>
276                     [% IF ( serial.status1 ) %]Expected[% END %]
277                     [% IF ( serial.status2 ) %]Arrived[% END %]
278                     [% IF ( serial.status3 ) %]Late[% END %]
279                     [% IF ( serial.status4 ) %]Missing[% END %]
280                     [% IF ( serial.status41 ) %]Missing (never received)[% END %]
281                     [% IF ( serial.status42 ) %]Missing (sold out)[% END %]
282                     [% IF ( serial.status43 ) %]Missing (damaged)[% END %]
283                     [% IF ( serial.status44 ) %]Missing (lost)[% END %]
284                     [% IF ( serial.status5 ) %]Not issued[% END %]
285                     [% IF ( serial.status6 ) %]Delete[% END %]
286                     [% IF ( serial.status7 ) %]Claimed[% END %]
287                     [% IF ( serial.status8 ) %]Stopped[% END %]
288                 </td>
289                 <td>
290                     [% serial.notes %]
291                 </td>
292                 <td>
293                     [% Branches.GetName( serial.branchcode ) %]
294                 </td>
295                 [% IF ( routing ) %]
296                 <td>
297                     <a href="" onclick="print_slip([% serial.subscriptionid |html %], '[% serial.serialseq.replace("'", "\\'") |html %] ([% serial.publisheddate | $KohaDates %])'); return false" >Print list</a>
298                 </td>
299                 [% END %]
300             </tr>
301           [% END %]
302         </tbody>
303       </table>
304     </div>
305     [% END %]
306   <input type="hidden" name="subscriptionid" value="[% subscriptionidlist %]" />
307
308 </div>
309 </form>
310 [% END %]
311
312 </div>
313 </div>
314
315 <div class="yui-b">
316 [% INCLUDE 'serials-menu.inc' %]
317 </div>
318 </div>
319 [% INCLUDE 'intranet-bottom.inc' %]