";
# FOREACH
do {
my ($value, $error, $oldloop);
my $list = [ { 'name' => 'id', 'description' => 'Bug #' }, { 'name' => 'count', 'description' => 'Dupe
Count' }, { 'name' => 'delta', 'description' => ("Change in last
" . $stash->get('changedsince') . " day(s)") }, { 'name' => 'component', 'description' => 'Component' }, { 'name' => 'bug_severity', 'description' => 'Severity' }, { 'name' => 'op_sys', 'description' => 'Op Sys' }, { 'name' => 'target_milestone', 'description' => 'Target
Milestone' }, { 'name' => 'short_desc', 'description' => 'Summary' } ];
unless (UNIVERSAL::isa($list, 'Template::Iterator')) {
$list = Template::Config->iterator($list)
|| die $Template::Config::ERROR, "\n";
}
($value, $error) = $list->get_first();
eval { $oldloop = $stash->get('loop') };
$stash->set('loop', $list);
eval {
LOOP: while (! $error) {
$stash->{'column'} = $value;
$output .= "\n \n ";
if ($stash->get(['column', 0, 'name', 0]) eq 'delta' && ! $stash->get('dobefore')) {
($value, $error) = $list->get_next();
next LOOP;
}
$output .= " \n\n \n \n ";
$stash->set('bug_ids_string', $stash->get(['bug_ids', 0, 'join', [ ',' ]]));
$output .= "\n get(['column', 0, 'name', 0]);
if ($stash->get('sortby') eq $stash->get(['column', 0, 'name', 0])) {
if (! $stash->get('reverse')) {
$output .= '&reverse=1';
}
}
else {
if ($stash->get(['column', 0, 'name', 0, 'match', [ 'delta|count' ]])) {
$output .= '&reverse=1';
}
}
if ($stash->get('maxrows')) {
$output .= ("&maxrows=" . $stash->get('maxrows'));
}
if ($stash->get('changedsince')) {
$output .= ("&changedsince=" . $stash->get('changedsince'));
}
if ($stash->get('openonly')) {
$output .= '&openonly=1';
}
if ($stash->get('product')) {
$output .= ("&product=" . $stash->get('product'));
}
if ($stash->get('format')) {
$output .= ("&format=" . $stash->get('format'));
}
if ($stash->get('sortvisible')) {
$output .= ("&bug_id=" . $stash->get('bug_ids_string') . "&sortvisible=1");
}
$output .= "\">";
$output .= $stash->get(['column', 0, 'description', 0]);
$output .= "\n \n \n | ";;
($value, $error) = $list->get_next();
}
};
$stash->set('loop', $oldloop);
die $@ if $@;
$error = 0 if $error && $error eq Template::Constants::STATUS_DONE;
die $error if $error;
};
$output .= "\n
\n";
if (! $stash->get('sortby')) {
$stash->set('sortby', 'count');
$stash->set('reverse', '1');
}
$output .= "\n";
if ($stash->get('sortby') eq 'id' || $stash->get('sortby') eq 'count' || $stash->get('sortby') eq 'delta') {
$output .= "\n ";
$stash->set('sortedbugs', $stash->get(['bugs', 0, 'nsort', [ $stash->get('sortby') ]]));
}
else {
$stash->set('sortedbugs', $stash->get(['bugs', 0, 'sort', [ $stash->get('sortby') ]]));
}
$output .= "\n";
if ($stash->get('reverse')) {
$stash->set('bugs', $stash->get(['sortedbugs', 0, 'reverse', 0]));
}
else {
$stash->set('bugs', $stash->get('sortedbugs'));
}
$output .= "\n\n";
$output .= "\n\n";
$stash->set('vis_bug_ids', [ ]);
$output .= "\n";
# FOREACH
do {
my ($value, $error, $oldloop);
my $list = $stash->get('bugs');
unless (UNIVERSAL::isa($list, 'Template::Iterator')) {
$list = Template::Config->iterator($list)
|| die $Template::Config::ERROR, "\n";
}
($value, $error) = $list->get_first();
eval { $oldloop = $stash->get('loop') };
$stash->set('loop', $list);
eval {
LOOP: while (! $error) {
$stash->{'bug'} = $value;
if ($stash->get(['loop', 0, 'index', 0]) >= $stash->get('maxrows')) {
last LOOP;
}
$output .= $stash->get(['vis_bug_ids', 0, 'push', [ $stash->get(['bug', 0, 'id', 0]) ]]);
$output .= " \n\n \n \n ";
if ($stash->get(['bug', 0, 'resolution', 0]) ne '') {
$output .= '';
}
$output .= "\n get(['bug', 0, 'id', 0]);
$output .= "\">";
$output .= $stash->get(['bug', 0, 'id', 0]);
$output .= "";
if ($stash->get(['bug', 0, 'resolution', 0]) ne '') {
$output .= '';
}
$output .= "\n \n | \n\n \n ";
$output .= $stash->get(['bug', 0, 'count', 0]);
$output .= "\n \n | \n";
if ($stash->get('dobefore')) {
$output .= "\n ";
$output .= $stash->get(['bug', 0, 'delta', 0]);
$output .= " | ";
}
$output .= "\n\n ";
$output .= $stash->get(['bug', 0, 'component', 0]);
$output .= " | \n ";
$output .= $stash->get(['bug', 0, 'bug_severity', 0]);
$output .= " | \n ";
$output .= $stash->get(['bug', 0, 'op_sys', 0]);
$output .= " | \n ";
$output .= $stash->get(['bug', 0, 'target_milestone', 0]);
$output .= " | \n ";
# FILTER
$output .= do {
my $output = '';
my $filter = $context->filter('html')
|| $context->throw($context->error);
$output .= $stash->get(['bug', 0, 'short_desc', 0]);
&$filter($output);
};
$output .= " | \n
";;
($value, $error) = $list->get_next();
}
};
$stash->set('loop', $oldloop);
die $@ if $@;
$error = 0 if $error && $error eq Template::Constants::STATUS_DONE;
die $error if $error;
};
$output .= "\n\n