From: hickert Date: Thu, 21 Oct 2010 15:03:59 +0000 (+0000) Subject: Updated release and distribution selector for the new Config Management X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=554783b5bcc860b62a3976d254c6b36f26fdda3a;p=gosa.git Updated release and distribution selector for the new Config Management git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20118 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc b/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc index 5617bec2f..cfaf42775 100644 --- a/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc +++ b/gosa-core/plugins/admin/newConfigManagement/class_ConfigManagementListing.inc @@ -30,25 +30,26 @@ class ConfigManagementListing extends management return($this->distributionSelector->getBase()); } - function getSelectedRelease() + function setDistribution($dist) { - return($this->releaseSelector->getBase()); + return($this->distributionSelector->setBase($dist)); } - function setDistribution($base) + function setRelease($rel) { - $this->distributionSelector->setBase($base); + return($this->releaseSelector->setBase($rel)); } - function setDistributions($distributions) + function getSelectedRelease() { - $this->distributionSelector->setBases($distributions); - $this->distributionSelector->update(TRUE); + return($this->releaseSelector->getBase()); } - function setRelease($base) + + function setDistributions($distributions) { - $this->releaseSelector->setBase($base); + $this->distributionSelector->setBases($distributions); + $this->distributionSelector->update(TRUE); } function setReleases($releases) diff --git a/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc index 757534c3d..7cea340d6 100644 --- a/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-core/plugins/admin/newConfigManagement/class_newConfigManagement.inc @@ -54,6 +54,21 @@ class newConfigManagement extends plugin $this->listing->save_object(); $this->selectedDistribution = $this->listing->getSelectedDistribution(); $this->selectedRelease = $this->listing->getSelectedRelease(); + + $distList = $this->getDistList(); + $releaseList = $this->getReleaseList(); + + if(!isset($releaseList[$this->selectedRelease])){ + if(count($releaseList)){ + $this->selectedRelease = key($releaseList); + }else{ + $this->selectedRelease = ""; + } + } + $this->listing->setDistribution($this->selectedDistribution); + $this->listing->setRelease($this->selectedRelease); + $this->listing->setDistributions($this->getDistList()); + $this->listing->setReleases($this->getReleaseList()); } @@ -95,9 +110,6 @@ class newConfigManagement extends plugin $displayEntries[] = $entry; } } - - $this->listing->setDistributions($this->getDistList()); - $this->listing->setReleases($this->getReleaseList()); return($this->listing->renderList()); } @@ -118,7 +130,7 @@ class newConfigManagement extends plugin function getDistList() { $list = $this->dataModel->getItemsByType('Distribution'); - $res = array('/root/wurst' => 'wurst', '/root/tester' => 'tester'); + $res = array(); foreach($list as $base => $entry){ $res[$entry['path']] = $entry['name']; }