partial fix for bug 1891
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / reserve / request.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Circulation &rsaquo; Holds &rsaquo; Place a hold on <!-- TMPL_VAR NAME="title" --></title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <script type="text/javascript">
5 // <![CDATA[ 
6 function check() {
7         var msg = "";
8         var count_reserv = 0;
9         var alreadyreserved = 0;
10
11 // check if we have checkitem form
12 if (document.form.checkitem){
13         for (i=0;i<document.form.checkitem.length;i++){
14                 if (document.form.checkitem[i].checked == true) {
15                                 count_reserv++ ;
16                         }
17         }
18         // for only one item, check the checkitem without consider the loop checkitem
19         if (i==0){
20                 if (document.form.checkitem.checked == true) {
21                         count_reserv++;
22                 }
23         }
24 }
25
26 if (document.form.request.checked == true){
27                 count_reserv++ ;
28 }
29
30 if (document.form.alreadyreserved.value == "1"){
31                  alreadyreserved++ ;
32 }
33
34 if (count_reserv == "0"){
35                 msg += ("- Please select an item to place a hold\n");
36 }
37 if (count_reserv >= "2"){
38                 msg += ("- You may only place a hold on one item at a time\n");
39 }
40
41 if (alreadyreserved > "0"){
42                 msg += ("- This patron had already placed a hold on this item\n Please cancel the previous hold first \n");
43 }
44
45         if (msg == "") return(true);
46         else    {
47                 alert(msg);
48                 return(false);
49         }
50 }
51
52  $(document).ready(function() {
53         $("#requestany").click(function() {
54                 if(this.checked){
55                 $("input[@name=checkitem]").each(function() {
56                         $(this).attr("checked","");
57                 });
58                 }
59         });
60         $("input[@name=checkitem]").click(function() {
61                 onechecked = 0;
62                 $("input[@name=checkitem]").each(function() {
63                         if(this.checked){
64                                 onechecked = 1;
65                         }
66                 });
67                 if(onechecked == 1){
68                         $("#requestany").attr("checked","");
69                 } else {
70                         $("#requestany").attr("checked","checked");
71                 }
72         });
73  });
74
75 // ]]>
76 </script>
77 </head>
78 <body>
79 <!-- TMPL_INCLUDE NAME="header.inc" -->
80 <!-- TMPL_INCLUDE NAME="circ-search.inc" -->
81
82 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalogue</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a> &rsaquo; Place a hold on <!-- TMPL_VAR NAME="title" --></div>
83
84  <div id="doc3" class="yui-t2">
85
86    <div id="bd">
87         <div id="yui-main">
88         <div class="yui-b">
89 <!-- TMPL_IF NAME="noitems" -->
90 <div class="dialog alert">            
91 <strong>Cannot reserve:</strong> this record has no items attached.                            
92 </div>
93 <!-- TMPL_ELSE -->
94 <!-- TMPL_IF NAME="messagetransfert" -->
95                 <div class="dialog message">
96                                 <h2>Hold found for (<!-- TMPL_VAR NAME="nextreservtitle" -->), please transfer</h2>
97                         <p>Hold placed by : <strong> <!-- TMPL_VAR NAME="nextreservsurname" --> <!-- TMPL_VAR NAME="nextreservfirstname" --></strong> at : <strong> <!-- TMPL_VAR NAME="branchname" --> </strong>, Please transfer this item.
98                         </p>
99                         <form name="cancelReservewithtransfert" action="branchreserves.pl" method="post">
100                                 <input type="submit" class="button" />
101                         </form>
102                 </div>
103         <!-- /TMPL_IF -->
104 <h1>Place a hold on <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a></h1>
105
106 <!-- TMPL_UNLESS NAME="cardnumber"-->
107     <!-- TMPL_IF NAME="messageborrower" -->                                    
108       <div class="dialog alert"><h3>Patron Not Found</h3><p>No patron with this name, Please, try another</p> </div>    
109     <!-- /TMPL_IF -->
110     <form action="request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" method="post">
111         <!-- TMPL_UNLESS name="CGIselectborrower" -->
112                         <fieldset class="brief">
113                         <label for="patron">Patron: </label>
114                                 <div class="hint">Enter patron card number or partial name:</div>
115                 <input type="text" size="20" id="patron" class="focus" name="findborrower" /> 
116                 <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber"-->" />
117                 <input type="submit" value="Search" />
118                         </fieldset>
119         <!-- TMPL_ELSE -->
120             <!-- TMPL_VAR NAME="CGIselectborrower" -->
121                 <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber"-->" />
122                 <input type="submit" value="Select" />
123         <!-- /TMPL_UNLESS -->
124     </form>
125 <!-- TMPL_ELSE -->
126
127 <!-- TMPL_IF NAME="warnings" -->
128     <div class="dialog alert">
129         <h3>Cannot Place Hold</h3>
130         <ul>
131 <!-- TMPL_IF NAME="maxreserves" -->
132       <li><strong>Too Many Holds: </strong> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="borrowerfirstname" --> <!-- TMPL_VAR NAME="borrowersurname" --> </a> has too many holds.</li>
133     <!-- /TMPL_IF -->
134
135     <!-- TMPL_IF NAME="alreadyreserved" -->
136      <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="borrowerfirstname" --> <!-- TMPL_VAR NAME="borrowersurname" --> </a> <strong>already has a hold</strong> on this item </li>
137     <!-- /TMPL_IF -->
138         </ul></div>
139 <!-- /TMPL_IF -->       
140
141 <!-- TMPL_IF NAME="messages" -->
142     <div class="dialog message"><ul>
143     <!-- TMPL_IF NAME="expiry" -->
144       <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="borrowerfirstname" --> <!-- TMPL_VAR NAME="borrowersurname" --> </a>'s <strong>account has expired</strong></li>
145     <!-- /TMPL_IF -->
146
147 <!-- TMPL_IF NAME="diffbranch" --><h3>Branch Mismatch</h3>
148       <li> <strong>Pickup library is different</strong> than <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="borrowerfirstname" --> <!-- TMPL_VAR NAME="borrowersurname" --> </a>'s home library</li>
149     <!-- /TMPL_IF -->
150 </ul></div>
151 <!-- /TMPL_IF -->
152
153   <!-- TMPL_IF NAME="messageborrower" -->
154    <div class="dialog alert"><h3>Patron not found:</h3> <p>Name or barcode not found. Please try an other </p></div>
155   <!-- /TMPL_IF -->
156   
157   <fieldset class="rows left">
158     <legend>Hold details</legend>
159         <form action="placerequest.pl" method="post" onsubmit="return check();" name="form">
160     
161         <input type="hidden" size="10" name="member" value="<!--  TMPL_VAR NAME="cardnumber" -->" />
162         <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
163         <input type="hidden" name="type" value="str8" />
164         <input type="hidden" name="title" value="<!-- TMPL_VAR NAME="title" -->" />
165         <input type="hidden" name="rank-request" value="<!-- TMPL_VAR NAME="fixedRank" -->" />
166        <ol> <li><span class="label">Patron:</span>
167             <!-- TMPL_IF NAME="cardnumber"-->
168                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="borrowerfirstname" --> <!-- TMPL_VAR NAME="borrowersurname" --> (<!--  TMPL_VAR NAME="cardnumber" -->)</a>
169             <!-- TMPL_ELSE -->
170                 Not defined yet
171             <!-- /TMPL_IF -->
172         </li>
173         <li>
174         <span class="label">Priority:</span>
175             <strong><!-- TMPL_VAR Name="fixedRank" --></strong>
176         </li>
177         <li>
178             <label for="holdnotes">Notes:</label>
179             <textarea id="holdnotes" name="notes" cols="30" rows="1"></textarea>
180         </li>
181         <li>
182             <label for="pickup">Pickup at:</label>
183             <!-- TMPL_VAR NAME="CGIbranch" -->
184         </li>
185
186         <li> <label for="requestany">Place a hold on the next available copy </label>
187                <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
188         </li>
189
190         <input type="hidden" name="biblioitem" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->" />
191         <input type="hidden" name="alreadyreserved" value="<!-- TMPL_VAR NAME="alreadyreserved" -->" />
192 </ol>
193         <fieldset class="action">
194         <!-- TMPL_IF NAME="cardnumber"-->
195         <input type="submit" value="Place Hold" />
196         <!-- /TMPL_IF -->
197         </fieldset>
198         <!-- TMPL_LOOP name="bibitemloop" -->
199 <ol>
200         <!-- TMPL_UNLESS NAME="item-level_itypes" -->
201         <li><span class="label">Item type:</span> <!-- TMPL_VAR NAME="description" --></li>
202         <!-- /TMPL_UNLESS -->
203         <!-- TMPL_IF NAME="publicationyear" --><li><span class="label">Publication year:</span> <!-- TMPL_VAR NAME="publicationyear" --></li><!-- /TMPL_IF -->
204 </ol>
205          
206         <table id="requestspecific">
207         <caption>Place a hold on a specific copy</caption>
208                 <tr>
209             <!-- TMPL_IF NAME="item-level_itypes" -->
210             <th>Hold</th>
211             <th>Item type</th>
212             <!-- /TMPL_IF -->
213             <th>Barcode</th>
214             <th>Home Library</th>
215             <th>Last Location</th>
216             <th>Call number</th>
217             <th>Information</th>
218         </tr>
219     <!-- TMPL_LOOP Name="itemloop" -->
220         <tr class="<!-- TMPL_VAR NAME="backgroundcolor" -->">
221             <!-- TMPL_IF NAME="item-level_itypes" -->
222             <td>
223             <!-- TMPL_IF NAME="available" -->
224             <input type="checkbox" name="checkitem" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
225             <!-- TMPL_ELSE -->
226             <input disabled="disabled" type="checkbox" name="checkitem" value="<!-- TMPL_VAR NAME="itemnumber" -->" /> 
227             <!-- /TMPL_IF -->
228             </td>
229
230             <td>
231             <img src="<!-- TMPL_VAR name="imageurl" -->" alt="<!-- TMPL_VAR NAME="itypename" -->" title="<!-- TMPL_VAR NAME="itypename" -->" />
232             </td>
233             <!-- /TMPL_IF -->
234
235             <td>
236                     <!-- TMPL_VAR NAME="barcode" --> 
237             </td>
238             <td>
239             <!-- TMPL_VAR NAME="homebranchname" -->
240             </td>
241             <td>
242             <!-- TMPL_VAR NAME="holdingbranchname" -->
243             </td>
244             <td>
245             <!-- TMPL_VAR NAME="itemcallnumber" -->
246             </td>
247             <td>
248                 <!-- TMPL_IF Name="onloan" -->
249             <span class="checkedout">Due <!-- TMPL_VAR NAME="onloan" --></span>
250                         <!-- TMPL_ELSE -->
251                 <!-- TMPL_IF Name="transfertwhen" -->
252             In transit from <!-- TMPL_VAR NAME="transfertfrom" -->,
253             to <!-- TMPL_VAR NAME="transfertto" -->, since <!-- TMPL_VAR NAME="transfertwhen" -->
254                 <!-- /TMPL_IF -->
255                 <!-- /TMPL_IF -->
256     
257                 <!-- TMPL_IF Name="message" -->
258             Unavailable (lost or missing)
259                 <!-- /TMPL_IF -->
260     
261                 <!-- TMPL_IF Name="notforloan" -->
262             Not for loan (<!-- TMPL_VAR NAME="notforloanvalue" -->)
263                 <!-- /TMPL_IF -->
264
265             <!-- TMPL_IF NAME="reservedate"-->
266                     <!-- TMPL_IF NAME="nocancel" -->
267                             Can't be cancelled when item is in transit
268                     <!-- TMPL_ELSE -->
269                     <!-- TMPL_IF NAME="waitingdate" -->Waiting<!-- TMPL_ELSE -->On hold<!-- /TMPL_IF -->
270                     <!-- TMPL_IF NAME="canreservefromotherbranches" -->for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="ReservedForBorrowernumber" -->"><!-- TMPL_VAR NAME="ReservedForFirstname" --> <!-- TMPL_VAR NAME="ReservedForSurname" --></a><!-- /TMPL_IF --> <!-- TMPL_IF NAME="waitingdate" -->at<!-- TMPL_ELSE -->expected at<!-- /TMPL_IF --> <!-- TMPL_VAR NAME="ExpectedAtLibrary" -->
271                     since
272                     <!-- TMPL_IF NAME="waitingdate" --><!-- TMPL_VAR NAME="waitingdate" --><!-- TMPL_ELSE --><!-- TMPL_IF name="reservedate" --><!-- TMPL_VAR NAME="reservedate" --><!-- /TMPL_IF --><!-- /TMPL_IF -->. <a class="info" href="modrequest.pl?CancelBiblioNumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;CancelBorrowerNumber=<!-- TMPL_VAR NAME="ReservedForBorrowernumber" -->&amp;CancelItemnumber=<!--  TMPL_VAR NAME="itemnumber"-->"  onclick="if (window.confirm('Are you sure you want to delete this hold?')) {return true;} else {return false;}">Cancel hold</a>
273
274                     <!-- /TMPL_IF -->
275             <!-- TMPL_ELSE -->
276                     Not on hold
277             <!-- /TMPL_IF -->
278             </td>
279         </tr>
280     <!-- /TMPL_LOOP --> <!-- itemloop -->
281         </table>
282     <!-- /TMPL_LOOP --> <!-- bibitemloop -->
283     
284     <fieldset class="action">
285     <!-- TMPL_IF NAME="cardnumber"-->
286         <input type="submit" value="Place Hold" />
287     <!-- /TMPL_IF -->
288     </fieldset>
289         </fieldset>
290     </form>
291 <!-- /TMPL_UNLESS -->
292
293 <!-- TMPL_UNLESS NAME="cardnumber" -->
294 <!-- TMPL_IF name="reserveloop" -->
295 <form name="T<!-- TMPL_VAR NAME="time" -->" action="modrequest.pl" method="post">
296 <fieldset class="rows left">
297 <legend>Existing holds</legend>
298     <table>
299       <tr>
300         <th>Priority</th>
301         <th>Patron</th>
302         <th>Notes</th>
303         <th>Date</th>
304         <th>Pick up Library</th>
305         <th>Details</th>
306       </tr>
307   <!-- TMPL_LOOP Name="reserveloop" -->
308       <tr>
309         <td>
310           <input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
311           <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
312           <select name="rank-request">
313     <!-- TMPL_IF Name="wait" -->
314             <option value="W" selected="selected">Waiting</option>
315     <!-- /TMPL_IF -->
316         <!-- TMPL_LOOP Name="optionloop" -->                 
317         <option value="<!-- TMPL_VAR NAME="num" -->" <!-- TMPL_IF Name="selected" --> selected <!-- /TMPL_IF -->><!-- TMPL_VAR NAME="num" --></option> 
318         <!-- /TMPL_LOOP -->  
319             <option value="del">del</option>
320           </select>
321         </td>
322         <td>
323           <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->" ><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></a>
324         </td>
325         <td><!-- TMPL_VAR NAME="notes" --></td>
326         <td><!-- TMPL_VAR NAME="date" --></td>
327         <td>
328     <!-- TMPL_IF Name="wait" -->
329         <!-- TMPL_IF NAME="atdestination" -->
330                 <!-- TMPL_IF name="found" -->
331                 Item waiting at <b> <!-- TMPL_VAR NAME="wbrname" --></b> <input type="hidden" name="pickup" value="<!-- TMPL_VAR NAME="wbrcode" -->" />
332             <!-- TMPL_ELSE -->
333                 Waiting to be pulled
334             <!-- /TMPL_IF -->
335           <!-- TMPL_ELSE -->
336             Item being transfered to <b> <!-- TMPL_VAR NAME="wbrname" --></b> <input type="hidden" name="pickup" value="<!-- TMPL_VAR NAME="wbrcode" -->" />
337          <!-- /TMPL_IF -->
338     <!-- TMPL_ELSE -->
339           <select name="pickup">
340       <!-- TMPL_LOOP Name="branchloop" -->
341         <!-- TMPL_IF Name="selected" -->
342             <option value="<!-- TMPL_VAR NAME="branch" -->" selected="selected">
343         <!-- TMPL_ELSE -->
344             <option value="<!-- TMPL_VAR NAME="branch" -->">
345         <!-- /TMPL_IF -->
346               <!-- TMPL_VAR NAME="branchname" -->
347             </option>
348       <!-- /TMPL_LOOP -->
349           </select>
350     <!-- /TMPL_IF -->
351         </td>
352         <td>
353     <!-- TMPL_IF Name="wait" -->
354           <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME='biblionumber' -->">
355                 <!-- TMPL_IF NAME="barcodenumber" -->
356                     <!-- TMPL_VAR NAME="barcodenumber" -->
357                     <input type="hidden" name="itemnumber" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
358                 <!-- TMPL_ELSE -->
359                     No Barcode
360                 <!-- /TMPL_IF -->
361           </a>
362     <!-- TMPL_ELSE -->
363       <!-- TMPL_IF Name="constrainttypea" -->
364           <i>Next available</i>
365       <!-- TMPL_ELSE -->
366         <!-- TMPL_IF Name="constrainttypeo" -->
367           only this type :<b><!-- TMPL_VAR NAME="volumeddesc" --> <!-- TMPL_VAR NAME="itemtype" --></b>
368         <!-- /TMPL_IF -->
369       <!-- /TMPL_IF -->
370     <!-- /TMPL_IF -->
371         </td>
372       </tr>
373   <!-- /TMPL_LOOP --> <!-- existing reserveloop -->
374      </table>
375 <fieldset class="action"><input type="submit" name="submit" value="Update hold(s)" /></fieldset>
376 </fieldset>
377 </form>
378 <!-- /TMPL_IF -->
379 <!-- /TMPL_UNLESS -->
380 <!-- /TMPL_IF -->
381 </div>
382 </div>
383
384 <div class="yui-b">
385 <!-- TMPL_INCLUDE NAME="biblio-view-menu.inc" -->
386
387 </div>
388 </div>
389 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->