summaryrefslogtreecommitdiff
path: root/fml/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2001-11-11 11:12:27 +0000
committerfukachan <fukachan>2001-11-11 11:12:27 +0000
commit9355ffe6229e1b86cfc968806ab2e2057732436e (patch)
treee36de4ce3cc4f46580baef8b1f93efbe146d8651 /fml/lib
parent13e1ed9bb846416f44c4e22ebc4fb2a827a6b585 (diff)
downloadfml8-9355ffe6229e1b86cfc968806ab2e2057732436e.tar.gz
fml8-9355ffe6229e1b86cfc968806ab2e2057732436e.tar.bz2
fml8-9355ffe6229e1b86cfc968806ab2e2057732436e.zip
enable "show" and "change_status" to work
Diffstat (limited to 'fml/lib')
-rw-r--r--fml/lib/FML/CGI/ThreadTrack.pm23
-rwxr-xr-xfml/lib/Mail/ThreadTrack.pm13
-rw-r--r--fml/lib/Mail/ThreadTrack/Print.pm18
-rw-r--r--fml/lib/Mail/ThreadTrack/Print/HTML.pm79
4 files changed, 107 insertions, 26 deletions
diff --git a/fml/lib/FML/CGI/ThreadTrack.pm b/fml/lib/FML/CGI/ThreadTrack.pm
index f3eeff0e..86022fd0 100644
--- a/fml/lib/FML/CGI/ThreadTrack.pm
+++ b/fml/lib/FML/CGI/ThreadTrack.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: ThreadTrack.pm,v 1.2 2001/11/11 01:12:44 fukachan Exp $
+# $FML: ThreadTrack.pm,v 1.3 2001/11/11 02:46:42 fukachan Exp $
#
package FML::CGI::ThreadTrack;
@@ -90,13 +90,28 @@ sub run_cgi
my $thread = new Mail::ThreadTrack $ttargs;
$thread->set_mode('html');
+ # for (param()) { print "PARAM(debug): $_ => ", param($_), "<BR>\n";}
+
if ($action eq 'list') {
$thread->summary();
}
- elsif ($action eq 'close') {
- my $id = $curproc->safe_param_article_id();
+ elsif ($action eq 'show') {
+ my $id = $curproc->safe_param_article_id();
my $tid = $thread->_create_thread_id_strings($id);
- $thread->close($tid);
+ $thread->show($tid);
+ }
+ elsif ($action eq 'change_status') {
+ my (@id);
+ for my $param (param()) {
+ my $req = param($param);
+ if ($req eq 'closed') {
+ if ($param =~ /^change_status\.(\S+)\/(\d+)$/) {
+ my $tid = $thread->_create_thread_id_strings($2);
+ print "closed $tid\n"; print br;
+ $thread->close($tid);
+ }
+ }
+ }
$thread->summary();
}
else {
diff --git a/fml/lib/Mail/ThreadTrack.pm b/fml/lib/Mail/ThreadTrack.pm
index 39510359..aeff51e2 100755
--- a/fml/lib/Mail/ThreadTrack.pm
+++ b/fml/lib/Mail/ThreadTrack.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: ThreadTrack.pm,v 1.14 2001/11/09 15:07:51 fukachan Exp $
+# $FML: ThreadTrack.pm,v 1.15 2001/11/11 00:58:44 fukachan Exp $
#
package Mail::ThreadTrack;
@@ -228,9 +228,17 @@ sub list_up_thread_id
my ($tid, $status, @thread_id);
my $rh_status = $self->{ _hash_table }->{ _status };
my $mode = 'default';
+ my $stat = {};
TICEKT_LIST:
while (($tid, $status) = each %$rh_status) {
+ if ($status =~ /close/o) {
+ $stat->{ 'closed' }++;
+ }
+ else {
+ $stat->{ $status }++;
+ }
+
if ($mode eq 'default') {
next TICEKT_LIST if $status =~ /close/o;
}
@@ -238,6 +246,9 @@ sub list_up_thread_id
push(@thread_id, $tid);
}
+ # save statistics
+ $self->{ _ticket_id_stat } = $stat;
+
\@thread_id;
}
diff --git a/fml/lib/Mail/ThreadTrack/Print.pm b/fml/lib/Mail/ThreadTrack/Print.pm
index 4b453194..af8bf132 100644
--- a/fml/lib/Mail/ThreadTrack/Print.pm
+++ b/fml/lib/Mail/ThreadTrack/Print.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: Print.pm,v 1.14 2001/11/10 09:04:27 fukachan Exp $
+# $FML: Print.pm,v 1.15 2001/11/11 00:57:35 fukachan Exp $
#
package Mail::ThreadTrack::Print;
@@ -257,6 +257,22 @@ sub _do_review
}
+=head2 show()
+
+=cut
+
+
+sub show
+{
+ my ($self, $tid) = @_;
+
+ $self->_load_library();
+ $self->db_open();
+ $self->show_articles_in_thread($tid);
+ $self->db_close();
+}
+
+
=head2 print()
=cut
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 "<TABLE BORDER=4>\n";
print $fd "<TD>id\n";
+ print $fd "<TD>change\n";
print $fd "<TD>summary\n";
print $fd "<TD>age\n";
print $fd "<TD>status\n";
- print $fd "<TD>change\n";
}
@@ -90,6 +119,10 @@ sub __end_thread_summary
my $fd = $self->{ _fd } || \*STDOUT;
print $fd "</TABLE>\n";
+
+ print submit(-name => 'submit');
+ print reset(-name => 'reset');
+ print $fd end_form;
}
@@ -119,18 +152,35 @@ sub __print_thread_summary
# <FORM ACTION=> ..>
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 "<TR>\n<TD>\n";
+ print submit(-name => 'submit'), reset(-name => 'reset');
+ }
print "<TR>\n";
+
+ # thread id
print "<TD>";
- print "<A HREF=\"$action&action=show\"\n\tTARGET=\"$target.show\">";
+ print "<A HREF=\"$action&action=show\" TARGET=\"lower\">\n";
print $tid;
print "\n</A>\n";
+ # action
print "<TD>";
+ 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 "<TD>";
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 "<TD>$age\n";
print "<TD>$status\n";
- print "<TD>";
- 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 "<A HREF=\"$action&action=close\" TARGET=\"$target.close\">";
- # print "[close]</A>\n";
print "\n\n";
}