View | Details | Raw Unified | Return to bug 8679
Collapse All | Expand All

(-)a/C4/Auth.pm (-7 lines)
Lines 334-343 sub get_template_and_user { Link Here
334
334
335
    if ( $in->{'type'} eq "intranet" ) {
335
    if ( $in->{'type'} eq "intranet" ) {
336
        $template->param(
336
        $template->param(
337
            AmazonContent               => C4::Context->preference("AmazonContent"),
338
            AmazonCoverImages           => C4::Context->preference("AmazonCoverImages"),
337
            AmazonCoverImages           => C4::Context->preference("AmazonCoverImages"),
339
            AmazonEnabled               => C4::Context->preference("AmazonEnabled"),
340
            AmazonSimilarItems          => C4::Context->preference("AmazonSimilarItems"),
341
            AutoLocation                => C4::Context->preference("AutoLocation"),
338
            AutoLocation                => C4::Context->preference("AutoLocation"),
342
            "BiblioDefaultView".C4::Context->preference("IntranetBiblioDefaultView") => 1,
339
            "BiblioDefaultView".C4::Context->preference("IntranetBiblioDefaultView") => 1,
343
            CalendarFirstDayOfWeek      => (C4::Context->preference("CalendarFirstDayOfWeek") eq "Sunday")?0:1,
340
            CalendarFirstDayOfWeek      => (C4::Context->preference("CalendarFirstDayOfWeek") eq "Sunday")?0:1,
Lines 390-396 sub get_template_and_user { Link Here
390
        }
387
        }
391
        $template->param(
388
        $template->param(
392
            opaccolorstylesheet       => C4::Context->preference("opaccolorstylesheet"),
389
            opaccolorstylesheet       => C4::Context->preference("opaccolorstylesheet"),
393
            AmazonContent             => "" . C4::Context->preference("AmazonContent"),
394
            AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
390
            AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
395
            AuthorisedValueImages     => C4::Context->preference("AuthorisedValueImages"),
391
            AuthorisedValueImages     => C4::Context->preference("AuthorisedValueImages"),
396
            BranchesLoop              => GetBranchesLoop($opac_name),
392
            BranchesLoop              => GetBranchesLoop($opac_name),
Lines 398-407 sub get_template_and_user { Link Here
398
            LibraryName               => "" . C4::Context->preference("LibraryName"),
394
            LibraryName               => "" . C4::Context->preference("LibraryName"),
399
            LibraryNameTitle          => "" . $LibraryNameTitle,
395
            LibraryNameTitle          => "" . $LibraryNameTitle,
400
            LoginBranchname           => C4::Context->userenv?C4::Context->userenv->{"branchname"}:"",
396
            LoginBranchname           => C4::Context->userenv?C4::Context->userenv->{"branchname"}:"",
401
            OPACAmazonEnabled         => C4::Context->preference("OPACAmazonEnabled"),
402
            OPACAmazonSimilarItems    => C4::Context->preference("OPACAmazonSimilarItems"),
403
            OPACAmazonCoverImages     => C4::Context->preference("OPACAmazonCoverImages"),
397
            OPACAmazonCoverImages     => C4::Context->preference("OPACAmazonCoverImages"),
404
            OPACAmazonReviews         => C4::Context->preference("OPACAmazonReviews"),
405
            OPACFRBRizeEditions       => C4::Context->preference("OPACFRBRizeEditions"),
398
            OPACFRBRizeEditions       => C4::Context->preference("OPACFRBRizeEditions"),
406
            OpacHighlightedWords       => C4::Context->preference("OpacHighlightedWords"),
399
            OpacHighlightedWords       => C4::Context->preference("OpacHighlightedWords"),
407
            OPACItemHolds             => C4::Context->preference("OPACItemHolds"),
400
            OPACItemHolds             => C4::Context->preference("OPACItemHolds"),
(-)a/C4/External/Amazon.pm (-210 lines)
Lines 1-210 Link Here
1
package C4::External::Amazon;
2
# Copyright (C) 2006 LibLime
3
# <jmf at liblime dot com>
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
use XML::Simple;
21
use LWP::Simple;
22
use LWP::UserAgent;
23
use HTTP::Request::Common;
24
use C4::Koha;
25
use URI::Escape;
26
use POSIX;
27
use Digest::SHA qw(hmac_sha256_base64);
28
29
use strict;
30
use warnings;
31
32
use vars qw($VERSION @ISA @EXPORT);
33
34
BEGIN {
35
    require Exporter;
36
    $VERSION = 3.07.00.049;
37
    @ISA = qw(Exporter);
38
    @EXPORT = qw(
39
        get_amazon_details
40
        get_amazon_tld
41
    );
42
}
43
44
45
sub get_amazon_tld {
46
    my %tld = (
47
        CA => '.ca',
48
        DE => '.de',
49
        FR => '.fr',
50
        JP => '.jp',
51
        UK => '.co.uk',
52
        US => '.com',
53
    );
54
55
    my $locale = C4::Context->preference('AmazonLocale');
56
    my $tld = $tld{ $locale } || '.com'; # default top level domain is .com
57
    return $tld;
58
}
59
60
61
=head1 NAME
62
63
C4::External::Amazon - Functions for retrieving Amazon.com content in Koha
64
65
=head2 FUNCTIONS
66
67
This module provides facilities for retrieving Amazon.com content in Koha
68
69
=over
70
71
=item get_amazon_detail( $isbn, $record, $marcflavour, $services )
72
73
Get editorial reviews, customer reviews, and similar products using Amazon Web Services.
74
75
Parameters:
76
77
=over
78
79
=item $isbn
80
81
Biblio record isbn
82
83
=item $record
84
85
Biblio MARC record
86
87
=item $marcflavour
88
89
MARC flavor, MARC21 or UNIMARC
90
91
=item $services
92
93
Requested Amazon services: A ref to an array. For example,
94
[ 'Similarities', 'EditorialReviews', 'Reviews' ].
95
No other service will be accepted. Services must be spelled exactly.
96
If no sercice is requested, AWS isn't called.
97
98
=back
99
100
=item get_amazon_tld()
101
102
Get Amazon Top Level Domain depending on Amazon local preference: AmazonLocal.
103
For example, if AmazonLocal is 'UK', returns '.co.uk'.
104
105
=back
106
107
=cut
108
109
110
sub get_amazon_details {
111
    my ( $isbn, $record, $marcflavour, $aws_ref ) = @_;
112
113
    return unless defined $aws_ref;
114
    my @aws = @$aws_ref;
115
    return if $#aws == -1;
116
117
    # Normalize the fields
118
    $isbn = GetNormalizedISBN($isbn);
119
    my $upc = GetNormalizedUPC($record,$marcflavour);
120
    my $ean = GetNormalizedEAN($record,$marcflavour);
121
    # warn "ISBN: $isbn | UPC: $upc | EAN: $ean";
122
123
    # Choose the appropriate and available item identifier
124
    my ( $id_type, $item_id ) =
125
        defined($isbn) && length($isbn) == 13 ? ( 'EAN',  $isbn ) :
126
        $isbn                                 ? ( 'ASIN', $isbn ) :
127
        $upc                                  ? ( 'UPC',  $upc  ) :
128
        $ean                                  ? ( 'EAN',  $upc  ) : ( undef, undef );
129
    return unless defined($id_type);
130
131
    # grab the item format to determine Amazon search index
132
    my %hformat = ( a => 'Books', g => 'Video', j => 'Music' );
133
    my $search_index = $hformat{ substr($record->leader(),6,1) } || 'Books';
134
135
    my $parameters={Service=>"AWSECommerceService" ,
136
        "AWSAccessKeyId"=> C4::Context->preference('AWSAccessKeyID') ,
137
        "Operation"=>"ItemLookup", 
138
        "AssociateTag"=>  C4::Context->preference('AmazonAssocTag') ,
139
        "Version"=>"2009-06-01",
140
        "ItemId"=>$item_id,
141
        "IdType"=>$id_type,
142
        "ResponseGroup"=>  join( ',',  @aws ),
143
        "Timestamp"=>strftime("%Y-%m-%dT%H:%M:%SZ", gmtime)
144
    };
145
    $$parameters{"SearchIndex"} = $search_index if $id_type ne 'ASIN';
146
    my @params;
147
    while (my ($key,$value)=each %$parameters){
148
        push @params, qq{$key=}.uri_escape($value, "^A-Za-z0-9\-_.~" );
149
    }
150
151
    my $url;
152
    if (C4::Context->preference('AWSPrivateKey')) {
153
        $url = qq{http://webservices.amazon} . get_amazon_tld() . 
154
               "/onca/xml?" . join("&",sort @params) . qq{&Signature=} . uri_escape(SignRequest(@params),"^A-Za-z0-9\-_.~" );
155
    } else {
156
        $url = qq{http://webservices.amazon} . get_amazon_tld() .  "/onca/xml?" .join("&",sort @params);
157
        warn "MUST set AWSPrivateKey syspref after 2009-08-15 in order to access Amazon web services";
158
    }
159
160
    my $content = get($url);
161
    warn "could not retrieve $url" unless $content;
162
    my $xmlsimple = XML::Simple->new();
163
    my $response = $xmlsimple->XMLin(
164
        $content,
165
        forcearray => [ qw(SimilarProduct EditorialReview Review Item) ],
166
    ) unless !$content;
167
    return $response;
168
}
169
170
sub SignRequest{
171
    my @params=@_;
172
    my $tld=get_amazon_tld(); 
173
    my $string = qq{GET\nwebservices.amazon$tld\n/onca/xml\n} . join("&",sort @params);
174
    return hmac_sha256_base64($string,C4::Context->preference('AWSPrivateKey')) . '=';
175
}
176
177
sub check_search_inside {
178
        my $isbn = shift;
179
        my $ua = LWP::UserAgent->new(
180
        agent => "Mozilla/4.76 [en] (Win98; U)",
181
        keep_alive => 1,
182
        env_proxy => 1,
183
        );
184
        my $available = 1;
185
        my $uri = "http://www.amazon.com/gp/reader/$isbn/ref=sib_dp_pt/002-7879865-0184864#reader-link";
186
        my $req = HTTP::Request->new(GET => $uri);
187
        $req->header (
188
                'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*',
189
                'Accept-Charset' => 'iso-8859-1,*,utf-8',
190
                'Accept-Language' => 'en-US' );
191
        my $res = $ua->request($req);
192
        my $content = $res->content();
193
        if ($content =~ m/This book is temporarily unavailable/) {
194
            undef $available;
195
        }
196
        return $available;
197
}
198
199
1;
200
__END__
201
202
=head1 NOTES
203
204
=cut
205
206
=head1 AUTHOR
207
208
Joshua Ferraro <jmf@liblime.com>
209
210
=cut
(-)a/C4/External/BakerTaylor.pm (-1 lines)
Lines 134-140 Such response will trigger a warning for each request (potentially many). Point Link Here
134
134
135
=head1 SEE ALSO
135
=head1 SEE ALSO
136
136
137
C4::External::Amazon
138
LWP::UserAgent
137
LWP::UserAgent
139
138
140
=head1 AUTHOR
139
=head1 AUTHOR
(-)a/C4/Koha.pm (-1 / +1 lines)
Lines 1232-1238 sub GetNormalizedUPC { Link Here
1232
}
1232
}
1233
1233
1234
# Normalizes and returns the first valid ISBN found in the record
1234
# Normalizes and returns the first valid ISBN found in the record
1235
# ISBN13 are converted into ISBN10. This is required to get Amazon cover book.
1235
# ISBN13 are converted into ISBN10. This is required to get some book cover images.
1236
sub GetNormalizedISBN {
1236
sub GetNormalizedISBN {
1237
    my ($isbn,$record,$marcflavour) = @_;
1237
    my ($isbn,$record,$marcflavour) = @_;
1238
    my @fields;
1238
    my @fields;
(-)a/C4/Search.pm (-2 lines)
Lines 1823-1830 sub searchResults { Link Here
1823
        $oldbiblio->{intransitcount}       = $item_in_transit_count;
1823
        $oldbiblio->{intransitcount}       = $item_in_transit_count;
1824
        $oldbiblio->{onholdcount}          = $item_onhold_count;
1824
        $oldbiblio->{onholdcount}          = $item_onhold_count;
1825
        $oldbiblio->{orderedcount}         = $ordered_count;
1825
        $oldbiblio->{orderedcount}         = $ordered_count;
1826
        # deleting - in isbn to enable amazon content
1827
        $oldbiblio->{isbn} =~ s/-//g;
1828
1826
1829
        if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
1827
        if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
1830
            my $fieldspec = C4::Context->preference("AlternateHoldingsField");
1828
            my $fieldspec = C4::Context->preference("AlternateHoldingsField");
(-)a/admin/systempreferences.pl (-8 lines)
Lines 266-283 $tabsysprefs{AdvancedSearchTypes} = "Searching"; Link Here
266
$tabsysprefs{DisplayMultiPlaceHold}   = "Searching";
266
$tabsysprefs{DisplayMultiPlaceHold}   = "Searching";
267
267
268
# EnhancedContent
268
# EnhancedContent
269
$tabsysprefs{AmazonEnabled}          = "EnhancedContent";
270
$tabsysprefs{OPACAmazonEnabled}      = "EnhancedContent";
271
$tabsysprefs{AmazonCoverImages}      = "EnhancedContent";
269
$tabsysprefs{AmazonCoverImages}      = "EnhancedContent";
272
$tabsysprefs{OPACAmazonCoverImages}  = "EnhancedContent";
270
$tabsysprefs{OPACAmazonCoverImages}  = "EnhancedContent";
273
$tabsysprefs{AWSAccessKeyID}         = "EnhancedContent";
274
$tabsysprefs{AWSPrivateKey}          = "EnhancedContent";
275
$tabsysprefs{AmazonLocale}           = "EnhancedContent";
271
$tabsysprefs{AmazonLocale}           = "EnhancedContent";
276
$tabsysprefs{AmazonAssocTag}         = "EnhancedContent";
272
$tabsysprefs{AmazonAssocTag}         = "EnhancedContent";
277
$tabsysprefs{AmazonSimilarItems}     = "EnhancedContent";
278
$tabsysprefs{OPACAmazonSimilarItems} = "EnhancedContent";
279
$tabsysprefs{AmazonReviews}          = "EnhancedContent";
280
$tabsysprefs{OPACAmazonReviews}      = "EnhancedContent";
281
273
282
# Babelthèque
274
# Babelthèque
283
$tabsysprefs{Babeltheque}            = "EnhancedContent";
275
$tabsysprefs{Babeltheque}            = "EnhancedContent";
(-)a/catalogue/detail.pl (-40 lines)
Lines 33-39 use C4::Reserves; Link Here
33
use C4::Members; # to use GetMember
33
use C4::Members; # to use GetMember
34
use C4::Serials;
34
use C4::Serials;
35
use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn);
35
use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn);
36
use C4::External::Amazon;
37
use C4::Search;		# enabled_staff_search_views
36
use C4::Search;		# enabled_staff_search_views
38
use C4::Tags qw(get_tags);
37
use C4::Tags qw(get_tags);
39
use C4::VirtualShelves;
38
use C4::VirtualShelves;
Lines 352-396 if (C4::Context->preference("FRBRizeEditions")==1) { Link Here
352
    };
351
    };
353
    if ($@) { warn "XISBN Failed $@"; }
352
    if ($@) { warn "XISBN Failed $@"; }
354
}
353
}
355
if ( C4::Context->preference("AmazonEnabled") == 1 ) {
356
    $template->param( AmazonTld => get_amazon_tld() );
357
    my $amazon_reviews  = C4::Context->preference("AmazonReviews");
358
    my $amazon_similars = C4::Context->preference("AmazonSimilarItems");
359
    my @services;
360
    if ( $amazon_reviews ) {
361
        $template->param( AmazonReviews => 1 );
362
        push( @services, 'EditorialReview' );
363
    }
364
    if ( $amazon_similars ) {
365
        $template->param( AmazonSimilarItems => 1 );
366
        push( @services, 'Similarities' );
367
    }
368
    my $amazon_details = &get_amazon_details( $isbn, $record, $marcflavour, \@services );
369
    if ( $amazon_similars ) {
370
        my $similar_products_exist;
371
        my @similar_products;
372
        for my $similar_product (@{$amazon_details->{Items}->{Item}->[0]->{SimilarProducts}->{SimilarProduct}}) {
373
            # do we have any of these isbns in our collection?
374
            my $similar_biblionumbers = get_biblionumber_from_isbn($similar_product->{ASIN});
375
            # verify that there is at least one similar item
376
		    if (scalar(@$similar_biblionumbers)){            
377
			    $similar_products_exist++ if ($similar_biblionumbers && $similar_biblionumbers->[0]);
378
                push @similar_products, +{ similar_biblionumbers => $similar_biblionumbers, title => $similar_product->{Title}, ASIN => $similar_product->{ASIN}  };
379
            }
380
        }
381
        $template->param( AmazonSimilarItems       => $similar_products_exist );
382
        $template->param( AMAZON_SIMILAR_PRODUCTS  => \@similar_products      );
383
    }
384
    if ( $amazon_reviews ) {
385
        my $item = $amazon_details->{Items}->{Item}->[0];
386
        my $editorial_reviews = \@{ $item->{EditorialReviews}->{EditorialReview} };
387
        #my $customer_reviews  = \@{$amazon_details->{Items}->{Item}->[0]->{CustomerReviews}->{Review}};
388
        #my $average_rating = $amazon_details->{Items}->{Item}->[0]->{CustomerReviews}->{AverageRating} || 0;
389
        #$template->param( amazon_average_rating    => $average_rating * 20    );
390
        #$template->param( AMAZON_CUSTOMER_REVIEWS  => $customer_reviews       );
391
        $template->param( AMAZON_EDITORIAL_REVIEWS => $editorial_reviews      );
392
    }
393
}
394
354
395
if ( C4::Context->preference("LocalCoverImages") == 1 ) {
355
if ( C4::Context->preference("LocalCoverImages") == 1 ) {
396
    my @images = ListImagesForBiblio($biblionumber);
356
    my @images = ListImagesForBiblio($biblionumber);
(-)a/installer/data/mysql/sysprefs.sql (-8 lines)
Lines 2-14 INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES Link Here
2
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('advancedMARCeditor',0,"If ON, the MARC editor won't display field/subfield descriptions",'','YesNo');
2
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('advancedMARCeditor',0,"If ON, the MARC editor won't display field/subfield descriptions",'','YesNo');
3
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowHoldDateInFuture','0','If set a date field is displayed on the Hold screen of the Staff Interface, allowing the hold date to be set in the future.','','YesNo');
3
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowHoldDateInFuture','0','If set a date field is displayed on the Hold screen of the Staff Interface, allowing the hold date to be set in the future.','','YesNo');
4
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACAllowHoldDateInFuture','0','If set, along with the AllowHoldDateInFuture system preference, OPAC users can set the date of a hold to be in the future.','','YesNo');
4
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACAllowHoldDateInFuture','0','If set, along with the AllowHoldDateInFuture system preference, OPAC users can set the date of a hold to be in the future.','','YesNo');
5
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonEnabled',0,'Turn ON Amazon Content - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
6
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonReviews',0,'Display Amazon review on staff interface - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
7
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonSimilarItems',0,'Turn ON Amazon Similar Items feature  - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
8
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACAmazonEnabled',0,'Turn ON Amazon Content in the OPAC - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
9
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACAmazonSimilarItems',0,'Turn ON Amazon Similar Items feature  - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
10
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web Services','US|CA|DE|FR|JP|UK','Choice');
5
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web Services','US|CA|DE|FR|JP|UK','Choice');
11
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSAccessKeyID','','See:  http://aws.amazon.com','','free');
12
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonAssocTag','','See:  http://aws.amazon.com','','free');
6
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonAssocTag','','See:  http://aws.amazon.com','','free');
13
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber',NULL,'YesNo');
7
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber',NULL,'YesNo');
14
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
8
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
Lines 255-261 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( Link Here
255
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('NovelistSelectPassword',NULL,'Enable Novelist user Profile',NULL,'free');
249
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('NovelistSelectPassword',NULL,'Enable Novelist user Profile',NULL,'free');
256
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('NovelistSelectView','tab','Where to display Novelist Select content','tab|above|below|right','Choice');
250
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('NovelistSelectView','tab','Where to display Novelist Select content','tab|above|below|right','Choice');
257
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAmazonCoverImages', '0', 'Display cover images on OPAC from Amazon Web Services','','YesNo');
251
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAmazonCoverImages', '0', 'Display cover images on OPAC from Amazon Web Services','','YesNo');
258
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAmazonReviews', '0', 'Display Amazon readers reviews on OPAC','','YesNo');
259
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AmazonCoverImages', '0', 'Display Cover Images in Staff Client from Amazon Web Services','','YesNo');
252
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AmazonCoverImages', '0', 'Display Cover Images in Staff Client from Amazon Web Services','','YesNo');
260
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'StaffSerialIssueDisplayCount', '3', '', 'Number of serial issues to display per subscription in the Staff client', 'Integer');
253
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'StaffSerialIssueDisplayCount', '3', '', 'Number of serial issues to display per subscription in the Staff client', 'Integer');
261
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'OPACSerialIssueDisplayCount', '3', '', 'Number of serial issues to display per subscription in the OPAC', 'Integer');
254
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'OPACSerialIssueDisplayCount', '3', '', 'Number of serial issues to display per subscription in the OPAC', 'Integer');
Lines 271-277 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('v Link Here
271
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('FilterBeforeOverdueReport','0','Do not run overdue report until filter selected','','YesNo');
264
INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('FilterBeforeOverdueReport','0','Do not run overdue report until filter selected','','YesNo');
272
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelFormat', '<itemcallnumber><copynumber>', '30|10', 'This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example <itemcallnumber>.', 'Textarea');
265
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelFormat', '<itemcallnumber><copynumber>', '30|10', 'This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example <itemcallnumber>.', 'Textarea');
273
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelAutoPrint', '0', '', 'If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.', 'YesNo');
266
INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelAutoPrint', '0', '', 'If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.', 'YesNo');
274
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSPrivateKey','','See:  http://aws.amazon.com.  Note that this is required after 2009/08/15 in order to retrieve any enhanced content other than book covers from Amazon.','','free');
275
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACFineNoRenewals','100','Fine limit above which user cannot renew books via OPAC','','Integer');
267
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACFineNoRenewals','100','Fine limit above which user cannot renew books via OPAC','','Integer');
276
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OverdueNoticeBcc','','Email address to bcc outgoing overdue notices sent by email','','free');
268
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OverdueNoticeBcc','','Email address to bcc outgoing overdue notices sent by email','','free');
277
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'NewItemsDefaultLocation', '', '', 'If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )', '');
269
INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'NewItemsDefaultLocation', '', '', 'If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )', '');
(-)a/installer/data/mysql/updatedatabase.pl (+14 lines)
Lines 5635-5640 if(C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
5635
    SetVersion($DBversion);
5635
    SetVersion($DBversion);
5636
}
5636
}
5637
5637
5638
$DBversion = "3.09.00.XXX";
5639
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
5640
    $dbh->do("DELETE FROM systempreferences WHERE variable='AmazonReviews'");
5641
    $dbh->do("DELETE FROM systempreferences WHERE variable='AmazonSimilarItems'");
5642
    $dbh->do("DELETE FROM systempreferences WHERE variable='AWSAccessKeyID'");
5643
    $dbh->do("DELETE FROM systempreferences WHERE variable='AWSPrivateKey'");
5644
    $dbh->do("DELETE FROM systempreferences WHERE variable='OPACAmazonReviews'");
5645
    $dbh->do("DELETE FROM systempreferences WHERE variable='OPACAmazonSimilarItems'");
5646
    $dbh->do("DELETE FROM systempreferences WHERE variable='AmazonEnabled'");
5647
    $dbh->do("DELETE FROM systempreferences WHERE variable='OPACAmazonEnabled'");
5648
    print "Upgrade to $DBversion done ('Remove preferences controlling broken Amazon features (Bug 8679')\n";
5649
    SetVersion ($DBversion);
5650
}
5651
5638
=head1 FUNCTIONS
5652
=head1 FUNCTIONS
5639
5653
5640
=head2 TableExists($table)
5654
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref (-50 lines)
Lines 18-37 Enhanced Content: Link Here
18
            - other editions of an item on the OPAC.
18
            - other editions of an item on the OPAC.
19
    Amazon:
19
    Amazon:
20
        -
20
        -
21
            - pref: AmazonEnabled
22
              default: 0
23
              choices:
24
                  yes: Use
25
                  no: "Don't use"
26
            - data from Amazon on the staff interface (including reviews and "Search Inside" links on item detail pages). This requires that you have signed up for and entered an access key.
27
        -
28
            - pref: OPACAmazonEnabled
29
              default: 0
30
              choices:
31
                  yes: Use
32
                  no: "Don't use"
33
            - data from Amazon on the OPAC (including reviews and "Search Inside" links on item detail pages). This requires that you have signed up for and entered an access key.
34
        -
35
            - Use Amazon data from its
21
            - Use Amazon data from its
36
            - pref: AmazonLocale
22
            - pref: AmazonLocale
37
              choices:
23
              choices:
Lines 43-56 Enhanced Content: Link Here
43
                  UK: British
29
                  UK: British
44
            - website.
30
            - website.
45
        -
31
        -
46
            - Access Amazon content using the access key
47
            - pref: AWSAccessKeyID
48
            - (free, at <a href="http://aws.amazon.com/">http://aws.amazon.com/</a>).
49
        -
50
            - Access Amazon content (other than book jackets) using the private key
51
            - pref: AWSPrivateKey
52
            - (free, at <a href="http://aws.amazon.com/">http://aws.amazon.com/</a>).
53
        -
54
            - Put the associate tag
32
            - Put the associate tag
55
            - pref: AmazonAssocTag
33
            - pref: AmazonAssocTag
56
            - on links to Amazon. This can net your library referral fees if a patron decides to buy an item.
34
            - on links to Amazon. This can net your library referral fees if a patron decides to buy an item.
Lines 62-101 Enhanced Content: Link Here
62
                  no: "Don't show"
40
                  no: "Don't show"
63
            - cover images from Amazon on search results and item detail pages on the staff interface.
41
            - cover images from Amazon on search results and item detail pages on the staff interface.
64
        -
42
        -
65
            - pref: AmazonReviews
66
              default: 1
67
              choices:
68
                  yes: Show
69
                  no: "Don't show"
70
            - reviews from Amazon on item detail pages on the staff interface.
71
        -
72
            - pref: AmazonSimilarItems
73
              default: 1
74
              choices:
75
                  yes: Show
76
                  no: "Don't show"
77
            - similar items, as determined by Amazon, on item detail pages on the staff interface.
78
        -
79
            - pref: OPACAmazonCoverImages
43
            - pref: OPACAmazonCoverImages
80
              default: 1
44
              default: 1
81
              choices:
45
              choices:
82
                  yes: Show
46
                  yes: Show
83
                  no: "Don't show"
47
                  no: "Don't show"
84
            - cover images from Amazon on search results and item detail pages on the OPAC.
48
            - cover images from Amazon on search results and item detail pages on the OPAC.
85
        -
86
            - pref: OPACAmazonSimilarItems
87
              default: 1
88
              choices:
89
                  yes: Show
90
                  no: "Don't show"
91
            - similar items, as determined by Amazon, on item detail pages on the OPAC.
92
        -
93
            - pref: OPACAmazonReviews
94
              default: 1
95
              choices:
96
                  yes: Show
97
                  no: "Don't show"
98
            - reviews from Amazon on item detail pages on the OPAC.
99
    Babelthèque:
49
    Babelthèque:
100
        -
50
        -
101
            - pref: Babeltheque
51
            - pref: Babeltheque
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-29 / +7 lines)
Lines 39-45 function verify_images() { Link Here
39
        $('#bibliodetails').tabs();
39
        $('#bibliodetails').tabs();
40
        $('#search-form').focus();
40
        $('#search-form').focus();
41
     });
41
     });
42
     [% IF ( AmazonEnabled ) %]$(window).load(function() {
42
     [% IF ( AmazonCoverImages ) %]$(window).load(function() {
43
        verify_images();
43
        verify_images();
44
     });[% END %]
44
     });[% END %]
45
//]]>
45
//]]>
Lines 74-80 function verify_images() { Link Here
74
        <span class="Z3988" title="[% ocoins %]"></span>
74
        <span class="Z3988" title="[% ocoins %]"></span>
75
    [% END %]
75
    [% END %]
76
76
77
    [% IF ( AmazonEnabled ) %]
77
    [% IF ( AmazonCoverImages ) %]
78
        [% IF ( XSLTDetailsDisplay ) %]
78
        [% IF ( XSLTDetailsDisplay ) %]
79
            <div class="yui-gc">
79
            <div class="yui-gc">
80
            <div id="catalogue_detail_biblio" class="yui-u first">
80
            <div id="catalogue_detail_biblio" class="yui-u first">
Lines 117-124 function verify_images() { Link Here
117
        [% END %]
117
        [% END %]
118
        [% IF ( holdcount ) %]<span class="results_summary"><span class="label">Holds:</span> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></span>[% ELSE %][% END %]
118
        [% IF ( holdcount ) %]<span class="results_summary"><span class="label">Holds:</span> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></span>[% ELSE %][% END %]
119
119
120
        [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]</div><div class="yui-u" id="bookcoverimg">
120
        [% IF ( AmazonCoverImages ) %]</div><div class="yui-u" id="bookcoverimg">
121
        <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /></a>[% END %][% END %]
121
        <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /></a>[% END %]
122
    [% ELSE %]
122
    [% ELSE %]
123
123
124
    <h3>[% title |html %]</h3>
124
    <h3>[% title |html %]</h3>
Lines 177-184 function verify_images() { Link Here
177
        </ul>
177
        </ul>
178
        </div>
178
        </div>
179
       
179
       
180
[% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]<div class="yui-u" id="bookcoverimg">
180
[% IF ( AmazonCoverImages ) %]<div class="yui-u" id="bookcoverimg">
181
<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /></a></div>[% END %][% END %]
181
<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /></a></div>[% END %]
182
        
182
        
183
        <div class="yui-u" style="margin-top: 1em;">
183
        <div class="yui-u" style="margin-top: 1em;">
184
        <ul>
184
        <ul>
Lines 260-266 function verify_images() { Link Here
260
<li><a href="#description">Descriptions</a></li>
260
<li><a href="#description">Descriptions</a></li>
261
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
261
[% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
262
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
262
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
263
[% IF ( AmazonSimilarItems ) %]<li><a href="#related">Related titles</a></li>[% END %]
264
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
263
[% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
265
 </ul>
264
 </ul>
266
265
Lines 449-462 function verify_images() { Link Here
449
    
448
    
450
<div id="description">
449
<div id="description">
451
<div class="content_set">
450
<div class="content_set">
452
[% IF ( AmazonEnabled ) %]
453
[% FOREACH AMAZON_EDITORIAL_REVIEW IN AMAZON_EDITORIAL_REVIEWS %]
454
    [% IF ( AMAZON_EDITORIAL_REVIEW.Content ) %]
455
    <h4>From [% AMAZON_EDITORIAL_REVIEW.Source %]:</h4>
456
    <p>[% AMAZON_EDITORIAL_REVIEW.Content %]</p>
457
    [% END %]
458
[% END %]
459
[% END %]
460
451
461
[% IF ( MARCNOTES ) %]
452
[% IF ( MARCNOTES ) %]
462
    [% FOREACH MARCNOTE IN MARCNOTES %]
453
    [% FOREACH MARCNOTE IN MARCNOTES %]
Lines 522-528 function verify_images() { Link Here
522
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
513
[% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
523
<div id="editions"><h4>Editions</h4>
514
<div id="editions"><h4>Editions</h4>
524
<table>
515
<table>
525
[% FOREACH XISBN IN XISBNS %]<tr>[% IF ( XISBN.AmazonEnabled ) %]<td><a href="http://www.amazon.com/gp/reader/[% XISBN.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img src="http://images.amazon.com/images/P/[% XISBN.normalized_isbn %].01._AA75_PU_PU-5_.jpg" /></a></td>[% END %]
516
[% FOREACH XISBN IN XISBNS %]<tr>[% IF ( AmazonCoverImages ) %]<td><a href="http://www.amazon.com/gp/reader/[% XISBN.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img src="http://images.amazon.com/images/P/[% XISBN.normalized_isbn %].01._AA75_PU_PU-5_.jpg" /></a></td>[% END %]
526
[% UNLESS ( item_level_itypes ) %]<td>[% IF ( noItemTypeImages ) %][% XISBN.description %][% ELSE %]<img src="[% XISBN.imageurl %]" alt="[% XISBN.description %]" title="[% XISBN.description %]">[% END %]</td>[% END %]
517
[% UNLESS ( item_level_itypes ) %]<td>[% IF ( noItemTypeImages ) %][% XISBN.description %][% ELSE %]<img src="[% XISBN.imageurl %]" alt="[% XISBN.description %]" title="[% XISBN.description %]">[% END %]</td>[% END %]
527
<td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% XISBN.biblionumber %]">[% XISBN.title |html %]</a> by [% XISBN.author %] &copy;[% XISBN.copyrightdate %]
518
<td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% XISBN.biblionumber %]">[% XISBN.title |html %]</a> by [% XISBN.author %] &copy;[% XISBN.copyrightdate %]
528
  [% IF ( XISBN.publishercode ) %]
519
  [% IF ( XISBN.publishercode ) %]
Lines 536-554 function verify_images() { Link Here
536
</table></div>[% END %]
527
</table></div>[% END %]
537
[% END %]
528
[% END %]
538
529
539
[% IF ( AmazonEnabled ) %][% IF ( AmazonSimilarItems ) %]
540
<div id="related">
541
<h4>Similar Items</h4>
542
<ul>
543
[% FOREACH AMAZON_SIMILAR_PRODUCT IN AMAZON_SIMILAR_PRODUCTS %]
544
[% FOREACH similar_biblionumber IN AMAZON_SIMILAR_PRODUCT.similar_biblionumbers %]
545
<li><img alt="" src="http://images.amazon.com/images/P/[% similar_biblionumber.ASIN %].01._SS50_.jpg" /> <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% similar_biblionumber.biblionumber %]">[% similar_biblionumber.title |html %]</a> </li>
546
[% END %]
547
[% END %]
548
</ul>
549
</div>
550
[% END %][% END %]
551
552
[% IF ( LocalCoverImages ) %]
530
[% IF ( LocalCoverImages ) %]
553
<div id="images">
531
<div id="images">
554
[% IF ( localimages.0 ) %]
532
[% IF ( localimages.0 ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-4 / +4 lines)
Lines 6-12 Link Here
6
var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
6
var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
7
var MSG_NON_RESERVES_SELECTED = _("One or more selected items cannot be placed on hold.");
7
var MSG_NON_RESERVES_SELECTED = _("One or more selected items cannot be placed on hold.");
8
var q_array = new Array();  // will hold search terms, if present
8
var q_array = new Array();  // will hold search terms, if present
9
[% IF ( AmazonEnabled ) %]
9
[% IF ( AmazonCoverImages ) %]
10
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
10
// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
11
function verify_images() {
11
function verify_images() {
12
    $("img").each(function(i){
12
    $("img").each(function(i){
Lines 440-459 YAHOO.util.Event.onContentReady("searchheader", function () { Link Here
440
                    <!-- TABLE RESULTS START -->
440
                    <!-- TABLE RESULTS START -->
441
                <table>
441
                <table>
442
                    <tr>
442
                    <tr>
443
                        [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]<th>&nbsp;</th>[% END %][% END %]
443
                        [% IF ( AmazonCoverImages ) %]<th>&nbsp;</th>[% END %]
444
                        <th colspan="2">Results</th>
444
                        <th colspan="2">Results</th>
445
                        <th>Location</th>
445
                        <th>Location</th>
446
                    </tr>
446
                    </tr>
447
                        <!-- Actual Search Results -->
447
                        <!-- Actual Search Results -->
448
                        [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
448
                        [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
449
                         [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
449
                         [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
450
                            [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]
450
                            [% IF ( AmazonCoverImages ) %]
451
                                <td>
451
                                <td>
452
                                    <a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
452
                                    <a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
453
									
453
									
454
                                        <img src="[% IF ( SEARCH_RESULT.normalized_isbn ) %]http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg[% ELSE %]http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif[% END %]" alt="" class="thumbnail" />
454
                                        <img src="[% IF ( SEARCH_RESULT.normalized_isbn ) %]http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg[% ELSE %]http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif[% END %]" alt="" class="thumbnail" />
455
                                    </a></td>
455
                                    </a></td>
456
                            [% END %][% END %]
456
                            [% END %]
457
                            <td>
457
                            <td>
458
                                <input type="checkbox" class="selection" id="bib[% SEARCH_RESULT.biblionumber %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" style="display:none" />
458
                                <input type="checkbox" class="selection" id="bib[% SEARCH_RESULT.biblionumber %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" style="display:none" />
459
                            </td>
459
                            </td>
(-)a/koha-tmpl/opac-tmpl/prog/en/css/opac.css (-10 lines)
Lines 1797-1812 div#menu li.active a:hover { Link Here
1797
	padding : 2px;
1797
	padding : 2px;
1798
}
1798
}
1799
1799
1800
#amazonreviews h4 {
1801
	font-size : 90%;
1802
	margin : 0;
1803
	padding : 0;
1804
}
1805
#amazonreviews h3 {
1806
	font-size : 100%;
1807
	margin : 0;
1808
	padding : 0;
1809
}
1810
span.starFull {
1800
span.starFull {
1811
	background: url(../../images/star-ratings.gif) top left no-repeat;
1801
	background: url(../../images/star-ratings.gif) top left no-repeat;
1812
	display : block;
1802
	display : block;
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt (-68 / +6 lines)
Lines 296-302 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
296
296
297
    <div id="bookcover">
297
    <div id="bookcover">
298
    [% IF ( OPACLocalCoverImages ) %]<div style="block" title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div>[% END %]
298
    [% IF ( OPACLocalCoverImages ) %]<div style="block" title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div>[% END %]
299
    [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( OPACurlOpenInNewWindow ) %]<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link" target="_blank"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>[% ELSE %]<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>[% END %][% END %][% END %]
299
    [% IF ( OPACAmazonCoverImages ) %][% IF ( OPACurlOpenInNewWindow ) %]<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link" target="_blank"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>[% ELSE %]<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>[% END %][% END %]
300
300
301
    [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( content_identifier_exists ) %][% IF ( using_https ) %]
301
    [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( content_identifier_exists ) %][% IF ( using_https ) %]
302
    <img src="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/[% SyndeticsCoverImageSize %].GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% normalized_upc %]&amp;oclc=[% normalized_oclc %]" alt="" class="thumbnail" />
302
    <img src="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/[% SyndeticsCoverImageSize %].GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% normalized_upc %]&amp;oclc=[% normalized_oclc %]" alt="" class="thumbnail" />
Lines 654-670 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
654
    [% END %]
654
    [% END %]
655
[% END %]
655
[% END %]
656
656
657
[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonSimilarItems ) %][% IF ( AMAZON_SIMILAR_PRODUCTS ) %]
658
    <li id="tab_related"><a href="#similars">Related</a></li>
659
[% END %][% END %][% END %]
660
661
[% IF ( OPACFRBRizeEditions ) %][% IF ( XISBNS ) %]
657
[% IF ( OPACFRBRizeEditions ) %][% IF ( XISBNS ) %]
662
    <li id="tab_editions"><a href="#editions">Editions</a></li>
658
    <li id="tab_editions"><a href="#editions">Editions</a></li>
663
[% END %][% END %]
659
[% END %][% END %]
664
660
665
[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonReviews ) %]
666
    <li id="tab_amazonreviews"><a href="#amazonreviews">Amazon reviews</a></li>
667
[% END %][% END %]
668
[% IF ( Babeltheque ) %]
661
[% IF ( Babeltheque ) %]
669
    <li id="tab_babeltheque"><a href="#babeltheque">Babelthèque</a></li>
662
    <li id="tab_babeltheque"><a href="#babeltheque">Babelthèque</a></li>
670
[% END %]
663
[% END %]
Lines 798-804 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
798
        <td rowspan="2" style="width:20px;"><a style="height: 10em;" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% IF ( shelfbrowser_prev_biblionumber ) %][% shelfbrowser_prev_biblionumber %][% ELSE %][% biblionumber %][% END %]&amp;shelfbrowse_itemnumber=[% shelfbrowser_prev_itemnumber %]#shelfbrowser"><img src="/opac-tmpl/prog/images/browse-prev.gif" alt="Previous" border="0" /></a></td>
791
        <td rowspan="2" style="width:20px;"><a style="height: 10em;" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% IF ( shelfbrowser_prev_biblionumber ) %][% shelfbrowser_prev_biblionumber %][% ELSE %][% biblionumber %][% END %]&amp;shelfbrowse_itemnumber=[% shelfbrowser_prev_itemnumber %]#shelfbrowser"><img src="/opac-tmpl/prog/images/browse-prev.gif" alt="Previous" border="0" /></a></td>
799
[% FOREACH PREVIOUS_SHELF_BROWS IN PREVIOUS_SHELF_BROWSE %]
792
[% FOREACH PREVIOUS_SHELF_BROWS IN PREVIOUS_SHELF_BROWSE %]
800
        <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% PREVIOUS_SHELF_BROWS.biblionumber %]&amp;shelfbrowse_itemnumber=[% PREVIOUS_SHELF_BROWS.itemnumber %]#shelfbrowser">
793
        <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% PREVIOUS_SHELF_BROWS.biblionumber %]&amp;shelfbrowse_itemnumber=[% PREVIOUS_SHELF_BROWS.itemnumber %]#shelfbrowser">
801
    [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %]<img border="0" src="http://images.amazon.com/images/P/[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
794
    [% IF ( OPACAmazonCoverImages ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %]<img border="0" src="http://images.amazon.com/images/P/[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
802
    [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( content_identifier_exists ) %]
795
    [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( content_identifier_exists ) %]
803
    [% IF ( using_https ) %]
796
    [% IF ( using_https ) %]
804
    <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_upc ) %]&amp;upc=[% PREVIOUS_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_oclc ) %]&amp;oclc=[% PREVIOUS_SHELF_BROWS.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />
797
    <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_upc ) %]&amp;upc=[% PREVIOUS_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_oclc ) %]&amp;oclc=[% PREVIOUS_SHELF_BROWS.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />
Lines 814-821 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
814
[% FOREACH NEXT_SHELF_BROWS IN NEXT_SHELF_BROWSE %]
807
[% FOREACH NEXT_SHELF_BROWS IN NEXT_SHELF_BROWSE %]
815
       <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% NEXT_SHELF_BROWS.biblionumber %]&amp;shelfbrowse_itemnumber=[% NEXT_SHELF_BROWS.itemnumber %]#shelfbrowser">
808
       <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% NEXT_SHELF_BROWS.biblionumber %]&amp;shelfbrowse_itemnumber=[% NEXT_SHELF_BROWS.itemnumber %]#shelfbrowser">
816
809
817
    [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %]
810
    [% IF ( OPACAmazonCoverImages ) %][% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %]
818
    <img border="0" src="http://images.amazon.com/images/P/[% NEXT_SHELF_BROWS.browser_normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
811
    <img border="0" src="http://images.amazon.com/images/P/[% NEXT_SHELF_BROWS.browser_normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
819
812
820
	[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( content_identifier_exists ) %]
813
	[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( content_identifier_exists ) %]
821
    [% IF ( using_https ) %]
814
    [% IF ( using_https ) %]
Lines 851-866 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
851
844
852
<div id="descriptions">
845
<div id="descriptions">
853
<div class="content_set">
846
<div class="content_set">
854
[% IF ( OPACAmazonEnabled ) %]
847
855
[% IF ( OPACAmazonReviews ) %]
856
[% FOREACH AMAZON_EDITORIAL_REVIEW IN AMAZON_EDITORIAL_REVIEWS %]
857
    [% IF ( AMAZON_EDITORIAL_REVIEW.Content ) %]
858
    <h4>From [% AMAZON_EDITORIAL_REVIEW.Source %]:</h4>
859
    <div>[% AMAZON_EDITORIAL_REVIEW.Content %]</div>
860
    [% END %]
861
[% END %]
862
[% END %]
863
[% END %]
864
[% IF ( SyndeticsEnabled ) %]
848
[% IF ( SyndeticsEnabled ) %]
865
[% IF ( SyndeticsSummary ) %]
849
[% IF ( SyndeticsSummary ) %]
866
[% IF ( SYNDETICS_SUMMARY ) %]
850
[% IF ( SYNDETICS_SUMMARY ) %]
Lines 1100-1106 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
1100
[% FOREACH XISBN IN XISBNS %]
1084
[% FOREACH XISBN IN XISBNS %]
1101
<tr>
1085
<tr>
1102
<td>
1086
<td>
1103
[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %]<img src="http://images.amazon.com/images/P/[% XISBN.normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />[% END %][% END %]
1087
[% IF ( OPACAmazonCoverImages ) %]<img src="http://images.amazon.com/images/P/[% XISBN.normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />[% END %]
1104
1088
1105
[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( XISBN.content_identifier_exists ) %]
1089
[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( XISBN.content_identifier_exists ) %]
1106
[% IF ( using_https ) %]
1090
[% IF ( using_https ) %]
Lines 1119-1170 YAHOO.util.Event.onContentReady("furtherm", function () { Link Here
1119
</table>
1103
</table>
1120
</div>[% END %][% END %]
1104
</div>[% END %][% END %]
1121
1105
1122
[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonSimilarItems ) %][% IF ( AMAZON_SIMILAR_PRODUCTS ) %]
1123
<!-- Amazon Similar items -->
1124
<div id="similars">
1125
<h4>Related Titles</h4>
1126
<table><tr>
1127
[% FOREACH AMAZON_SIMILAR_PRODUCT IN AMAZON_SIMILAR_PRODUCTS %]
1128
[% FOREACH similar_biblionumber IN AMAZON_SIMILAR_PRODUCT.similar_biblionumbers %]
1129
<td>[% IF ( OPACAmazonCoverImages ) %]<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% similar_biblionumber.biblionumber %]"><img alt="" src="http://images.amazon.com/images/P/[% similar_biblionumber.ASIN %].01._SS50_.jpg" />[% END %]
1130
    [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( similar_biblionumber.content_identifier_exists ) %]
1131
    [% IF ( using_https ) %]
1132
    <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% similar_biblionumber.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( similar_biblionumber.browser_normalized_upc ) %]&amp;upc=[% similar_biblionumber.browser_normalized_upc %][% END %][% IF ( similar_biblionumber.browser_normalized_oclc ) %]&amp;oclc=[% similar_biblionumber.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />
1133
    [% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% similar_biblionumber.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( similar_biblionumber.browser_normalized_upc ) %]&amp;upc=[% similar_biblionumber.browser_normalized_upc %][% END %][% IF ( similar_biblionumber.browser_normalized_oclc ) %]&amp;oclc=[% similar_biblionumber.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />[% END %]
1134
    [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
1135
<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% similar_biblionumber.biblionumber %]">[% similar_biblionumber.title |html %]</a> </td>
1136
[% END %]
1137
[% END %]
1138
</tr></table>
1139
</div>[% END %]
1140
[% END %][% END %]
1141
1142
[% IF ( OPACAmazonEnabled ) %]
1143
[% IF ( OPACAmazonReviews ) %]
1144
<!-- Amazon Reviews -->
1145
<div id="amazonreviews">
1146
        [% IF ( amazon_average_rating ) %]
1147
            <div class="clearfix"><h3 style="float: left;">Average rating (from Amazon[% AmazonTld %]): </h3><span class="starMT" style="float: left;"><span class="starFull" style="float: left; width:[% amazon_average_rating / 2 %]px"></span></span> [% IF ( normalized_isbn ) %][% IF ( OPACurlOpenInNewWindow ) %]<a href="http://www.amazon[% AmazonTld %]/gp/customer-reviews/write-a-review.html/002-2970817-7876066?%5Fencoding=UTF8&amp;asin=[% normalized_isbn %]&amp;store=books" target="_blank">Add your own review</a>[% ELSE %]<a href="http://www.amazon[% AmazonTld %]/gp/customer-reviews/write-a-review.html/002-2970817-7876066?%5Fencoding=UTF8&amp;asin=[% normalized_isbn %]&amp;store=books">Add your own review</a>[% END %][% END %]</div>
1148
1149
        [% FOREACH AMAZON_CUSTOMER_REVIEW IN AMAZON_CUSTOMER_REVIEWS %]
1150
            <div class="content_set">
1151
            <div class="clearfix" style="margin: .5em 0;"><h4 style="float: left;">[% AMAZON_CUSTOMER_REVIEW.Summary |html %]</h4>  <span class="starMT" style="float: left;"><span class="starFull" style="float: left; width:[% Rating * 10 %]px"></span></span> </div>  [% AMAZON_CUSTOMER_REVIEW.Date | $KohaDates %]
1152
            [% IF ( AMAZON_CUSTOMER_REVIEW.Content ) %]
1153
                <p style="margin-left: .2em;">[% AMAZON_CUSTOMER_REVIEW.Content |html %]</p>
1154
            [% END %]
1155
            </div>
1156
        [% END %]
1157
        [% ELSE %]
1158
1159
    <p> Sorry, there are no reviews from this library available for this title. [% IF ( normalized_isbn ) %][% IF ( OPACurlOpenInNewWindow ) %]<a href="http://www.amazon[% AmazonTld %]/gp/customer-reviews/write-a-review.html/002-2970817-7876066?%5Fencoding=UTF8&amp;asin=[% normalized_isbn %]&amp;store=books" target="_blank">Add your own review</a>[% ELSE %]<a href="http://www.amazon[% AmazonTld %]/gp/customer-reviews/write-a-review.html/002-2970817-7876066?%5Fencoding=UTF8&amp;asin=[% normalized_isbn %]&amp;store=books">Add your own review</a>[% END %][% END %]</p>
1160
1161
        [% END %]
1162
</div>
1163
<!-- /Amazon Reviews -->
1164
[% END %]
1165
[% END %]
1166
1167
1168
[% IF ( OPACLocalCoverImages ) %]
1106
[% IF ( OPACLocalCoverImages ) %]
1169
<div id="images">
1107
<div id="images">
1170
<p>Click on an image to view it in the image viewer</p>
1108
<p>Click on an image to view it in the image viewer</p>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tt (-1 / +1 lines)
Lines 36-42 Link Here
36
       <dc:identifier>ISBN [% SEARCH_RESULT.isbn |html %]</dc:identifier>
36
       <dc:identifier>ISBN [% SEARCH_RESULT.isbn |html %]</dc:identifier>
37
       <link>[% IF ( SEARCH_RESULT.BiblioDefaultViewmarc ) %][% OPACBaseURL %]/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% ELSE %][% IF ( SEARCH_RESULT.BiblioDefaultViewisbd ) %][% OPACBaseURL %]/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% ELSE %][% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% END %][% END %]</link>
37
       <link>[% IF ( SEARCH_RESULT.BiblioDefaultViewmarc ) %][% OPACBaseURL %]/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% ELSE %][% IF ( SEARCH_RESULT.BiblioDefaultViewisbd ) %][% OPACBaseURL %]/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% ELSE %][% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% END %][% END %]</link>
38
       <description><![CDATA[
38
       <description><![CDATA[
39
[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %][% END %]
39
[% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %]
40
[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( SEARCH_RESULT.content_identifier_exists ) %]<img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&amp;client=[% SEARCH_RESULT.SyndeticsClientCode %]&amp;type=xw10[% IF ( SEARCH_RESULT.normalized_upc ) %]&amp;upc=[% SEARCH_RESULT.normalized_upc %][% END %][% IF ( SEARCH_RESULT.normalized_oclc ) %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc %][% END %]" alt="" />
40
[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( SEARCH_RESULT.content_identifier_exists ) %]<img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&amp;client=[% SEARCH_RESULT.SyndeticsClientCode %]&amp;type=xw10[% IF ( SEARCH_RESULT.normalized_upc ) %]&amp;upc=[% SEARCH_RESULT.normalized_upc %][% END %][% IF ( SEARCH_RESULT.normalized_oclc ) %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc %][% END %]" alt="" />
41
[% ELSE %]
41
[% ELSE %]
42
<img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" />
42
<img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" />
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt (-1 / +1 lines)
Lines 65-71 You have never borrowed anything from this library. Link Here
65
65
66
[% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
66
[% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
67
<td>
67
<td>
68
[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( READING_RECOR.normalized_isbn ) %]<a href="http://www.amazon.com/gp/reader/[% READING_RECOR.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% READING_RECOR.normalized_isbn %].01.THUMBZZZ.jpg" alt="Cover Image" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
68
[% IF ( OPACAmazonCoverImages ) %][% IF ( READING_RECOR.normalized_isbn ) %]<a href="http://www.amazon.com/gp/reader/[% READING_RECOR.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% READING_RECOR.normalized_isbn %].01.THUMBZZZ.jpg" alt="Cover Image" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
69
69
70
    [% IF ( GoogleJackets ) %][% IF ( READING_RECOR.normalized_isbn ) %]<div style="block" title="[% READING_RECOR.biblionumber |url %]" class="[% READING_RECOR.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
70
    [% IF ( GoogleJackets ) %][% IF ( READING_RECOR.normalized_isbn ) %]<div style="block" title="[% READING_RECOR.biblionumber |url %]" class="[% READING_RECOR.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
71
71
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tt (-1 / +1 lines)
Lines 198-204 function highlightOn() { Link Here
198
            [% ELSE %]
198
            [% ELSE %]
199
                <tr>
199
                <tr>
200
            [% END %]
200
            [% END %]
201
                    <td>[% IF ( OPACAmazonEnabled ) %]
201
                    <td>[% IF ( OPACAmazonCoverImages ) %]
202
                        <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% GROUP_RESULT.biblionumber |url %]">[% IF ( GROUP_RESULT.isbn ) %]<img src="http://images.amazon.com/images/P/[% GROUP_RESULT.isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<img src="http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="" class="thumbnail" />[% END %]
202
                        <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% GROUP_RESULT.biblionumber |url %]">[% IF ( GROUP_RESULT.isbn ) %]<img src="http://images.amazon.com/images/P/[% GROUP_RESULT.isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<img src="http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="" class="thumbnail" />[% END %]
203
                        </a>
203
                        </a>
204
                        [% ELSE %]
204
                        [% ELSE %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt (-1 / +1 lines)
Lines 603-609 $(document).ready(function(){ Link Here
603
                </td><td>
603
                </td><td>
604
                    <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
604
                    <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
605
            [% IF ( OPACLocalCoverImages ) %]<span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>[% END %]
605
            [% IF ( OPACLocalCoverImages ) %]<span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>[% END %]
606
                    [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
606
                    [% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
607
607
608
                [% IF ( SyndeticsEnabled ) %]
608
                [% IF ( SyndeticsEnabled ) %]
609
                    [% IF ( SyndeticsCoverImages ) %]
609
                    [% IF ( SyndeticsCoverImages ) %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt (-1 / +1 lines)
Lines 408-414 $(function() { Link Here
408
                        </td>
408
                        </td>
409
          <td>
409
          <td>
410
          <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber %]">
410
          <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber %]">
411
                    [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( itemsloo.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% itemsloo.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
411
                    [% IF ( OPACAmazonCoverImages ) %][% IF ( itemsloo.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% itemsloo.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
412
412
413
          [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
413
          [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
414
                <img src="https://secure.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% itemsloo.normalized_upc %]&amp;oclc=[% itemsloo.normalized_oclc %]" alt="" class="thumbnail" />
414
                <img src="https://secure.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% itemsloo.normalized_upc %]&amp;oclc=[% itemsloo.normalized_oclc %]" alt="" class="thumbnail" />
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews-rss.tt (-1 / +1 lines)
Lines 13-19 Link Here
13
       <title>New comment on [% review.title |html %] [% FOREACH subtitl IN review.subtitle %], [% subtitl.subfield |html %][% END %]</title>
13
       <title>New comment on [% review.title |html %] [% FOREACH subtitl IN review.subtitle %], [% subtitl.subfield |html %][% END %]</title>
14
       <link>[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% review.biblionumber %]#comments</link>
14
       <link>[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% review.biblionumber %]#comments</link>
15
       <description><![CDATA[
15
       <description><![CDATA[
16
[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( review.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% review.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %][% END %]
16
[% IF ( OPACAmazonCoverImages ) %][% IF ( review.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% review.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %]
17
17
18
[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( review.content_identifier_exists ) %][% IF ( using_https ) %]<img src="https://secure.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% review.normalized_upc %]&amp;oclc=[% review.normalized_oclc %]" alt="" />
18
[% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( review.content_identifier_exists ) %][% IF ( using_https ) %]<img src="https://secure.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% review.normalized_upc %]&amp;oclc=[% review.normalized_oclc %]" alt="" />
19
[% ELSE %]
19
[% ELSE %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews.tt (-1 / +1 lines)
Lines 80-86 $(document).ready(function(){ Link Here
80
    [% END %]
80
    [% END %]
81
81
82
82
83
            [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( review.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% review.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
83
            [% IF ( OPACAmazonCoverImages ) %][% IF ( review.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% review.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
84
84
85
            [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
85
            [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
86
        <img src="https://secure.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% review.normalized_upc %]&amp;oclc=[% review.normalized_oclc %]" alt="" class="thumbnail" />
86
        <img src="https://secure.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% review.normalized_upc %]&amp;oclc=[% review.normalized_oclc %]" alt="" class="thumbnail" />
(-)a/opac/opac-ISBDdetail.pl (-37 lines)
Lines 54-60 use C4::Review; Link Here
54
use C4::Serials;    # uses getsubscriptionfrom biblionumber
54
use C4::Serials;    # uses getsubscriptionfrom biblionumber
55
use C4::Koha;
55
use C4::Koha;
56
use C4::Members;    # GetMember
56
use C4::Members;    # GetMember
57
use C4::External::Amazon;
58
57
59
my $query = CGI->new();
58
my $query = CGI->new();
60
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
59
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 192-231 if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){ Link Here
192
 $template->param('OPACSearchForTitleIn' => $search_for_title);
191
 $template->param('OPACSearchForTitleIn' => $search_for_title);
193
}
192
}
194
193
195
## Amazon.com stuff
196
#not used unless preference set
197
if ( C4::Context->preference("OPACAmazonEnabled") == 1 ) {
198
199
    my $amazon_details = &get_amazon_details( $isbn, $record, $marcflavour );
200
201
    foreach my $result ( @{ $amazon_details->{Details} } ) {
202
        $template->param( item_description => $result->{ProductDescription} );
203
        $template->param( image            => $result->{ImageUrlMedium} );
204
        $template->param( list_price       => $result->{ListPrice} );
205
        $template->param( amazon_url       => $result->{url} );
206
    }
207
208
    my @products;
209
    my @reviews;
210
    for my $details ( @{ $amazon_details->{Details} } ) {
211
        next unless $details->{SimilarProducts};
212
        for my $product ( @{ $details->{SimilarProducts}->{Product} } ) {
213
            push @products, +{ Product => $product };
214
        }
215
        next unless $details->{Reviews};
216
        for my $product ( @{ $details->{Reviews}->{AvgCustomerRating} } ) {
217
            $template->param( rating => $product * 20 );
218
        }
219
        for my $reviews ( @{ $details->{Reviews}->{CustomerReview} } ) {
220
            push @reviews,
221
              +{
222
                Summary => $reviews->{Summary},
223
                Comment => $reviews->{Comment},
224
              };
225
        }
226
    }
227
    $template->param( SIMILAR_PRODUCTS => \@products );
228
    $template->param( AMAZONREVIEWS    => \@reviews );
229
}
230
231
output_html_with_http_headers $query, $cookie, $template->output;
194
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/opac/opac-detail.pl (-42 lines)
Lines 34-40 use C4::Items; Link Here
34
use C4::Circulation;
34
use C4::Circulation;
35
use C4::Tags qw(get_tags);
35
use C4::Tags qw(get_tags);
36
use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn);
36
use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn);
37
use C4::External::Amazon;
38
use C4::External::Syndetics qw(get_syndetics_index get_syndetics_summary get_syndetics_toc get_syndetics_excerpt get_syndetics_reviews get_syndetics_anotes );
37
use C4::External::Syndetics qw(get_syndetics_index get_syndetics_summary get_syndetics_toc get_syndetics_excerpt get_syndetics_reviews get_syndetics_anotes );
39
use C4::Review;
38
use C4::Review;
40
use C4::Ratings;
39
use C4::Ratings;
Lines 747-792 if (C4::Context->preference("OPACLocalCoverImages")){ Link Here
747
		$template->param(OPACLocalCoverImages => 1);
746
		$template->param(OPACLocalCoverImages => 1);
748
}
747
}
749
748
750
# Amazon.com Stuff
751
if ( C4::Context->preference("OPACAmazonEnabled") ) {
752
    $template->param( AmazonTld => get_amazon_tld() );
753
    my $amazon_reviews  = C4::Context->preference("OPACAmazonReviews");
754
    my $amazon_similars = C4::Context->preference("OPACAmazonSimilarItems");
755
    my @services;
756
    if ( $amazon_reviews ) {
757
        push( @services, 'EditorialReview', 'Reviews' );
758
    }
759
    if ( $amazon_similars ) {
760
        push( @services, 'Similarities' );
761
    }
762
    my $amazon_details = &get_amazon_details( $isbn, $record, $marcflavour, \@services );
763
    my $similar_products_exist;
764
    if ( $amazon_reviews ) {
765
        my $item = $amazon_details->{Items}->{Item}->[0];
766
        my $customer_reviews = \@{ $item->{CustomerReviews}->{Review} };
767
        my $editorial_reviews = \@{ $item->{EditorialReviews}->{EditorialReview} };
768
        my $average_rating = $item->{CustomerReviews}->{AverageRating} || 0;
769
        $template->param( amazon_average_rating    => $average_rating * 20);
770
        $template->param( AMAZON_CUSTOMER_REVIEWS  => $customer_reviews );
771
        $template->param( AMAZON_EDITORIAL_REVIEWS => $editorial_reviews );
772
    }
773
    if ( $amazon_similars ) {
774
        my $item = $amazon_details->{Items}->{Item}->[0];
775
        my @similar_products;
776
        for my $similar_product (@{ $item->{SimilarProducts}->{SimilarProduct} }) {
777
            # do we have any of these isbns in our collection?
778
            my $similar_biblionumbers = get_biblionumber_from_isbn($similar_product->{ASIN});
779
            # verify that there is at least one similar item
780
            if (scalar(@$similar_biblionumbers)){
781
                $similar_products_exist++ if ($similar_biblionumbers && $similar_biblionumbers->[0]);
782
                push @similar_products, +{ similar_biblionumbers => $similar_biblionumbers, title => $similar_product->{Title}, ASIN => $similar_product->{ASIN}  };
783
            }
784
        }
785
        $template->param( OPACAmazonSimilarItems => $similar_products_exist );
786
        $template->param( AMAZON_SIMILAR_PRODUCTS => \@similar_products );
787
    }
788
}
789
790
my $syndetics_elements;
749
my $syndetics_elements;
791
750
792
if ( C4::Context->preference("SyndeticsEnabled") ) {
751
if ( C4::Context->preference("SyndeticsEnabled") ) {
793
- 

Return to bug 8679