Bugzilla – Attachment 140212 Details for
Bug 31521
Allow to configure behaviour when checking in a reserved item at SCO
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31521: Configure behaviour when checking in a reserved item at SCO
Bug-31521-Configure-behaviour-when-checking-in-a-r.patch (text/plain), 7.48 KB, created by
Julian Maurice
on 2022-09-05 14:16:53 UTC
(
hide
)
Description:
Bug 31521: Configure behaviour when checking in a reserved item at SCO
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2022-09-05 14:16:53 UTC
Size:
7.48 KB
patch
obsolete
>From 4449cbe2a3cc0cbd9e72795a8e16ba3c13f59236 Mon Sep 17 00:00:00 2001 >From: jeremy breuillard <jeremy.breuillard@biblibre.com> >Date: Mon, 9 May 2022 11:42:55 +0200 >Subject: [PATCH] Bug 31521: Configure behaviour when checking in a reserved > item at SCO > >This patch adds a system preference (SCOCheckinIfReservedBehaviour) >which allow to control the behaviour of SCO checkin when the returned >item is reserved: >- allow checkin (current behaviour) >- allow checkin and show a message >- forbid checkin and show a message > >The message is configurable is another system preference >(SCOCheckinIfReservedMessage) > >Test plan: >1. Apply patch, run updatedatabase.pl and restart koha >2. Enable WebBasedSelfCheck and SCOAllowCheckin >3. (Staff) Set SCOCheckinIfReservedBehaviour to "Forbid checkin & show > message" >4. (Staff) Write some text in SCOCheckinIfReservedMessage >5. (Staff) Checkout an item I to patron A >6. (Staff) Place a hold on item I for patron B >7. (SCO) Log in to SCO with patron A >8. (SCO) Try to return item I > The configured message should be displayed and item I should still be > checked out >9. (Staff) Set SCOCheckinIfReservedBehaviour to "Allow checkin & show message" >10. (SCO) Try to return item I > The configured message should be displayed and item I should have > been checked in >11. (Staff) Checkout item I to patron A again >12. (Staff) Set SCOCheckinIfReservedBehaviour to "Allow checkin" >13. (SCO) Try to return item I > The configured message should NOT be displayed and item I should > have been checked in >--- > .../data/mysql/atomicupdate/bug-31521.pl | 20 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 2 ++ > .../admin/preferences/circulation.pref | 12 +++++++++++ > .../bootstrap/en/modules/sco/sco-main.tt | 10 ++++++++++ > opac/sco/sco-main.pl | 5 +++++ > 5 files changed, 49 insertions(+) > create mode 100644 installer/data/mysql/atomicupdate/bug-31521.pl > >diff --git a/installer/data/mysql/atomicupdate/bug-31521.pl b/installer/data/mysql/atomicupdate/bug-31521.pl >new file mode 100644 >index 0000000000..fca18ecbb9 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug-31521.pl >@@ -0,0 +1,20 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "31521", >+ description => "Add sysprefs SCOCheckinIfReservedBehaviour and SCOCheckinIfReservedMessage", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) >+ VALUES ('SCOCheckinIfReservedMessage','', NULL,'Message to display if SCOCheckinIfReservedBehaviour is "Alert" or "Forbid"','Free') >+ }); >+ >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences (`variable`, `value`,`options`,`explanation`, `type`) >+ VALUES ('SCOCheckinIfReservedBehaviour', 'Allow', 'Allow|Alert|Forbid', 'Behaviour of SCO checkin when the returned item is reserved', 'Choice') >+ }); >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index 9a5cb2e0a8..b516b5330f 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -615,6 +615,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('RoutingListNote','To change this note edit <a href=\"/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped\">RoutingListNote</a> system preference.','70|10','Define a note to be shown on all routing lists','Textarea'), > ('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'), > ('SCOAllowCheckin','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'), >+('SCOCheckinIfReservedMessage','', NULL,'Message to display if SCOCheckinIfReservedBehaviour is "Alert" or "Forbid"','Free'), >+('SCOCheckinIfReservedBehaviour', 'Allow', 'Allow|Alert|Forbid', 'Behaviour of SCO checkin when the returned item is reserved', 'Choice'), > ('SCOMainUserBlock','','70|10','Add a block of HTML that will display on the self checkout screen','Textarea'), > ('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'), > ('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index f99af038e8..915647aa93 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -1163,6 +1163,18 @@ Circulation: > type: textarea > syntax: css > class: code >+ - >+ - "Message displayed when there are holds during a self checkin" >+ - pref: SCOCheckinIfReservedMessage >+ type: textarea >+ - >+ - "Behavior for the self checkin when there are holds on the returned item" >+ - pref: SCOCheckinIfReservedBehaviour >+ choices: >+ Alert: Allow checkin & show message >+ Allow: Allow checkin >+ Forbid: Forbid checkin & show message >+ - "</br>The message shown can be configured in system preference SCOCheckinIfReservedMessage" > - > - pref: ShowPatronImageInWebBasedSelfCheck > choices: >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >index 7feec7e2fc..dc147d98a2 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >@@ -214,11 +214,21 @@ > <div class="alert alert-info"> > <p>Item not checked in: please see circulation staff for assistance</p> > </div> >+ [% IF Koha.Preference('SCOCheckinIfReservedBehaviour') == 'Forbid' %] >+ <div class="alert alert-warning"> >+ [% Koha.Preference('SCOCheckinIfReservedMessage') | html %] >+ </div> >+ [% END %] > [% ELSIF ( returned == 1 ) %] > <span class="sco-alert-success return"></span> > <div class="alert alert-info"> > <p>Item checked in</p> > </div> >+ [% IF Koha.Preference('SCOCheckinIfReservedBehaviour') == 'Alert' %] >+ <div class="alert alert-warning"> >+ [% Koha.Preference('SCOCheckinIfReservedMessage') | html %] >+ </div> >+ [% END %] > [% END %] > > >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index ac89db749c..478e7c54cc 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -158,6 +158,11 @@ if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) { > unless $patron->checkouts->find( { itemnumber => $item->itemnumber } ); > } > >+ if ($success && C4::Context->preference('SCOCheckinIfReservedBehaviour') eq 'Forbid') { >+ my $holds_count = Koha::Holds->search({ itemnumber => $item->itemnumber }); >+ $success = 0 if $holds_count > 0; >+ } >+ > if ( $success ) { > ($success) = AddReturn( $barcode, $branch ) > } >-- >2.30.2
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 31521
:
140212
|
169820
|
170572