From 164ef5ecd2bc03eb3368c3857a610e2885dd1b13 Mon Sep 17 00:00:00 2001 From: Sam Lau Date: Tue, 18 Jun 2024 19:04:44 +0000 Subject: [PATCH] Bug 26777: Added new sys pref 'OPACVirtualCard' Signed-off-by: Laura Escamilla Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- .../data/mysql/atomicupdate/bug_37118.pl | 21 +++++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../en/modules/admin/preferences/opac.pref | 6 ++++++ 3 files changed, 28 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_37118.pl diff --git a/installer/data/mysql/atomicupdate/bug_37118.pl b/installer/data/mysql/atomicupdate/bug_37118.pl new file mode 100644 index 0000000000..26d3554c94 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_37118.pl @@ -0,0 +1,21 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "37118", + description => "Adds new system preference 'OPACVirtualCard'", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # Do you stuffs here + $dbh->do(q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('OPACVirtualCard', '0', NULL,'Enable virtual library cards for patrons on the OPAC.', 'YesNo') + }); + + # sysprefs + say $out "Added new system preference 'OPACVirtualCard'"; + + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index 1a7cd033e9..707f80b805 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -568,6 +568,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('opacuserlogin','1',NULL,'Enable or disable display of user login features','YesNo'), ('OPACUserSummary', 1, NULL, "Show the summary of a logged in user's checkouts, overdues, holds and fines on the mainpage", 'YesNo'), ('OPACViewOthersSuggestions','0',NULL,'If ON, allows all suggestions to be displayed in the OPAC','YesNo'), +('OPACVirtualCard','0',NULL,'If ON, the patron virtual library card tab in the OPAC will be enabled','YesNo'), ('OPACXSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on OPAC','Free'), ('OPACXSLTListsDisplay','default','','Enable XSLT stylesheet control over lists pages display on OPAC','Free'), ('OPACXSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on OPAC','Free'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 1fe694567c..1f26f6623e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -908,6 +908,12 @@ OPAC: 1: Show 0: "Don't show" - purchase suggestions from other patrons on the OPAC. + - + - pref: OPACVirtualCard + choices: + 1: Allow + 0: "Don't allow" + - patrons to access the 'My Virtual Card' tab on their account page on the OPAC. - - "Fields that should be mandatory for patron purchase suggestions:" - pref: OPACSuggestionMandatoryFields -- 2.39.5