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

(-)a/installer/data/mysql/atomicupdate/bug_37463-add_CoverImagesCategories_syspref.pl (+16 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "37463",
5
    description => "Add new system preference CoverImagesCategories",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        $dbh->do(
11
            q{INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('CoverImagesCategories', '', NULL, 'Cover images will show in the patron checkouts table for selected patron categories. Please note: this only currently works for Amazon cover images.:', 'Free')}
12
        );
13
14
        say $out "Added system preference 'CoverImagesCategories'";
15
    },
16
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 175-180 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
175
('ContentWarningField', '', NULL, 'MARC field to use for content warnings', 'Free'),
175
('ContentWarningField', '', NULL, 'MARC field to use for content warnings', 'Free'),
176
('CookieConsent', '0', NULL, 'Require cookie consent to be displayed', 'YesNo'),
176
('CookieConsent', '0', NULL, 'Require cookie consent to be displayed', 'YesNo'),
177
('CookieConsentedJS', '', NULL, 'Add Javascript code that will run if cookie consent is provided (e.g. tracking code).', 'Free'),
177
('CookieConsentedJS', '', NULL, 'Add Javascript code that will run if cookie consent is provided (e.g. tracking code).', 'Free'),
178
('CoverImagesCategories', '', NULL, 'Cover images will show in the patron checkouts table for selected patron categories. Please note: this only currently works for Amazon cover images', 'Free'),
178
('CreateAVFromCataloguing', '1', '', 'Ability to create authorized values from the cataloguing module', 'YesNo'),
179
('CreateAVFromCataloguing', '1', '', 'Ability to create authorized values from the cataloguing module', 'YesNo'),
179
('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'),
180
('CronjobLog','0',NULL,'If ON, log information from cron jobs.','YesNo'),
180
('CSVDelimiter',',',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
181
('CSVDelimiter',',',';|tabulation|,|/|\\|#||','Define the default separator character for exporting reports','Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+5 lines)
Lines 1284-1289 Circulation: Link Here
1284
            - pref: SelfCheckAllowByIPRanges
1284
            - pref: SelfCheckAllowByIPRanges
1285
              class: short
1285
              class: short
1286
            - (Leave blank if not used. Use ranges or simple IP addresses separated by spaces, like <code>192.168.1.1 192.168.0.0/24</code>.)
1286
            - (Leave blank if not used. Use ranges or simple IP addresses separated by spaces, like <code>192.168.1.1 192.168.0.0/24</code>.)
1287
        -
1288
            - "Cover images will show in the patron checkouts table for selected patron categories. Please note: this only currently works for Amazon cover images"
1289
            - pref: CoverImagesCategories
1290
              choices: patron-categories
1291
              class: multiple
1287
        -
1292
        -
1288
            - "Patron categories allowed to check out in a batch while logged into the self checkout system:"
1293
            - "Patron categories allowed to check out in a batch while logged into the self checkout system:"
1289
            - pref: SCOBatchCheckoutsValidCategories
1294
            - pref: SCOBatchCheckoutsValidCategories
(-)a/koha-tmpl/intranet-tmpl/prog/js/checkouts.js (+8 lines)
Lines 145-150 function LoadIssuesTable() { Link Here
145
                          + "</a>"
145
                          + "</a>"
146
                          + onsite_checkout
146
                          + onsite_checkout
147
147
148
                          if (oObj.showcoverimage == 1 ) {
149
                    title += '<div class="cover-image" id="amazon-bookcoverimg" style="display: block;">'
150
                        + '<a href="https://images-na.ssl-images-amazon.com/images/P/'
151
                        + oObj.isbn
152
                        + '.01.LZZZZZZZ.jpg" title="Amazon cover image"><img src="https://images-na.ssl-images-amazon.com/images/P/'
153
                        + oObj.isbn
154
                        + '.01.MZZZZZZZ.jpg" alt="Amazon cover image"/></a><div class="hint">Image from Amazon.com</div></div>';
155
                          }
148
                    return title;
156
                    return title;
149
                },
157
                },
150
                "type":  "anti-the"
158
                "type":  "anti-the"
(-)a/svc/checkouts (-3 / +14 lines)
Lines 239-244 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
239
        }
239
        }
240
    }
240
    }
241
241
242
    my @coverimagescategories = split( ",", C4::Context->preference("CoverImagesCategories") );
243
    my $showcoverimage        = 0;
244
    my $patroncategory        = Koha::Patrons->find( $c->{borrowernumber} )->categorycode;
245
    if ( grep( /^$patroncategory$/, @coverimagescategories ) ) {
246
        $showcoverimage = 1;
247
    }
248
249
    my $biblio = Koha::Biblios->find( $c->{biblionumber} );
250
    my $isbn   = $biblio->normalized_isbn;
251
242
    my $checkout = {
252
    my $checkout = {
243
        DT_RowId               => $c->{itemnumber} . '-' . $c->{borrowernumber},
253
        DT_RowId               => $c->{itemnumber} . '-' . $c->{borrowernumber},
244
        title                  => $c->{title},
254
        title                  => $c->{title},
Lines 303-310 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
303
            firstname  => $c->{firstname},
313
            firstname  => $c->{firstname},
304
            cardnumber => $c->{cardnumber},
314
            cardnumber => $c->{cardnumber},
305
        },
315
        },
306
        issued_today => !$c->{not_issued_today},
316
        issued_today   => !$c->{not_issued_today},
307
        recalled     => $recalled,
317
        recalled       => $recalled,
318
        isbn           => $isbn,
319
        showcoverimage => $showcoverimage,
308
    };
320
    };
309
321
310
    if ( $c->{not_issued_today} ) {
322
    if ( $c->{not_issued_today} ) {
311
- 

Return to bug 37463