From 9355ffe6229e1b86cfc968806ab2e2057732436e Mon Sep 17 00:00:00 2001 From: fukachan Date: Sun, 11 Nov 2001 11:12:27 +0000 Subject: enable "show" and "change_status" to work --- fml/lib/Mail/ThreadTrack/Print/HTML.pm | 79 +++++++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 20 deletions(-) (limited to 'fml/lib/Mail/ThreadTrack/Print/HTML.pm') diff --git a/fml/lib/Mail/ThreadTrack/Print/HTML.pm b/fml/lib/Mail/ThreadTrack/Print/HTML.pm index 69e1e960..eb0399dd 100644 --- a/fml/lib/Mail/ThreadTrack/Print/HTML.pm +++ b/fml/lib/Mail/ThreadTrack/Print/HTML.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Sort.pm,v 1.4 2001/11/10 08:50:41 fukachan Exp $ +# $FML: HTML.pm,v 1.4 2001/11/11 00:57:36 fukachan Exp $ # package Mail::ThreadTrack::Print::HTML; @@ -21,7 +21,7 @@ use Mail::ThreadTrack::Print::Utils qw(decode_mime_string STR2EUC); # Arguments: $self $str # Side Effects: none # Return Value: none -sub show_articles_for_thread +sub show_articles_in_thread { my ($self, $thread_id) = @_; my $mode = $self->get_mode || 'text'; @@ -68,14 +68,43 @@ sub show_articles_for_thread sub __start_thread_summary { my ($self, $args) = @_; - my $fd = $self->{ _fd } || \*STDOUT; + my $config = $self->{ _config }; + my $ml_name = $config->{ ml_name }; + my $fd = $self->{ _fd } || \*STDOUT; + my $action = "fmlthread.cgi"; + my $target = "ResultsWindow"; + + # statistics + if (defined $self->{ _ticket_id_stat }) { + my $stat = $self->{ _ticket_id_stat }; + for my $key ('open', 'analyzed', 'closed') { + print $fd "$key: "; + print $fd defined $stat->{ $key } ? $stat->{ $key } : 0; + print $fd ", "; + } + print $fd br, "\n"; + } + + print $fd start_form(-action=>$action, -target=>$target); + print $fd submit(-name => 'submit'); + print $fd reset(-name => 'reset'); + print $fd "\n"; + + print $fd hidden(-name => 'ml_name', + -default => [ $ml_name ], + ), "\n"; + + param('action', 'change_status'); # we need to override + print $fd hidden(-name => 'action', + -default => [ 'change_status ' ], + ), "\n"; print $fd "\n"; print $fd "
id\n"; + print $fd "change\n"; print $fd "summary\n"; print $fd "age\n"; print $fd "status\n"; - print $fd "change\n"; } @@ -90,6 +119,10 @@ sub __end_thread_summary my $fd = $self->{ _fd } || \*STDOUT; print $fd "
\n"; + + print submit(-name => 'submit'); + print reset(-name => 'reset'); + print $fd end_form; } @@ -119,18 +152,35 @@ sub __print_thread_summary #
..> my $xtid = CGI::escape($tid); - $action = "${action}?ml_name=${ml_name}"; - $action .= "&thread_id=$xtid&article_id=$aid"; + $action = "${action}?ml_name=${ml_name}&article_id=$aid"; + + $self->{ _table_count } = 1 unless defined $self->{ _table_count }; + if (($self->{ _table_count }++ % 5) == 0) { + print "\n\n"; + print submit(-name => 'submit'), reset(-name => 'reset'); + } print "\n"; + + # thread id print ""; - print ""; + print "\n"; print $tid; print "\n\n"; + # action print ""; + my $name = "change_status.$tid"; + my $values = ["open", "analyzed", "closed"]; + my $default = $status; + print radio_group(-name => $name, + -values => $values, + -default => $default, + -linebreak => 'true', + ); - # summary + # message (article) brief summary + print ""; if (defined $articles) { $aid = (split(/\s+/, $articles))[0]; my $f = File::Spec->catfile($spool_dir, $aid); @@ -140,20 +190,9 @@ sub __print_thread_summary } } + # addional information: age, status print "$age\n"; print "$status\n"; - print ""; - my $name = "change-status=$tid"; - my $values = ['open', 'analyzed', 'closed']; - my $default = $status; - print checkbox_group(-name=>$name, - -values=>$values, - -defaults=>$default, - -linebreak=>'true', - ); - - # print ""; - # print "[close]\n"; print "\n\n"; } -- cgit v1.2.1