From: hickert Date: Mon, 9 May 2011 12:27:31 +0000 (+0000) Subject: Updated loading of config item details. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=903ce1000146c1818234e7c53e5dd859883de2f6;p=gosa.git Updated loading of config item details. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20791 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index d4f646b56..dabdfb595 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -19,11 +19,11 @@ class newConfigManagement extends plugin var $currentObject = NULL; var $itemsPerMethod = NULL; - var $initFailed = TRUE; var $initialized = FALSE; var $errorMessage = ""; + /*! \brief Initialize the plugin and finally update the data model. */ function __construct($config, $dn) @@ -600,7 +600,7 @@ class newConfigManagement extends plugin function editEntry($ids) { $item = $this->dataModel->getItemById($ids[0]); - $release = preg_replace("/^.*\//","", $this->getReleasePath($item['path'])); + $release = $this->getReleasePart($item['path']); $path = $this->getItemPath($item['path']); $method = $this->cfgItemMap[$item['type']]; @@ -608,9 +608,16 @@ class newConfigManagement extends plugin if($this->cfgItemMap[$item['type']] != 'root'){ if($item['status'] == '-'){ $rpc = $this->config->getRpcHandle(); - $item['values'] = $rpc->getConfigItem($release, $path); - $this->dataModel->setItemStatus($item['path'], 'fetched'); - $this->dataModel->setItemValues($item['path'], $item['values']); + echo $release; + $res = $rpc->getConfigItem($release, $path); + if(!$rpc->success()){ + msg_dialog::display(_("Error"), sprintf(_("Failed to load config item details: %s"), $rpc->get_error()),ERROR_DIALOG); + return; + }else{ + $item['values'] = $res; + $this->dataModel->setItemStatus($item['path'], 'fetched'); + $this->dataModel->setItemValues($item['path'], $item['values']); + } } } @@ -747,8 +754,8 @@ class newConfigManagement extends plugin } if(in_array($values['name'],$usedNames)){ $msgs[] = msgPool::duplicated(_("Name")); - }elseif(preg_match("/[^a-z0-9]/i",$values['name'])){ - $msgs[] = msgPool::invalid(_("Name"), $values['name'], '/[a-z0-9]/'); + }elseif(preg_match("/[^a-z0-9\.]/i",$values['name'])){ + $msgs[] = msgPool::invalid(_("Name"), $values['name'], '/[a-z0-9\.]/'); } }