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