Code

Added instant service creation
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 May 2010 13:15:09 +0000 (13:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 19 May 2010 13:15:09 +0000 (13:15 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18554 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_serverService.inc

index 5e4e35ced3f4916ebc7804f44968f60a61408d7a..711cc48ee7dd97fc6aacff2fd42d64b16be07799 100644 (file)
@@ -99,7 +99,7 @@ class ServerService extends management
         $contents =file_get_contents(get_template_path("serverService-list.xml", true));
         $template = "
             <action>
-            <name>new_%s</name>
+            <name>instantNew_%s</name>
             <type>entry</type>
             <label>%s</label>
             </action>";
@@ -123,6 +123,7 @@ class ServerService extends management
         $this->registerAction("restart",            "updateServiceStatus");
         $this->registerAction("stop",               "updateServiceStatus");
         $this->registerAction("start",              "updateServiceStatus");
+        $this->registerAction("instantNew",         "instantNewService");
     }
 
 
@@ -135,6 +136,10 @@ class ServerService extends management
         if(isset($_POST['CancelServiceAdd'])) $action['action'] = "newServiceCancel";
         if(isset($_POST['SaveService']))      $action['action'] = "saveService";
         if(isset($_POST['CancelService']))    $action['action'] = "cancelService";
+        if(preg_match("/^instantNew_/",$action['action'])){
+            $action['targets'][] = preg_replace("/^instantNew_/i","",$action['action']);
+            $action['action'] = "instantNew";
+        }
         return($action);
     }
 
@@ -197,6 +202,19 @@ class ServerService extends management
     }
 
 
+    /*! \brief  Create the selected service.
+     */
+    function instantNewService($action, $targets, $all)
+    {
+        $this->closeDialogs();
+        $serv = $targets[0];
+        $this->plugins[$serv]->is_account = true;
+        $this->dialogObject  = $this->plugins[$serv];
+        $this->current = $serv;
+        $this->dialog = TRUE;
+    }
+
+
     /*! \brief  Save the currently edited service.
      */
     function saveService()