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

(-)a/installer/data/mysql/atomicupdate/bug_37463-add_CoverImagesCategories_syspref.pl (+14 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(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')});
11
12
        say $out "Added system preference 'CoverImagesCategories'";
13
    },
14
};
(-)a/installer/data/mysql/atomicupdate/bug_37463-add_SCOCoverImagesCategories_syspref.pl (-14 lines)
Lines 1-14 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "37463",
5
    description => "Add new system preference SCOCoverImagesCategories",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{INSERT IGNORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('SCOCoverImagesCategories', '', NULL, 'Cover images will show for checked out items in the self checkout module for selected patron categories:', 'Free')});
11
12
        say $out "Added system preference 'SCOCoverImagesCategories'";
13
    },
14
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 685-691 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
685
('SavedSearchFilters', '0', NULL, 'Allow staff with permission to create/edit custom search filters', 'YesNo'),
685
('SavedSearchFilters', '0', NULL, 'Allow staff with permission to create/edit custom search filters', 'YesNo'),
686
('SCOAllowCheckin','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
686
('SCOAllowCheckin','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
687
('SCOBatchCheckoutsValidCategories','',NULL,'Patron categories allowed to checkout in a batch while logged into Self Checkout','Free'),
687
('SCOBatchCheckoutsValidCategories','',NULL,'Patron categories allowed to checkout in a batch while logged into Self Checkout','Free'),
688
('SCOCoverImagesCategories', '', NULL, 'Cover images will show for checked out items in the self checkout module for selected patron categories:', 'Free'),
688
('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'),
689
('SCOLoadCheckoutsByDefault','1','','If enabled, load the list of a patrons checkouts when they log in to the Self Checkout','YesNo'),
689
('SCOLoadCheckoutsByDefault','1','','If enabled, load the list of a patrons checkouts when they log in to the Self Checkout','YesNo'),
690
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
690
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
691
('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'),
691
('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-2 / +2 lines)
Lines 1285-1292 Circulation: Link Here
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
        -
1287
        -
1288
            - "Cover images will show for checked out items in the self checkout module for selected patron categories:"
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: SCOCoverImagesCategories
1289
            - pref: CoverImagesCategories
1290
              choices: patron-categories
1290
              choices: patron-categories
1291
              class: multiple
1291
              class: multiple
1292
        -
1292
        -
(-)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 (-1 / +12 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 305-310 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
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