Bugzilla – Attachment 15807 Details for
Bug 9722
Allow users to add notes when placing a hold in opac
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9722: Allow users to add notes when placing a hold in opac
Bug-9722-Allow-users-to-add-notes-when-placing-a-h.patch (text/plain), 9.26 KB, created by
Kyle M Hall (khall)
on 2013-03-01 16:14:24 UTC
(
hide
)
Description:
Bug 9722: Allow users to add notes when placing a hold in opac
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-03-01 16:14:24 UTC
Size:
9.26 KB
patch
obsolete
>From 9cf9aaa34f5644568cb0a649d41b43f5d98210a6 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 25 Feb 2013 15:21:57 +0100 >Subject: [PATCH] Bug 9722: Allow users to add notes when placing a hold in opac > >The option of adding a note is controlled by new pref OpacShowHoldNotes. >This development is part of a larger one (see umbrella report 9721). > >Test plan: >1 Verify if new pref is disabled by default. Place a hold. You can't add a note. >2 Enable the pref. Place a hold and add a note. Check in staff if you can see >the note in Catalogue Detail/Holds tab. >3 Toggle SingleBranchmode, AllowHoldDateInFuture/OPACAllowHoldDateInFuture, >OPACShowHoldQueueDetails, or OPACItemHolds. >Check the display of columns when placing a hold from opac. >4 Place a few holds with notes from opac search results in one run (enable >DisplayMultiPlaceHold). Check results in staff again. > >Remark: A few lines already refer to mandatory note reasons. This is handled >in a subsequent report. No reason to worry. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > .../prog/en/modules/admin/preferences/opac.pref | 8 ++++ > koha-tmpl/opac-tmpl/prog/en/css/opac.css | 11 +++++ > .../opac-tmpl/prog/en/modules/opac-reserve.tt | 41 +++++++++++++++++++- > opac/opac-reserve.pl | 8 +++- > 4 files changed, 64 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 6d6672c..4f10e68 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -399,6 +399,14 @@ OPAC: > yes: Display > no: Don't display > - the list of authors/subjects in a popup for a combined search on OPAC detail pages. >+ - >+ - pref: OpacShowHoldNotes >+ default: 0 >+ choices: >+ yes: Allow >+ no: Do not allow >+ - users to add a note when placing a hold. >+ > Policy: > - > - pref: singleBranchMode >diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >index cc6666e..8e34c45 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css >+++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >@@ -2781,6 +2781,7 @@ div.authorizedheading { > width: 75%; > } > >+ > .contentblock { > position: relative; > margin-left: 2em; >@@ -2920,3 +2921,13 @@ a.reviewlink,a.reviewlink:visited { > .idbresult img { > padding-right: 6px; > } >+ >+.notesrow label { >+ font-weight: bold; >+} >+.notesrow span { >+ display: block; >+} >+.notesrow textarea { >+ width: 100%; >+} >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >index 5788b38..6b09e2b 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >@@ -4,6 +4,9 @@ > <script type="text/javascript"> > // <![CDATA[ > var MSG_NO_COPY_SELECTED = _("Expecting a specific copy selection."); >+ var ForceHoldNotesReasons=new Array( >+ _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific copy information may be helpful."), >+ "*** Add a new reason above this line ***" ); // NOTE: Do not renumber reasons; this will affect use of existing ones. > > function prefixOf (s, tok) { > var index = s.indexOf(tok); >@@ -29,6 +32,16 @@ > }); > // Hides all 'specific copy' table rows on load. > $(".copiesrow").hide(); >+ $(".notesrow").hide(); >+ >+ // 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]); >+ } >+ }); > > $("#place_on_hdr").show(); > $(".place_on_type").show(); >@@ -101,6 +114,13 @@ > $(".copiesrow").hide(); > }); > >+ // Show or hide holds notes >+ $(".shownotes").click(function(){ >+ biblioNum = suffixOf($(this).attr("id"), "_"); >+ $(".notesrow").hide(); >+ $("#notesrow_"+biblioNum).show(); >+ }); >+ > // When 'Place Hold' button is clicked > $(".placehold").click(function(){ > var biblionumbers = ""; >@@ -253,6 +273,7 @@ > <th>Hold starts on date</th> > [% END %] > <th>Hold not needed after</th> >+ [% IF ( OPACShowHoldNotes ) %]<th>Notes</th>[% END %] > [% IF ( OPACItemHolds ) %] > <th id="place_on_hdr" style="display:none">Place on</th> > [% END %] >@@ -261,7 +282,7 @@ > <th>Pickup location</th> > [% END %] > [% END %] >- </tr>[% ELSE %]<tr><th colspan="5">Title</th></tr>[% END %] >+ </tr>[% ELSE %]<tr><th colspan="[% itemtable_colspan + 1 %]">Title</th></tr>[% END %] > > [% FOREACH bibitemloo IN bibitemloop %] > <tr> >@@ -281,7 +302,7 @@ > [% ELSE %] > [% UNLESS ( none_available ) %]<td class="hold"> </td>[% END %] > [% END %] >- [% IF ( bibitemloo.holdable ) %]<td class="title">[% ELSE %]<td class="title" colspan="5">[% END %] >+ [% IF ( bibitemloo.holdable ) %]<td class="title">[% ELSE %]<td class="title" colspan="[% itemtable_colspan + 1 %]">[% END %] > <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> > [% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %] > >@@ -339,6 +360,8 @@ > <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('expiration_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear date</a></p> > </td>[% END %] > >+ [% IF ( OPACShowHoldNotes ) %][% IF ( bibitemloo.holdable ) %]<td><input type="button" id="shownotes_[% bibitemloo.biblionumber %]" class="shownotes" value="Show notes"/></td>[% END %][% END %] >+ > [% IF ( bibitemloo.holdable ) %] > <!-- HOLD ABLE --> > [% IF ( OPACItemHolds ) %] >@@ -415,6 +438,20 @@ > [% END %] > </tr> > >+ [% IF ( OPACShowHoldNotes ) %] >+ [% IF ( bibitemloo.holdable ) %] >+ <tr class="notesrow" id="notesrow_[% bibitemloo.biblionumber %]"> >+ <td> </td> >+ <td colspan="[% itemtable_colspan %]"> >+ <label for="holdnotes">Hold notes:</label> >+ <span id="forcenotesreason_[% bibitemloo.biblionumber %]" class="forcenotesreason"></span> >+ <textarea name="notes_[% bibitemloo.biblionumber %]">[% bibitemloo.holdnotes %]</textarea> >+ <input type="hidden" id="notesmandatory_[% bibitemloo.biblionumber %]" value="[% bibitemloo.mandatorynotes %]"/> >+ </td> >+ </tr> >+ [% END %] >+ [% END %] >+ > [% IF ( OPACItemHolds ) %] > [% IF ( bibitemloo.holdable ) %] > <tr class="copiesrow" id="copiesrow_[% bibitemloo.biblionumber %]"> >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 07b4f76..5dc5bcd 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -171,7 +171,6 @@ foreach my $biblioNumber (@biblionumbers) { > # > # > if ( $query->param('place_reserve') ) { >- my $notes = $query->param('notes'); > my $reserve_cnt = 0; > if ($MAXIMUM_NUMBER_OF_RESERVES) { > $reserve_cnt = GetReservesFromBorrowernumber( $borrowernumber ); >@@ -255,6 +254,7 @@ if ( $query->param('place_reserve') ) { > # Inserts a null into the 'itemnumber' field of 'reserves' table. > $itemNum = undef; > } >+ my $notes = $query->param('notes_'.$biblioNum)||''; > > if ( $MAXIMUM_NUMBER_OF_RESERVES > && $reserve_cnt >= $MAXIMUM_NUMBER_OF_RESERVES ) >@@ -374,6 +374,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 > > if (!$itemLevelTypes && $biblioData->{itemtype}) { > $biblioLoopIter{description} = $itemTypes->{$biblioData->{itemtype}}{description}; >@@ -550,13 +551,16 @@ if ( $numBibsAvailable == 0 || !$anyholdable) { > $template->param( none_available => 1 ); > } > >-my $itemTableColspan = 7; >+my $itemTableColspan = 8; > if (! $template->{VARS}->{'OPACItemHolds'}) { > $itemTableColspan--; > } > if (! $template->{VARS}->{'singleBranchMode'}) { > $itemTableColspan--; > } >+my $show_notes=C4::Context->preference('OPACShowHoldNotes'); >+$template->param(OPACShowHoldNotes=>$show_notes); >+$itemTableColspan-- if !$show_notes; > $template->param(itemtable_colspan => $itemTableColspan); > > # display infos >-- >1.7.2.5
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 9722
:
15752
|
15753
|
15806
|
15807
|
15808
|
15834
|
15836
|
17717
|
17718
|
17719
|
17726
|
18342
|
18343
|
18344