From ed0ac0cf2d292486d59960c7244746174343c36b Mon Sep 17 00:00:00 2001 From: Martin Persson Date: Mon, 25 May 2015 14:33:13 +0200 Subject: [PATCH] Bug 14247: Add system preference for news display MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Test plan: * Apply dependant patch 14246 (if not done already). * Apply current patch. * Log into the Staff client, go to 'Administration' -> 'Global Preferences' -> 'Tools', a new section titled 'News' should appear with a single option named 'NewsAuthorDisplay'. Available values should be 'Not at all', 'OPAC only', 'Staff client only' and 'Both OPAC and staff client'. By default the value should be 'Not at all' (to mimic existing behaviour, important!). * Change the value to something different and save the changes. * Use the mysql command line client to connect to the Koha database: $ mysql -u kohaadmin -p -D koha * Enter the following query: SELECT * FROM systempreferences WHERE variable = 'NewsAuthorDisplay'; * Check to make sure that the 'value' column has changed to reflect the choice you made in the above step. Separate SQL testing (clean installation of Koha): * Koha$ mysql -u root < create_koha_test_db.sql * Koha$ mysql -u koha_test -D koha_test < installer/data/mysql/kohastructure.sql * Koha$ mysql -u koha_test -D koha_test < installer/data/mysql/sysprefs.sql Testing the update script works the same way: * Koha$ echo "DELETE FROM systempreferences WHERE variable = 'NewsAuthorDisplay';" | mysql -u koha_test -D koha_test * Koha$ mysql -u koha_test -D koha_test < installer/data/mysql/atomicupdate/add_news_prefs.sql Signed-off-by: Marc Véron Signed-off-by: Mark Tompsett Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- installer/data/mysql/atomicupdate/add_news_prefs.sql | 2 ++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/tools.pref | 10 ++++++++++ 3 files changed, 13 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/add_news_prefs.sql diff --git a/installer/data/mysql/atomicupdate/add_news_prefs.sql b/installer/data/mysql/atomicupdate/add_news_prefs.sql new file mode 100644 index 0000000000..caca0b5e3f --- /dev/null +++ b/installer/data/mysql/atomicupdate/add_news_prefs.sql @@ -0,0 +1,2 @@ +-- Add NewsAuthorDisplay system preference, bug 14247. +INSERT IGNORE INTO systempreferences (`variable`,`value`,`options`,`explanation`,`type`) VALUES('NewsAuthorDisplay','none','none|opac|staff|both','Display the author name for news items.','Choice'); diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index b7d33027c8..5d4910e41f 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -218,6 +218,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('MembershipExpiryDaysNotice',NULL,'Send an account expiration notice that a patron\'s card is about to expire after',NULL,'Integer'), ('minPasswordLength','3',NULL,'Specify the minimum length of a patron/staff password','free'), ('NewItemsDefaultLocation','','','If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )',''), +('NewsAuthorDisplay','none','none|opac|staff|both','Display the author name for news items.','Choice'), ('noissuescharge','5','','Define maximum amount withstanding before check outs are blocked','Integer'), ('noItemTypeImages','0',NULL,'If ON, disables item-type images','YesNo'), ('NoLoginInstructions', '', '60|10', 'Instructions to display on the OPAC login form when a patron is not logged in', 'Textarea'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref index 636a9f64f8..5a3ddce775 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/tools.pref @@ -11,3 +11,13 @@ Tools: - pref: ImageLimit class: Integer - images. + News: + - + - "Show the author for news items:" + - pref: NewsAuthorDisplay + choices: + none: "Not at all" + opac: "OPAC only" + staff: "Staff client only" + both: "Both OPAC and staff client" + - -- 2.39.2