present => $present eq "true",
inserted => $inserted,
id => $id,
+ msgid => $msgid,
date => Mail::Field::Date->new('date', $date),
from => Mail::Field::AddrList->new('from', $from),
to => Mail::Field::AddrList->new('to', $to),
cc => Mail::Field::AddrList->new('cc', $cc),
- msgid => $msgid,
subject => Mail::Field->new('subject', $subj),
};
print h1("#$bugid - ".$bug->{title});
print "\n";
-my $creationdate = strftime("%a %b %e %H:%M:%S %Y",
- gmtime($bug->{creationdate}));
-my $lastchangedate = strftime("%a %b %e %H:%M:%S %Y",
- gmtime($bug->{lastchangedate}));
+sub fmtdate {
+ return htmlsanit(strftime("%a %b %e %H:%M:%S %Y", gmtime(shift)));
+}
+
+my $creationdate = fmtdate($bug->{creationdate});
+my $lastchangedate = fmtdate($bug->{lastchangedate});
print div({-class=>"bugmetadata"},
p(["Owner: " .htmlsanit($bug->{owner}),
"Date: " .htmlsanit($creationdate),
print "\n\n";
-our $msgs = $bug->messages;
-
print "\n";
sub hdr {
return b($tag).": ".htmlsanit($value);
}
-foreach my $msgid ( keys $msgs ) {
+our @msgs = keys $bug->messages;
+
+foreach my $msgid ( @msgs ) {
my $m = Bugs::Message->lookup_id($dbh, $msgid);
print comment("Message $msgid: ". $m->{msgid}) . "\n";
hdr("To", $m->{to}->stringify),
hdr("Cc", $m->{cc}->stringify),
hdr("Subject", $m->{subject}->stringify),
- hdr("Date", $m->{date}->stringify)))),
+ hdr("Date", fmtdate($m->{date})),
+ ))),
pre({-class=>"body"}, htmlsanit(join("\n",@body))),
]);
} else {