Bugzilla – Attachment 60461 Details for
Bug 18037
Hold notes template cleanup (from 15545)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18037: Hold notes template cleanup (from 15545)
Bug-18037-Hold-notes-template-cleanup-from-15545.patch (text/plain), 6.50 KB, created by
Jonathan Druart
on 2017-02-20 12:48:28 UTC
(
hide
)
Description:
Bug 18037: Hold notes template cleanup (from 15545)
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-02-20 12:48:28 UTC
Size:
6.50 KB
patch
obsolete
>From b6823f25611a3ea9264b4bac46779b3851e33c9c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 15 Dec 2014 14:10:56 +0100 >Subject: [PATCH] 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> >--- > .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 36 ++++++++++------------ > opac/opac-reserve.pl | 2 +- > 2 files changed, 18 insertions(+), 20 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >index 3c192e0..401561a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/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; > } > >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index d42cc15..e304066 100755 >--- a/opac/opac-reserve.pl >+++ b/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}; >-- >2.9.3
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18037
:
59814
|
59815
| 60461