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("AllNoticeCSS");
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 / +33 lines)
Lines 59-64 sub html_content { Link Here
59
59
60
    my $title   = $self->subject;
60
    my $title   = $self->subject;
61
    my $content = $self->content;
61
    my $content = $self->content;
62
    my $stylesheets = $self->stylesheets;
62
63
63
    my $wrapped;
64
    my $wrapped;
64
    if ( $self->is_html ) {
65
    if ( $self->is_html ) {
Lines 73-79 sub html_content { Link Here
73
  <head>
74
  <head>
74
    <title>$title</title>
75
    <title>$title</title>
75
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
76
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
76
    $css
77
    $stylesheets
77
  </head>
78
  </head>
78
  <body>
79
  <body>
79
  $content
80
  $content
Lines 88-93 EOS Link Here
88
    return $wrapped;
89
    return $wrapped;
89
}
90
}
90
91
92
=head3 stylesheets
93
94
  my $stylesheets = $message->stylesheets;
95
96
Returns a string of all the stylesheet links for the message
97
98
=cut
99
100
sub stylesheets {
101
    my ($self) = @_;
102
103
    my $all_stylesheets = C4::Context->preference("AllNoticeStylesheet") || '';
104
    $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$all_stylesheets">\n} if $all_stylesheets;
105
    my $all_style_pref = C4::Context->preference("AllNoticeCSS");
106
    $all_stylesheets .= qq{<style type="text/css">$all_style_pref</style>} if $all_style_pref;
107
    if ( $self->message_transport_type eq 'email' ) {
108
        my $email_stylesheet = C4::Context->preference("EmailNoticeStylesheet") || '';
109
        $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$email_stylesheet">\n} if $email_stylesheet;
110
        my $email_style_pref = C4::Context->preference("EmailNoticeCSS");
111
        $all_stylesheets .= qq{<style type="text/css">$email_style_pref</style>} if $email_style_pref;
112
    }
113
    if ( $self->message_transport_type eq 'print' ) {
114
        my $print_stylesheet = C4::Context->preference("PrintNoticeStylesheet") || '';
115
        $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$print_stylesheet">\n} if $print_stylesheet;
116
        my $print_style_pref = C4::Context->preference("PrintNoticeCSS");
117
        $all_stylesheets .= qq{<style type="text/css">$print_style_pref</style>\n} if $print_style_pref;
118
    }
119
120
    return $all_stylesheets;
121
}
122
91
=head3 patron
123
=head3 patron
92
124
93
    my $patron = $message->patron
125
    my $patron = $message->patron
(-)a/circ/transfer-slip.pl (-3 / +2 lines)
Lines 55-64 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"),
62
    style      => $style,
61
    style      => $style,
63
    id         => 'transfer_slip',
62
    id         => 'transfer_slip',
64
);
63
);
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/printslip.tt (-2 / +2 lines)
Lines 36-43 Link Here
36
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
36
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
37
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon | url %][% ELSE %][% interface | html %]/[% theme | html %]/img/favicon.ico[% END %]" type="image/x-icon" />
37
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon | url %][% ELSE %][% interface | html %]/[% theme | html %]/img/favicon.ico[% END %]" type="image/x-icon" />
38
[% Asset.css("css/print.css") | $raw %]
38
[% Asset.css("css/print.css") | $raw %]
39
[% IF ( Koha.Preference('SlipCSS') ) %]
39
[% IF ( Koha.Preference('PrintSlipStylesheet') ) %]
40
<link rel="stylesheet" type="text/css" href="[% Koha.Preference('SlipCSS') | $raw %]" />
40
<link rel="stylesheet" type="text/css" href="[% Koha.Preference('PrintSlipStylesheet') | $raw %]" />
41
[% END %]
41
[% END %]
42
[% FOR slip IN slips %]
42
[% FOR slip IN slips %]
43
    [% IF slip.style %]<style>[% slip.style.replace('([^\{\}]+?)\s*\{', '#slip_' _ slip.id _ ' $1 {') | $raw %]</style>[% END %]
43
    [% IF slip.style %]<style>[% slip.style.replace('([^\{\}]+?)\s*\{', '#slip_' _ slip.id _ ' $1 {') | $raw %]</style>[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/printnotice.tt (-3 lines)
Lines 15-23 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') ) %]
19
<link rel="stylesheet" type="text/css" href="[% Koha.Preference('SlipCSS') | $raw %]" />
20
[% END %]
21
[% IF style %]<style>[% style | $raw %]</style>[% END %]
18
[% IF style %]<style>[% style | $raw %]</style>[% END %]
22
</head>
19
</head>
23
20
(-)a/members/printslip.pl (-1 / +2 lines)
Lines 117-126 $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},
123
    id             => $print,
122
    id             => $print,
123
    stylesheet     => C4::Context->preference("PrintSlipStylesheet"),
124
    error          => $error,
124
);
125
);
125
126
126
$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS' ) );
127
$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 64-70 for my $train_item_id (@train_item_ids) { Link Here
64
$template->param(
64
$template->param(
65
    slips      => \@slips,
65
    slips      => \@slips,
66
    caller     => 'preservation',
66
    caller     => 'preservation',
67
    stylesheet => C4::Context->preference("SlipCSS"),
67
    stylesheet => C4::Context->preference("PrintSlipStylesheet"),
68
);
68
);
69
69
70
$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS') );
70
$template->param( IntranetSlipPrinterJS => C4::Context->preference('IntranetSlipPrinterJS') );
71
- 

Return to bug 35267