Bugzilla – Attachment 86598 Details for
Bug 20421
Apply CheckPrevCheckout logic when placing a hold on the staff client
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20421: Inform staff that patron does have the title checked out during placing hold
Bug-20421-Inform-staff-that-patron-does-have-the-t.patch (text/plain), 5.84 KB, created by
Martin Renvoize (ashimema)
on 2019-03-14 12:26:22 UTC
(
hide
)
Description:
Bug 20421: Inform staff that patron does have the title checked out during placing hold
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-03-14 12:26:22 UTC
Size:
5.84 KB
patch
obsolete
>From b5ddc41e06b943943c44662c5234289d5c5931b2 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Tue, 13 Mar 2018 14:57:49 +0000 >Subject: [PATCH] Bug 20421: Inform staff that patron does have the title > checked out during placing hold > >Test plan: >1) Enable the CheckPrevCheckout and DisplayMultiPlaceHold system preferences >2) Have a patron with some checkouts history >3) Try to place hold on one of titles from history for this patron >4) You should see an information at the top of confirm request page, but >you still should be able to place a hold >5) Try this with multiple titles - one or more of them should be from >history >6) You should see this information in "Information" column >7) There is also new column placed at the beggining with checkbox, you >could uncheck it for titles you do not want to place a hold on it >8) Confirm the hold is placed only on checked titles > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../prog/en/modules/reserve/request.tt | 28 +++++++++++++++---- > reserve/request.pl | 18 +++++++++++- > 2 files changed, 40 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index 8a0cc00eba..65df866535 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -90,6 +90,14 @@ > </form> > [% ELSIF NOT noitems %] > >+[% IF ( checked_previously && !multi_hold ) %] >+<div class="dialog alert"> >+ <ul> >+ <li>Patron has previously checked out this title</li> >+ </ul> >+</div> >+[% END %] >+ > [% IF ( exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %] > <div class="dialog alert"> > >@@ -439,6 +447,7 @@ > > <table id="requesttitles"> > <tr> >+ <th> </th> > <th>Title</th> > [% UNLESS ( item_level_itypes ) %] > <th>Item type</th> >@@ -453,15 +462,17 @@ > <tr> > [% END %] > <td> >+ [% UNLESS ( biblioloo.warn ) %] >+ <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber | html %]"/></td> >+ [% END %] >+ <td> > <ul> > <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber | uri %]">[% biblioloo.title | html %]</a></li> > [% IF ( biblioloo.publicationyear ) %] > <li><span class="label">Publication year:</span> [% biblioloo.publicationyear | html %]</li> > [% END %] > </ul> >- [% UNLESS ( biblioloo.warn ) %] >- <span class="multi_hold_item" title="[% biblioloo.biblionumber | html %]"></span> >- [% ELSE %] >+ [% IF ( biblioloo.warn ) %] > <span class="not_holdable" title="[% biblioloo.biblionumber | html %]"></span> > [% END %] > </td> >@@ -472,6 +483,9 @@ > [% END %] > <td>[% biblioloo.rank | html %]</td> > <td> >+ [% IF ( biblioloo.checked_previously ) %] >+ <span class="alert">Patron has previously checked out this title</span><br/> >+ [% END %] > [% IF ( biblioloo.alreadyres ) %] > <ul> > [% ELSE %] >@@ -509,7 +523,11 @@ > [% ELSIF ( none_available ) %] > <input type="submit" disabled="disabled" value="Place hold" /> > [% ELSE %] >- <input type="submit" value="Place hold" /> >+ [% IF ( multi_hold ) %] >+ <input type="submit" value="Place hold" id="multi_hold_submit"/> >+ [% ELSE %] >+ <input type="submit" value="Place hold" /> >+ [% END %] > [% END %] > [% END %] > </fieldset> >@@ -742,7 +760,7 @@ > } > > function checkMultiHold() { >- var spans = $(".multi_hold_item"); >+ var spans = $(".multi_hold_item_checkbox:checked"); > if ($(spans).size() == 0) { > alert(MSG_NO_ITEMS_AVAILABLE); > return false; >diff --git a/reserve/request.pl b/reserve/request.pl >index 2ef00c8b95..5ec4de105d 100755 >--- a/reserve/request.pl >+++ b/reserve/request.pl >@@ -143,6 +143,7 @@ if ( $biblionumbers ) { > push @biblionumbers, $input->multi_param('biblionumber'); > } > >+my $multihold = scalar $input->param('multi_hold'); > # FIXME multi_hold should not be a variable but depends on the number of elements in @biblionumbers > $template->param(multi_hold => scalar $input->param('multi_hold')); > >@@ -208,6 +209,10 @@ my $patron = Koha::Patrons->find( $borrowernumber_hold ); > > my $logged_in_patron = Koha::Patrons->find( $borrowernumber ); > >+my $wants_check; >+if ($patron) { >+ $wants_check = $patron->wants_check_for_previous_checkout; >+} > my $itemdata_enumchron = 0; > my $itemdata_ccode = 0; > my @biblioloop = (); >@@ -373,7 +378,18 @@ foreach my $biblionumber (@biblionumbers) { > > foreach my $itemnumber ( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} } ) { > my $item = $iteminfos_of->{$itemnumber}; >- >+ my $do_check; >+ if ( $patron ) { >+ $do_check = $patron->do_check_for_previous_checkout($item) if $wants_check; >+ if ( $do_check && $wants_check ) { >+ $item->{checked_previously} = $do_check; >+ if ( $multihold ) { >+ $biblioloopiter{checked_previously} = $do_check; >+ } else { >+ $template->param( checked_previously => $do_check ); >+ } >+ } >+ } > $item->{force_hold_level} = $force_hold_level; > > unless (C4::Context->preference('item-level_itypes')) { >-- >2.20.1
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 20421
:
72935
|
76611
|
86133
|
86150
|
86598
|
86691
|
88002
|
88686
|
88687