%# A cynic is a person searching for an honest man, with a stolen lantern.
%# -- Edgar A. Shoaff
<& /Edit/Elements/104Header,
Buttons => [
Add => ( $session{CurrentUser}->HasRight(
Right => 'CreateReport', Object => $RTx::Reports
) ? "/RG/Report/index.html?Action-Add=1" : ''),
Save => '',
Delete => 1,
Copy => '',
Search => '',
Lot => '',
Count => '',
Check => '',
Import => '',
Export => '',
TransIn => '',
TransOut => '',
Info => '',
Report => '',
Help => '1',
],
Method => 'POST',
BGColor => '#ADD6D6',
Top =>'/RG/Elements/Top',
&>
<& /RG/Elements/ToggleSave, no_parent => 1, toggle => 0 &>
<& /RG/Elements/Tab, Text => 'Template Base' &> |
|
<& List, Delete => 1, List => $List, Begin => $Begin, ARGS => \%ARGS &>
|
<%INIT>
my $height = 440;
$Action = 'New' if $Action eq 'Add';
$session{PAGE} = 'File';
if ($Action eq 'Delete') {
foreach my $Id (@ListDelete) {
my $item = RTx::Report->new($session{'CurrentUser'});
$item->Load( $Id );
$item->Delete;
}
$Begin = 0;
}
my %Categories;
my $Reports = RTx::Reports->new($session{'CurrentUser'});
$Reports->UnLimit;
my $List = [];
while (my $report = $Reports->Next) {
my $descr = $report->Category;
$Categories{$descr}++ if length $descr;
next if length $Category and $descr ne $Category;
push @$List, $report;
}
@$List = sort { $a->Name cmp $b->Name } @$List;
%INIT>
<%ARGS>
$Action => 'New'
$Begin => 0
$Id => undef
$Category => ''
@ListDelete => ()
%ARGS>