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

(-)a/C4/UsageStats.pm (-1 lines)
Lines 216-222 sub BuildReport { Link Here
216
        LocalCoverImages
216
        LocalCoverImages
217
        OPACLocalCoverImages
217
        OPACLocalCoverImages
218
        NovelistSelectEnabled
218
        NovelistSelectEnabled
219
        XISBN
220
        OpenLibraryCovers
219
        OpenLibraryCovers
221
        OpenLibrarySearch
220
        OpenLibrarySearch
222
        UseKohaPlugins
221
        UseKohaPlugins
(-)a/C4/XISBN.pm (-16 / +2 lines)
Lines 80-86 sub _get_biblio_from_xisbn { Link Here
80
80
81
sub get_xisbns {
81
sub get_xisbns {
82
    my ( $isbn ) = @_;
82
    my ( $isbn ) = @_;
83
    my ($response,$thing_response,$xisbn_response,$syndetics_response,$errors);
83
    my ($response,$thing_response,$syndetics_response,$errors);
84
    # THINGISBN
84
    # THINGISBN
85
    if ( C4::Context->preference('ThingISBN') ) {
85
    if ( C4::Context->preference('ThingISBN') ) {
86
        my $url = "http://www.librarything.com/api/thingISBN/".$isbn;
86
        my $url = "http://www.librarything.com/api/thingISBN/".$isbn;
Lines 96-116 sub get_xisbns { Link Here
96
		$syndetics_response = {isbn => \@syndetics_response};
96
		$syndetics_response = {isbn => \@syndetics_response};
97
	}
97
	}
98
98
99
    # XISBN
99
    $response->{isbn} = [ @{ $syndetics_response->{isbn} or [] }, @{ $thing_response->{isbn} or [] } ];
100
    if ( C4::Context->preference('XISBN') ) {
101
        my $affiliate_id=C4::Context->preference('OCLCAffiliateID');
102
        my $limit = C4::Context->preference('XISBNDailyLimit') || 999;
103
        my $reached_limit = _service_throttle('xisbn',$limit);
104
        my $url = "http://xisbn.worldcat.org/webservices/xid/isbn/".$isbn."?method=getEditions&format=xml&fl=form,year,lang,ed";
105
        $url.="&ai=".$affiliate_id if $affiliate_id;
106
        unless ($reached_limit) {
107
            $xisbn_response = _get_url($url,'xisbn');
108
        }
109
        $errors->{xisbn} = $xisbn_response->{ stat }
110
            if $xisbn_response->{ stat } ne 'ok';
111
    }
112
113
    $response->{isbn} = [ @{ $xisbn_response->{isbn} or [] },  @{ $syndetics_response->{isbn} or [] }, @{ $thing_response->{isbn} or [] } ];
114
    my @xisbns;
100
    my @xisbns;
115
    my $unique_xisbns; # a hashref
101
    my $unique_xisbns; # a hashref
116
102
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref (-16 lines)
Lines 186-207 Enhanced Content: Link Here
186
                  yes: Add
186
                  yes: Add
187
                  no: "Don't add"
187
                  no: "Don't add"
188
            - the rating from <a href='https://idreambooks.com/'>IDreamBooks.com</a> to OPAC search results.
188
            - the rating from <a href='https://idreambooks.com/'>IDreamBooks.com</a> to OPAC search results.
189
    OCLC:
190
        -
191
            - pref: XISBN
192
              choices:
193
                  yes: Use
194
                  no: "Don't use"
195
            - the OCLC xISBN service to show other editions of a title (when either FRBRizeEditions or OPACFRBRizeEditions is on).
196
        -
197
            - Use the <a href="http://www.worldcat.org/affiliate/webservices/xisbn/app.jsp">OCLC affiliate ID</a>
198
            - pref: OCLCAffiliateID
199
            - to access the xISBN service. Note that unless you have signed up for an ID, you are limited to 1000 requests per day.
200
        -
201
            - Only use the xISBN service
202
            - pref: XISBNDailyLimit
203
              class: integer
204
            - times a day. Unless you are paying for the xISBN service, you should leave this at the default of 999 (as detailed above).
205
    Syndetics:
189
    Syndetics:
206
        -
190
        -
207
            - pref: SyndeticsEnabled
191
            - pref: SyndeticsEnabled
(-)a/t/db_dependent/UsageStats.t (-1 lines)
Lines 469-475 sub mocking_systempreferences_to_a_set_value { Link Here
469
        LocalCoverImages
469
        LocalCoverImages
470
        OPACLocalCoverImages
470
        OPACLocalCoverImages
471
        NovelistSelectEnabled
471
        NovelistSelectEnabled
472
        XISBN
473
        OpenLibraryCovers
472
        OpenLibraryCovers
474
        OpenLibrarySearch
473
        OpenLibrarySearch
475
        UseKohaPlugins
474
        UseKohaPlugins
(-)a/t/db_dependent/XISBN.t (-17 / +1 lines)
Lines 5-11 Link Here
5
5
6
use Modern::Perl;
6
use Modern::Perl;
7
7
8
use Test::More tests => 4;
8
use Test::More tests => 3;
9
use MARC::Record;
9
use MARC::Record;
10
use C4::Biblio;
10
use C4::Biblio;
11
use C4::XISBN;
11
use C4::XISBN;
Lines 51-57 is( $trial->{biblionumber}, Link Here
51
51
52
## Test ThingISBN
52
## Test ThingISBN
53
t::lib::Mocks::mock_preference( 'ThingISBN', 1 );
53
t::lib::Mocks::mock_preference( 'ThingISBN', 1 );
54
t::lib::Mocks::mock_preference( 'XISBN', 0 );
55
54
56
my $results_thingisbn;
55
my $results_thingisbn;
57
eval { $results_thingisbn = C4::XISBN::get_xisbns($isbn1); };
56
eval { $results_thingisbn = C4::XISBN::get_xisbns($isbn1); };
Lines 63-82 SKIP: { Link Here
63
        "Gets correct biblionumber from a book with a similar isbn using ThingISBN." );
62
        "Gets correct biblionumber from a book with a similar isbn using ThingISBN." );
64
}
63
}
65
64
66
## Test XISBN
67
t::lib::Mocks::mock_preference( 'ThingISBN', 0 );
68
t::lib::Mocks::mock_preference( 'XISBN', 1 );
69
70
my $results_xisbn;
71
eval { ($results_xisbn, $errors) = C4::XISBN::get_xisbns($isbn1); };
72
SKIP: {
73
    skip "Problem retrieving XISBN (" . $errors->{xisbn} . ")", 1
74
        if $errors->{xisbn};
75
    is( $results_xisbn->[0]->{biblionumber},
76
        $biblionumber3,
77
        "Gets correct biblionumber from a book with a similar isbn using XISBN." );
78
}
79
80
$dbh->rollback;
65
$dbh->rollback;
81
66
82
# Util subs
67
# Util subs
83
- 

Return to bug 21226