%# HELP! MY TYPEWRITER IS BROKEN! %# -- E. E. CUMMINGS <& /RG/Elements/PageHeader &>

<& /RG/Elements/VerticalBar3D &> % foreach my $key (RTx::Report->Sets) { <& /Edit/Elements/PushButton, Name => "Set$key", ImagePath => '/RG/img/', Image => "set$key", Text => loc(($key eq "Parameter") ? "Params" : "Layout"), Disabled => 0, Javascript => $m->scomp('/Edit/Elements/NewWindow', "$key.html", 440, 220, 'settings', 0), Width => 15, Height => 15 &> % } <& /Edit/Elements/PushButton, Name => "Print", ImagePath => '/RG/img/', Image => "setPrint", Text => loc("Print"), Disabled => 0, Javascript => $m->scomp('/Edit/Elements/NewWindow', "Print.html", 440, 220, 'settings', 0), Width => 15, Height => 15 &> | <& /RG/Elements/VerticalBar3D &> | <&|/l&>Insert Part | % foreach my $key (DBIx::ReportBuilder->Parts) { % next unless $hasRight->("Part\u$key"); <& /Edit/Elements/Button, Name => "Op-Insert\u$key", ImagePath => '/RG/img/', Image => "obj\u$key", Text => loc($key), Style => 'width:19; height:19' &> % } | <& /RG/Elements/VerticalBar3D &> % if (($session{reportPartTag} eq 'p' or !defined($session{reportPartTag})) % and $hasRight->("PartP")) { | <&|/l&>Add Variable % foreach my $key (DBIx::ReportBuilder->Vars) { | <& /Edit/Elements/Button, Name => "Op->VarInsert$key", ImagePath => '/RG/img/', Image => "var$key", Text => loc($key), Style => 'width:19; height:19' &> % } | <& /RG/Elements/VerticalBar3D &> % } % if ($session{reportPartTag} eq 'graph' or $session{reportPartTag} eq 'table') { | <&|/l&>Add Clause % foreach my $key (reverse DBIx::ReportBuilder->Clauses) { % next unless $hasRight->("Clause\u$key"); | <& /Edit/Elements/Button, Name => "Op-ClauseInsert\u$key", ImagePath => '/RG/img/', Image => "obj\u$key", Text => loc($key), Style => 'width:19; height:19' &> % } | <& /RG/Elements/VerticalBar3D &> % }
| <& /Edit/Elements/Tabs, Map => [ map {$_ => $_} RTx::Report->Views ], Show => $View, ImagePath => "/RG/img/view" &>

% return if $View eq $session{reportView}; % $session{reportView} = $View;
<%INIT> our $DB; my $View = $ARGS{View} || $ARGS{Show} || 'Edit'; my $ReportObj = eval { $DB->ReportObj($Id) }; my $hasRight = sub { !$ReportObj or $ReportObj->CurrentUserHasRight($_[0]) }; <%ARGS> $Id => $session{reportId}