Code

Removed second release selector from config management
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 4 Apr 2011 06:33:08 +0000 (06:33 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 4 Apr 2011 06:33:08 +0000 (06:33 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20637 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto-ng/admin/newConfigManagement/DeviceConfig-list.tpl
gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc
gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc

index e4c7373b2eb65cfacc08a8b464aa975ba8aba5ba..0620e18353ae1cef83d83f0352c4489c62acca75 100644 (file)
@@ -7,7 +7,6 @@
      <tr>
       <td>{$RELOAD}</td>
       <td class="left-border">{t}Container{/t} {$CONTAINER}</td>
-      <td class="left-border">{t}Item{/t} {$ITEM}</td>
       <td class="left-border">{$ACTIONS}</td>
       <td class="left-border">{$FILTER}</td>
      </tr>
index c1d4c93e4fc9af1651fc05f4fb191cebd36a4f71..3657adb88962bb5edf7b112f81b1d0324a3623b8 100644 (file)
@@ -6,7 +6,6 @@ class ConfigManagementListing extends management
     private $base = "";
 
     private $containerSelector = NULL;
-    private $itemSelector = NULL;
     private $objectTypeStr = "";
 
     function __construct($config, $ui, $parent)
@@ -16,7 +15,6 @@ class ConfigManagementListing extends management
         $this->rebuildListing();
 
         $this->containerSelector = new ItemSelector(array(),'/root','/root');
-        $this->itemSelector = new ItemSelector(array(),'','');
 
         $this->parent = &$parent;
     }
@@ -24,7 +22,6 @@ class ConfigManagementListing extends management
     function save_object()
     {
         $this->containerSelector->update();    
-        $this->itemSelector->update();    
     }
 
     function getSelectedContainer()
@@ -37,37 +34,18 @@ class ConfigManagementListing extends management
         return($this->containerSelector->setBase($dist));
     }
 
-    function setItem($rel)
-    {
-        return($this->itemSelector->setBase($rel));
-    }
-
-    function getSelectedItem()
-    {
-        return($this->itemSelector->getBase());
-    }
-
-
     function setContainers($containers) 
     {
         $this->containerSelector->setBases($containers);
         $this->containerSelector->update(TRUE);
     }
 
-    function setItems($items) 
-    {
-        $this->itemSelector->setBases($items);
-        $this->itemSelector->update(TRUE);
-    }
-
-
     function renderList()
     {
         $headpage = $this->getHeadpage();
         $headpage->update();
         $smarty = get_smarty();
         $smarty->assign("CONTAINER", $this->containerSelector->render());
-        $smarty->assign("ITEM", $this->itemSelector->render());
         $display = $headpage->render();
         return($this->getHeader().$display);
     }
index dda5975ef37969189fe1caa1da83979ecd3c764d..d97831b33976e44ea14560bd302ee438ef4d04da 100644 (file)
@@ -9,7 +9,6 @@ class newConfigManagement extends plugin
     var $plDescription = "Config management";
 
     var $selectedContainer;
-    var $selectedItem;
 
     var $dataModel = NULL;
     var $listing = NULL;
@@ -41,16 +40,17 @@ class newConfigManagement extends plugin
         if(!$rpc->success()){
             msg_dialog::display(_("Error"), sprintf(_("Failed to load distributions: %s"), $rpc->get_error()),ERROR_DIALOG);
             return(NULL);
-        }
-        foreach($res as $dist){
-            $this->dataModel->addItem('Distribution','/root', $dist['name'], $dist);
-            foreach($dist['releases'] as $release){
-                $distPath = "/root/{$dist['name']}";
-                $this->dataModel->addItem('Release',$distPath, $release['name'], $release);
-
-                foreach($dist['components'] as $component){
-                    $comPath = "{$distPath}/{$release['name']}";
-                    $this->dataModel->addItem('Component',$comPath, $component['name'], $component);
+        }else{
+            foreach($res as $dist){
+                $this->dataModel->addItem('Distribution','/root', $dist['name'], $dist);
+                foreach($dist['releases'] as $release){
+                    $distPath = "/root/{$dist['name']}";
+                    $this->dataModel->addItem('Release',$distPath, $release['name'], $release);
+
+                    foreach($dist['components'] as $component){
+                        $comPath = "{$distPath}/{$release['name']}";
+                        $this->dataModel->addItem('Component',$comPath, $component['name'], $component);
+                    }
                 }
             }
         }
@@ -69,8 +69,7 @@ class newConfigManagement extends plugin
 
         // Get the selected distribution and release from the listing widget.
         $cont = $this->listing->getSelectedContainer();
-        $item = $this->listing->getSelectedItem();
-        $this->setCurrentContainer($cont, $item);
+        $this->setCurrentContainer($cont);
     }
 
 
@@ -119,34 +118,18 @@ class newConfigManagement extends plugin
      *  @param  String  The path of the item to set.
      *  @return 
      */
-    function setCurrentContainer($cont, $item)
+    function setCurrentContainer($cont)
     {
         $this->selectedContainer = $cont;
-        $this->selectedItem = $item;
 
         // Get a list of all available container and items.
-        $distList = $this->getContainerList();
         $releaseList = $this->getItemList();
 
-        // Ensure that we've valid values selected.
-        if(!isset($releaseList[$this->selectedItem])){
-            if(count($releaseList)){
-                echo "Fallback";
-                $this->selectedItem = key($releaseList);
-            }else{
-                echo "Fallback 2";
-                $this->selectedItem = "";
-            }
-        }
-
         // Update list of items within the selected container. 
         $this->updateItemList($this->selectedContainer);
 
         // Transfer checked values back to the listing class.
-        $this->listing->setContainer($this->selectedContainer);
-        $this->listing->setItem($this->selectedItem);
         $this->listing->setContainers($this->getContainerList());
-        $this->listing->setItems($this->getItemList());
     }
 
 
@@ -173,7 +156,7 @@ class newConfigManagement extends plugin
     function getItemsToBeDisplayed()
     {
 
-        $path = $this->selectedContainer.$this->selectedItem;
+        $path = $this->selectedContainer;
         $item = $this->dataModel->getItemByPath($path);
         return($item);
     }
@@ -332,7 +315,7 @@ class newConfigManagement extends plugin
         $item = $this->dataModel->getItemById($id);
         if($item){
             if(in_array($item['type'], array('Distribution', 'Release'))){
-                $this->setCurrentContainer($item['path'], $this->selectedItem);
+                $this->setCurrentContainer($item['path']);
             }elseif(in_array($item['type'], array('Component'))){
                 $next = preg_replace("/".preg_quote($this->selectedContainer,'/')."/","", $item['path']);
                 $this->setCurrentContainer($this->selectedContainer, $next);