diff --git a/installer/data/mysql/atomicupdate/bug_18421_add_coce_intranet.perl b/installer/data/mysql/atomicupdate/bug_18421_add_coce_intranet.perl new file mode 100755 index 0000000000..af27757b60 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_18421_add_coce_intranet.perl @@ -0,0 +1,24 @@ +#! /usr/bin/perl + +use Modern::Perl; +use C4::Context; + +my $dbh=C4::Context->dbh; + +################ +# IntranetCoce # +################ + +# validate systempreferences.Coce and save the config for OpacCoce +my $current_coce_pref = C4::Context->preference('Coce') || 0; + +# add two new systempreferences in order to have distinct behavior between intranet and OPAC +$dbh->do("INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES + ('IntranetCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the staff intranet', 'YesNo'), + ('OpacCoce','$current_coce_pref', NULL, 'If on, enables cover retrieval from the configured Coce server in the OPAC', 'YesNo') + ;") or die "Error applying Bug 18421: error inserting new values into database: ". $dbh->errstr . "\n"; + +$dbh->do("DELETE IGNORE FROM systempreferences WHERE variable = 'Coce';") + or die "Error applying Bug 18421: error deleting the old syspref 'Coce': ". $dbh->errstr . "\n"; + +print "Upgrade to XX.XX done (Bug 18421: Add Coce image cache to the Intranet)\n"; diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index bb3c8098d8..cb172ffaa0 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -121,7 +121,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('CircControl','ItemHomeLibrary','PickupLibrary|PatronLibrary|ItemHomeLibrary','Specify the agency that controls the circulation and fines policy','Choice'), ('CircSidebar','0',NULL,'Activate or deactivate the navigation sidebar on all Circulation pages','YesNo'), ('ClaimsBccCopy','0','','Bcc the ClaimAcquisition and ClaimIssues alerts','YesNo'), -('Coce','0', NULL, 'If on, enables cover retrieval from the configured Coce server', 'YesNo'), ('CoceHost', '', NULL, 'Coce server URL', 'Free'), ('CoceProviders', '', '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'), @@ -248,6 +247,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('IntranetBiblioDefaultView','normal','normal|marc|isbd|labeled_marc','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','Choice'), ('intranetbookbag','1','','If ON, enables display of Cart feature in the intranet','YesNo'), ('IntranetCirculationHomeHTML', '', NULL, 'Show the following HTML in a div on the bottom of the reports home page', 'Free'), +('IntranetCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the staff intranet', 'YesNo'), ('intranetcolorstylesheet','','50','Define the color stylesheet to use in the Staff Client','free'), ('IntranetFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','free'), ('IntranetmainUserblock','','70|10','Add a block of HTML that will display on the intranet home page','Textarea'), @@ -361,6 +361,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OpacBrowseResults','1',NULL,'Disable/enable browsing and paging search results from the OPAC detail page.','YesNo'), ('OpacCloud','0',NULL,'If ON, enables subject cloud on OPAC','YesNo'), ('OpacAdditionalStylesheet','','','Define an auxiliary stylesheet for OPAC use, to override specified settings from the primary opac.css stylesheet. Enter the filename (if the file is in the server\'s css directory) or a complete URL beginning with http (if the file lives on a remote server).','free'), +('OpacCoce','0', NULL, 'If on, enables cover retrieval from the configured Coce server in the OPAC', 'YesNo'), ('OpacCustomSearch','','70|10','Replace the search box on the OPAC with the provided HTML','Textarea'), ('opaccredits','','70|10','Define HTML Credits at the bottom of the OPAC page','Textarea'), ('OPACdefaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specify the default field used for sorting','Choice'), 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 f6e01e2ea2..9f90d15f0a 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 @@ -412,11 +412,17 @@ Enhanced Content: - pref: RecordedBooksDomain Coce Cover images cache: - - - pref: Coce + - pref: OpacCoce choices: yes: Enable no: "Don't enable" - - a Coce image cache service. + - a Coce image cache service in the OPAC. + - + - pref: IntranetCoce + choices: + yes: Enable + no: "Don't enable" + - a Coce image cache service in the staff intranet. - - Coce server URL - pref: CoceHost diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 05f6ba3dcc..c1dabf218e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -63,13 +63,19 @@
The record you requested does not exist ([% biblionumber | html %]).
[% ELSE %] +[% + IntranetCoce = Koha.Preference('IntranetCoce') + CoceProviders = Koha.Preference('CoceProviders') + CoceHost = Koha.Preference('CoceHost') +%] + [% INCLUDE 'cat-toolbar.inc' %] [% IF ( ocoins ) %] [% END %] - [% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled ) %] + [% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce ) %]
[% ELSE %]
@@ -121,7 +127,7 @@ [% END %] - [% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled ) %] + [% IF ( AmazonCoverImages || LocalCoverImages || AdlibrisEnabled || IntranetCoce ) %]
[% IF ( LocalCoverImages ) %]
@@ -135,6 +141,16 @@
[% END %] + [% IF ( IntranetCoce && CoceProviders ) %] + [% coce_id = normalized_ean || normalized_isbn %] + + [% IF ( coce_id ) %] + + [% ELSE %] + No cover image available + [% END %] + + [% END %] [% END %]
@@ -754,6 +770,7 @@ [% INCLUDE 'catalog-strings.inc' %] [% Asset.js("js/catalog.js") | $raw %] [% INCLUDE 'greybox.inc' %] + [% END %] -[% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %] +[% IF ( Koha.Preference('OpacCoce') && Koha.Preference('CoceProviders') ) %] [% Asset.js("js/coce.js") | $raw %]