From: hickert Date: Wed, 20 Apr 2011 09:06:42 +0000 (+0000) Subject: Updated loading of extended values X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=469b05df739509471d989379ad08df9045ea935f;p=gosa.git Updated loading of extended values git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20752 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index 530e9a2c3..910cc8a1e 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -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); diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/root.tpl b/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/root.tpl index de539865b..399e8095b 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/root.tpl +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/root.tpl @@ -13,8 +13,8 @@ {$installation_method} - {$mirrorName} - {$mirror} + {$originName} + {$origin} {else if $type == 'Release'}