From 4ad600ffed2d44ef4a8e0158ff0cebb040ea1eef Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 31 Mar 2015 13:58:37 -0300 Subject: [PATCH] Bug 9580: (QA followup) add a Coce syspref and fix options for Providers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This proposed followup adds a 'Coce' syspref so it is consistent with the rest of the enhanced content providers sysprefs (also, there's no point making the user delete its configuration if disabling his Coce integration for testing purposes, for example). It also changes the CoceProviders syspref so it is a 'multiple' type syspref. It puts some sensible descriptions to the options too. Feel free to discuss this followup, it is just an idea! Signed-off-by: Tomas Cohen Arazi Signed-off-by: Frédéric Demians - OK for the 'Coce' syspref: it's sensible to distinct configuration from enabling/disbaling the service. - OK also for the multichoices systempreference. If a new service popup, it won't be difficult to amend the .pref file. --- installer/data/mysql/sysprefs.sql | 3 ++- installer/data/mysql/updatedatabase.pl | 8 ++++++-- .../modules/admin/preferences/enhanced_content.pref | 13 +++++++++++-- .../opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 2 +- .../bootstrap/en/includes/shelfbrowser.inc | 2 +- .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 8 ++++---- .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 6 ++++-- 7 files changed, 29 insertions(+), 13 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index cb47d9eca7..1e07e3cd6a 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -86,8 +86,9 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('CircAutocompl','1',NULL,'If ON, autocompletion is enabled for the Circulation input','YesNo'), ('CircAutoPrintQuickSlip','qslip',NULL,'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window, Display a print slip window or Clear the screen.','Choice'), ('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'), +('Coce','0', NULL, 'If on, enables cover retrieval from the configured Coce server', 'YesNo'), ('CoceHost', NULL, NULL, 'Coce server URL', 'Free'), -('CoceProviders', NULL, NULL, 'Coce providers, for example aws,gb', 'Free'), +('CoceProviders', NULL, 'aws,gb,ol', 'Coce providers', 'multiple'), ('COinSinOPACResults','1','','If ON, use COinS in OPAC search results page. NOTE: this can slow down search response time significantly','YesNo'), ('ConfirmFutureHolds','0','','Number of days for confirming future holds','Integer'), ('CurrencyFormat','US','US|FR','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\' in \'FR\' or \'360,000.00\' in \'US\'.','Choice'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 8e13509281..8aea7f83b6 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9955,15 +9955,19 @@ if ( CheckVersion($DBversion) ) { $DBversion = "3.19.00.XXX"; if ( CheckVersion($DBversion) ) { + $dbh->do(q{ + INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) + VALUES('Coce','0', 'If on, enables cover retrieval from the configured Coce server', NULL, 'YesNo') + }); $dbh->do(q{ INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES('CoceHost', NULL, 'Coce server URL', NULL,'Free') }); $dbh->do(q{ INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) - VALUES('CoceProviders', NULL, 'Coce Providers, for example: aws,gb', NULL,'Free') + VALUES('CoceProviders', NULL, 'Coce providers', 'aws,gb,ol', 'multiple') }); - print "Upgrade to $DBversion done (Bug 9580 - Cover image from Coce, a remote image URL cache)\n"; + print "Upgrade to $DBversion done (Bug 9580: Cover image from Coce, a remote image URL cache)\n"; SetVersion($DBversion); } 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 cf639aa8bb..30025468ae 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 @@ -338,11 +338,20 @@ Enhanced Content: - pref: OverDriveLibraryID - . Coce Cover images cache: + - + - pref: Coce + choices: + yes: Enable + no: "Don't enable" + - a Coce image cache service. - - Coce server URL - pref: CoceHost class: url - - - Providers + - Use the following providers to fetch the covers - pref: CoceProviders - - 'separated by comma, for example: aws,gb. Leave empty not to activate this service.' + multiple: + aws: Amazon Web Services + gb: Google Books + ol: Open Library diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc index 1b7520f6c8..dda9446559 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc @@ -165,7 +165,7 @@ $.widget.bridge('uitooltip', $.ui.tooltip); //]]> [% END %] -[% IF Koha.Preference('CoceProviders') %] +[% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %]