From 7a1b891b06c4f3c8eea5fae73542ebc60864d125 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 7 Oct 2010 08:16:14 +0000 Subject: [PATCH] Updated recipe tab -The Recipe-tab adds the fai/puppets tabs now on demand. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19931 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../goto/Device/class_InstallRecipe.inc | 52 +++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc b/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc index aca7d0114..a4a332261 100644 --- a/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc +++ b/gosa-plugins/goto/admin/systems/goto/Device/class_InstallRecipe.inc @@ -148,7 +148,11 @@ class InstallRecipe extends plugin function save_object() { + + if(isset($_POST['InstallRecipePosted'])){ + + $currentInstallMethod = $this->kickstartConfigManagement; plugin::save_object(); $this->kickstartRootEnabled = isset($_POST['kickstartRootEnabled']); $this->kickstartTimeUTC = isset($_POST['kickstartTimeUTC']); @@ -167,6 +171,10 @@ class InstallRecipe extends plugin } } $this->kickstartNTPServerList->setListData($this->kickstartNTPServer); + + if($currentInstallMethod != $this->kickstartConfigManagement){ + $this->updateRecipeTab(); + } } if(isset($_POST['cancelPassword'])) $this->setKickstartRootPasswordHash =false; if(isset($_POST['setPassword'])) { @@ -183,7 +191,6 @@ class InstallRecipe extends plugin $this->kickstartRootPasswordHash = @$test->generate_hash(get_post('rootPassword')); } - $this->updateRecipeTab(); } @@ -193,13 +200,52 @@ class InstallRecipe extends plugin if(!isset($this->recipeTabs[$mode])){ $this->recipeTabs[$mode] = new DeviceConfig($this->config, $this->dn); $this->recipeTabs[$mode]->parent = &$this->parent; + + if($this->recipeTabs[$mode]->setInstallMethod($mode)){ + + $class= &$this->recipeTabs[$mode]; + + // Add some dummy entries for testing. + if($mode == 'puppet'){ + $id = $class->addItem('PuppetModule','test1', + array( + 'dependency' => array('stulle','Wurst'), + 'version' => '2.4-f', + 'name' => 'Thundebird', + 'description' => 'Mozilla mail client') + ); + $id = $class->addItem('PuppetModule','test2', + array( + 'dependency' => array('Leipnitz','Dose'), + 'version' => 1, + 'name' => 'Firefox', + 'description' => 'Test Module') + ); + $class->setCurrentItem($id); + $id = $class->addItem('PuppetTemplate','temp1', + array( + 'name' => 'temp1', + 'data' => 'kekse.tpl') + ); + $class->setCurrentItem($id); + $id = $class->addItem('PuppetTemplate','tep1', + array( + 'name' => 'tep1', + 'data' => 'kekse.tpl') + ); + + $class->setCurrentItem($class->getRootItemID()); + } + }else{ + unset($this->recipeTabs[$mode]); + } } // Update the recipe tab to match the selected installation method. - if($this->is_account){ + if($this->is_account && isset($this->recipeTabs[$mode])){ if(isset($this->parent->by_object['DeviceConfig']) && - $this->recipeTabs[$mode] === $this->parent->by_object['DeviceConfig']){ + $this->recipeTabs[$mode] === $this->parent->by_object['DeviceConfig']){ return; } -- 2.30.2