Browse Source

Bug 18037: Hold notes template cleanup (from 15545)

From the second patch of bug 15545:
Removing some unused template code related to a former approach.
Adding some changes for future extension by bug 15545.

This patch was tested by Liz Rea when the routine IsHoldNoteRequired was
called by opac-reserve.pl. The only change here is that we do not yet
call this routine; so leaving her original signoff.

Test plan:
[1] Enable OPACHoldNotes.
[2] Place a hold on a serial record. No behavior change.

Signed-off-by: Liz Rea  <liz@catalyst.net.nz>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
17.05.x
Marcel de Rooy 10 years ago
committed by Kyle M Hall
parent
commit
9b92a494e6
  1. 36
      koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt
  2. 2
      opac/opac-reserve.pl

36
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt

@ -279,10 +279,11 @@
[% IF ( OpacHoldNotes ) %]
<li>
<div class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]">
<label for="holdnotes[% bibitemloo.biblionumber %]">Hold notes:</label>
<span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span>
<textarea id="holdnotes[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea>
<input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/>
<label for="holdnotes_[% bibitemloo.biblionumber %]">Hold notes:</label>
[% IF bibitemloo.reqholdnotes %]
<span id="reqholdnotes_[% bibitemloo.biblionumber %]">Please enter additional information about the requested item:</span>
[% END %]
<textarea id="holdnotes_[% bibitemloo.biblionumber %]" rows="2" cols="30" name="notes_[% bibitemloo.biblionumber %]" >[% bibitemloo.holdnotes %]</textarea>
</div>
</li>
[% END # / IF OpacHoldNotes %]
@ -432,10 +433,6 @@
<script type="text/javascript">
// <![CDATA[
var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection.");
var ForceHoldNotesReasons=new Array(
_("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific item information may be helpful."),
"*** Add a new reason above this line ***" );
// NOTE: Do not renumber reasons; this will affect use of existing ones.
// Clear the contents of an input field
$(".clearfield").on("click",function(e){
@ -495,17 +492,11 @@
$("#reqspecific_[% bibitemloo.biblionumber %]").click();
$("#copiesrow_[% bibitemloo.biblionumber %]").show();
[% END %]
[% IF bibitemloo.reqholdnotes %]
$("#holdnotes_[% bibitemloo.biblionumber %]").attr( 'required', true );
[% END %]
[% END %]
// Insert reasons for forced hold notes
$(".forcenotesreason").each(function(){
biblioNum = suffixOf($(this).attr("id"), "_");
var j=$("#notesmandatory_"+biblioNum).val();
if(j>0) {
$(this).html(ForceHoldNotesReasons[j-1]);
}
});
$(".date-format").each(function(){
if($(this).hasClass("to")){ var op = "to"; }
if($(this).hasClass("from")){ var op = "from"; }
@ -615,11 +606,19 @@
biblionumbers += biblioNum + "/";
selections += biblioNum + "/";
// If required hold note is empty, make it visible
if( $("#holdnotes_"+biblioNum).attr( 'required' ) && $("#holdnotes_"+biblioNum).val() == '' ) {
if( !$("#hold-options-"+biblioNum).is(':visible')) {
$("#toggle-hold-options-"+biblioNum).click();
}
}
// If the 'specific copy' radio button is checked
if ($("#reqspecific_" + biblioNum + ":checked").size() > 0) {
// Find the selected copy
var item = $(".checkitem_" + biblioNum + ":checked");
if ($(item).size() == 0) {
alert(MSG_NO_ITEM_SELECTED);
badBib = biblioNum;
return false;
} else {
@ -637,8 +636,7 @@
return true;
});
if (badBib) {
alert(MSG_NO_ITEM_SELECTED);
if (badBib) { // alert has been raised already
return false;
}

2
opac/opac-reserve.pl

@ -414,7 +414,7 @@ foreach my $biblioNum (@biblionumbers) {
$biblioLoopIter{rank} = $biblioData->{rank};
$biblioLoopIter{reservecount} = $biblioData->{reservecount};
$biblioLoopIter{already_reserved} = $biblioData->{already_reserved};
$biblioLoopIter{mandatorynotes}=0; #FIXME: For future use
$biblioLoopIter{reqholdnotes}=0; #TODO: For future use
if (!$itemLevelTypes && $biblioData->{itemtype}) {
$biblioLoopIter{translated_description} = $itemTypes->{$biblioData->{itemtype}}{translated_description};

Loading…
Cancel
Save