diff --git a/mailboxes/lang/en b/mailboxes/lang/en index cd387a07d..c2ebb6f34 100644 --- a/mailboxes/lang/en +++ b/mailboxes/lang/en @@ -154,6 +154,15 @@ view_sub=Attached Email view_sub2=Attached email from $1 view_egone=This message no longer exists view_eugone=This user does not exist +view_ical=Event +view_ical_when=When +view_ical_where=Where +view_ical_who=Who +view_ical_orginizertime=Organizer time +view_ical_orginizername=Organizer name +view_ical_orginizeremail=Organizer email +view_ical_attendees=Attendees details +view_ical_desc=Event description view_gnupg=GnuPG signature verification view_gnupg_0=Signature by $1 is valid. diff --git a/mailboxes/view_mail.cgi b/mailboxes/view_mail.cgi index 9eefa8c41..91bfb2c37 100755 --- a/mailboxes/view_mail.cgi +++ b/mailboxes/view_mail.cgi @@ -148,11 +148,209 @@ else { print &ui_table_end(); # Show body attachment, with properly linked URLs -@bodyright = ( ); +my $bodycontents; +my @bodyright = ( ); +my $calendars = { }; +if (@calendars) { + # CSS for HTML version + $calendars->{'html'} .= < +STYLE + foreach my $calendar (@calendars) { + my $title = $calendar->{'summary'} || $calendar->{'description'}; + my $orginizer = $calendar->{'organizer_name'}; + my @attendees; + foreach my $a (@{$calendar->{'attendees'}}) { + push(@attendees, { name => $a->{'name'}, + email => $a->{'email'} }); + } + my $who = join(", ", map { $_->{'name'} } @attendees); + if ($who && $orginizer) { + $who .= ", ${orginizer}*"; + } + elsif ($orginizer) { + $who = "${orginizer}*"; + } + # HTML version + $calendars->{'html'} .= < +
| + $title + | +|
| + $text{'view_ical_when'} + | +$calendar->{'dtwhen_local'} | +
| + $text{'view_ical_where'} + | +$calendar->{'location'} | +
| + $text{'view_ical_who'} + | +$who | +
| + $text{'view_ical_orginizertime'} + | +$calendar->{'dtwhen'} | +
| + $text{'view_ical_orginizername'} + | +$calendar->{'organizer_name'} | +
| + $text{'view_ical_orginizeremail'} + | +$calendar->{'organizer_email'} | +
| + $text{'view_ical_attendees'} + | +@{[join('', map {
+ " $_->{'name'} |
+
| + $text{'view_ical_desc'} + | +@{[join(' ', + @{$calendar->{'description'}})]} |
+
";
+ $bodycontents .= $calendars->{'text'}
+ if ($calendars->{'text'});
foreach $l (&wrap_lines(&eucconv($body->{'data'}),
$config{'wrap_width'})) {
$bodycontents .= &link_urls_and_escape($l,
@@ -166,7 +364,9 @@ if ($body && $body->{'data'} =~ /\S/) {
}
elsif ($body eq $htmlbody) {
# Attempt to show HTML
- $bodycontents = $body->{'data'};
+ $bodycontents = $calendars->{'html'}
+ if ($calendars->{'html'});
+ $bodycontents .= $body->{'data'};
my @imageurls;
my $image_mode = int(defined($in{'images'}) ? $in{'images'} : $config{'view_images'});
$bodycontents = &disable_html_images($bodycontents, $image_mode, \@imageurls);