exit(0);
}
-my $bugid = url(-relative=>1);
-fourohfour() unless $bugid =~ m/[0-9]+/;
+# Parse path to determine bug number and (optional) mode:
+
+my $path = url(-absolute=>1);
+
+$path =~ m,^$c{CGIPath}bug/([0-9]+)(?:/(mbox))?/?$, or fourohfour();
+
+my $bugid = $1;
+my $mode = "normal";
+$mode = $2 if $2;
my $bug = Emesinae::Bug->new( $dbh, ID => $bugid );
fourohfour() unless $bug;
+if ( $mode eq "mbox" ) {
+ print header( -type => 'application/mbox', -charset => 'utf-8',);
+
+ foreach my $m ( sort msgcmp $bug->messages ) {
+ eval {
+ my $fh;
+
+ # Could forge a placeholder for messages which aren't present here.
+
+ $fh = $m->headers;
+ print for (<$fh>);
+
+ print "\n";
+
+ $fh = $m->body;
+ print for (<$fh>);
+ };
+ # Ignore errors...
+ }
+
+ exit(0);
+}
+
print header( -charset => 'utf-8', );
print start_html(
-title => $c{TrackerName} . ": #$bugid - " . htmlsanit( $bug->{title} ),
)
);
+print p(
+ { -class => "bugcontrol" },
+ "[ "
+ . buglink($bug, "Retrieve as mbox", "/mbox")
+ . " ]"
+ ) . "\n";
+
print hr;
print "\n\n";
sub buglink {
my $b = shift;
my $t = shift or $b->{title};
- my $url = cgipath( "bug/" . $b->{id} );
+ my $p = shift or ""; # Optional subpath
+
+ my $url = cgipath( "bug/" . $b->{id} . $p );
return a( { href => $url }, $t );
}
bug.pl:
- offer link to followup to a bug, but not reply to a specific message.
- - retrieve bug as an mbox
bugs.pl:
- summary of the status of the bugs