summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fml/lib/FML/Process/CGI.pm11
-rw-r--r--fml/lib/FML/Ticket/Model/minimal_states.pm35
2 files changed, 11 insertions, 35 deletions
diff --git a/fml/lib/FML/Process/CGI.pm b/fml/lib/FML/Process/CGI.pm
index 993cd29d..38b05d44 100644
--- a/fml/lib/FML/Process/CGI.pm
+++ b/fml/lib/FML/Process/CGI.pm
@@ -98,10 +98,6 @@ sub run
my $title = $config->{ ticket_cgi_title } || 'ticket system interface';
my $color = $config->{ ticket_cgi_bgcolor } || '#E6E6FA';
- use FileHandle;
- my ($rfd, $wfd) = FileHandle::pipe;
- $args->{ fd } = $wfd;
-
# ticket object
my $ticket = $curproc->_load_ticket_model_module($args);
$ticket->mode({ mode => 'html' });
@@ -112,14 +108,9 @@ sub run
# menu at the top of scrren
$ticket->cgi_top_menu($curproc, $args);
- # get ticket id list
- my $tid = $ticket->get_id_list($curproc, $args);
- $ticket->sort($curproc, $args, $tid);
- for (@$tid) { $ticket->html_show($curproc, $args, $_);}
-
# show summary
$ticket->mode({ mode => 'html' });
- $ticket->show_summary($curproc, $args, {rfd => $rfd, wfd => $wfd});
+ $ticket->show_summary($curproc, $args);
# o.k. end of html
print end_html;
diff --git a/fml/lib/FML/Ticket/Model/minimal_states.pm b/fml/lib/FML/Ticket/Model/minimal_states.pm
index be5ce669..ba2565e3 100644
--- a/fml/lib/FML/Ticket/Model/minimal_states.pm
+++ b/fml/lib/FML/Ticket/Model/minimal_states.pm
@@ -492,15 +492,22 @@ It is also larger if $status is C<open>.
sub show_summary
{
my ($self, $curproc, $args, $optargs) = @_;
- my $method = 'show_summary_in_'. $self->{ _mode };
- $self->$method($curproc, $args, $optargs);
+ my $mode = $self->{ _mode } || 'text';
+ my $ml_name = $curproc->{ config }->{ ml_name };
+
+ print "<HR><PRE>" if $mode eq 'html';
+
+ $self->_show_summary($curproc, $args, $optargs);
+
+ print "</PRE>\n" if $mode eq 'html';
}
-sub show_summary_in_text
+sub _show_summary
{
my ($self, $curproc, $args) = @_;
my ($tid, $status, $ticket_id);
+ my $mode = $self->{ _mode } || 'text';
# rh: ticket id list, which is ARRAY REFERENCE tied to db_dir/*db's
$ticket_id = $self->get_id_list($curproc, $args);
@@ -523,28 +530,6 @@ sub show_summary_in_text
}
-sub show_summary_in_html
-{
- my ($self, $curproc, $args, $optargs) = @_;
- my $rfd = $optargs->{ rfd };
- my $wfd = $optargs->{ wfd };
-
- my $ml_name = $curproc->{ config }->{ ml_name };
- print "<HR>\n";
- print "<P> $ml_name ML brief summary <BR>\n";
- print "<PRE>\n";
-
- my $argv = $args->{ ARGV };
- $argv->[ 0 ] = 'list';
- $self->show_summary_in_text($curproc, $args);
-
- close($wfd);
- while (<$rfd>) { print STDOUT " $_";}
-
- print "</PRE>\n\n";
-}
-
-
# return @ticket_id ARRAY
sub get_id_list
{