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 1283-1289 sub _add_attachments { Link Here
1283
    my $message = Koha::Email->new;
1283
    my $message = Koha::Email->new;
1284
1284
1285
    if ( $letter->{is_html} ) {
1285
    if ( $letter->{is_html} ) {
1286
        $message->html_body( _wrap_html( $letter->{content}, $letter->{title} ) );
1286
        $message->html_body( _wrap_html( $letter->{content}, $letter->{title}, 'email' ) );
1287
    }
1287
    }
1288
    else {
1288
    else {
1289
        $message->text_body( $letter->{content} );
1289
        $message->text_body( $letter->{content} );
Lines 1505-1511 sub _send_message_by_email { Link Here
1505
        } else {
1505
        } else {
1506
            $email = Koha::Email->create($params);
1506
            $email = Koha::Email->create($params);
1507
            if ($is_html) {
1507
            if ($is_html) {
1508
                $email->html_body( _wrap_html( $content, $subject ) );
1508
                $email->html_body( _wrap_html( $content, $subject, 'email' ) );
1509
            } else {
1509
            } else {
1510
                $email->text_body($content);
1510
                $email->text_body($content);
1511
            }
1511
            }
Lines 1590-1599 sub _send_message_by_email { Link Here
1590
}
1590
}
1591
1591
1592
sub _wrap_html {
1592
sub _wrap_html {
1593
    my ($content, $title) = @_;
1593
    my ( $content, $title, $type ) = @_;
1594
1594
1595
    my $css = C4::Context->preference("NoticeCSS") || '';
1595
    my $all_stylesheets = C4::Context->preference("AllNoticeStylesheet") || '';
1596
    $css = qq{<link rel="stylesheet" type="text/css" href="$css">} if $css;
1596
    $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$all_stylesheets">} if $all_stylesheets;
1597
    my $all_style_pref = C4::Context->preference("AllNoticeCSS");
1598
    $all_stylesheets .= qq{<style type="text/css">$all_style_pref</style>} if $all_style_pref;
1599
    if ( $type eq 'email' ) {
1600
        my $email_stylesheet = C4::Context->preference("EmailNoticeStylesheet") || '';
1601
        $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$email_stylesheet">} if $email_stylesheet;
1602
        my $email_style_pref = C4::Context->preference("EmailNoticeCSS");
1603
        $all_stylesheets .= qq{<style type="text/css">$email_style_pref</style>} if $email_style_pref;
1604
    }
1605
    if ( $type eq 'print' ) {
1606
        my $print_stylesheet = C4::Context->preference("PrintNoticeStylesheet") || '';
1607
        $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$print_stylesheet">} if $print_stylesheet;
1608
        my $print_style_pref = C4::Context->preference("PrintNoticeCSS");
1609
        $all_stylesheets .= qq{<style type="text/css">$print_style_pref</style>} if $print_style_pref;
1610
    }
1597
    return <<EOS;
1611
    return <<EOS;
1598
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
1612
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
1599
    "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1613
    "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Lines 1601-1607 sub _wrap_html { Link Here
1601
<head>
1615
<head>
1602
<title>$title</title>
1616
<title>$title</title>
1603
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1617
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1604
$css
1618
$all_stylesheets
1605
</head>
1619
</head>
1606
<body>
1620
<body>
1607
$content
1621
$content
(-)a/Koha/Notice/Message.pm (-1 / +33 lines)
Lines 60-65 sub html_content { Link Here
60
60
61
    my $title   = $self->subject;
61
    my $title   = $self->subject;
62
    my $content = $self->content;
62
    my $content = $self->content;
63
    my $stylesheets = $self->stylesheets;
63
64
64
    my $wrapped;
65
    my $wrapped;
65
    if ( $self->is_html ) {
66
    if ( $self->is_html ) {
Lines 74-80 sub html_content { Link Here
74
  <head>
75
  <head>
75
    <title>$title</title>
76
    <title>$title</title>
76
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
77
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
77
    $css
78
    $stylesheets
78
  </head>
79
  </head>
79
  <body>
80
  <body>
80
  $content
81
  $content
Lines 124-129 sub restrict_patron_when_notice_fails { Link Here
124
    return $self;
125
    return $self;
125
}
126
}
126
127
128
=head3 stylesheets
129
130
  my $stylesheets = $message->stylesheets;
131
132
Returns a string of all the stylesheet links for the message
133
134
=cut
135
136
sub stylesheets {
137
    my ($self) = @_;
138
139
    my $all_stylesheets = C4::Context->preference("AllNoticeStylesheet") || '';
140
    $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$all_stylesheets">\n} if $all_stylesheets;
141
    my $all_style_pref = C4::Context->preference("AllNoticeCSS");
142
    $all_stylesheets .= qq{<style type="text/css">$all_style_pref</style>} if $all_style_pref;
143
    if ( $self->message_transport_type eq 'email' ) {
144
        my $email_stylesheet = C4::Context->preference("EmailNoticeStylesheet") || '';
145
        $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$email_stylesheet">\n} if $email_stylesheet;
146
        my $email_style_pref = C4::Context->preference("EmailNoticeCSS");
147
        $all_stylesheets .= qq{<style type="text/css">$email_style_pref</style>} if $email_style_pref;
148
    }
149
    if ( $self->message_transport_type eq 'print' ) {
150
        my $print_stylesheet = C4::Context->preference("PrintNoticeStylesheet") || '';
151
        $all_stylesheets .= qq{<link rel="stylesheet" type="text/css" href="$print_stylesheet">\n} if $print_stylesheet;
152
        my $print_style_pref = C4::Context->preference("PrintNoticeCSS");
153
        $all_stylesheets .= qq{<style type="text/css">$print_style_pref</style>\n} if $print_style_pref;
154
    }
155
156
    return $all_stylesheets;
157
}
158
127
=head3 type
159
=head3 type
128
160
129
=cut
161
=cut
(-)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 29-36 Link Here
29
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
29
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
30
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon | url %][% ELSE %][% interface | html %]/[% theme | html %]/img/favicon.ico[% END %]" type="image/x-icon" />
30
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon | url %][% ELSE %][% interface | html %]/[% theme | html %]/img/favicon.ico[% END %]" type="image/x-icon" />
31
[% Asset.css("css/print.css") | $raw %]
31
[% Asset.css("css/print.css") | $raw %]
32
[% IF ( Koha.Preference('SlipCSS') ) %]
32
[% IF ( Koha.Preference('PrintSlipStylesheet') ) %]
33
<link rel="stylesheet" type="text/css" href="[% Koha.Preference('SlipCSS') | $raw %]" />
33
<link rel="stylesheet" type="text/css" href="[% Koha.Preference('PrintSlipStylesheet') | $raw %]" />
34
[% END %]
34
[% END %]
35
[% FOR slip IN slips %]
35
[% FOR slip IN slips %]
36
    [% IF slip.style %]<style>[% slip.style.replace('([^\{\}]+?)\s*\{', '#slip_' _ slip.id _ ' $1 {') | $raw %]</style>[% END %]
36
    [% 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