Code

Added sorting to workstation startup. FAI server/release
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jun 2008 13:10:56 +0000 (13:10 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 16 Jun 2008 13:10:56 +0000 (13:10 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11341 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/systems/goto/class_workstationStartup.inc

index 8cc81a1b41be69d5ccca2f887a958151bc1071cc..4d2ea8c6fec2de8ff56fc680bd6941bccc558c93 100644 (file)
@@ -1099,12 +1099,6 @@ class workstartup extends plugin
      */
     if($force || !isset($this->cache['SERVERS'])){
 
-      /* Only add inherit option, if we are part in an object group
-       */
-      if($this->member_of_ogroup){
-        $this->cache['SERVERS']['inherited']=array();
-      }
-
       $o_queue = new gosaSupportDaemon();
       $tmp = $o_queue->FAI_get_server();
       if($o_queue->is_error()){
@@ -1117,6 +1111,8 @@ class workstartup extends plugin
           $rel = $entry['RELEASE'];
           $this->cache['SERVERS']['auto'][$rel] = $rel;
           $this->cache['SERVERS'][$entry['SERVER']][$rel] = $rel;
+          uksort($this->cache['SERVERS']['auto'], 'strnatcasecmp');
+          uksort($this->cache['SERVERS'][$entry['SERVER']], 'strnatcasecmp');
         }
       }
     }
@@ -1204,6 +1200,13 @@ class workstartup extends plugin
           }
         }
       }
+      uksort($this->cache['SERVERS'], 'strnatcasecmp');
+
+      /* Only add inherit option, if we are part in an object group
+       */
+      if($this->member_of_ogroup){
+        $this->cache['SERVERS'] = array_merge(array('inherited' => array()),$this->cache['SERVERS']);
+      }
     }
 
     /* Get list of available kernel for this release