View | Details | Raw Unified | Return to bug 15545
Collapse All | Expand All

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt (-19 / +17 lines)
Lines 265-274 Link Here
265
                                                        [% IF ( OpacHoldNotes ) %]
265
                                                        [% IF ( OpacHoldNotes ) %]
266
                                                            <li>
266
                                                            <li>
267
                                                                <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
267
                                                                <div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
268
                                                                    <label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
268
                                                                    <label for="holdnotes_[% bibitemloo.biblionumber %]">Hold notes:</label>
269
                                                                    <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
269
                                                                    [% IF bibitemloo.reqholdnotes %]
270
                                                                    <textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
270
                                                                        <span id="reqholdnotes_[% bibitemloo.biblionumber %]">Please enter additional information about the requested item:</span>
271
                                                                    <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
271
                                                                    [% END %]
272
                                                                    <textarea id="holdnotes_[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]" >[% bibitemloo.holdnotes %]</textarea>
272
                                                                </div>
273
                                                                </div>
273
                                                            </li>
274
                                                            </li>
274
                                                        [% END # / IF OpacHoldNotes %]
275
                                                        [% END # / IF OpacHoldNotes %]
Lines 418-427 Link Here
418
<script type="text/javascript">
419
<script type="text/javascript">
419
// <![CDATA[
420
// <![CDATA[
420
    var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
421
    var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
421
    var ForceHoldNotesReasons=new Array(
422
       _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific item information may be helpful."),
423
       "*** Add a new reason above this line ***" );
424
       // NOTE: Do not renumber reasons; this will affect use of existing ones.
425
422
426
        // Clear the contents of an input field
423
        // Clear the contents of an input field
427
        $(".clearfield").on("click",function(e){
424
        $(".clearfield").on("click",function(e){
Lines 481-497 Link Here
481
            $("#reqspecific_[% bibitemloo.biblionumber %]").click();
478
            $("#reqspecific_[% bibitemloo.biblionumber %]").click();
482
            $("#copiesrow_[% bibitemloo.biblionumber %]").show();
479
            $("#copiesrow_[% bibitemloo.biblionumber %]").show();
483
          [% END %]
480
          [% END %]
481
          [% IF bibitemloo.reqholdnotes %]
482
              $("#holdnotes_[% bibitemloo.biblionumber %]").attr( 'required', true );
483
          [% END %]
484
        [% END %]
484
        [% END %]
485
485
486
        // Insert reasons for forced hold notes
487
        $(".forcenotesreason").each(function(){
488
            biblioNum = suffixOf($(this).attr("id"), "_");
489
            var j=$("#notesmandatory_"+biblioNum).val();
490
            if(j>0) {
491
                $(this).html(ForceHoldNotesReasons[j-1]);
492
            }
493
        });
494
495
        $(".date-format").each(function(){
486
        $(".date-format").each(function(){
496
            if($(this).hasClass("to")){ var op = "to"; }
487
            if($(this).hasClass("to")){ var op = "to"; }
497
            if($(this).hasClass("from")){ var op = "from"; }
488
            if($(this).hasClass("from")){ var op = "from"; }
Lines 601-611 Link Here
601
                biblionumbers += biblioNum + "/";
592
                biblionumbers += biblioNum + "/";
602
                selections += biblioNum + "/";
593
                selections += biblioNum + "/";
603
594
595
                // If required hold note is empty, make it visible
596
                if( $("#holdnotes_"+biblioNum).attr( 'required' ) && $("#holdnotes_"+biblioNum).val() == '' ) {
597
                    if( !$("#hold-options-"+biblioNum).is(':visible')) {
598
                        $("#toggle-hold-options-"+biblioNum).click();
599
                    }
600
                }
601
604
                // If the 'specific copy' radio button is checked
602
                // If the 'specific copy' radio button is checked
605
                if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
603
                if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
606
                    // Find the selected copy
604
                    // Find the selected copy
607
                    var item = $(".checkitem_" + biblioNum + ":checked");
605
                    var item = $(".checkitem_" + biblioNum + ":checked");
608
                    if ($(item).size() == 0) {
606
                    if ($(item).size() == 0) {
607
                        alert(MSG_NO_ITEM_SELECTED);
609
                        badBib = biblioNum;
608
                        badBib = biblioNum;
610
                        return false;
609
                        return false;
611
                    } else {
610
                    } else {
Lines 623-630 Link Here
623
                return true;
622
                return true;
624
            });
623
            });
625
624
626
            if (badBib) {
625
            if (badBib) { // alert has been raised already
627
                alert(MSG_NO_ITEM_SELECTED);
628
                return false;
626
                return false;
629
            }
627
            }
630
628
(-)a/opac/opac-reserve.pl (-2 / +3 lines)
Lines 396-402 foreach my $biblioNum (@biblionumbers) { Link Here
396
    $biblioLoopIter{rank} = $biblioData->{rank};
396
    $biblioLoopIter{rank} = $biblioData->{rank};
397
    $biblioLoopIter{reservecount} = $biblioData->{reservecount};
397
    $biblioLoopIter{reservecount} = $biblioData->{reservecount};
398
    $biblioLoopIter{already_reserved} = $biblioData->{already_reserved};
398
    $biblioLoopIter{already_reserved} = $biblioData->{already_reserved};
399
    $biblioLoopIter{mandatorynotes}=0; #FIXME: For future use
399
    $biblioLoopIter{reqholdnotes} = C4::Reserves::IsHoldNoteRequired(
400
        $biblioData->{biblionumber}, $record,
401
    );
400
402
401
    if (!$itemLevelTypes && $biblioData->{itemtype}) {
403
    if (!$itemLevelTypes && $biblioData->{itemtype}) {
402
        $biblioLoopIter{translated_description} = $itemTypes->{$biblioData->{itemtype}}{translated_description};
404
        $biblioLoopIter{translated_description} = $itemTypes->{$biblioData->{itemtype}}{translated_description};
403
- 

Return to bug 15545