Bugzilla – Attachment 170572 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), 8.07 KB, created by
Sam Lau
on 2024-08-21 16:48:45 UTC
(
hide
)
Description:
Bug 31521: Configure behaviour when checking in a reserved item at SCO
Filename:
MIME Type:
Creator:
Sam Lau
Created:
2024-08-21 16:48:45 UTC
Size:
8.07 KB
patch
obsolete
>From 9787d9434834288a41573b595e9910ffdfaa7347 Mon Sep 17 00:00:00 2001 >From: Jeremy Breuillard <jeremy.breuillard@biblibre.com> >Date: Mon, 29 Jul 2024 11:58:16 +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 > >Signed-off-by: Sam Lau <samalau@gmail.com> >--- > .../data/mysql/atomicupdate/bug-31521.pl | 20 +++++++++++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 2 ++ > .../admin/preferences/circulation.pref | 15 +++++++++++++- > .../bootstrap/en/modules/sco/sco-main.tt | 12 +++++++++++ > opac/sco/sco-main.pl | 6 ++++++ > 5 files changed, 54 insertions(+), 1 deletion(-) > 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 1a7cd033e9..810aa63e2a 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -684,6 +684,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'), > ('SavedSearchFilters', '0', NULL, 'Allow staff with permission to create/edit custom search filters', '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'), > ('SCOBatchCheckoutsValidCategories','',NULL,'Patron categories allowed to checkout in a batch while logged into Self Checkout','Free'), > ('SCOLoadCheckoutsByDefault','1','','If enabled, load the list of a patrons checkouts when they log in to the Self Checkout','YesNo'), > ('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','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 76983576a6..1725c357a5 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 >@@ -521,7 +521,7 @@ Circulation: > - pref: ItemsDeniedRenewal > type: textarea > syntax: text/x-yaml >- class: code >+ aslass: code > - Define custom rules to deny specific items from renewal. > - "<br />Can name any field in the items table followed by a colon then a space then" > - "a bracketed list of values separated by commas." >@@ -1212,6 +1212,19 @@ Circulation: > type: textarea > syntax: javascript > 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" >+ > Self check-out module: > - > - "Include the following JavaScript on all pages in the web-based self checkout:" >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 b9b4c05e46..b646279383 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 >@@ -235,11 +235,23 @@ > <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 <i>([% barcode | html %])</i></p> > </div> >+ [% IF Koha.Preference('SCOCheckinIfReservedBehaviour') == 'Alert' %] >+ <div class="alert alert-warning"> >+ [% Koha.Preference('SCOCheckinIfReservedMessage') | html %] >+ </div> >+ [% END %] >+ > [% END %] > > [% UNLESS ( hide_main ) %] >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index bf923c754f..1f65bc9604 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -176,6 +176,12 @@ if ( $patron && $op eq "cud-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.39.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