From 43dac58dc2347dce111640d988fca95a693b8b53 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 27 Apr 2011 08:39:38 +0000 Subject: [PATCH] Fixed item saving git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20772 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_newConfigManagement.inc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index 45d8c1b43..3af2a457d 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -720,9 +720,16 @@ class newConfigManagement extends plugin $values[$w->getName()] = $w->getValue(); } - // No input error were found, now check that we do not use the same name twice. + // No input error were found, now check that we do not use the same name twice + // and that it is valid. if(!count($msgs)){ - $usedNames = $this->getUsedNamesForPath($this->selectedContainer); + + // Get used item names for the current path + if($this->currentObject){ + $usedNames = $this->getUsedNamesForPath($this->currentObject['parentPath']); + }else{ + $usedNames = $this->getUsedNamesForPath($this->selectedContainer); + } // Allow the item to keep its name. if($this->currentObject != NULL && isset($this->currentObject['values']['name'])){ @@ -762,7 +769,9 @@ class newConfigManagement extends plugin // Initiate the rpc request. $rpc = $this->config->getRpcHandle(); $res = $rpc->createDistribution($name, $itype, array('mirror'=>$origin, 'install_method' => $imethod)); + print_a(array($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); -- 2.30.2