From: hickert Date: Mon, 11 Apr 2011 06:38:36 +0000 (+0000) Subject: Updated removeItem method X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1c74cc77258f0f3967fc0b10ca33e213134101f7;p=gosa.git Updated removeItem method git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20670 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 062d46818..16dd8fcc0 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementDataModel.inc @@ -19,6 +19,13 @@ class ConfigManagementDataModel return($this->data); } + function removeItem($path) + { + $item = &$this->data['linear'][$path]; + $parent = &$this->data['linear'][$item['parentPath']]; + unset($parent['children'][$path]); + unset($this->data['linear'][$path]); + } function addItem($type, $path, $name, $values = array(), $status = "") { diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index e146ea10d..5812db35e 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -432,10 +432,11 @@ class newConfigManagement extends plugin $path = $item['values']['__path']; $rpc = $this->config->getRpcHandle(); $rpc->removeConfigItem($release, $path); - if(!$rpc->success()){ msg_dialog::display(_("Error"), sprintf(_("Failed to remove: %s"), $rpc->get_error()),ERROR_DIALOG); return(NULL); + }else{ + $this->dataModel->removeItem($item['path']); } }