From: hickert Date: Tue, 5 Apr 2011 12:41:19 +0000 (+0000) Subject: Allow to save item changes again X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=07802b5c7e453492efbf4278155ba4eb07074e86;p=gosa.git Allow to save item changes again git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20657 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc index cc59dc7cf..e02848aeb 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_ConfigManagementListing.inc @@ -8,6 +8,8 @@ class ConfigManagementListing extends management private $containerSelector = NULL; private $objectTypeStr = ""; + public $parent; + function __construct($config, $ui, $parent) { // Set storage points - We do not have any - We just create a fake list which lists all items @@ -172,18 +174,19 @@ class ConfigManagementListing extends management $items = ""; $i = 0; - foreach($this->parent->addableContainerItems as $item){ - $desc = $this->parent->itemConfig[$item]['description']; - $img = $images[$i++]; - $items .= - "". - " add_{$item}". - " entry". - " {$img}". - " ". - ""; + if($this->parent){ + foreach($this->parent->addableContainerItems as $item){ + $desc = $this->parent->itemConfig[$item]['description']; + $img = $images[$i++]; + $items .= + "". + " add_{$item}". + " entry". + " {$img}". + " ". + ""; + } } - if(!empty($items)){ $items = @@ -220,7 +223,12 @@ class ConfigManagementListing extends management $this->registerAction("cancelItemEdit", "closeDialogs"); $this->registerAction("cancelItemAdd", "closeDialogs"); - $this->registerAction("saveItemAdd", "saveItemAdd"); + $this->registerAction("saveItemChanges", "saveItemChanges"); + } + + function saveItemChanges() + { + $this->parent->saveItemChanges(); } function removeEntryRequested($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="") @@ -245,6 +253,10 @@ class ConfigManagementListing extends management $this->dialog = TRUE; } + function clearDialogObject() + { + $this->closeDialogs(); + } } ?> diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index bf29fc9e9..06ddce55f 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -16,6 +16,10 @@ class newConfigManagement extends plugin var $cfgTypeMap = NULL; var $cfgItemMap = NULL; + var $addableContainerItems = array(); + var $currentObject = NULL; + + /*! \brief Initialize the plugin and finally update the data model. */ function __construct($config, $dn) @@ -434,9 +438,19 @@ class newConfigManagement extends plugin $this->setInstallMethod($method); $this->TemplateEngine->setValues($item['type'],$item['values']['itemValues']); $this->listing->setDialogObject($this->TemplateEngine); + $this->currentObject = $item; } } - + function saveItemChanges() + { + $this->listing->clearDialogObject(); + $item = $this->currentObject; + $this->TemplateEngine->save_object(); + foreach($this->TemplateEngine->getWidgets() as $w){ + $item['values']['itemValues'][$w->getName()] = $w->getValue(); + } + $this->dataModel->setItemValues($item['path'], $item['values']); + } } ?>