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

(-)a/C4/Letters.pm (-9 / +23 lines)
Lines 340-346 sub SendAlerts { Link Here
340
            );
340
            );
341
341
342
            if ( $letter->{is_html} ) {
342
            if ( $letter->{is_html} ) {
343
                $mail->html_body( _wrap_html( $letter->{content}, "" . $letter->{title} ) );
343
                $mail->html_body( _wrap_html( $letter->{content}, "" . $letter->{title}, 'email' ) );
344
            }
344
            }
345
            else {
345
            else {
346
                $mail->text_body( $letter->{content} );
346
                $mail->text_body( $letter->{content} );
Lines 516-522 sub SendAlerts { Link Here
516
        );
516
        );
517
517
518
        if ( $letter->{is_html} ) {
518
        if ( $letter->{is_html} ) {
519
            $mail->html_body( _wrap_html( $letter->{content}, "" . $letter->{title} ) );
519
            $mail->html_body( _wrap_html( $letter->{content}, "" . $letter->{title}, 'email' ) );
520
        }
520
        }
521
        else {
521
        else {
522
            $mail->text_body( "" . $letter->{content} );
522
            $mail->text_body( "" . $letter->{content} );
Lines 1266-1272 sub _add_attachments { Link Here
1266
    my $message = Koha::Email->new;
1266
    my $message = Koha::Email->new;
1267
1267
1268
    if ( $letter->{is_html} ) {
1268
    if ( $letter->{is_html} ) {
1269
        $message->html_body( _wrap_html( $letter->{content}, $letter->{title} ) );
1269
        $message->html_body( _wrap_html( $letter->{content}, $letter->{title}, 'email' ) );
1270
    }
1270
    }
1271
    else {
1271
    else {
1272
        $message->text_body( $letter->{content} );
1272
        $message->text_body( $letter->{content} );
Lines 1488-1494 sub _send_message_by_email { Link Here
1488
        } else {
1488
        } else {
1489
            $email = Koha::Email->create($params);
1489
            $email = Koha::Email->create($params);
1490
            if ($is_html) {
1490
            if ($is_html) {
1491
                $email->html_body( _wrap_html( $content, $subject ) );
1491
                $email->html_body( _wrap_html( $content, $subject, 'email' ) );
1492
            } else {
1492
            } else {
1493
                $email->text_body($content);
1493
                $email->text_body($content);
1494
            }
1494
            }
Lines 1573-1582 sub _send_message_by_email { Link Here
1573
}
1573
}
1574
1574
1575
sub _wrap_html {
1575
sub _wrap_html {
1576
    my ($content, $title) = @_;
1576
    my ( $content, $title, $type ) = @_;
1577
1577
1578
    my $css = C4::Context->preference("NoticeCSS") || '';
1578
    my $all_stylesheets = C4::Context->preference("AllNoticeStylesheet") || '';
1579
    $css = qq{<link rel="stylesheet" type="text/css" href="$css">} if $css;
1579
    $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$all_stylesheets">} if $all_stylesheets;
1580
    my $all_style_pref = C4::Context->preference("EmailNoticeCSS");
1581
    $all_stylesheets .= qq{<style type="text/css">$all_style_pref</style>} if $all_style_pref;
1582
    if ( $type eq 'email' ) {
1583
        my $email_stylesheet = C4::Context->preference("EmailNoticeStylesheet") || '';
1584
        $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$email_stylesheet">} if $email_stylesheet;
1585
        my $email_style_pref = C4::Context->preference("EmailNoticeCSS");
1586
        $all_stylesheets .= qq{<style type="text/css">$email_style_pref</style>} if $email_style_pref;
1587
    }
1588
    if ( $type eq 'print' ) {
1589
        my $print_stylesheet = C4::Context->preference("PrintNoticeStylesheet") || '';
1590
        $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$print_stylesheet">} if $print_stylesheet;
1591
        my $print_style_pref = C4::Context->preference("PrintNoticeCSS");
1592
        $all_stylesheets .= qq{<style type="text/css">$print_style_pref</style>} if $print_style_pref;
1593
    }
1580
    return <<EOS;
1594
    return <<EOS;
1581
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
1595
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
1582
    "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1596
    "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Lines 1584-1590 sub _wrap_html { Link Here
1584
<head>
1598
<head>
1585
<title>$title</title>
1599
<title>$title</title>
1586
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1600
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1587
$css
1601
$all_stylesheets
1588
</head>
1602
</head>
1589
<body>
1603
<body>
1590
$content
1604
$content
(-)a/Koha/Notice/Message.pm (-1 / +18 lines)
Lines 60-65 sub html_content { Link Here
60
    my $title   = $self->subject;
60
    my $title   = $self->subject;
61
    my $content = $self->content;
61
    my $content = $self->content;
62
62
63
    my $all_stylesheets = C4::Context->preference("AllNoticeStylesheet") || '';
64
    $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$all_stylesheets">} if $all_stylesheets;
65
    my $all_style_pref = C4::Context->preference("EmailNoticeCSS");
66
    $all_stylesheets .= qq{<style type="text/css">$all_style_pref</style>} if $all_style_pref;
67
    if ( $self->message_transport_type eq 'email' ) {
68
        my $email_stylesheet = C4::Context->preference("EmailNoticeStylesheet") || '';
69
        $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$email_stylesheet">} if $email_stylesheet;
70
        my $email_style_pref = C4::Context->preference("EmailNoticeCSS");
71
        $all_stylesheets .= qq{<style type="text/css">$email_style_pref</style>} if $email_style_pref;
72
    }
73
    if ( $self->message_transport_type eq 'print' ) {
74
        my $print_stylesheet = C4::Context->preference("PrintNoticeStylesheet") || '';
75
        $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$print_stylesheet">} if $print_stylesheet;
76
        my $print_style_pref = C4::Context->preference("PrintNoticeCSS");
77
        $all_stylesheets .= qq{<style type="text/css">$print_style_pref</style>} if $print_style_pref;
78
    }
79
63
    my $wrapped;
80
    my $wrapped;
64
    if ( $self->is_html ) {
81
    if ( $self->is_html ) {
65
82
Lines 73-79 sub html_content { Link Here
73
  <head>
90
  <head>
74
    <title>$title</title>
91
    <title>$title</title>
75
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
92
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
76
    $css
93
    $all_stylesheets
77
  </head>
94
  </head>
78
  <body>
95
  <body>
79
  $content
96
  $content
(-)a/circ/transfer-slip.pl (-4 / +3 lines)
Lines 55-65 else { Link Here
55
    $slip = "Item not found";
55
    $slip = "Item not found";
56
}
56
}
57
$template->param(
57
$template->param(
58
    slip => $slip,
58
    slip   => $slip,
59
    plain => !$is_html,
59
    plain  => !$is_html,
60
    caller => 'cud-transfer',
60
    caller => 'cud-transfer',
61
    stylesheet => C4::Context->preference("SlipCSS"),
61
    style  => $style,
62
    style      => $style,
63
);
62
);
64
63
65
output_html_with_http_headers $input, $cookie, $template->output;
64
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt (-2 / +2 lines)
Lines 26-33 Link Here
26
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
26
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
27
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon | url %][% ELSE %][% interface | html %]/[% theme | html %]/img/favicon.ico[% END %]" type="image/x-icon" />
27
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon | url %][% ELSE %][% interface | html %]/[% theme | html %]/img/favicon.ico[% END %]" type="image/x-icon" />
28
[% Asset.css("css/print.css") | $raw %]
28
[% Asset.css("css/print.css") | $raw %]
29
[% IF ( Koha.Preference('SlipCSS') ) %]
29
[% IF ( Koha.Preference('PrintSlipStylesheet') ) %]
30
<link rel="stylesheet" type="text/css" href="[% Koha.Preference('SlipCSS') | $raw %]" />
30
<link rel="stylesheet" type="text/css" href="[% Koha.Preference('PrintSlipStylesheet') | $raw %]" />
31
[% END %]
31
[% END %]
32
32
33
[% INCLUDE 'slip-print.inc' #printThenClose %]
33
[% INCLUDE 'slip-print.inc' #printThenClose %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printnotice.tt (-2 / +2 lines)
Lines 15-22 Link Here
15
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon | url %][% ELSE %][% interface | html %]/[% theme | html %]/img/favicon.ico[% END %]" type="image/x-icon" />
15
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon | url %][% ELSE %][% interface | html %]/[% theme | html %]/img/favicon.ico[% END %]" type="image/x-icon" />
16
16
17
[% Asset.css("css/print.css") | $raw %]
17
[% Asset.css("css/print.css") | $raw %]
18
[% IF ( Koha.Preference('SlipCSS') ) %]
18
[% IF ( Koha.Preference('PrintSlipStylesheet') ) %]
19
<link rel="stylesheet" type="text/css" href="[% Koha.Preference('SlipCSS') | $raw %]" />
19
<link rel="stylesheet" type="text/css" href="[% Koha.Preference('PrintSlipStylesheet') | $raw %]" />
20
[% END %]
20
[% END %]
21
[% IF style %]<style>[% style | $raw %]</style>[% END %]
21
[% IF style %]<style>[% style | $raw %]</style>[% END %]
22
</head>
22
</head>
(-)a/members/printslip.pl (-1 / +2 lines)
Lines 117-125 $template->param( Link Here
117
    plain          => !$is_html,
117
    plain          => !$is_html,
118
    borrowernumber => $borrowernumber,
118
    borrowernumber => $borrowernumber,
119
    caller         => 'members',
119
    caller         => 'members',
120
    stylesheet     => C4::Context->preference("SlipCSS"),
121
    error          => $error,
120
    error          => $error,
122
    style          => $letter->{style},
121
    style          => $letter->{style},
122
    stylesheet     => C4::Context->preference("PrintSlipStylesheet"),
123
    error          => $error,
123
);
124
);
124
125
125
$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS' ) );
126
$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS' ) );
(-)a/opac/sco/printslip.pl (-1 / +1 lines)
Lines 80-86 if (my $letter = IssueSlip (Koha::Patrons->find( $loggedinuser )->branchcode, $p Link Here
80
$template->{VARS}->{slip} = $slip;
80
$template->{VARS}->{slip} = $slip;
81
$template->{VARS}->{plain} = !$is_html;
81
$template->{VARS}->{plain} = !$is_html;
82
$template->{VARS}->{borrowernumber} = $patron->borrowernumber;
82
$template->{VARS}->{borrowernumber} = $patron->borrowernumber;
83
$template->{VARS}->{stylesheet} = C4::Context->preference("SlipCSS");
83
$template->{VARS}->{stylesheet} = C4::Context->preference("PrintSlipStylesheet");
84
$template->{VARS}->{error} = $error;
84
$template->{VARS}->{error} = $error;
85
85
86
output_html_with_http_headers $input, $cookie, $template->output;
86
output_html_with_http_headers $input, $cookie, $template->output;
(-)a/preservation/print_slip.pl (-2 / +1 lines)
Lines 61-67 for my $train_item_id (@train_item_ids) { Link Here
61
$template->param(
61
$template->param(
62
    slips      => \@slips,
62
    slips      => \@slips,
63
    caller     => 'preservation',
63
    caller     => 'preservation',
64
    stylesheet => C4::Context->preference("SlipCSS"),
64
    stylesheet => C4::Context->preference("PrintSlipStylesheet"),
65
);
65
);
66
66
67
$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS') );
67
$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS') );
68
- 

Return to bug 35267