From 720337e3e58572ed4caddc657d608a6fb92c3322 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 --- .../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 0496d3fd48..8aae8b7535 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -566,6 +566,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 8c2c30d7fd..ee28bcf443 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 @@ -902,6 +902,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.2