summaryrefslogtreecommitdiff
path: root/lib/gcstar/GCGraphicComponents
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-03-09 22:05:38 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-03-09 22:05:38 +0100
commitb9a4e9c8a68dcb6b17617f4f7a5ad5ad3298bfa9 (patch)
tree55b47f0b304ebea5608d98f0a978b150e5ab30c8 /lib/gcstar/GCGraphicComponents
parent126bb8cb6b93240bb4d3a2b816b74c286c3d422b (diff)
Imported Upstream version 1.7.1upstream/1.7.1upstream
Diffstat (limited to 'lib/gcstar/GCGraphicComponents')
-rw-r--r--lib/gcstar/GCGraphicComponents/GCDoubleLists.pm73
1 files changed, 52 insertions, 21 deletions
diff --git a/lib/gcstar/GCGraphicComponents/GCDoubleLists.pm b/lib/gcstar/GCGraphicComponents/GCDoubleLists.pm
index c59cae1..63ab50f 100644
--- a/lib/gcstar/GCGraphicComponents/GCDoubleLists.pm
+++ b/lib/gcstar/GCGraphicComponents/GCDoubleLists.pm
@@ -470,6 +470,32 @@ use GCUtils;
$self->removeFromPermanent($self->{ignoreString});
}
+ sub setModel
+ {
+ my ($self, $model) = @_;
+ $self->{model} = $model;
+ if ($model)
+ {
+ my $groups = $model->getGroups;
+ $self->{separator} = $model->getDisplayedText('Separator');
+ while (my ($key, $value) = each %{$model->{fieldsInfo}})
+ {
+ next if !$value->{displayed};
+ my $displayed = $groups->{$value->{group}}->{displayed}
+ . $self->{separator}
+ . $value->{displayed};
+ $self->{fieldNameToId}->{$displayed} = $key;
+ $self->{fieldIdToName}->{$key} = $displayed;
+ }
+ my $order = 0;
+ foreach (@{$model->{groups}})
+ {
+ $self->{groupsOrder}->{$groups->{$_->{id}}->{displayed}} = $order++;
+ }
+ $self->{model} = $model;
+ }
+ }
+
sub new
{
my ($proto, $parent, $preList, $isIdList, $ignoreField) = @_;
@@ -524,27 +550,32 @@ use GCUtils;
$self->{fieldNameToId} = {};
$self->{groupsOrder} = {};
- my $model = $self->{parent}->{model};
- if ($model)
- {
- my $groups = $model->getGroups;
- $self->{separator} = $model->getDisplayedText('Separator');
- while (my ($key, $value) = each %{$model->{fieldsInfo}})
- {
- next if !$value->{displayed};
- my $displayed = $groups->{$value->{group}}->{displayed}
- . $self->{separator}
- . $value->{displayed};
- $self->{fieldNameToId}->{$displayed} = $key;
- $self->{fieldIdToName}->{$key} = $displayed;
- }
- my $order = 0;
- foreach (@{$model->{groups}})
- {
- $self->{groupsOrder}->{$groups->{$_->{id}}->{displayed}} = $order++;
- }
- $self->{model} = $model;
- }
+# my $model = $self->{parent}->{model};
+# use Data::Dumper;
+# if ($model)
+# {
+# my $groups = $model->getGroups;
+# print "GROUPS : ",Dumper($groups),"\n";
+# print "FIELDS : ",Dumper($model->{fieldsInfo}),"\n";
+# $self->{separator} = $model->getDisplayedText('Separator');
+# while (my ($key, $value) = each %{$model->{fieldsInfo}})
+# {
+# next if !$value->{displayed};
+# my $displayed = $groups->{$value->{group}}->{displayed}
+# . $self->{separator}
+# . $value->{displayed};
+# print "ADDING ",$displayed,"\n";
+# $self->{fieldNameToId}->{$displayed} = $key;
+# $self->{fieldIdToName}->{$key} = $displayed;
+# }
+# my $order = 0;
+# foreach (@{$model->{groups}})
+# {
+# $self->{groupsOrder}->{$groups->{$_->{id}}->{displayed}} = $order++;
+# }
+# $self->{model} = $model;
+# }
+ $self->setModel($self->{parent}->{model});
if ($preList)
{