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

(-)a/Koha/Notice/Message.pm (-1 / +34 lines)
Lines 17-23 package Koha::Notice::Message; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
21
use Koha::Database;
20
use Koha::Database;
22
21
23
use base qw(Koha::Object);
22
use base qw(Koha::Object);
Lines 32-37 Koha::Notice::Message - Koha notice message Object class, related to the message Link Here
32
31
33
=cut
32
=cut
34
33
34
=head3 html_content
35
36
  my $wrapped_content = $message->html_content;
37
38
This method returns the message content approprately wrapped
39
with html headers and css includes for html formatted notices.
40
41
=cut
42
43
sub html_content {
44
    my ($self) = @_;
45
46
    my $title   = $self->subject;
47
    my $content = $self->content;
48
    my $css     = C4::Context->preference("NoticeCSS") || '';
49
    $css = qq{<link rel="stylesheet" type="text/css" href="$css">} if $css;
50
51
    return <<EOS;
52
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
53
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
54
<html lang="en" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
55
  <head>
56
    <title>$title</title>
57
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
58
    $css
59
  </head>
60
  <body>
61
  $content
62
  </body>
63
</html>
64
EOS
65
66
}
67
35
=head3 type
68
=head3 type
36
69
37
=cut
70
=cut
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/notices.tt (-2 / +1 lines)
Lines 67-73 Link Here
67
                                            <td>
67
                                            <td>
68
                                                <a class="notice-title" data-noticeid="[% QUEUED_MESSAGE.message_id | html %]" href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | uri %]&amp;noticeid=[% QUEUED_MESSAGE.message_id | uri %]">[% QUEUED_MESSAGE.subject | html %]</a>
68
                                                <a class="notice-title" data-noticeid="[% QUEUED_MESSAGE.message_id | html %]" href="/cgi-bin/koha/members/notices.pl?borrowernumber=[% borrowernumber | uri %]&amp;noticeid=[% QUEUED_MESSAGE.message_id | uri %]">[% QUEUED_MESSAGE.subject | html %]</a>
69
                                                [% IF QUEUED_MESSAGE.content_type.search('html') %]
69
                                                [% IF QUEUED_MESSAGE.content_type.search('html') %]
70
                                                <iframe class="notice" id="notice[% QUEUED_MESSAGE.message_id | html %]" srcdoc="[% QUEUED_MESSAGE.content | html %]"></iframe>
70
                                                <iframe class="notice" id="notice[% QUEUED_MESSAGE.message_id | html %]" srcdoc="[% QUEUED_MESSAGE.html_content | html %]"></iframe>
71
                                                [% ELSE %]
71
                                                [% ELSE %]
72
                                                <iframe class="notice" id="notice[% QUEUED_MESSAGE.message_id | html %]" srcdoc="[% QUEUED_MESSAGE.content | html | html_line_break %]"></iframe>
72
                                                <iframe class="notice" id="notice[% QUEUED_MESSAGE.message_id | html %]" srcdoc="[% QUEUED_MESSAGE.content | html | html_line_break %]"></iframe>
73
                                                [% END %]
73
                                                [% END %]
74
- 

Return to bug 30287