From 8c801ea1323dd5247a8c4e1477b800d18f64f28b Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 17 Aug 2023 09:10:54 +0000 Subject: [PATCH] Bug 34557: Add SCOLoadCheckoutsByDefault system preference This patch adds a enw system preference SCOLoadCheckoutsByDefault When enabled, a patron's list o fcurrent checkouts will be loaded when the sign in to the SCO module. If disabled, they will see link to load their checkouts. In either case, a new section is added to the SCO to show a brief display of the last checked out it To test: 1 - Enable WebBasedSelfCheck system preference 2 - Browse to: http://localhost:8080/cgi-bin/koha/sco/sco-main.pl 3 - Sign in the SCO user (or enable AutoSelfCheck) 4 - Sign in as a user with several items checked out 5 - Confirm you see a list of items checked out 6 - Apply patches, updatedatabase, restart_all 7 - 'Finish' and login patron to SCO again 8 - Confirm you still see the list 9 - 'Finish' 10 - Chenge the system preference 11 - Sign in to SCO, confirm checkouts do not load 12 - Confirm you see 'Load your checkouts' link 13 - Check an item out 14 - Confirm you see the last checkout, but not a list 15 - Attempt to checkout an item that cannot be checked out 16 - Confirm "Return to account summary" does not load checkouts 17 - Click "Load your checkouts" 18 - Confirm they load 19 - Check out another item, confrim they remain and are updated 20 - Checkout an item that cannot be issued 21 - Confirm 'Return to account summary' loads the checkouts again Signed-off-by: Andrew Auld Signed-off-by: AndrewA Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../data/mysql/atomicupdate/bug_34557.pl | 19 +++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../admin/preferences/circulation.pref | 6 +++ .../bootstrap/en/modules/sco/sco-main.tt | 27 +++++++++++++ opac/sco/sco-main.pl | 40 ++++++++++--------- 5 files changed, 75 insertions(+), 18 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_34557.pl diff --git a/installer/data/mysql/atomicupdate/bug_34557.pl b/installer/data/mysql/atomicupdate/bug_34557.pl new file mode 100755 index 0000000000..90a4cd3ec3 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_34557.pl @@ -0,0 +1,19 @@ +use Modern::Perl; + +return { + bug_number => "34557", + description => "Add system preference SCOLoadCheckoutsByDefault", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + $dbh->do( + q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('SCOLoadCheckoutsByDefault','1','','If enabled, load the list of a patrons checkouts when they log in to the Self Checkout','YesNo') + } + ); + + say $out "Added new system preference 'SCOLoadCheckoutsByDefault'"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 044361b6ad..108410335f 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -653,6 +653,7 @@ 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'), +('SCOLoadCheckoutsByDefault','1','','If enabled, load the list of a patrons checkouts when they log in to the Self Checkout','YesNo'), ('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