From d46f0fce67cd6db0d25750d4c55cd4574d3c6e2e Mon Sep 17 00:00:00 2001 From: Sam Lau Date: Mon, 24 Jun 2024 16:26:36 +0000 Subject: [PATCH] Bug 26777: (Follow-up) Add new system preference 'OPACVirtualCardBarcode' --- .../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 | 16 ++++++++++ 4 files changed, 49 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..2549d36ed3 --- /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|Pharmacode|EAN-13|UPC|EAN-8|EAN-5|EAN-2|ITF|Codabar','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 89398d4544..beeb2986e3 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -565,6 +565,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|Pharmacode|EAN-13|UPC|EAN-8|EAN-5|EAN-2|ITF|Codabar','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 0ab5f840b9..5e454a12a1 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 @@ -898,6 +898,22 @@ OPAC: 1: Allow 0: "Don't allow" - patrons to access the 'My Virtual Card' tab on their account page on the OPAC. + - + - "Show a " + - pref: OPACVirtualCardBarcode + default: CODE39 + choices: + CODE39: "CODE39" + CODE128: "CODE128" + pharmacode: "Pharmacode" + EAN13: "EAN-13" + UPC: "UPC" + EAN8: "EAN-8" + EAN5: "EAN-5" + EAN2: "EAN-2" + ITF: "ITF" + codabar: "Codabar" + - " barcode in the patron's virtual card." - - "Fields that should be mandatory for patron purchase suggestions:" - pref: OPACSuggestionMandatoryFields -- 2.39.2