Bugzilla – Attachment 37409 Details for
Bug 9580
Cover image from Coce, a remote image URL cache
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9580: (QA followup) add a Coce syspref and fix options for Providers
Bug-9580-QA-followup-add-a-Coce-syspref-and-fix-op.patch (text/plain), 10.78 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-03-31 17:03:17 UTC
(
hide
)
Description:
Bug 9580: (QA followup) add a Coce syspref and fix options for Providers
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-03-31 17:03:17 UTC
Size:
10.78 KB
patch
obsolete
>From 53d931d3934cf36cc0c5c5320a7fe2f90207234c Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Tue, 31 Mar 2015 13:58:37 -0300 >Subject: [PATCH] Bug 9580: (QA followup) add a Coce syspref and fix options > for Providers > >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 <tomascohen@gmail.com> >--- > installer/data/mysql/sysprefs.sql | 3 ++- > installer/data/mysql/updatedatabase.pl | 8 ++++++-- > .../prog/en/modules/admin/preferences/enhanced_content.pref | 13 +++++++++++-- > koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 8 ++++---- > koha-tmpl/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 cb47d9e..1e07e3c 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 8e13509..8aea7f8 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9957,13 +9957,17 @@ $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 cf639aa..3002546 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 >@@ -339,10 +339,19 @@ Enhanced Content: > - . > 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 1b7520f..dda9446 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); > //]]> > </script> > [% END %] >-[% IF Koha.Preference('CoceProviders') %] >+[% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %] > <script type="text/javascript" src="[% interface %]/[% theme %]/js/coce.js"></script> > <script type="text/javascript"> > //<![CDATA[ >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >index 9140199..255fac1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/shelfbrowser.inc >@@ -53,7 +53,7 @@ > <span class="no-image">No cover image available</span> > [% END %] > [% END %] >- [% IF ( Koha.Preference('CoceProviders') ) %] >+ [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %] > [% coce_id = item.browser_normalized_ean || item.browser_normalized_isbn %] > <div title="[% item.biblionumber |url %]" class="[% coce_id %]" id="coce-thumbnail-preview-[% coce_id %]"></div> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index b0805d1..ce188f5 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -79,7 +79,7 @@ > [% IF ( GoogleJackets ) %] > <div title="[% biblionumber |url %]" class="[% normalized_isbn %]" id="gbs-thumbnail-preview"></div> > [% END %] >- [% IF ( Koha.Preference('CoceProviders') ) %] >+ [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %] > [% coce_id = normalized_ean || normalized_isbn %] > <div style="block" title="[% biblionumber |url %]" class="[% coce_id %]" id="coce-thumbnail-preview"></div> > [% END %] >@@ -1445,7 +1445,7 @@ > [% IF ( GoogleJackets ) %] > KOHA.Google.GetCoverFromIsbn([% covernewwindow %]); > [% END %] >- [% IF ( Koha.Preference('CoceProviders') ) %] >+ [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %] > KOHA.coce.getURL('[% Koha.Preference('CoceHost') %]', '[% Koha.Preference('CoceProviders') %]',[% covernewwindow %]); > [% END %] > >@@ -1506,7 +1506,7 @@ > [% IF ( GoogleJackets ) %] > KOHA.Google.GetCoverFromIsbn([% covernewwindow %]); > [% END %] >- [% IF ( Koha.Preference('CoceProviders') ) %] >+ [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %] > KOHA.coce.getURL('[% Koha.Preference('CoceHost') %]', '[% Koha.Preference('CoceProviders') %]',[% covernewwindow %]); > [% END %] > [% IF OpenLibraryCovers %] >@@ -1532,7 +1532,7 @@ > [% IF ( GoogleJackets ) %] > KOHA.Google.GetCoverFromIsbn([% covernewwindow %]); > [% END %] >- [% IF ( Koha.Preference('CoceProviders') ) %] >+ [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %] > KOHA.coce.getURL('[% Koha.Preference('CoceHost') %]', '[% Koha.Preference('CoceProviders') %]',[% covernewwindow %]); > [% END %] > [% IF OpenLibraryCovers %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index a995258..948c069 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -257,7 +257,7 @@ > [% END %] > [% END %] > >- [% IF ( Koha.Preference('CoceProviders') ) %] >+ [% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %] > [% coce_id = SEARCH_RESULT.normalized_ean || SEARCH_RESULT.normalized_isbn %] > [% IF ( coce_id ) %] > <span style="block" title="[% SEARCH_RESULT.biblionumber |url %]" class="[% coce_id %]" id="coce-thumbnail[% loop.count %]"></span> >@@ -913,7 +913,9 @@ $(document).ready(function(){ > [% IF OpenLibraryCovers %]KOHA.OpenLibrary.GetCoverFromIsbn();[% END %] > [% IF OPACLocalCoverImages %]KOHA.LocalCover.GetCoverFromBibnumber(false);[% END %] > [% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %] >-[% IF ( Koha.Preference('CoceProviders') ) %]KOHA.coce.getURL('[% Koha.Preference('CoceHost') %]', '[% Koha.Preference('CoceProviders') %]');[% END %] >+[% IF ( Koha.Preference('Coce') && Koha.Preference('CoceProviders') ) %] >+ KOHA.coce.getURL('[% Koha.Preference('CoceHost') %]', '[% Koha.Preference('CoceProviders') %]'); >+[% END %] > > [% IF ( DidYouMean ) %] > $("#didyoumean").load("/cgi-bin/koha/svc/suggestion?render=stub&q=[% querystring |uri %]", >-- >2.3.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9580
:
15203
|
16778
|
21162
|
24071
|
24145
|
32794
|
32795
|
32801
|
32808
|
32809
|
32857
|
32891
|
32929
|
32942
|
32944
|
33201
|
34678
|
34679
|
37409
|
37410