]> xenbits.xensource.com Git - people/aperard/emesinae.git/commitdiff
bug: fix display of message date
authorIan Campbell <ijc@hellion.org.uk>
Fri, 2 Nov 2012 15:24:53 +0000 (15:24 +0000)
committerIan Campbell <ijc@hellion.org.uk>
Fri, 2 Nov 2012 15:24:53 +0000 (15:24 +0000)
Bugs/Message.pm
CGI/bug.pl

index fe6325566f40d2b62a77b9e04fa3feb3c5caab61..1ee41a8264de773bc6181da569a8fff1222bf76b 100644 (file)
@@ -79,11 +79,11 @@ sub lookup_msgid {
                 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),
     };
 
index 89af0cd499fbadbe3643155601ab1e8155a3f14d..a4874f5c4338005926f5938200f0fdf7a9477c06 100755 (executable)
@@ -39,10 +39,12 @@ print start_html(-title=>$c{TrackerName}.": #$bugid - ".$bug->{title},
 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),
@@ -54,8 +56,6 @@ print hr;
 
 print "\n\n";
 
-our $msgs = $bug->messages;
-
 print "\n";
 
 sub hdr {
@@ -64,7 +64,9 @@ 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";
 
@@ -77,7 +79,8 @@ foreach my $msgid ( keys $msgs ) {
                                             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 {