Syndetics: add fiction notes/title profile link
[koha.git] / koha-tmpl / opac-tmpl / prog / en / modules / opac-reserve.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_VAR NAME="LibraryNameTitle" DEFAULT="Koha Online" --> Catalog &rsaquo;  Reserving <!-- TMPL_VAR NAME="title" escape="html" --> for <!-- TMPL_LOOP NAME="USER_INFO" --><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --><!-- /TMPL_LOOP -->
2 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
3 <script type="text/javascript">
4 // <![CDATA[
5  var MSG_NO_COPY_SELECTED = _("Expecting a specific copy selection.");
6
7  function prefixOf (s, tok) {
8      var index = s.indexOf(tok);
9      return s.substring(0, index);
10  }
11  function suffixOf (s, tok) {
12      var index = s.indexOf(tok);
13      return s.substring(index + 1);
14  }
15
16  $(document).ready(function() {
17     var copiesRowId = null;
18     var wasSpecific = false;
19     var lastCopiesRowId = null;
20         $(".checkitem").parent().click(function(e){
21                 if(e.target.tagName.toLowerCase() == 'td'){
22            $(this).find("input.checkitem").each( function() {
23                $(this).attr('checked', !$(this).attr('checked'));
24                         });
25                 }
26         });
27     // Hides all 'specific copy' table rows on load.
28     $(".copiesrow").hide();
29
30     $("#place_on_hdr").show();
31     $(".place_on_type").show();
32
33     // Replace non-JS single-selection with multi-selection capability.
34     $(".reserve_mode").val("multi");
35     $(".confirm_nonjs").remove();
36     $(".confirmjs_hold").each(function(){
37         var bib = $(this).attr("title");
38         var html = "<input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
39         html += "value=\"" + bib + "\"/>";
40         $(this).html(html);
41     });
42     $(".confirmjs_nohold").each(function(){
43         var bib = $(this).attr("title");
44         var html = "<input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
45         html += "value=\"" + bib + "\"/>";
46         $(this).html(html);
47     });
48
49     // Make sure a specific item was selected where specified
50     // before moving on to a new item.
51     function changeSelection (newCopiesRowId, isSpecific) {
52         if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) {
53             var biblioNum = suffixOf(copiesRowId, "_");
54             
55             // If the 'specific copy' radio button was checked
56               if (wasSpecific && (copiesRowId != newCopiesRowId)) {
57                 // Find the selected copy
58                 var item = $(".checkitem_" + biblioNum + ":checked");
59                 if ($(item).size() == 0) {
60                     alert(MSG_NO_COPY_SELECTED);
61                     return false;
62                 }
63             }
64         }
65         copiesRowId = newCopiesRowId;
66         wasSpecific = isSpecific;
67         return true;
68     }
69
70     // When 'specific copy' radio button is clicked
71     $(".selectspecific").click(function() {
72
73         // Make sure all other specific copy table rows are hidden
74         biblioNum = suffixOf($(this).attr("id"), "_");
75         newCopiesRowId = "#copiesrow_" + biblioNum;
76
77         if (!changeSelection(newCopiesRowId, true)) {
78             return false;
79         }
80         $(".copiesrow:not(" + newCopiesRowId + ")").hide();
81         
82         // Show the specific copy table for this radio button.
83         $(newCopiesRowId).show();
84     });
85
86
87     // When 'first available' radion button is clicked
88     $(".selectany").click(function() {
89         // Make sure all other specific copy table rows are hidden
90         biblioNum = suffixOf($(this).attr("id"), "_");
91         newCopiesRowId = "#copiesrow_" + biblioNum;
92
93         if (!changeSelection(newCopiesRowId, false)) {
94             return false;
95         }
96
97         // Hide the copies table row
98         $(".copiesrow").hide();
99     });
100
101     // When 'Place Hold' button is clicked
102     $(".placehold").click(function(){
103         var biblionumbers = "";
104         var selections = "";
105
106         if ($(".confirmjs:checked").size() == 0) {
107             alert(MSG_NO_RECORD_SELECTED);
108             return false;
109         }
110
111         // Find the items with the 'Hold' box checked
112         var badBib = null;
113         $(".confirmjs:checked").each(function() {
114             var biblioNum = $(this).val();
115             biblionumbers += biblioNum + "/";
116             selections += biblioNum + "/";
117
118             // If the 'specific copy' radio button is checked
119             if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
120                 // Find the selected copy
121                 var item = $(".checkitem_" + biblioNum + ":checked");
122                 if ($(item).size() == 0) {
123                     badBib = biblioNum;
124                     return false;
125                 } else {
126                   selections += $(item).val();
127                 }
128             }
129             selections += "/";
130
131             // Add the pickup location
132             var branchSel = $("#branch_" + biblioNum);
133             if (branchSel.size() > 0) {
134                 selections += $(branchSel).val();
135             }
136             selections += "/";
137             return true;
138         });
139
140         if (badBib) {
141             alert(MSG_NO_COPY_SELECTED);
142             return false;
143         }
144
145         $("#selections").val(selections);
146         $("#biblionumbers").val(biblionumbers);
147
148         return true;
149     });
150
151  });
152 // ]]>
153 </script>
154 </head>
155
156 <body>
157   <div id="doc3" class="yui-t7">
158     <!--TMPL_INCLUDE NAME="masthead.inc" -->
159     <div id="bd">
160           <div id="yui-g">
161         <div id="holds" class="container">
162       
163           <!-- TMPL_IF NAME="message" -->
164             <!-- TMPL_IF NAME="GNA" -->
165               <div class="dialog alert">
166                 <strong>Sorry</strong>, you cannot place holds because the library doesn't have up-to-date <a href="/cgi-bin/koha/opac-userdetails.pl">contact information</a> on file.
167               </div>
168               <div class="dialog alert">Please contact your librarian, or use the <a href="/cgi-bin/koha/opac-userupdate.pl">online update form</a> to submit current information (<em>Please note:</em> there may be a delay in restoring your account if you submit online)
169               </div>
170             <!-- /TMPL_IF -->
171             <!-- TMPL_IF NAME="lost" -->
172               <div class="dialog alert">
173                 <strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.
174               </div>
175               <div class="dialog alert">If this is an error, please take your card to the circulation desk at your local library and the error will be corrected.
176               </div>
177             <!-- /TMPL_IF -->
178             <!-- TMPL_IF NAME="debarred" -->
179               <div class="dialog alert">
180                 <strong>Sorry</strong>, you cannot place holds because your account has been frozen.
181               </div>
182               <div class="dialog alert">Usually the reason for freezing an account is old overdues or damage fees.   If <a href="/cgi-bin/koha/opac-user.pl">your account page</a> shows your account to be clear, please consult a librarian.
183               </div>
184             <!-- /TMPL_IF -->
185             <!-- TMPL_IF NAME="too_much_oweing" -->
186               <div class="dialog alert">
187                 Sorry, you cannot place holds because you owe <!-- TMPL_VAR NAME="too_much_oweing" -->.
188               </div>
189             <!-- /TMPL_IF -->
190             <!-- TMPL_IF NAME="too_many_reserves" -->
191               <div class="dialog alert">Sorry, you cannot place more than <!-- TMPL_VAR NAME="too_many_reserves" --> holds.
192               </div>
193             <!-- /TMPL_IF -->
194             <!-- TMPL_IF NAME="bad_biblionumber" -->
195               <div class="dialog alert">ERROR: No biblio record found for biblionumber <!-- TMPL_VAR NAME="bad_biblionumber" -->.</div>
196             <!-- /TMPL_IF -->
197             <!-- TMPL_IF NAME="no_items_selected" -->
198               <div class="dialog alert">
199                 You must select at least one item.
200               </div>
201             <!-- /TMPL_IF -->
202             <!-- TMPL_IF NAME="no_branch_selected" -->
203               <div class="dialog alert">
204                 You must select a library for pickup.
205               </div>
206             <!-- /TMPL_IF -->
207             <!-- TMPL_IF NAME="no_biblionumber" -->
208               <div class="dialog alert">ERROR: No biblionumber received.</div>
209             <!-- /TMPL_IF -->
210             <!-- TMPL_IF NAME="bad_data" -->
211               <div class="dialog alert">ERROR: Internal error: incomplete hold request.</div>
212             <!-- /TMPL_IF -->
213             <!-- TMPL_IF NAME="none_available" -->
214               <div class="dialog alert"><strong>Sorry</strong>, none of these items can be placed on hold.
215               </div>
216             <!-- /TMPL_IF -->
217           <!-- /TMPL_IF --><!-- NAME="message" -->
218
219           <!-- TMPL_UNLESS NAME="message" -->
220               <h3>Confirm holds for:
221                 <!-- TMPL_LOOP NAME="USER_INFO" -->
222                   <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --> (<!-- TMPL_VAR NAME="cardnumber" -->)
223                 <!-- /TMPL_LOOP -->
224               </h3>
225
226             <form action="/cgi-bin/koha/opac-reserve.pl" method="post">
227             <input type="hidden" name="place_reserve" value="1"/>
228
229             <!-- These values are set dynamically by js -->
230             <input type="hidden" name="biblionumbers" id="biblionumbers"/>
231             <input type="hidden" name="selecteditems" id="selections"/>
232             <div id="bigloop">
233               <table id="bibitemloop">
234                 <tr>
235                   <th colspan="2">Hold</th>
236                   <th>Title</th>
237                   <!-- TMPL_UNLESS NAME="item-level_itypes" -->
238                     <th>Item Type</th>
239                   <!-- /TMPL_UNLESS -->
240                   <th>Priority</th>
241                   <!-- TMPL_IF NAME="OPACItemHolds" -->
242                     <th id="place_on_hdr" style="display:none">Place On:</th>
243                   <!-- /TMPL_IF -->
244                   <!-- TMPL_UNLESS NAME="singleBranchMode" -->
245                     <th>Pickup Location</th>
246                   <!-- /TMPL_UNLESS -->
247                 </tr>
248
249                 <!-- TMPL_LOOP name="bibitemloop" -->
250                   <tr>
251                       <!-- TMPL_IF NAME="holdable" -->
252                                           <td colspan="2">
253                       <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
254                       <input class="single_bib" name="single_bib" type="hidden" value="<!-- TMPL_VAR NAME="biblionumber" -->"/>
255                         <span class="confirmjs_hold" title="<!-- TMPL_VAR NAME="biblionumber" -->"></span>
256                         <span class="confirm_nonjs">
257                           <input type="radio" class="confirmbox checkitem <!-- TMPL_VAR NAME="checkitem_bib" -->"
258                                  name="<!-- TMPL_VAR NAME="checkitem_bib" -->" checked="checked"
259                                  id="<!-- TMPL_VAR NAME="checkitem_bib" -->"
260                                  value="any" />
261                           <label class="confirm_label" for="<!-- TMPL_VAR NAME="checkitem_bib" -->">Next available copy</label>
262                         </span>
263                                         </td>
264                       <!-- TMPL_ELSE -->
265                                           <td>
266                       <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
267                       <input class="single_bib" name="single_bib" type="hidden" value="<!-- TMPL_VAR NAME="biblionumber" -->"/>
268                         <span class="confirmjs_nohold" title="<!-- TMPL_VAR NAME="biblionumber" -->"></span>
269                         <span class="confirm_nonjs">
270                           <input type="radio" class="confirmbox checkitem <!-- TMPL_VAR NAME="checkitem_bib" -->"
271                                  name="<!-- TMPL_VAR NAME="checkitem_bib" -->" disabled="disabled"
272                                  id="<!-- TMPL_VAR NAME="checkitem_bib" -->"
273                                  value="any" />
274                         </span>
275                                         </td><td>
276                         <!-- TMPL_IF NAME="already_reserved" -->
277                           <div class="bibmessage">You have already requested this title.</div>
278                         <!-- /TMPL_IF -->
279                         <!-- TMPL_UNLESS NAME="bib_available" -->
280                           <div class="bibmessage">No available items.</div>
281                         <!-- TMPL_ELSE -->
282                           <div class="bibmessage">This title cannot be requested.</div>
283                         <!-- /TMPL_UNLESS -->
284                     </td>
285                       <!-- /TMPL_IF -->
286                     <td>
287                       <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" escape="html" --><!-- TMPL_IF NAME="subtitle" --> <!-- TMPL_VAR NAME="subtitle" ESCAPE="html" --><!-- /TMPL_IF --></a>
288                       <!-- TMPL_IF NAME="author" -->,  by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF -->
289                     </td>
290                     <!-- TMPL_UNLESS NAME="item-level_itypes" -->
291                       <td>
292                         <img src="<!-- TMPL_VAR NAME="imageurl" -->"
293                              alt="<!-- TMPL_VAR NAME="description" -->"
294                              title="<!-- TMPL_VAR NAME="description" -->" />
295                       </td>
296                     <!-- /TMPL_UNLESS -->
297                     <td><!-- TMPL_VAR name="rank" --> out of <!-- TMPL_VAR NAME="reservecount" --></td>
298                     <!-- TMPL_IF NAME="OPACItemHolds" -->
299                       <td class="place_on_type" style="display:none">
300                         <table>
301                           <tr>
302                             <td>
303                               <!-- TMPL_UNLESS NAME="holdable" -->
304                                 <input type="radio" name="reqtype_<!-- TMPL_VAR NAME="biblionumber" -->"
305                                        id="reqany_<!-- TMPL_VAR NAME="biblionumber" -->"
306                                        class="selectany"
307                                        value="Any"
308                                        disabled="disabled"
309                                 />
310                               <!-- TMPL_ELSE -->
311                                 <input type="radio" name="reqtype_<!-- TMPL_VAR NAME="biblionumber" -->"
312                                        id="reqany_<!-- TMPL_VAR NAME="biblionumber" -->"
313                                        class="selectany"
314                                        value="Any"
315                                        checked="checked"
316                                 />
317                               <!-- /TMPL_UNLESS -->
318                               <label for="reqany_<!-- TMPL_VAR NAME="biblionumber" -->">Next available copy</label>
319                             </td>
320                           </tr>
321                           <tr>
322                             <td>
323                               <!-- TMPL_UNLESS NAME="holdable" -->
324                                 <input type="radio" name="reqtype_<!-- TMPL_VAR NAME="biblionumber" -->"
325                                        id="reqspecific_<!-- TMPL_VAR NAME="biblionumber" -->"
326                                        class="selectspecific"
327                                        disabled="disabled"
328                                        value="Specific"
329                                 />
330                               <!-- TMPL_ELSE -->
331                                 <input type="radio" name="reqtype_<!-- TMPL_VAR NAME="biblionumber" -->"
332                                        id="reqspecific_<!-- TMPL_VAR NAME="biblionumber" -->"
333                                        class="selectspecific"
334                                        value="Specific"
335                                 />
336                               <!-- /TMPL_UNLESS -->
337                               <label for="reqspecific_<!-- TMPL_VAR NAME="biblionumber"-->">A specific copy</label>
338                             </td>
339                           </tr>
340                         </table>
341                       </td>
342                     <!-- /TMPL_IF -->
343
344                     <!-- TMPL_UNLESS NAME="singleBranchMode" -->
345                       <td>
346                         <select name="branch" id="branch_<!-- TMPL_VAR NAME="biblionumber" -->"
347                           <!-- TMPL_UNLESS NAME="holdable" -->disabled="disabled"<!-- /TMPL_UNLESS --> >
348                           <!-- TMPL_LOOP NAME="branchChoicesLoop" -->
349                             <!-- TMPL_IF name="selected" -->
350                               <option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
351                             <!-- TMPL_ELSE -->
352                               <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
353                             <!-- /TMPL_IF -->
354                           <!-- /TMPL_LOOP -->
355                         </select>
356                       </td>
357                     <!-- /TMPL_UNLESS -->
358                   </tr>
359
360                   <!-- TMPL_IF NAME="OPACItemHolds" -->
361                   <!-- TMPL_IF NAME="bib_available" -->
362                     <tr class="copiesrow" id="copiesrow_<!-- TMPL_VAR NAME="biblionumber"-->">
363                       <td colspan="1">
364                       </td>
365                       <td colspan="<!-- TMPL_VAR NAME="itemtable_colspan" -->">
366                         <table>
367                           <caption>Select a specific copy:</caption>
368                           <tr>
369                             <th>Copy</th>
370                             <!-- TMPL_IF NAME="item-level_itypes" -->
371                               <th>Item Type</th>
372                             <!-- /TMPL_IF -->
373                             <th>Barcode</th>
374                             <!-- TMPL_UNLESS NAME="singleBranchMode" -->
375                               <th>Home Library</th>
376                               <th>Last Location</th>
377                             <!-- /TMPL_UNLESS -->
378                             <th>Call Number</th>
379                             <th>Information</th>
380                           </tr>
381
382                           <!-- TMPL_LOOP name="itemLoop" -->
383                             <tr class="<!-- TMPL_VAR NAME="backgroundcolor" -->">
384                               <td>
385                                 <!-- TMPL_IF NAME="available" -->
386                                   <input type="radio" class="checkitem checkitem_<!-- TMPL_VAR NAME="biblionumber" -->" name="checkitem_<!-- TMPL_VAR NAME="biblionumber" -->"
387                                          value="<!-- TMPL_VAR NAME="itemnumber" -->" />
388                                 <!-- TMPL_ELSE -->
389                                   <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="<!-- TMPL_VAR NAME="itemnumber" -->" />
390                                   <img src="/intranet-tmpl/<!-- TMPL_VAR NAME="theme" -->/img/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
391                                 <!-- /TMPL_IF --> <!-- TMPL_IF NAME="copynumber" --><!-- TMPL_VAR NAME="copynumber" --><!-- /TMPL_IF -->
392                               </td>
393                               <!-- TMPL_IF NAME="item-level_itypes" -->
394                                 <td>
395                                   <img src="<!-- TMPL_VAR NAME="imageurl" -->"
396                                        alt="<!-- TMPL_VAR NAME="description" -->"
397                                        title="<!-- TMPL_VAR NAME="description" -->" />
398                                 </td>
399                               <!-- /TMPL_IF -->
400                               <td><!-- TMPL_VAR NAME="barcode" --></td>
401                               <!-- TMPL_UNLESS NAME="singleBranchMode" -->
402                                 <td><!-- TMPL_VAR NAME="homeBranchName" --></td>
403                                 <td><!-- TMPL_VAR NAME="holdingBranchName" --></td>
404                               <!-- /TMPL_UNLESS -->
405                               <td><!-- TMPL_VAR NAME="callNumber" --></td>
406                               <td>
407                                 <!-- TMPL_IF NAME="date_due" -->
408                                   <span class="checkedout">Due <!-- TMPL_VAR NAME="date_due" --></span>
409                                 <!-- TMPL_ELSIF NAME="transfertwhen" -->
410                                   <span class="intransit">In transit from <!-- TMPL_VAR NAME="transfertfrom" -->,
411                                     to <!-- TMPL_VAR NAME="transfertto" -->, since <!-- TMPL_VAR NAME="transfertwhen" --></span>
412                                 <!-- /TMPL_IF -->
413                                 <!-- TMPL_IF Name="message" -->
414                                   <span class="lost">Unavailable (lost or missing)</span>
415                                 <!-- /TMPL_IF -->
416                                 <!-- TMPL_IF Name="notforloan" -->
417                                   <span class="notforloan">Not for loan (<!-- TMPL_VAR NAME="notforloanvalue" -->)</span>
418                                 <!-- /TMPL_IF -->
419                                 <!-- TMPL_IF NAME="reservedate"-->
420                                   <span class="waiting"><!-- TMPL_IF NAME="waitingdate" -->Waiting<!-- TMPL_ELSE -->On hold<!-- /TMPL_IF --> for patron 
421                                     <!-- TMPL_IF NAME="waitingdate" -->at<!-- TMPL_ELSE -->expected at<!-- /TMPL_IF --> <!-- TMPL_VAR NAME="ExpectedAtLibrary" -->
422                                     since
423                                     <!-- TMPL_IF NAME="waitingdate" --><!-- TMPL_VAR NAME="waitingdate" --><!-- TMPL_ELSE --><!-- TMPL_IF name="reservedate" --><!-- TMPL_VAR NAME="reservedate" --><!-- /TMPL_IF --><!-- /TMPL_IF -->.
424                                   </span>
425                                 <!-- TMPL_ELSE -->
426                                   <span class="notonhold">Not on hold</span>
427                                 <!-- /TMPL_IF -->&nbsp;
428                               </td>
429                             </tr>
430                           <!-- /TMPL_LOOP -->
431                         </table>
432                       </td>
433                     </tr>
434                   <!-- /TMPL_IF --><!-- bib_available -->
435                   <!-- /TMPL_IF --><!-- OPACItemHolds -->
436                 <!-- /TMPL_LOOP -->
437               </table><!-- bibitemloop -->
438             </div><!-- bigloop -->
439
440             <!-- TMPL_IF NAME="none_available" -->
441             <input type="submit" disabled="disabled" value="Place Hold" />
442             <!-- TMPL_ELSE -->
443             <input type="submit" value="Place Hold" class="placehold" />
444             <!-- /TMPL_IF -->
445
446             </form>
447
448           <!-- /TMPL_UNLESS --><!-- message -->
449
450         </div><!-- holds -->
451       </div><!-- yui-g -->
452     </div><!-- bd    -->
453   </div><!-- doc3  -->
454
455 <div><!-- The following include seems to have an extra "/div" in it... -->
456 <!-- TMPL_INCLUDE NAME="opac-bottom.inc"-->