<%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} }
}
%INIT>
<%ARGS>
$Type => 'null'
$FID => ''
$Id => ''
$InBody => undef
$InPart => undef
$Descr => undef
$Total => 0
%ARGS>
|