From 1d0b329d67de3c2829ee102a034c4c41f350b9fc Mon Sep 17 00:00:00 2001 From: David Roberts Date: Sat, 29 Jul 2017 22:54:18 +0100 Subject: [PATCH] Add BDS system preferences and enable them to be read by the templates https://bugs.koha-community.org/show_bug.cgi?id=19044 --- C4/Auth.pm | 2 ++ installer/data/mysql/atomicupdate/BDS.perl | 14 ++++++++++++++ installer/data/mysql/sysprefs.sql | 3 +++ .../en/modules/admin/preferences/enhanced_content.pref | 18 ++++++++++++++++++ 4 files changed, 37 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/BDS.perl diff --git a/C4/Auth.pm b/C4/Auth.pm index d22e935..9d52ab9 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -421,6 +421,8 @@ sub get_template_and_user { "BiblioDefaultView" . C4::Context->preference("BiblioDefaultView") => 1, EnhancedMessagingPreferences => C4::Context->preference('EnhancedMessagingPreferences'), GoogleJackets => C4::Context->preference("GoogleJackets"), + BDSOpacEnable => C4::Context->preference("BDSOpacEnable"), + BDSStaffEnable => C4::Context->preference("BDSStaffEnable"), OpenLibraryCovers => C4::Context->preference("OpenLibraryCovers"), KohaAdminEmailAddress => "" . C4::Context->preference("KohaAdminEmailAddress"), LoginBranchcode => ( C4::Context->userenv ? C4::Context->userenv->{"branch"} : undef ), diff --git a/installer/data/mysql/atomicupdate/BDS.perl b/installer/data/mysql/atomicupdate/BDS.perl new file mode 100644 index 0000000..99c8555 --- /dev/null +++ b/installer/data/mysql/atomicupdate/BDS.perl @@ -0,0 +1,14 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + # you can use $dbh here like: + $dbh->do( "INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('BDSOpacEnable', '0', 'Enable or disable BDS enhanced content in the OPAC', NULL, 'YesNo'),('BDSStaffEnable', '0', 'Enable or disable BDS enhanced content in the Staff Interface', NULL, 'YesNo'),('DBMCode','','NULL','BDS Customer DBM Code','Free');" ); + + # or perform some test and warn + # if( !column_exists( 'biblio', 'biblionumber' ) ) { + # warn "There is something wrong"; + # } + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug XXXXX - description)\n"; +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 0bd8cac..da98e44 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -78,6 +78,9 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('BasketConfirmations','1','always ask for confirmation.|do not ask for confirmation.','When closing or reopening a basket,','Choice'), ('BatchCheckouts','0','','Enable or disable batch checkouts','YesNo'), ('BatchCheckoutsValidCategories','',NULL,'Patron categories allowed to checkout in a batch','Free'), +('BDSOpacEnable','0','NULL','Enable or disable BDS enhanced content in the OPAC','YesNo'), +('BDSStaffEnable','0','NULL','Enable or disable BDS enhanced content in the Staff Interface','YesNo'), +('DBMCode','','NULL','BDS Customer DBM Code','Free'), ('BiblioAddsAuthorities','0',NULL,'If ON, adding a new biblio will check for an existing authority record and create one on the fly if one doesn\'t exist','YesNo'), ('BiblioDefaultView','normal','normal|marc|isbd','Choose the default detail view in the catalog; choose between normal, marc or isbd','Choice'), ('BibtexExportAdditionalFields', '', NULL , 'Define additional BibTex tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.', 'textarea'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref index f62882d..20f293e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref @@ -79,6 +79,24 @@ Enhanced Content: - pref: BakerTaylorPassword class: password - . + BDS: + - + - pref: BDSOpacEnable + choices: + yes: Show + no: "Don't show" + - BDS enhanced content in the OPAC. + - + - pref: BDSStaffEnable + choices: + yes: Show + no: "Don't show" + - BDS enhanced content in the Staff Interface + - + - Enter your unique BDS + - pref: DBMCode + - DBM code. + Novelist Select: - - pref: NovelistSelectEnabled -- 2.1.4