From: hickert Date: Wed, 27 Apr 2011 14:08:37 +0000 (+0000) Subject: Fixed loading of releases X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1522c1e57843d32cce1e09952a4f163bd99ee7c7;p=gosa.git Fixed loading of releases git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20776 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc index 46ccd2886..d50b3f71b 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc @@ -69,7 +69,7 @@ class ConfigManagementDataModel $parentId = $this->data['linear'][$path]['id']; $parentDn = $this->data['linear'][$path]['dn']; }else{ - echo "No parent"; + trigger_error("Parent item ({$path}) does not exists!"); return(FALSE); } diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index d3efd9651..65172d44d 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -214,9 +214,13 @@ class newConfigManagement extends plugin $rPath = "/root/{$dist['name']}/$rPath"; $rName = preg_replace("/^.*\//","", $rPath); $rPath = preg_replace("/\/[^\/]*$/","", $rPath); - $values = array('name' => $rName); - $this->dataModel->addItem('Release',$rPath, $rName, $values); + + if(!$this->dataModel->itemExistsByPath($rPath)){ + trigger_error("Invalid release name '{$rName}' in path '{$rPath}' received! Skipping entry!"); + }else{ + $id = $this->dataModel->addItem('Release',$rPath, $rName, $values); + } } } } @@ -546,7 +550,6 @@ class newConfigManagement extends plugin $dist = $this->getDistributionPart($item['path']); $rpc = $this->config->getRpcHandle(); $rpc->removeDistribution($dist, array('recursive' => TRUE)); - echo "Removing distribution '{$dist}'"; if(!$rpc->success()){ msg_dialog::display(_("Error"), sprintf(_("Failed to remove the distribution: %s. Error was: %s"), $dist, $rpc->get_error()), ERROR_DIALOG); @@ -560,7 +563,6 @@ class newConfigManagement extends plugin $release = preg_replace("/^.*\//","", $this->getReleasePart($item['path'])); $rpc = $this->config->getRpcHandle(); $rpc->removeRelease($release, array('recursive' => TRUE)); - echo "Removing release '{$release}'"; if(!$rpc->success()){ msg_dialog::display(_("Error"), sprintf(_("Failed to remove the release: %s. Error was: %s"), $release, $rpc->get_error()),ERROR_DIALOG); @@ -570,7 +572,7 @@ class newConfigManagement extends plugin } }else{ - echo $item['type']." - are not handled yet!"; + trigger_error($item['type']." - are not handled yet!"); } } } @@ -827,6 +829,8 @@ class newConfigManagement extends plugin $this->dataModel->setItemValues($nP, $values); $this->listing->clearDialogObject(); } + }else{ + $this->listing->clearDialogObject(); } @@ -849,7 +853,7 @@ class newConfigManagement extends plugin }else{ // We've successfully added/saved the item, now add it to the tree. - $this->dataModel->addItem($type, $this->selectedContainer, $values['name'],array(), '-' ); + $this->dataModel->addItem($type, $this->selectedContainer, $values['name'],$values, '-' ); $this->listing->clearDialogObject(); } }