<%PERL> unless ($session{in_part} eq $InPart) { $session{in_part} = $InPart; $session{in_body} = $InBody; $m->print(""); } <& /RG/Elements/PageHeader &>
  <%PERL> $m->comp( "/Field/$Type", %ARGS, CF => $CF, obj => $obj, dbh => $dbh, table => $table, field => $field, curfield => $curfield, curtable => $curtable, tables => \@tables, ); % if ($Type ne 'null') { <% loc('Change') %>
<& /RG/Elements/Submit, Op => 'Leftward', # loc Image => 'Left', Enabled => ( $FID > 0 ), &> <& /RG/Elements/Submit, Op => 'Rightward', # loc Image => 'Right', Enabled => ( $FID < ($Total - 1) ), &> <& /RG/Elements/Submit, Op => 'DeleteField', # loc Image => 'Field_Delete', Enabled => 1 &>
<%INIT> require RG::Table; require RG::Parser; $session{reportPartId} = $Id; my $obj = $session{ids}[$Id]; my $dbh ||= RG::Parser->new($session{file}, $Conf)->{DBH}; my $table = RG::Table->new(${$obj->this->{table}}, $dbh, $session{vars}); my $field = $table->{FIELDS}[$FID]; my $CF = $Conf->{DB}{$session{db}}; my @tables = @{$table->{TABLE}}; my $curtable = $field->{TABLE}; my $curname = $field->{NAME}; # XXX: reach inside fnames for non-DATA fields my $curfield = $field->{FNAME}; $curtable ||= $tables[0] if $#tables == 0; if ($curtable and $curfield) { # resolve conflict tables/fields combinations during selects (delete( @{$field}{qw/NAME/} ), $curfield = '') unless grep $_->{$curtable}, @{ $table->{FIELDNAME}{$curfield} } } <%ARGS> $Type => 'null' $FID => '' $Id => '' $InBody => undef $InPart => undef $Descr => undef $Total => 0