From 4d3a298963fcb5412f645eb973daaef81690eda2 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 18 May 2011 12:35:55 +0000 Subject: [PATCH] Updated Config Mangement to enabled Template editing git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20859 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../class_newConfigManagement.inc | 25 +++++++++++++++++-- .../newConfigManagement/goto/Config/root.json | 3 ++- .../newConfigManagement/goto/Config/root.tpl | 2 +- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc index 4168b3643..31f3df8f0 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/class_newConfigManagement.inc @@ -727,8 +727,6 @@ 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\.]/'); } } @@ -840,6 +838,29 @@ class newConfigManagement extends plugin $this->listing->clearDialogObject(); } } + }elseif($type == "Template"){ + + // Initiate the rpc request. + $rpc = $this->config->getRpcHandle(); + $res = $rpc->installSetTemplate($values['name'], $values); + if(!$rpc->success()){ + msg_dialog::display(_("Error"), sprintf(_("Failed to save template: %s"), $rpc->get_error()),ERROR_DIALOG); + return(NULL); + }else{ + + // We've successfully added/saved the item, now add it to the tree. + if(!$item){ + $this->dataModel->addItem($type, $this->selectedContainer, $values['name'],$values, '-' ); + $this->listing->clearDialogObject(); + }else{ + + // Update the model and clear the dialogs + $path = $item['path']; + $this->dataModel->setItemValues($path, $values); + $this->listing->clearDialogObject(); + } + } + }else{ echo "{$type} Cannot be saved yet"; $this->listing->clearDialogObject(); diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/root.json b/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/root.json index 3156d45ce..423df6e21 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/root.json +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/root.json @@ -92,7 +92,7 @@ "name": { "description": "Name", "default": "", - "syntax": "/^[a-z0-9\-\.]*$/i", + "syntax": "/^[a-z0-9\\-\\.]*$/i", "value": "", "required": true, "type": "string", @@ -119,6 +119,7 @@ "value": "", "syntax": "/^[a-z0-9\\-]*$/i", "required": true, + "initiallyEditableOnly": true, "type": "string", "display": "Name" }, diff --git a/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/root.tpl b/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/root.tpl index e2d8cd532..e2c513404 100644 --- a/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/root.tpl +++ b/gosa-plugins/goto-ng/admin/newConfigManagement/goto/Config/root.tpl @@ -28,7 +28,7 @@ - +
-- 2.30.2
{$architecturesName} {$architectures}