Code

Fix by mba for #2697
authorpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Jun 2009 15:03:21 +0000 (15:03 +0000)
committerpsc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 19 Jun 2009 15:03:21 +0000 (15:03 +0000)
Reduce '|removed' entries by applying clean_up_releases() function
on child releases, too.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13749 594d385d-05f5-0310-b6e9-bd551577e9d8

trunk/gosa-plugins/fai/admin/fai/class_FAI.inc

index 3366d0307d7a1aea7ce8c7c65f8c8264ac5bba3c..7cfb966cc671c30d73154f39b713594989842182 100644 (file)
@@ -571,14 +571,22 @@ class FAI
     /* Collect some basic informations and initialize some variables */ 
     $base_release       = FAI::get_release_dn($Current_DN);
     $previous_releases  = array_reverse(FAI::             get_previous_releases_of_this_release($base_release,true));
+    $sub_releases       = array_keys(FAI::get_sub_releases_of_this_release($base_release,false));
     $Kill = array();
     $Skip = array();
 
     /* We must also include the given release dn */
     $previous_releases[] = $base_release;
 
+    /* Merge parent, current and child releases into one big release to 
+       iterate over */
+    $all_releases = $previous_releases;
+    foreach($sub_releases as $sub_release){
+      $all_releases[] = $sub_release;
+    }
+
     /* Walk through all releases */
-    foreach($previous_releases as $release){
+    foreach($all_releases as $release){
 
       /* Get fai departments */
       $deps_to_search = FAI::get_FAI_departments($release);