From d21df4b75300863914666724f9116deda4aa4253 Mon Sep 17 00:00:00 2001 From: janw Date: Fri, 7 Mar 2008 10:32:54 +0000 Subject: [PATCH] Create per-type entries for class (FAIstate can differ for FAItypes of same FAIclass). git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9430 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-si/gosa-si-server | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/gosa-si/gosa-si-server b/gosa-si/gosa-si-server index 2251e9f7a..d664cadc3 100755 --- a/gosa-si/gosa-si-server +++ b/gosa-si/gosa-si-server @@ -1329,15 +1329,16 @@ sub get_fai_release_entries { push @result, $bufentry; } } else { - my $types = get_fai_types($tmp_classes->{$entry}); - my $state = get_fai_state($tmp_classes->{$entry}); - push @result, - { - 'class' => $entry, - 'type' => $types, - 'release' => $parent, - 'state' => $state, - }; + my @types = get_fai_types($tmp_classes->{$entry}); + foreach my $type (@types) { + push @result, + { + 'class' => $entry, + 'type' => $type->{'type'}, + 'release' => $parent, + 'state' => $type->{'state'}, + }; + } } } } @@ -1347,15 +1348,19 @@ sub get_fai_release_entries { sub get_fai_types { my $tmp_classes = shift || return undef; - my $result = ""; + my @result; foreach my $type(keys %{$tmp_classes}) { if(defined($tmp_classes->{$type}[0]) && (!($tmp_classes->{$type}[0] =~ /^.*?removed.*?$/))) { - $result.= "$type|"; + my $entry = { + type => $type, + state => $tmp_classes->{$type}[0], + }; + push @result, $entry; } } - chop($result); - return $result; + + return @result; } sub get_fai_state { -- 2.30.2