diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-03-09 22:05:42 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2016-03-09 22:05:42 +0100 |
commit | ad3a1af7de96e4c76b3f9ac9b1539092e81d123a (patch) | |
tree | 343f50d68935c7bd689924f01b7e83316a3fb9ec /lib/gcstar/GCGraphicComponents | |
parent | 965998f7990b75e58fe5219f9c38a3c24198375a (diff) | |
parent | b9a4e9c8a68dcb6b17617f4f7a5ad5ad3298bfa9 (diff) |
Merge tag 'upstream/1.7.1'
Upstream version 1.7.1
Diffstat (limited to 'lib/gcstar/GCGraphicComponents')
-rw-r--r-- | lib/gcstar/GCGraphicComponents/GCDoubleLists.pm | 73 |
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) { |