sub STR2EUC { my ($str) = @_; use Jcode; &Jcode::convert(\$str, 'euc'); return $str; } sub show_articles_for_ticket { my ($self, $ticket_id) = @_; my $mode = $self->get_mode || 'text'; my $config = $self->{ _config }; my $spool_dir = $config->{ spool_dir }; $self->db_open(); my $articles = $self->{ _hash_table }->{ _articles }->{ $ticket_id }; print ""; print "show contents related with ticket_id=$ticket_id\n"; print ""; print "
\n";
if (defined($articles) && defined($spool_dir) && -d $spool_dir) {
use FileHandle;
my $s = '';
for (split(/\s+/, $articles)) {
my $file = File::Spec->catfile($spool_dir, $_);
my $fh = new FileHandle $file;
while (defined($_ = $fh->getline())) {
next if 1 .. /^$/;
$s = STR2EUC($_);
$s =~ s/&/&/g;
$s =~ s/</g;
$s =~ s/>/>/g;
$s =~ s/\"/"/g;
print $s;
}
$fh->close;
}
}
print "";
$self->db_close();
}
sub cgi_top_menu
{
my ($self) = @_;
my $config = $self->{ _config };
my $action = 'fmlticket.cgi';
my $target = $config->{ ticket_cgi_target_window } || 'TicketCGIWindow';
use DirHandle;
my $dh = new DirHandle $config->{ ml_home_prefix };
my @dirlist;
my $prefix = $config->{ ml_home_prefix };
while ($_ = $dh->read()) {
next if /^\./;
next if /^\@/;
push(@dirlist, $_) if -f "$prefix/$_/config.cf";
}
$dh->close;
if ($self->get_mode eq 'html') {
require 'ctime.pl';
my $time = ctime(time);
my $ml_name = $config->{ ml_name };
print "[$time] the brief summary for \"$ml_name\" ML