Bugzilla – Attachment 18342 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.31 KB, created by
Jonathan Druart
on 2013-05-23 10:35:27 UTC
(
hide
)
Description:
Bug 9722: Allow users to add notes when placing a hold in opac
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-05-23 10:35:27 UTC
Size:
9.31 KB
patch
obsolete
>From 257204544a16ce58707b64dc20062c94bbffd9ef 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> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > .../prog/en/modules/admin/preferences/opac.pref | 8 ++++ > koha-tmpl/opac-tmpl/prog/en/css/opac.css | 10 +++++ > .../opac-tmpl/prog/en/modules/opac-reserve.tt | 41 +++++++++++++++++++- > opac/opac-reserve.pl | 8 +++- > 4 files changed, 63 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 d1225b4..81824e4 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 >@@ -417,6 +417,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 24a62a1..5e5d2f4 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css >+++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css >@@ -2795,6 +2795,7 @@ div.authorizedheading { > width: 75%; > } > >+ > .contentblock { > position: relative; > margin-left: 2em; >@@ -2950,3 +2951,12 @@ a.reviewlink,a.reviewlink:visited { > float:left; > padding: 0.1em 0; > } >+.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 85f1c30..c77a11e 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 d0da2c5..d1c3360 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -170,7 +170,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 ); >@@ -254,6 +253,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 ) >@@ -373,6 +373,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}; >@@ -547,13 +548,16 @@ if ( $numBibsAvailable == 0 || $anyholdable == 0) { > $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.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 9722
:
15752
|
15753
|
15806
|
15807
|
15808
|
15834
|
15836
|
17717
|
17718
|
17719
|
17726
| 18342 |
18343
|
18344