Bugzilla – Attachment 51834 Details for
Bug 15545
Remove remainders of unfinished reqholdnotes functionality
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15545: Use IsHoldNoteRequired in opac-reserve.pl
Bug-15545-Use-IsHoldNoteRequired-in-opac-reservepl.patch (text/plain), 6.74 KB, created by
Marcel de Rooy
on 2016-05-26 12:32:21 UTC
(
hide
)
Description:
Bug 15545: Use IsHoldNoteRequired in opac-reserve.pl
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-05-26 12:32:21 UTC
Size:
6.74 KB
patch
obsolete
>From 07f58e4b6ad09d8b184c7b33592f30a0cf2390b7 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 15545: Use IsHoldNoteRequired in opac-reserve.pl >Content-Type: text/plain; charset=utf-8 > >This patch implements use of the new Reserves routine IsHoldNoteRequired, >making it possible to require a note when placing a hold. >Only a very small change in opac-reserve.pl is needed. As well as >corresponding changes in the template. I am removing some unused template >code related to a former approach. > >Test plan: >[1] Disable UseKohaPlugins, enable OpacHoldNotes. >[2] Place a hold on a serial record (leader pos 7 == s). Verify that > the hold note is not required. >[3] Enable UseKohaPlugins. Install the Rijks_HoldNoteRequired plugins. > (Go to plugins/plugins-home.pl and upload Rijks_HoldNoteRequired.kpz. > This file can be found as an attachment to this BZ report.) >[4] Again place a hold on a serial record. The hold note should be required. >--- > .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 36 +++++++++----------- > opac/opac-reserve.pl | 4 ++- > 2 files changed, 20 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 eb1cd3c..3fd9532 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -268,10 +268,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 %] >@@ -423,10 +424,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){ >@@ -486,17 +483,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"; } >@@ -606,11 +597,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 { >@@ -628,8 +627,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 3f77672..961142e 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -410,7 +410,9 @@ 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} = C4::Reserves::IsHoldNoteRequired( >+ $biblioData->{biblionumber}, $record, >+ ); > > if (!$itemLevelTypes && $biblioData->{itemtype}) { > $biblioLoopIter{translated_description} = $itemTypes->{$biblioData->{itemtype}}{translated_description}; >-- >1.7.10.4
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 15545
:
46687
|
46688
|
46689
|
49084
|
49085
|
49086
|
51832
|
51833
|
51834
|
53546
|
53547
|
59252
|
59253
|
139947
|
140960