Bugzilla – Attachment 85925 Details for
Bug 22445
Ability to define a URL for custom cover images
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22445: Add new prefs *CustomCoverImages*
Bug-22445-Add-new-prefs-CustomCoverImages.patch (text/plain), 6.60 KB, created by
Jonathan Druart
on 2019-03-01 23:11:57 UTC
(
hide
)
Description:
Bug 22445: Add new prefs *CustomCoverImages*
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-03-01 23:11:57 UTC
Size:
6.60 KB
patch
obsolete
>From 6356d81d204bf7a22195b24f3dcc40bbb40fd5f7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 1 Mar 2019 08:00:02 -0300 >Subject: [PATCH] Bug 22445: Add new prefs *CustomCoverImages* > >This patch set adds a new method to display cover images for >bibliographic records. >The idea is to provide a flexible way allowing several use cases: >- local path >- remote url >- webservice >which would follow a given pattern. > >So far only the following patterns are available: >- %isbn% will be replaced byt the isbn of the record >- %issn% >- using MARC subfields: > %024$a% to replace with the value in 024$a > >For example >- /your/local/images/%isbn%.png >- https://covers.openlibrary.org/b/isbn/%isbn%-M.jpb >- etc. > >There are 3 new sysprefs: >CustomCoverImagesURL >=> Define the path/url >CustomCoverImages >=> Turn on/off the display of the custom cover image in the staff client >OPACCustomCoverImages >=> Turn on/off the display of the custom cover image at the OPAC > >Sponsored-by: Orex Digital >--- > installer/data/mysql/atomicupdate/bug_xxxxx.perl | 14 ++++++++++++++ > installer/data/mysql/sysprefs.sql | 3 +++ > .../en/modules/admin/preferences/enhanced_content.pref | 17 ++++++++++++++++- > 3 files changed, 33 insertions(+), 1 deletion(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_xxxxx.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_xxxxx.perl b/installer/data/mysql/atomicupdate/bug_xxxxx.perl >new file mode 100644 >index 0000000000..4cf30e86cc >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_xxxxx.perl >@@ -0,0 +1,14 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences >+ ( variable, value, options, explanation, type ) >+ VALUES >+ ('CustomCoverImages','0',NULL,'If enabled, the custom cover images will be displayed in the staff client. CustomCoverImagesURL must be defined.','YesNo'), >+ ('OPACCustomCoverImages','0',NULL,'If enabled, the custom cover images will be displayed at the OPAC. CustomCoverImagesURL must be defined.','YesNo'), >+ ('CustomCoverImagesURL','',NULL,'Define an URL serving book cover images, using the following patterns: %issn%, %isbn%, FIXME ADD MORE (use it with CustomCoverImages and/or OPACCustomCoverImages)','free') >+ }); >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug XXXXX - Add new pref *CustomCoverImages*)\n"; >+} >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index d142b14a0e..4e4c098e0c 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -125,6 +125,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'), > ('CumulativeRestrictionPeriods',0,NULL,'Cumulate the restriction periods instead of keeping the highest','YesNo'), > ('CurrencyFormat','US','US|FR|CH','Determines the display format of currencies. eg: \'36000\' is displayed as \'360 000,00\' in \'FR\' or \'360,000.00\' in \'US\'.','Choice'), >+('CustomCoverImages','0',NULL,'If enabled, the custom cover images will be displayed in the staff client. CustomCoverImagesURL must be defined.','YesNo'), >+('CustomCoverImagesURL','',NULL,'Define an URL serving book cover images, using the following patterns: %issn%, %isbn%, FIXME ADD MORE (use it with CustomCoverImages and/or OPACCustomCoverImages)','free'), > ('dateformat','us','metric|us|iso|dmydot','Define global date format (us mm/dd/yyyy, metric dd/mm/yyy, ISO yyyy-mm-dd, dmydot dd.mm.yyyy)','Choice'), > ('DebugLevel','2','0|1|2','Define the level of debugging information sent to the browser when errors are encountered (set to 0 in production). 0=none, 1=some, 2=most','Choice'), > ('decreaseLoanHighHolds',NULL,'','Decreases the loan period for items with number of holds above the threshold specified in decreaseLoanHighHoldsValue','YesNo'), >@@ -344,6 +346,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'), >+('OPACCustomCoverImages','0',NULL,'If enabled, the custom cover images will be displayed at the OPAC. CustomCoverImagesURL must be defined.','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..e06ae65b3b 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 >@@ -313,7 +313,7 @@ Enhanced Content: > - pref: TagsExternalDictionary > class: file > - on the server to be approved without moderation. >- Local Cover Images: >+ Local or remote cover images: > - > - pref: LocalCoverImages > choices: >@@ -332,6 +332,21 @@ Enhanced Content: > yes: Allow > no: "Don't allow" > - multiple images to be attached to each bibliographic record. >+ - >+ - pref: CustomCoverImages >+ choices: >+ yes: Display >+ no: "Don't display" >+ - "custom remote url images in the staff client.<br/>" >+ - pref: OPACCustomCoverImages >+ choices: >+ yes: Display >+ no: "Don't display" >+ - "custom remote url images at the OPAC.<br/>" >+ - "Using the following URL:" >+ - pref: CustomCoverImagesURL >+ class: url >+ - "You can defined it using the following patterns: %isbn%, %issn%." > HTML5 Media: > - > - Show a tab with a HTML5 media player for files catalogued in field 856 >-- >2.11.0
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 22445
:
85925
|
85926
|
85927
|
85928
|
85929
|
85930
|
85931
|
85932
|
85933
|
85934
|
85935
|
85936
|
85937
|
85938
|
86214
|
86726
|
86727
|
87434
|
89973
|
89974
|
89975
|
89976
|
89977
|
89978
|
89979
|
89980
|
89981
|
89982
|
89983
|
89984
|
89985
|
89986
|
89987
|
89988
|
89989
|
89996
|
89997
|
89998
|
89999
|
90000
|
90001
|
90002
|
90003
|
90004
|
90005
|
90006
|
90007
|
90009
|
90010
|
90011
|
90012
|
90013
|
94227
|
94228
|
94229
|
94230
|
94231
|
94232
|
94233
|
94234
|
94235
|
94236
|
94237
|
94238
|
94239
|
94240
|
94241
|
94242
|
94243
|
94244
|
94559
|
94560
|
94561
|
94562
|
94563
|
94564
|
94566
|
94567
|
94568
|
94569
|
94570
|
94571
|
94572
|
94573
|
94574
|
94575
|
94576
|
94577