cvsuser 05/10/20 13:04:24
Modified: App-Repository/lib/App/ValueDomain RepositoryTableColumns.pm
Log:
able to distinguish between key columns and non-key columns
Revision Changes Path
1.2 +16 -2
p5ee/App-Repository/lib/App/ValueDomain/RepositoryTableColumns.pm
Index: RepositoryTableColumns.pm
===================================================================
RCS file:
/cvs/public/p5ee/App-Repository/lib/App/ValueDomain/RepositoryTableColumns.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- RepositoryTableColumns.pm 12 Oct 2005 14:03:22 -0000 1.1
+++ RepositoryTableColumns.pm 20 Oct 2005 20:04:24 -0000 1.2
@@ -76,10 +76,24 @@
my $table = $self->{table} || die "No table specified in $self->{name}
ValueDomain";
my $values = $rep->get_column_names($table);
my $labels = $rep->get_column_labels($table);
- $labels = { %$labels };
+ $values = [ @$values ]; # make a copy
+ $labels = { %$labels }; # make a copy
if ($self->{sort}) {
@$values = sort { $labels->{$a} cmp $labels->{$b} } @$values;
}
+print STDERR "iskey=[$self->{is_key}]\n";
+ if (defined $self->{is_key}) {
+ my $is_key = $self->{is_key};
+ my @values = ();
+ my $column_defs = $rep->{table}{$table}{column};
+ foreach my $col (@$values) {
+ if (($is_key && $column_defs->{$col}{is_key}) ||
+ (!$is_key && !$column_defs->{$col}{is_key})) {
+ push(@values, $col);
+ }
+ }
+ $values = [EMAIL PROTECTED];
+ }
$self->{values} = $values;
$self->{labels} = $labels;