Code

Create per-type entries for class (FAIstate can differ for FAItypes of same FAIclass).
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 7 Mar 2008 10:32:54 +0000 (10:32 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 7 Mar 2008 10:32:54 +0000 (10:32 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9430 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-si/gosa-si-server

index 2251e9f7a00f314a7c12535d9567ca981ee13660..d664cadc3185401752cc999a29f0baefb1dd1bfa 100755 (executable)
@@ -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 {