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