Bug 11497: remove TT construct for picking a default string that i18n toolchain fails...
[koha_ffzg] / koha-tmpl / opac-tmpl / bootstrap / en / modules / opac-reserve.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Placing a hold
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% BLOCK cssinclude %][% END %]
7 </head>
8
9 <body id="opac-holds">
10 [% INCLUDE 'masthead.inc' %]
11
12 <div class="main">
13     <ul class="breadcrumb">
14         <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
15         <li><a href="#">Placing a hold</a></li>
16     </ul>
17
18     <div class="container">
19
20                 <div id="holds">
21                     [% IF ( message ) %]
22                         [% IF ( GNA ) %]
23                             <div id="gna" class="alert">
24                                 <p><strong>Sorry</strong>, you cannot place holds because the library doesn't have up-to-date <a href="/cgi-bin/koha/opac-memberentry.pl">contact information</a> on file.</p>
25                                 <p>Please contact your librarian, or use the <a href="/cgi-bin/koha/opac-memberentry.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)</p>
26                             </div>
27                         [% END %]
28
29                         [% IF ( lost ) %]
30                             <div id="lost" class="alert">
31                                 <p><strong>Sorry</strong>, you cannot place holds because your library card has been marked as lost or stolen.</p>
32                                 <p>If this is an error, please take your card to the circulation desk at your local library and the error will be corrected.</p>
33                             </div>
34                         [% END %]
35
36                         [% IF ( debarred ) %]
37                             <div id="debarred" class="alert">
38                                 <p><strong>Sorry</strong>, you cannot place holds because your account has been frozen.</p>
39                                 <p>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.</p>
40                             </div>
41                         [% END %]
42
43                         [% IF ( too_much_oweing ) %]
44                             <div id="too_much_oweing" class="alert">
45                                 Sorry, you cannot place holds because you owe [% too_much_oweing %].
46                             </div>
47                         [% END %]
48
49                         [% IF ( too_many_reserves ) %]
50                             <div id="too_many_reserves" class="alert">
51                                 Sorry, you cannot place more than [% too_many_reserves %] holds.
52                             </div>
53                         [% END %]
54
55                         [% IF ( bad_biblionumber ) %]
56                             <div id="bad_biblionumber" class="alert">
57                                 ERROR: No biblio record found for biblionumber [% bad_biblionumber %].</div>
58                         [% END %]
59
60                         [% IF ( no_items_selected ) %]
61                             <div id="no_items_selected" class="alert">
62                                 You must select at least one item.
63                             </div>
64                         [% END %]
65
66                         [% IF ( no_branch_selected ) %]
67                             <div id="no_branch_selected" class="alert">
68                                 You must select a library for pickup.
69                             </div>
70                         [% END %]
71
72                         [% IF ( no_biblionumber ) %]
73                             <div id="no_biblionumber" class="alert">ERROR: No biblionumber received.</div>
74                         [% END %]
75
76                         [% IF ( bad_data ) %]
77                             <div id="bad_data" class="alert">ERROR: Internal error: incomplete hold request.</div>
78                         [% END %]
79
80                     [% ELSE %]
81
82                         [% IF ( none_available ) %]
83                             <div id="none_available" class="alert"><strong>Sorry</strong>, none of these items can be placed on hold.
84                             </div>
85                         [% END %]
86
87                     [% END # / IF message %]
88
89                     [% UNLESS ( message ) %]
90                         [% UNLESS ( none_available ) %]
91                             <h3>Confirm holds for:
92                                 [% FOREACH USER_INF IN USER_INFO %]
93                                     [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
94                                 [% END %]
95                             </h3>
96                         [% END # / UNLESS none_available %]
97
98                         [% IF (RESERVE_CHARGE) %]
99                             <div class="alert" id="reserve_fee">
100                                 There is a charge of [% RESERVE_CHARGE %] for placing this hold
101                             </div>
102                         [% END %]
103
104                         <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
105                             <input type="hidden" name="place_reserve" value="1"/>
106                             <!-- These values are set dynamically by js -->
107                             <input type="hidden" name="biblionumbers" id="biblionumbers"/>
108                             <input type="hidden" name="selecteditems" id="selections"/>
109                             <div id="bigloop">
110
111                                 [% FOREACH bibitemloo IN bibitemloop %]
112                                     <div class="holdrow">
113                                         <p>
114                                             [% IF ( bibitemloo.holdable ) %]
115                                                 <input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
116                                                 <input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
117                                                 <span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]" style="padding:.3em"></span>
118                                                 <span class="confirm_nonjs">
119                                                     <input type="radio" class="confirmbox checkitem [% bibitemloo.biblionumber %]" name="[% bibitemloo.biblionumber %]" checked="checked" id="single_[% bibitemloo.biblionumber %]" value="any" />
120                                                     <label class="confirm_label" for="single_[% bibitemloo.biblionumber %]">Place a hold on </label>
121                                                 </span>
122                                             [% END # / bibitemloo.holdable %]
123
124                                             <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">
125                                                 [% bibitemloo.title |html %]
126                                                 [% IF ( bibitemloo.subtitle ) %]
127                                                     [% FOREACH subtitl IN bibitemloo.subtitle %]
128                                                         [% subtitl.subfield %]
129                                                     [% END %]
130                                                 [% END %]
131                                             </a>
132                                             [% IF ( bibitemloo.author ) %],  by [% bibitemloo.author %][% END %]
133                                         </p>
134
135                                         [% UNLESS ( bibitemloo.holdable ) %]
136                                             [% IF ( bibitemloo.already_reserved ) %]
137                                                 <div class="alert">You have already requested this title.</div>
138                                             [% ELSE %]
139                                                 [% UNLESS ( bibitemloo.bib_available ) %]
140                                                     <div class="alert">No available items.</div>
141                                                 [% ELSE %]
142                                                     [% IF ( bibitemloo.already_patron_possession ) %]
143                                                         <div class="alert">This title cannot be requested because it's already in your possession.</div>
144                                                     [% ELSE %]
145                                                         <div class="alert">This title cannot be requested.</div>
146                                                     [% END %]
147                                                 [% END # / UNLESS bibitemloo.bib_available %]
148                                             [% END # / IF bibitemloo.already_reserved %]
149                                         [% END # / UNLESS bibitemloo.holdable %]
150
151                                         [% IF ( bibitemloo.holdable ) %]
152                                             <fieldset class="rows">
153                                                 <ul>
154                                                     <!-- HOLDABLE -->
155                                                     [% UNLESS ( item_level_itypes ) %]
156                                                         <li class="itype">
157                                                             <span class="label">Item type: </span>
158                                                             [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
159                                                             [% bibitemloo.description %]
160                                                         </li>
161                                                     [% END %]
162
163                                                     [% IF showholds || showpriority %]
164                                                         <li class="priority">
165                                                             <span class="label">Holds and priority: </span>
166                                                             [% IF showpriority %] [% bibitemloo.rank %] [% END %]
167                                                             [% IF showholds && showpriority %] out of [% END %]
168                                                             [% IF showholds %] [% bibitemloo.reservecount %] [% END %]
169                                                         </li>
170                                                     [% END %]
171
172
173                                                     [% UNLESS ( singleBranchMode ) %]
174                                                         [% IF ( bibitemloo.holdable && choose_branch ) %]
175                                                             <li class="branch">
176                                                                 <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
177                                                                 [% UNLESS ( bibitemloo.holdable ) %]
178                                                                     <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
179                                                                         [% FOREACH branchloo IN bibitemloo.branchloop %]
180                                                                             [% IF ( branchloo.selected ) %]
181                                                                                 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
182                                                                             [% ELSE %]
183                                                                                 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
184                                                                             [% END %]
185                                                                         [% END %]
186                                                                     </select>
187                                                                 [% ELSE %]
188                                                                     <select name="branch" id="branch_[% bibitemloo.biblionumber %]">
189                                                                         [% FOREACH branchloo IN bibitemloo.branchloop %]
190                                                                             [% IF ( branchloo.selected ) %]
191                                                                                 <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
192                                                                             [% ELSE %]
193                                                                                 <option value="[% branchloo.branchcode %]">[% branchloo.branchname %]</option>
194                                                                             [% END %]
195                                                                         [% END %]
196                                                                     </select>
197                                                                 [% END # / UNLESS bibitemloo.holdable %]
198                                                             </li>
199                                                         [% END # / IF bibitemloo.holdable && choose_branch %]
200                                                     [% END # / UNLESS singleBranchMode %]
201                                                 </ul>
202
203                                                 <a class="toggle-hold-options" id="toggle-hold-options-[% bibitemloo.biblionumber %]" style="display:none;" href="#">Show more options</a>
204
205                                                 <div id="hold-options-[% bibitemloo.biblionumber %]" class="hold-options">
206
207                                                     <ul>
208                                                         [% IF ( reserve_in_future ) %]
209                                                             <li>
210                                                                 <label for="from[% bibitemloo.biblionumber %]">Hold starts on date:</label>
211                                                                 <input name="reserve_date_[% bibitemloo.biblionumber %]" id="from[% bibitemloo.biblionumber %]" size="10" class="holddatefrom"/>
212                                                                 <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
213                                                             </li>
214                                                         [% END %]
215
216                                                         <li>
217                                                             <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
218                                                             <input name="expiration_date_[% bibitemloo.biblionumber %]" id="to[% bibitemloo.biblionumber %]" size="10" class="holddateto" />
219                                                             <span class="date-format to" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
220                                                         </li>
221
222                                                         [% IF ( OpacHoldNotes ) %]
223                                                             <li>
224                                                                 <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
225                                                                     <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
226                                                                     <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
227                                                                     <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
228                                                                     <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
229                                                                 </div>
230                                                             </li>
231                                                         [% END # / IF OpacHoldNotes %]
232
233                                                         [% IF ( OPACItemHolds ) %]
234                                                             <!-- ITEM HOLDS -->
235                                                             <li class="lradio">
236                                                                 <label class="radio inline" for="reqany_[% bibitemloo.biblionumber %]">Next available item</label>
237                                                                 [% UNLESS ( bibitemloo.holdable ) %]
238                                                                     <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqany_[% bibitemloo.biblionumber %]" class="selectany" value="Any" disabled="disabled" />
239                                                                 [% ELSE %]
240                                                                     <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqany_[% bibitemloo.biblionumber %]" class="selectany" value="Any" checked="checked" />
241                                                                 [% END %]
242
243                                                                 <label class="radio inline" for="reqspecific_[% bibitemloo.biblionumber %]">A specific item</label>
244                                                                 [% UNLESS ( bibitemloo.holdable ) %]
245                                                                     <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqspecific_[% bibitemloo.biblionumber %]" class="selectspecific" disabled="disabled" value="Specific" />
246                                                                 [% ELSE %]
247                                                                     <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]" id="reqspecific_[% bibitemloo.biblionumber %]" class="selectspecific" value="Specific" />
248                                                                 [% END %]
249                                                             </li>
250                                                         [% END # / IF OPACItemHolds %]
251                                                     </ul>
252
253                                                     [% IF ( OPACItemHolds ) %]
254                                                         <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber %]">
255                                                             <caption>Select a specific item:</caption>
256                                                             <tr>
257                                                                 <th>Copy number</th>
258                                                                 [% IF ( item_level_itypes ) %]
259                                                                     <th>Item type</th>
260                                                                 [% END %]
261                                                                 <th>Barcode</th>
262                                                                 [% UNLESS ( singleBranchMode ) %]
263                                                                     <th>Home library</th>
264                                                                     <th>Last location</th>
265                                                                 [% END %]
266                                                                 <th>Call number</th>
267                                                                 [% IF ( itemdata_enumchron ) %]
268                                                                     <th>Vol info</th>
269                                                                 [% END %]
270                                                                 <th>Information</th>
271                                                             </tr>
272
273                                                             [% FOREACH itemLoo IN bibitemloo.itemLoop %]
274                                                                 <tr class="[% itemLoo.backgroundcolor %]">
275                                                                     <td class="copynumber">
276                                                                         [% IF ( itemLoo.available ) %]
277                                                                             <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]" value="[% itemLoo.itemnumber %]" />
278                                                                         [% ELSE %]
279                                                                             <input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" />
280                                                                             <img src="[% interface %]/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
281                                                                         [% END %]
282
283                                                                         [% IF ( itemLoo.copynumber ) %]
284                                                                             [% itemLoo.copynumber %]
285                                                                         [% END %]
286                                                                     </td>
287
288                                                                     [% IF ( item_level_itypes ) %]
289                                                                         <td class="itype">
290                                                                             [% UNLESS ( noItemTypeImages ) %]
291                                                                                 [% IF ( itemLoo.imageurl ) %]
292                                                                                     <img src="[% itemLoo.imageurl %]" alt="" />
293                                                                                 [% END %]
294                                                                             [% END %]
295                                                                             [% itemLoo.description %]
296                                                                         </td>
297                                                                     [% END %]
298
299                                                                     <td class="barcode">[% itemLoo.barcode %]</td>
300                                                                     [% UNLESS ( singleBranchMode ) %]
301                                                                         <td class="homebranch">[% itemLoo.homeBranchName %]</td>
302                                                                         <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
303                                                                     [% END %]
304                                                                     <td class="call_no">[% itemLoo.callNumber %]</td>
305                                                                     [% IF ( itemdata_enumchron ) %]
306                                                                         <td class="vol_info">[% itemLoo.enumchron %]</td>
307                                                                     [% END %]
308                                                                     <td class="information">
309                                                                         [% IF ( itemLoo.dateDue ) %]
310                                                                             <span class="checkedout">Due [% itemLoo.dateDue %]</span>
311                                                                         [% ELSIF ( itemLoo.transfertwhen ) %]
312                                                                             <span class="intransit">In transit from [% itemLoo.transfertfrom %] to [% itemLoo.transfertto %] since [% itemLoo.transfertwhen %]</span>
313                                                                         [% END %]
314
315                                                                         [% IF ( itemLoo.message ) %]
316                                                                             <span class="lost">Unavailable (lost or missing)</span>
317                                                                         [% END %]
318
319                                                                         [% IF ( itemLoo.notforloan ) %]
320                                                                             <span class="notforloan">Not for loan ([% itemLoo.notforloanvalue %])</span>
321                                                                         [% END %]
322
323                                                                         [% IF ( itemLoo.reservedate ) %]
324                                                                             <span class="waiting">
325                                                                                 [% IF ( itemLoo.waitingdate ) %]
326                                                                                     Waiting
327                                                                                 [% ELSE %]
328                                                                                     On hold
329                                                                                 [% END %]
330                                                                                 for patron
331                                                                                 [% IF ( itemLoo.waitingdate ) %]
332                                                                                     at
333                                                                                 [% ELSE %]
334                                                                                     expected at
335                                                                                 [% END %]
336                                                                                 [% itemLoo.ExpectedAtLibrary %] since
337                                                                                 [% IF ( itemLoo.waitingdate ) %]
338                                                                                     [% itemLoo.waitingdate | $KohaDates %]
339                                                                                 [% ELSE %]
340                                                                                     [% IF ( itemLoo.reservedate ) %]
341                                                                                         [% itemLoo.reservedate %]
342                                                                                     [% END %]
343                                                                                 [% END %].
344                                                                             </span>
345                                                                         [% ELSE %]
346                                                                             <span class="notonhold">Not on hold</span>
347                                                                         [% END # / IF ( itemLoo.reservedate )%]
348                                                                     </td>
349                                                                 </tr>
350                                                             [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%]
351                                                         </table> <!-- / #copiesrow_[% bibitemloo.biblionumber %] -->
352                                                     [% END # / IF ( OPACItemHolds )%]
353                                                 </div> <!-- / #hold-options-[% bibitemloo.biblionumber %] -->
354                                             </fieldset>
355                                         [% END # / IF ( bibitemloo.holdable ) %]
356                                     </div> <!-- / .holdrow -->
357                                 [% END # / FOREACH bibitemloo IN bibitemloop %]
358                             </div><!-- #bigloop -->
359
360                             [% UNLESS ( none_available ) %]
361                                 <input type="submit" value="Place hold" class="btn placehold" />
362                             [% END %]
363
364                         </form>
365                     [% END # / UNLESS message %]
366                 </div> <!-- / #holds -->
367     </div> <!-- / .container -->
368 </div> <!-- / .main -->
369 [% INCLUDE 'opac-bottom.inc' %]
370 [% BLOCK jsinclude %]
371 [% INCLUDE 'calendar.inc' %]
372 <script type="text/javascript">
373 // <![CDATA[
374     var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
375     var ForceHoldNotesReasons=new Array(
376        _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific item information may be helpful."),
377        "*** Add a new reason above this line ***" );
378        // NOTE: Do not renumber reasons; this will affect use of existing ones.
379
380         // Clear the contents of an input field
381         $(".clearfield").on("click",function(e){
382             $(this).closest("td").find("input").val("");
383             e.preventDefault();
384         });
385     $(document).ready(function() {
386         $("#hold-request-form").preventDoubleFormSubmit();
387         var copiesRowId = null;
388         var wasSpecific = false;
389         var lastCopiesRowId = null;
390         $(".checkitem").parent().click(function(e){
391             if(e.target.tagName.toLowerCase() == 'td'){
392                 $(this).find("input.checkitem").each( function() {
393                     $(this).attr('checked', !$(this).attr('checked'));
394                 });
395             }
396         });
397         // Hides all 'specific copy' table rows on load.
398         $(".copiesrow").hide();
399
400         // Insert reasons for forced hold notes
401         $(".forcenotesreason").each(function(){
402             biblioNum = suffixOf($(this).attr("id"), "_");
403             var j=$("#notesmandatory_"+biblioNum).val();
404             if(j>0) {
405                 $(this).html(ForceHoldNotesReasons[j-1]);
406             }
407         });
408
409         $("#place_on_hdr").show();
410         $(".place_on_type").show();
411         $("#place_on_hdr,.place_on_type,.toggle-hold-options").show();
412         $(".hold-options").hide();
413         $(".holddatefrom,.holddateto").prop("readOnly", true);
414
415         $(".date-format").each(function(){
416             if($(this).hasClass("to")){ var op = "to"; }
417             if($(this).hasClass("from")){ var op = "from"; }
418             var bibNum = $(this).data("biblionumber");
419             $(this).html("<a href=\"#\" class=\"clear-date\" data-op=\"" + op + "\" id=\"clear" + bibNum + "\">" + _("Clear date") + "</a>");
420         });
421
422         $(".clear-date").on("click",function(e){
423             e.preventDefault();
424             var fieldID = this.id.replace("clear","");
425             var op = $(this).data("op");
426             $("#" + op + fieldID).val("");
427         });
428
429         // Replace non-JS single-selection with multi-selection capability.
430         $(".reserve_mode").val("multi");
431         $(".confirm_nonjs").remove();
432         $(".confirmjs_hold").each(function(){
433             var bib = $(this).attr("title");
434             var html = "<label><input type =\"checkbox\" class=\"confirmjs\" checked=\"checked\"";
435             html += "value=\"" + bib + "\"/> " + _("Place a hold on") + " </label> ";
436             $(this).html(html);
437         });
438         $(".confirmjs_nohold").each(function(){
439             var bib = $(this).attr("title");
440             var html = "<label><input type =\"checkbox\" class=\"confirmjs\" disabled=\"disabled\"";
441             html += "value=\"" + bib + "\"/>" + _("Place a hold on: ") + "</label>";
442             $(this).html(html);
443         });
444
445         // Make sure a specific item was selected where specified
446         // before moving on to a new item.
447         function changeSelection (newCopiesRowId, isSpecific) {
448             if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) {
449                 var biblioNum = suffixOf(copiesRowId, "_");
450
451                 // If the 'specific copy' radio button was checked
452                   if (wasSpecific && (copiesRowId != newCopiesRowId)) {
453                     // Find the selected copy
454                     var item = $(".checkitem_" + biblioNum + ":checked");
455                     if ($(item).size() == 0) {
456                         alert(MSG_NO_ITEM_SELECTED);
457                         return false;
458                     }
459                 }
460             }
461             copiesRowId = newCopiesRowId;
462             wasSpecific = isSpecific;
463             return true;
464         }
465
466         // When 'specific copy' radio button is clicked
467         $(".selectspecific").click(function() {
468
469             // Make sure all other specific copy table rows are hidden
470             biblioNum = suffixOf($(this).attr("id"), "_");
471             newCopiesRowId = "#copiesrow_" + biblioNum;
472
473             if (!changeSelection(newCopiesRowId, true)) {
474                 return false;
475             }
476
477             // Show the specific copy table for this radio button.
478             $(newCopiesRowId).show();
479         });
480
481         // When 'first available' radion button is clicked
482         $(".selectany").click(function() {
483             // Make sure all other specific copy table rows are hidden
484             biblioNum = suffixOf($(this).attr("id"), "_");
485             newCopiesRowId = "#copiesrow_" + biblioNum;
486
487             if (!changeSelection(newCopiesRowId, false)) {
488                 return false;
489             }
490
491             // Hide the copies table row
492             $(newCopiesRowId).hide();
493         });
494
495         // When 'Place Hold' button is clicked
496         $(".placehold").click(function(){
497             var biblionumbers = "";
498             var selections = "";
499
500             if ($(".confirmjs:checked").size() == 0) {
501                 alert(MSG_NO_RECORD_SELECTED);
502                 return false;
503             }
504
505             // Find the items with the 'Hold' box checked
506             var badBib = null;
507             $(".confirmjs:checked").each(function() {
508                 var biblioNum = $(this).val();
509                 biblionumbers += biblioNum + "/";
510                 selections += biblioNum + "/";
511
512                 // If the 'specific copy' radio button is checked
513                 if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
514                     // Find the selected copy
515                     var item = $(".checkitem_" + biblioNum + ":checked");
516                     if ($(item).size() == 0) {
517                         badBib = biblioNum;
518                         return false;
519                     } else {
520                       selections += $(item).val();
521                     }
522                 }
523                 selections += "/";
524
525                 // Add the pickup location
526                 var branchSel = $("#branch_" + biblioNum);
527                 if (branchSel.size() > 0) {
528                     selections += $(branchSel).val();
529                 }
530                 selections += "/";
531                 return true;
532             });
533
534             if (badBib) {
535                 alert(MSG_NO_ITEM_SELECTED);
536                 return false;
537             }
538
539             $("#selections").val(selections);
540             $("#biblionumbers").val(biblionumbers);
541
542             return true;
543         });
544
545         $(".toggle-hold-options").on("click",function(e){
546             e.preventDefault();
547             toggleLink = $(this);
548             var optionsID = this.id.replace("toggle-hold-options-","");
549             $("#hold-options-"+optionsID).toggle(0, function() {
550                 toggleLink.text($(this).is(':visible') ? _("Hide options") : _("Show more options"));
551             });
552         });
553
554         [% FOREACH bibitemloo IN bibitemloop %]
555             [% IF ( bibitemloo.holdable ) %]
556                 // http://jqueryui.com/demos/datepicker/#date-range
557                 var dates[% bibitemloo.biblionumber %] = $( "#from[% bibitemloo.biblionumber %], #to[% bibitemloo.biblionumber %]" ).datepicker({
558                     minDate: 1,
559                     changeMonth: true,
560                     numberOfMonths: 1,
561                     onSelect: function( selectedDate ) {
562                         var option = this.id == "from[% bibitemloo.biblionumber %]" ? "minDate" : "maxDate",
563                             instance = $( this ).data( "datepicker" );
564                             date = $.datepicker.parseDate(
565                                 instance.settings.dateFormat ||
566                                 $.datepicker._defaults.dateFormat,
567                                 selectedDate, instance.settings );
568                         dates[% bibitemloo.biblionumber %].not( this ).datepicker( "option", option, date );
569                     }
570                 });
571             [% END %]
572         [% END %]
573
574  });
575 // ]]>
576 </script>
577 [% END %]