Code

Updated config management
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 18 May 2011 14:09:05 +0000 (14:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 18 May 2011 14:09:05 +0000 (14:09 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20863 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc
gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/root.json

index 57a369c311eaeb800a945ca3d72219549d4b0e43..aef5352b3273a3101285ed3c39cf7b95cc2f271d 100644 (file)
@@ -31,6 +31,7 @@ class newConfigManagement extends plugin
         $this->config = &$config;
         $this->listing = new ConfigManagementListing($this->config, get_userinfo(), $this);
 
+
         // Load the template engine and tell her what template
         //  to use for the HTML it produces.
         $this->TemplateEngine = new TemplateEngine($config);
@@ -61,6 +62,24 @@ class newConfigManagement extends plugin
 
         // Load configuration via rpc.
         $rpc = $this->config->getRpcHandle();
+
+        // Load some base install parameters
+        $res = $rpc->getSupportedBaseInstallMethods();
+        $baseInstTypes = $installationTypes = $installationMethods = array();
+        foreach($res as $type => $data){
+            $baseInstTypes[$type] = $type;
+            if(isset($data['repositories'])){
+                foreach($data['repositories'] as $m){
+                    $installationTypes[$m] = $m;
+                }
+            }
+            if(isset($data['methods'])){
+                foreach($data['methods'] as $m){
+                    $installationMethods[$m] =$m;
+                }
+            }
+        }
+
         $res = $rpc->getSupportedInstallMethods();
         if(!$rpc->success()){
             $this->errorMessage = $rpc->get_error();;
@@ -100,7 +119,7 @@ class newConfigManagement extends plugin
         $map['%ROOT_CFG_ITEMS'] = &$rootElements;
         $map['%INSTALLATION_TYPES'] = array('dep' => 'dep', 'rpm' => 'rpm');
         $map['%INSTALLATION_METHODS'] = array('puppet' => 'puppet');
-        $map['%TEMPLATE_METHODS'] = array('preseed' => 'preseed');
+        $map['%BASE_INSTALLATION_METHODS'] = array('preseed' => 'preseed');
         $this->itemConfig = $this->__fillPlaceholder($this->itemConfig, $map);
         return(TRUE);
     }
index 30a6c450240c869ad9f9b322ecf0d15e5068c47f..0bc998c92d0a44732bcac7a4e470c23247bd7f19 100644 (file)
                         "required": true,
                         "type": "combobox",
                         "display": "Method",
-                        "values": "%TEMPLATE_METHODS",
+                        "values": "%BASE_INSTALLATION_METHODS",
                         "initiallyEditableOnly": true
                     },
                     "data": {