From f95a6adf7a1533f0cdf6d36a63d0483a146da666 Mon Sep 17 00:00:00 2001 From: Sam Lau Date: Mon, 24 Jun 2024 16:26:36 +0000 Subject: [PATCH] Bug 26777: Add new system preference 'OPACVirtualCardBarcode' Signed-off-by: Laura Escamilla Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer --- .../data/mysql/atomicupdate/bug_26777.pl | 32 +++++++++++++++++++ .../data/mysql/atomicupdate/bug_37118.pl | 23 ------------- installer/data/mysql/mandatory/sysprefs.sql | 1 + .../en/modules/admin/preferences/opac.pref | 17 ++++++++++ 4 files changed, 50 insertions(+), 23 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_26777.pl delete mode 100755 installer/data/mysql/atomicupdate/bug_37118.pl diff --git a/installer/data/mysql/atomicupdate/bug_26777.pl b/installer/data/mysql/atomicupdate/bug_26777.pl new file mode 100755 index 0000000000..f9df800b93 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_26777.pl @@ -0,0 +1,32 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_failure say_success say_info); + +return { + bug_number => "26777", + description => "Adds new system preferences 'OPACVirtualCard and 'OPACVirtualCardBarcode'", + 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') + } + ); + + $dbh->do( + q{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES + ('OPACVirtualCardBarcode', 'code39', 'code39|code128|ean13|upca|upce|ean8|itf14|qrcode|matrix2of5|industrial2of5|iata2of5|coop2of5','Specify the type of barcode to be used in the patron virtual library card tab in the OPAC.', 'Choice') + } + ); + + + # sysprefs + say $out "Added new system preference 'OPACVirtualCard'"; + say $out "Added new system preference 'OPACVirtualCardBarcode'"; + + }, +}; diff --git a/installer/data/mysql/atomicupdate/bug_37118.pl b/installer/data/mysql/atomicupdate/bug_37118.pl deleted file mode 100755 index 4c3990c89f..0000000000 --- a/installer/data/mysql/atomicupdate/bug_37118.pl +++ /dev/null @@ -1,23 +0,0 @@ -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 707f80b805..2a4002a852 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -569,6 +569,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('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'), +('OPACVirtualCardBarcode','code39','code39|code128|ean13|upca|upce|ean8|itf14|qrcode|matrix2of5|industrial2of5|iata2of5|coop2of5','Specify the type of barcode to be used in the patron virtual library card tab in the OPAC','Choice'), ('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 1f26f6623e..9b3b1ca675 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 @@ -914,6 +914,23 @@ OPAC: 1: Allow 0: "Don't allow" - patrons to access the 'My Virtual Card' tab on their account page on the OPAC. + - "If set to allow, show a " + - pref: OPACVirtualCardBarcode + default: code39 + choices: + code39: "CODE39" + code128: "CODE128" + ean13: "EAN-13" + upca: "UPC-A" + upce: "UPC-E" + ean8: "EAN-8" + itf14: "ITF-14" + qrcode: "QR Code" + matrix2of5: "Matrix 2 of 5" + industrial2of5: "Industrial 2 of 5" + iata2of5: "IATA 2 of 5" + coop2of5: "COOP 2 of 5" + - " barcode in the patron's virtual card." - - "Fields that should be mandatory for patron purchase suggestions:" - pref: OPACSuggestionMandatoryFields -- 2.39.5