Code

Enabled system creation
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 12 Jan 2010 09:02:00 +0000 (09:02 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 12 Jan 2010 09:02:00 +0000 (09:02 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15147 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/systems/admin/systems/class_systemManagement.inc
gosa-plugins/systems/admin/systems/system-list.xml

index 3eae80e02678d9c7552ff6a2ca8793ed24770e31..a7e9df0de1f9b5bcef62160c3e76cf51ccac1b05 100644 (file)
@@ -115,6 +115,15 @@ class systemManagement extends management
     $this->registerAction("systemTypeChosen","systemTypeChosen");
     $this->registerAction("handleActivationQueue","handleActivationQueue");
 
+    $this->registerAction("new_goServer",         "newEntry");
+    $this->registerAction("new_gotoWorkstation",  "newEntry");
+    $this->registerAction("new_gotoTerminal",     "newEntry");
+    $this->registerAction("new_gotoPrinter",      "newEntry");
+    $this->registerAction("new_goFonHardware",    "newEntry");
+    $this->registerAction("new_ieee802Device",    "newEntry");
+    $this->registerAction("new_FAKE_OC_OpsiHost", "newEntry");
+
+
     // Add copy&paste and snapshot handler.
     if ($this->config->boolValueIsTrue("main", "copyPaste")){
       $this->cpHandler = new CopyPasteHandler($this->config);
@@ -491,6 +500,27 @@ class systemManagement extends management
   }
 
 
+  /*! \brief  Edit the selected system type.
+   *
+   *  @param  String  'action'  The name of the action which was the used as trigger.
+   *  @param  Array   'target'  A list of object dns, which should be affected by this method.
+   *  @param  Array   'all'     A combination of both 'action' and 'target'.
+   */
+  function newEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="")
+  {
+    $tInfo = $this->getObjectDefinitions();
+    $info = preg_replace("/^new_/","",$action);
+    if(!isset($tInfo[$info])){
+      trigger_error("Unknown action type '".$action."' cant create a new system!");
+    }else{
+      management::newEntry($action,$target,$all, 
+          $tInfo[$info]['tabClass'],
+          $tInfo[$info]['tabDesc'],
+          $tInfo[$info]['aclCategory']);
+    }
+  }
+
+
   function activateMultiple($action,$target)
   {
     $headpage = $this->getHeadpage();
@@ -797,6 +827,14 @@ class systemManagement extends management
     if(isset($_GET['PerformIsoCreation']))  $action['action'] = "performIsoCreation";
     if(isset($_POST['SystemTypeAborted']))  $action['action'] = "cancel";
 
+    if(isset($_POST['new_goServer']))  $action['action'] = "new_goServer";
+    if(isset($_POST['new_gotoWorkstation']))  $action['action'] = "new_gotoWorkstation";
+    if(isset($_POST['new_gotoTerminal']))  $action['action'] = "new_gotoTerminal";
+    if(isset($_POST['new_gotoPrinter']))  $action['action'] = "new_gotoPrinter";
+    if(isset($_POST['new_goFonHardware']))  $action['action'] = "new_goFonHardware";
+    if(isset($_POST['new_ieee802Device']))  $action['action'] = "new_ieee802Device";
+    if(isset($_POST['new_FAKE_OC_OpsiHost']))  $action['action'] = "new_FAKE_OC_OpsiHost";
+
     if(!is_object($this->tabObject) && !is_object($this->dialogObject)){
       if(count($this->activationQueue)) $action['action'] = "handleActivationQueue";
     }
index bb7f8194a197832001760c0382c94c6ec80ca52b..bc34465ad920f85dc436a169d8d3a5a3c35f40b8 100644 (file)
      <label>Create</label>
 
      <action>
-      <name>new_server</name>
+      <name>new_goServer</name>
       <type>entry</type>
       <image>plugins/systems/images/select_server.png</image>
       <label>Server</label>
      </action>
 
      <action>
-      <name>new_workstation</name>
+      <name>new_gotoWorkstation</name>
       <type>entry</type>
       <image>plugins/systems/images/select_workstation.png</image>
       <label>Workstation</label>
      </action>
 
      <action>
-      <name>new_terminal</name>
+      <name>new_gotoTerminal</name>
       <type>entry</type>
       <image>plugins/systems/images/select_terminal.png</image>
       <label>Terminal</label>
      </action>
 
      <action>
-      <name>new_printer</name>
+      <name>new_gotoPrinter</name>
       <type>entry</type>
       <image>plugins/systems/images/select_printer.png</image>
       <label>Network printer</label>
      </action>
 
      <action>
-      <name>new_phone</name>
+      <name>new_goFonHardware</name>
       <type>entry</type>
       <image>plugins/systems/images/select_phone.png</image>
       <label>Phone</label>
      </action>
 
      <action>
-      <name>new_component</name>
+      <name>new_ieee802Device</name>
       <type>entry</type>
       <image>plugins/systems/images/select_component.png</image>
       <label>Network device</label>
      </action>
 
      <action>
-      <name>new_opsi_client</name>
+      <name>new_FAKE_OC_OpsiHost</name>
       <type>entry</type>
       <image>plugins/systems/images/select_winstation.png</image>
       <label>Opsi client</label>