From a0e1458ee548edaaa39b6dffc2a489d4e3fc23a0 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 19 Apr 2011 10:32:44 +0000 Subject: [PATCH] Updated release creation git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20747 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_newConfigManagement.inc | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index 2b9234627..79b0d2e6c 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -667,6 +667,35 @@ class newConfigManagement extends plugin $this->listing->clearDialogObject(); + }elseif($type == 'Release'){ + + // We've to create a new release + + // Build up the new release path. + $name = $values['name']; + $rPath = $this->getReleasePart($this->selectedContainer); + $newPath = trim($rPath."/".$name, '/'); + + // Detect the parent distribution + $dist = $this->getDistributionPath($this->selectedContainer); + $dist = preg_replace("#^/root/#", "", $dist); + + // Initiate the rpc request. + $rpc = $this->config->getRpcHandle(); + $res = $rpc->createRelease($dist, $newPath); + if(!$rpc->success()){ + msg_dialog::display(_("Error"), sprintf(_("Failed to save release: %s"), $rpc->get_error()),ERROR_DIALOG); + return(NULL); + }else{ + + // We've successfully added the item, now add it to the tree. + $this->dataModel->addItem($type, $this->selectedContainer, $values['name'],array(), '-' ); + + // Finally - close the dialog. + $this->listing->clearDialogObject(); + } + + $this->listing->clearDialogObject(); }else{ echo "{$type} Cannot be saved yet"; -- 2.30.2