Bugzilla – Attachment 103857 Details for
Bug 25261
Multiple parts handling - confirmation alert
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25261: Require confirmation of multiple parts items
Bug-25261-Require-confirmation-of-multiple-parts-i.patch (text/plain), 8.77 KB, created by
Martin Renvoize (ashimema)
on 2020-04-28 12:57:09 UTC
(
hide
)
Description:
Bug 25261: Require confirmation of multiple parts items
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-04-28 12:57:09 UTC
Size:
8.77 KB
patch
obsolete
>From 0fe84fe6391da5e55ea709ad84deffb22cb7357f Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 5 Aug 2015 13:52:09 +0100 >Subject: [PATCH] Bug 25261: Require confirmation of multiple parts items > >Test plan >1/ Catalogue an item to contain multiple parts by populating 'Materials >specified (bound volume or other part)' >2/ Enable the new system preference 'CircConfirmParts' >3/ Attempt to checkout the item created in step 1 to a user and note >that confirmation is now required. >4/ Checkout the item >5/ Attempt to checkin the item you have just checked out and note that >confirmation is required. >6/ Signoff >--- > C4/Circulation.pm | 6 +++ > circ/returns.pl | 39 ++++++++++++------- > .../prog/en/modules/circ/circulation.tt | 9 ++++- > .../prog/en/modules/circ/returns.tt | 35 +++++++++++++++-- > 4 files changed, 71 insertions(+), 18 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index faaa2692e8..f487fca465 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -843,6 +843,12 @@ sub CanBookBeIssued { > } > } > >+ # Additional Materials Check >+ my $no_of_parts = $item_object->materials; >+ if ( $no_of_parts > 0 ) { >+ $needsconfirmation{additional_materials} = $no_of_parts; >+ } >+ > # > # CHECK IF BOOK ALREADY ISSUED TO THIS BORROWER > # >diff --git a/circ/returns.pl b/circ/returns.pl >index 8044262551..b7dc02f2a6 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -274,18 +274,18 @@ if ($barcode) { > my $checkout = $item->checkout; > my $biblio = $item->biblio; > $template->param( >- title => $biblio->title, >- homebranch => $item->homebranch, >- holdingbranch => $item->holdingbranch, >- returnbranch => $returnbranch, >- author => $biblio->author, >- itembarcode => $item->barcode, >- itemtype => $item->effective_itemtype, >- ccode => $item->ccode, >- itembiblionumber => $biblio->biblionumber, >- biblionumber => $biblio->biblionumber, >+ title => $biblio->title, >+ homebranch => $item->homebranch, >+ holdingbranch => $item->holdingbranch, >+ returnbranch => $returnbranch, >+ author => $biblio->author, >+ itembarcode => $item->barcode, >+ itemtype => $item->effective_itemtype, >+ ccode => $item->ccode, >+ itembiblionumber => $biblio->biblionumber, >+ biblionumber => $biblio->biblionumber, > additional_materials => $materials, >- issue => $checkout, >+ issue => $checkout, > ); > } # FIXME else we should not call AddReturn but set BadBarcode directly instead > >@@ -297,9 +297,18 @@ if ($barcode) { > > my $return_date = $dropboxmode ? $dropboxdate : $return_date_override_dt; > >+ # Block return if multi-part and confirm has not been recieved >+ my $needs_confirm = 0; >+ if ( C4::Context->preference("CircConfirmParts") ) { >+ if ( $item->materials > 0 && !$query->param('multiple_confirm') ) { >+ $needs_confirm = 1; >+ } >+ } >+ > # do the return > ( $returned, $messages, $issue, $borrower ) = >- AddReturn( $barcode, $userenv_branch, $exemptfine, $return_date ); >+ AddReturn( $barcode, $userenv_branch, $exemptfine, $return_date ) >+ unless $needs_confirm; > > if ($returned) { > my $time_now = dt_from_string()->truncate( to => 'minute'); >@@ -340,13 +349,17 @@ if ($barcode) { > ); > } > } >- } elsif ( C4::Context->preference('ShowAllCheckins') and !$messages->{'BadBarcode'} ) { >+ } elsif ( C4::Context->preference('ShowAllCheckins') and !$messages->{'BadBarcode'} and !$needs_confirm ) { > $input{duedate} = 0; > $returneditems{0} = $barcode; > $riduedate{0} = 0; > push( @inputloop, \%input ); > } > $template->param( privacy => $borrower->{privacy} ); >+ >+ if ( $needs_confirm ) { >+ $template->param( needs_confirm => $needs_confirm ); >+ } > } > $template->param( inputloop => \@inputloop ); > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 9087ccb03d..b72cc1ce5c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -82,7 +82,7 @@ > > [% IF ( NEEDSCONFIRMATION ) %] > <div id="circ_needsconfirmation" class="dialog alert audio-alert-action"> >- [% IF CAN_user_circulate_force_checkout %] >+ [% IF CAN_user_circulate_force_checkout or additional_materials %] > <h3>Please confirm checkout</h3> > [% ELSE %] > <h3>Cannot check out</h3> >@@ -98,6 +98,7 @@ > </li> > [% END %] > >+ > [% IF ( DEBT ) %] > <li>The patron has a debt of [% DEBT | $Price %].</li> > [% END %] >@@ -196,6 +197,12 @@ > [% END %] > </li> > [% END %] >+ >+ [% IF additional_materials %] >+ <li> >+ Please confirm that the accompanying materials are present: [% additional_materials %] >+ </li> >+ [% END %] > </ul> > > [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >index 50580d54e8..25d3107923 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt >@@ -121,11 +121,38 @@ > </div> > [% END %] > >- [% IF additional_materials %] >- <div class="dialog message" id="materials"> >- Note about the accompanying materials: <br /> >- [% additional_materials | html %] >+ [% IF needs_confirm %] >+ <div id="circ_needsconfirmation" class="dialog alert audio-alert-action"> >+ <h3>Please confirm checkin</h3> >+ <ul> >+ [% IF additional_materials %] >+ <li> >+ Please confirm that the accompanying materials are present: [% additional_materials | html %] >+ </li> >+ [% END %] >+ </ul> >+ >+ <form method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off"> >+ <input type="hidden" name="barcode" value="[% itembarcode | html %]" /> >+ >+ [% IF additional_materials %] >+ <input type="hidden" name="multiple_confirm" value="1" /> >+ [% END %] >+ >+ <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, checkin (Y)</button> >+ <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't checkin (N)</button> >+ </form> >+ </div> >+ [% ELSE %] >+ [% IF additional_materials %] >+ <div class="dialog alert"> >+ <ul> >+ <li> >+ Note about the accompanying materials: [% additional_materials | html %] >+ </li> >+ </ul> > </div> >+ [% END %] > [% END %] > > [% IF ( collectionItemNeedsTransferred ) %] >-- >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 25261
:
103856
|
103857
|
104011
|
104012
|
104013
|
104404
|
104405
|
104406
|
104407
|
104408
|
104409
|
104410
|
104411
|
104412
|
104413
|
104414
|
107217
|
107218
|
107219
|
107220
|
107221
|
107222
|
107228
|
107229
|
107230
|
107231
|
107232
|
107233
|
107234
|
107285
|
107331
|
107822
|
107823
|
108196
|
108197
|
108198
|
108199
|
108200
|
108201
|
108202
|
108203
|
108204
|
108205
|
108206
|
108207
|
108208
|
108230
|
108231
|
108232
|
108233
|
108234
|
108235
|
108236
|
108237
|
108238
|
108239
|
108240
|
108241
|
108242
|
109478
|
109479
|
109480
|
109481
|
109482
|
109483
|
109484
|
109485
|
109486
|
109487
|
109488
|
109489
|
109490
|
109491
|
109492
|
109493
|
109494
|
109495
|
109496
|
109497
|
109498
|
109499
|
109500
|
109501
|
109502
|
109503
|
109504
|
109508
|
110038
|
110039
|
110040
|
110041
|
110042
|
110043
|
110044
|
110045
|
110046
|
110047
|
110048
|
110049
|
110050
|
110051
|
110052
|
110133
|
110184
|
110258
|
110259
|
110268
|
110322
|
110323
|
110324
|
110325
|
110326
|
110327
|
110328
|
110329
|
110330
|
110331
|
110332
|
110333
|
110334
|
110335
|
110336
|
110337
|
110338
|
110339
|
110340
|
110341
|
110356
|
110357
|
110358
|
110359
|
110360
|
110361
|
110362
|
110363
|
110364
|
110365
|
110366
|
110367
|
110368
|
110369
|
110370
|
110371
|
110372
|
110373
|
110374
|
110375
|
110915
|
110916
|
110917
|
110918
|
110919
|
110920
|
110921
|
110922
|
110923
|
110924
|
110925
|
110926
|
110927
|
110928
|
110929
|
110930
|
110931
|
110932
|
110933
|
110934
|
111027