Code

Updated loading of extended values
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 20 Apr 2011 09:06:42 +0000 (09:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 20 Apr 2011 09:06:42 +0000 (09:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20752 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 530e9a2c3861493f48c68cbb97ecf1d0386ce874..910cc8a1eef72a036997a9a3386ec3ba5538d7f6 100644 (file)
@@ -59,7 +59,7 @@ class newConfigManagement extends plugin
         $items['Distribution']['name'] = 'Distribution';
         $items['Distribution']['description'] = _('Distribution');
         $items['Distribution']['options']['name'] = $dOpt1;
-        $items['Distribution']['options']['mirror'] = $dOpt3;
+        $items['Distribution']['options']['origin'] = $dOpt3;
         $items['Distribution']['options']['installation_type'] = $dOpt2;
         $items['Distribution']['options']['installation_method'] = $dOpt4;
 
@@ -160,7 +160,30 @@ class newConfigManagement extends plugin
             return(FALSE);
         }else{
             foreach($res as $dist){
-                $this->dataModel->addItem('Distribution','/root', $dist['name'], $dist);
+       
+                // Simple strings 
+                $values = array();
+                foreach(array('origin','installation_method', 'installation_method','debian_security',
+                        'debian_volatile', 'name', 'mirror_sources', 'managed', 'path') as $attr){
+                    $values[$attr] = $dist[$attr];
+                }
+
+                // Boxed strings
+                foreach(array('type') as $attr){
+                    $values[$attr] = $dist[$attr]['name'];
+                }
+
+                // Arrays
+                foreach(array('releases', 'architectures', 'components', 'sections') as $attr){
+                    $values[$attr] = array();
+                    if(is_array($dist[$attr])){
+                        foreach($dist[$attr] as $aEntry){
+                            $values[$attr][] = $aEntry['name'];
+                        }
+                    }
+                }
+    
+                $this->dataModel->addItem('Distribution','/root', $dist['name'], $values);
 
                 if(isset($dist['releases'])){
 
@@ -669,11 +692,11 @@ class newConfigManagement extends plugin
                 $name = $values['name'];
                 $itype = $values['installation_type'];
                 $imethod = $values['installation_method'];
-                $mirror = $values['mirror'];
+                $origin = $values['origin'];
 
                 // Initiate the rpc request.
                 $rpc = $this->config->getRpcHandle();
-                $res = $rpc->createDistribution($name, $itype, array('mirror'=>$mirror, 'install_method' => $imethod));
+                $res = $rpc->createDistribution($name, $itype, array('mirror'=>$origin, 'install_method' => $imethod));
                 if(!$rpc->success()){
                     msg_dialog::display(_("Error"), sprintf(_("Failed to save distributions: %s"), $rpc->get_error()),ERROR_DIALOG);
                     return(NULL);
index de539865be6876ab21b7d2522e3d9aada31ef6e6..399e8095b28b295e589786b5e407580fdc12ce56 100644 (file)
@@ -13,8 +13,8 @@
         <td>{$installation_method}</td>
     </tr>
     <tr>
-        <td>{$mirrorName}</td>
-        <td>{$mirror}</td>
+        <td>{$originName}</td>
+        <td>{$origin}</td>
     </tr>
 </table>
 {else if $type == 'Release'}