From 292262367ee39eb112b44b1dd27f8071521ab713 Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Mon, 28 Oct 2019 18:15:22 -0300 Subject: [PATCH] Bug 22581: Add new system preferences MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch adds 2 new system preferences: 1. OPACShowMusicalInscripts - to toggle musical inscripts to appear in opac's detail page 2. OPACPlayMusicalInscripts - to toggle musical inscripts to be transformed and payed in midi. Depends on OPACShowMusicalInscripts to be enabled. To test: 1. apply this patch 2. perl installer/data/mysql/updatedatabase.pl 3. search for this new preferences in admin module SUCCESS => they appear in OPAC section. 4. sign off Sponsored-by: Biblioteca Provincial Fr. Mamerto Esquiú (Provincia Franciscana de la Asunción) Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- installer/data/mysql/atomicupdate/bug-22581.perl | 12 ++++++++++++ installer/data/mysql/sysprefs.sql | 2 ++ .../prog/en/modules/admin/preferences/opac.pref | 14 ++++++++++++++ 3 files changed, 28 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug-22581.perl diff --git a/installer/data/mysql/atomicupdate/bug-22581.perl b/installer/data/mysql/atomicupdate/bug-22581.perl new file mode 100644 index 0000000000..53b04445e2 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug-22581.perl @@ -0,0 +1,12 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + # you can use $dbh here like: + $dbh->do( qq{ + INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) + VALUES ('OPACShowMusicalInscripts','0','','Display musical inscripts on the OPAC record details page when available.','YesNo'), + ('OPACPlayMusicalInscripts','0','','If displayed musical inscripts, play midi conversion on the OPAC record details page.','YesNo') + } ); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 22581 - add new OPACShowMusicalInscripts and OPACPlayMusicalInscripts system preferences)\n"; +} diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 234b6f8a3d..86514d94f9 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -431,6 +431,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OPACShelfBrowser','1','','Enable/disable Shelf Browser on item details page. WARNING: this feature is very resource consuming on collections with large numbers of items.','YesNo'), ('OPACShowCheckoutName','0','','Displays in the OPAC the name of patron who has checked out the material. WARNING: Most sites should leave this off. It is intended for corporate or special sites which need to track who has the item.','YesNo'), ('OPACShowHoldQueueDetails','none','none|priority|holds|holds_priority','Show holds details in OPAC','Choice'), +('OPACShowMusicalInscripts','0','','Display musical inscripts on the OPAC record details page when available.','YesNo'), +('OPACPlayMusicalInscripts','0','','If displayed musical inscripts, play midi conversion on the OPAC record details page.','YesNo'), ('OpacShowRecentComments','0',NULL,'If ON a link to recent comments will appear in the OPAC masthead','YesNo'), ('OPACShowUnusedAuthorities','1','','Show authorities that are not being used in the OPAC.','YesNo'), ('OpacStarRatings','all','disable|all|details',NULL,'Choice'), 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 8d00e78155..82214b4746 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 @@ -161,6 +161,20 @@ OPAC: column: "on a separate column" - "for items on the OPAC record details page." - "
Note: If 'on a separate column' is selected, you still need to enable the item_shelving_location display on the configure columns administration page" + - + - pref: OPACShowMusicalInscripts + default: 0 + choices: + yes: Show + no: "Don't show" + - musical inscripts on the OPAC record details page. + - + - pref: OPACPlayMusicalInscripts + default: 0,'','If displayed musical inscripts, play midi conversion for items on the OPAC record details page.' + choices: + yes: Play + no: "Don't play" + - MIDI representation of musical inscripts on the OPAC record details page. - - pref: OpacKohaUrl default: 0 -- 2.39.5