From b0e88fe5b1ca3bce326d92be558ea50a95923317 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 2 Mar 2018 17:25:46 +0000 Subject: [PATCH 1/4] Add Coce support - experimental This adds the option to use coce, it needs more work but is here for testing purposes --- Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm | 4 +++ .../ByWaterSolutions/CoverFlow/configure.tt | 28 +++++++++++++------ .../Com/ByWaterSolutions/CoverFlow/report.tt | 14 +++++++++- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm b/Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm index 71f1f59..ebca472 100644 --- a/Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm +++ b/Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm @@ -71,6 +71,7 @@ sub report { showtitle => $self->retrieve_data('showtitle'), size_limit => $self->retrieve_data('size_limit'), title_limit => $self->retrieve_data('title_limit'), + use_coce => $self->retrieve_data('use_coce'), ); print $cgi->header( @@ -102,6 +103,7 @@ sub configure { custom_image => $self->retrieve_data('custom_image'), size_limit => $self->retrieve_data('size_limit'), title_limit => $self->retrieve_data('title_limit'), + use_coce => $self->retrieve_data('use_coce'), ); @@ -116,6 +118,7 @@ sub configure { } else { my $coverlinks = $cgi->param('coverlinks') ? 1:0; + my $use_coce = $cgi->param('use_coce') ? 1:0; my $showtitle = $cgi->param('showtitle') ? 1:0; my $custom_image = $cgi->param('custom_image'); $self->store_data( @@ -127,6 +130,7 @@ sub configure { size_limit => $cgi->param('size_limit'), title_limit => $cgi->param('title_limit'), last_configured_by => C4::Context->userenv->{'number'}, + use_coce => $use_coce, } ); diff --git a/Koha/Plugin/Com/ByWaterSolutions/CoverFlow/configure.tt b/Koha/Plugin/Com/ByWaterSolutions/CoverFlow/configure.tt index 4e87669..1316960 100644 --- a/Koha/Plugin/Com/ByWaterSolutions/CoverFlow/configure.tt +++ b/Koha/Plugin/Com/ByWaterSolutions/CoverFlow/configure.tt @@ -41,16 +41,28 @@ $(document).ready(function() {
- - +
+ Image options -
- - + + -
- - +
+ + +
+

Note you must define the url for the Coce service and select service providers in the system preferences if you choose this, you do not need to enable coce images for the catalog

+ +
+ + + +
+ + +
+ +
[% IF error %]
Error: [% error %]
[% END %] diff --git a/Koha/Plugin/Com/ByWaterSolutions/CoverFlow/report.tt b/Koha/Plugin/Com/ByWaterSolutions/CoverFlow/report.tt index 48aea74..1b9aad5 100644 --- a/Koha/Plugin/Com/ByWaterSolutions/CoverFlow/report.tt +++ b/Koha/Plugin/Com/ByWaterSolutions/CoverFlow/report.tt @@ -1,4 +1,5 @@ -
+[% USE Koha %] + From 4fda029ffd05d28c03c1ead754cec7851d550de6 Mon Sep 17 00:00:00 2001 From: Travis CI User Date: Fri, 2 Mar 2018 17:29:00 +0000 Subject: [PATCH 2/4] Version auto-incremented - 14.1 --- package-lock.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 849d228..a33d208 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "koha-coverflow-plugin", - "version": "2.4.4", + "version": "2.4.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e266fd2..40ec431 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "koha-coverflow-plugin", - "version": "2.4.5", - "previous_version": "2.4.4", + "version": "2.4.6", + "previous_version": "2.4.5", "description": "Koha CoverFlow Plugin", "main": "index.js", "dependencies": { From f8cf76cfd03415e04236d487d61a2b0940c107a6 Mon Sep 17 00:00:00 2001 From: "Wm. Nick Clemens" Date: Thu, 24 May 2018 09:10:45 -0400 Subject: [PATCH 3/4] Add documentation and examples on features --- README.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 54 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9674998..5d1a19e 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,32 @@ Once set up is complete you will need to alter your UseKohaPlugins system prefer Once the plugin is installed, the steps to get your coverflow to show up are as follows: -First, you need to create one or more public reports for your coverflow widget or widgets to be based on. This is how the plugin knows what the content of your widget should contain. Each report needs only three columns; title, biblionumber, and isbn. It is important that you have a good and valid isbn, as that is the datum used to actually fetch the cover. In the iteration of the plugin, we are using Amazon cover images, but I believe in the end I will make the cover image fetcher configurable so we can use any data source for cover image fetching. +First, you need to create one or more public reports for your coverflow widget or widgets to be based on. This is how the plugin knows what the content of your widget should contain. Each report needs only three columns; title, biblionumber, and isbn. It is important that you have a good and valid isbn, as that is the datum used to actually fetch the cover. Example finding items added in the last 30 days: +``` +SELECT b.biblionumber, SUBSTRING_INDEX(m.isbn, ' ', 1) AS isbn, b.title + FROM items i + LEFT JOIN biblioitems m USING (biblioitemnumber) + LEFT JOIN biblio b ON (i.biblionumber=b.biblionumber) + WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= i.dateaccessioned AND m.isbn IS NOT NULL AND m.isbn != '' + HAVING isbn != "" + GROUP BY biblionumber + ORDER BY rand() + LIMIT 30 +``` -Note: You can add an additional column 'localcover' - this should be blank if the biblio doesn't have a localcover and can contain any other data if it does. If this column is populated a local cover will be used. +In the iteration of the plugin, we are using Amazon cover images, but I believe in the end I will make the cover image fetcher configurable so we can use any data source for cover image fetching. **Coce has been added as experimental cover source feel free to test using URL https://coce.bywatersolutions.com** + +Note: You can add an additional column 'localcover' - this should be blank if the biblio doesn't have a localcover and can contain any other data if it does. If this column is populated a local cover will be used. Example below: +``` +SELECT DISTINCT biblio.title, biblio.biblionumber, SUBSTRING_INDEX(biblioitems.isbn, ' ', 1) AS isbn, c.imagenumber AS localcover +FROM items +LEFT JOIN biblioitems USING (biblioitemnumber) +LEFT JOIN biblio ON (items.biblionumber=biblio.biblionumber) +LEFT JOIN biblioimages c ON (items.biblionumber=c.biblionumber) +WHERE biblioitems.isbn IS NOT NULL AND biblioitems.isbn !='' +ORDER BY RAND() +LIMIT 15 +``` Second, we need to configure the plugin. The first option is whether to use coverimages as the links to the biblios, and whether or not to display titles under images if so. @@ -76,6 +99,35 @@ The final step is to put your selector element somewhere in your public catalog. ``` Once that is in place, you need only refresh your OPAC page, and there you have it, your very own catalog coverflow widget! Not only do these coverflows look great on a computer screen, but they look great on mobile platforms as well, and are even touch responsive! +# Report with parameters +It is now possible to use reports that take input. For example,in a multibranchsystem you can setup a single report as below: +``` +SELECT b.biblionumber, SUBSTRING_INDEX(m.isbn, ' ', 1) AS isbn, b.title + FROM items i + LEFT JOIN biblioitems m USING (biblioitemnumber) + LEFT JOIN biblio b ON (i.biblionumber=b.biblionumber) + WHERE DATE_SUB(CURDATE(),INTERVAL 30 DAY) <= i.dateaccessioned AND m.isbn IS NOT NULL AND m.isbn != '' + AND items.homebranch = <> + HAVING isbn != "" + GROUP BY biblionumber + ORDER BY rand() + LIMIT 30 +``` +Then in the plugin configuration you can use thismultiple times: +``` +- id: 42 + selector: #coverflow1 + params: + - BRANCHA + options: + style: coverflow +- id: 42 + selector: #coverflow2 + params: + - BRANCHB + options: + style: coverflow +``` # Build and release From 4db3dc61bf4736c82dc7be55fb983bac88efc319 Mon Sep 17 00:00:00 2001 From: Travis CI User Date: Thu, 24 May 2018 13:14:04 +0000 Subject: [PATCH 4/4] Version auto-incremented - 18.1 --- package-lock.json | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a33d208..8245570 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "koha-coverflow-plugin", - "version": "2.4.5", + "version": "2.4.6", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 40ec431..704518b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "koha-coverflow-plugin", - "version": "2.4.6", - "previous_version": "2.4.5", + "version": "2.4.7", + "previous_version": "2.4.6", "description": "Koha CoverFlow Plugin", "main": "index.js", "dependencies": {