Code

Fixed two small typos.
[gosa.git] / gosa-plugins / systems / admin / systems / class_systemManagement.inc
index 00f39f4af094850b32daf65f70d49c387f677352..e49653d78523dfdac10151dadcf8c159f7c29edf 100644 (file)
@@ -522,6 +522,8 @@ class systems extends plugin
 
       $ui = get_userinfo();
       $tabs = array(
+          "ArpNewDevice"=> array("CLASS"=>"TERMTABS",     "TABCLASS" =>"termtabs",      "ACL"=> "incoming/systems"),
+          "NewDevice"   => array("CLASS"=>"TERMTABS",     "TABCLASS" =>"termtabs",      "ACL"=> "incoming/systems"),
           "terminal"    => array("CLASS"=>"TERMTABS",     "TABCLASS" =>"termtabs",      "ACL"=> "terminal/termgeneric"),
           "workstation" => array("CLASS"=>"WORKTABS",     "TABCLASS" =>"worktabs",      "ACL"=> "workstation/workgeneric"),
           "server"      => array("CLASS"=>"SERVTABS",     "TABCLASS" =>"servtabs",      "ACL"=> "server/servgeneric"),
@@ -601,9 +603,13 @@ class systems extends plugin
       $this->dn = $this->terminals[$s_entry]['dn'];
       $attrs    = $this->terminals[$s_entry];
 
+  
+
       $type= $this->get_system_type($attrs);
       $ui = get_userinfo();
       $tabs = array(
+          "ArpNewDevice"=> array("CLASS"=>"TERMTABS",     "TABCLASS" =>"termtabs",      "ACL"=> "incoming/systems"),
+          "NewDevice"   => array("CLASS"=>"TERMTABS",     "TABCLASS" =>"termtabs",      "ACL"=> "incoming/systems"),
           "terminal"    => array("CLASS"=>"TERMTABS",     "TABCLASS" =>"termtabs",      "ACL"=> "terminal/termgeneric"),
           "workstation" => array("CLASS"=>"WORKTABS",     "TABCLASS" =>"worktabs",      "ACL"=> "workstation/workgeneric"),
           "server"      => array("CLASS"=>"SERVTABS",     "TABCLASS" =>"servtabs",      "ACL"=> "server/servgeneric"),
@@ -612,7 +618,6 @@ class systems extends plugin
           "winstation"  => array("CLASS"=>"WINTABS",      "TABCLASS" =>"wintabs",       "ACL"=> "winworkstation/wingeneric"),
           "component"   => array("CLASS"=>"COMPONENTTABS","TABCLASS" =>"componenttabs", "ACL"=> "component/componentGeneric"));
 
-
       /* get object type */
       $tabtype  = "termtabs";
       $tabobj   = "TERMTABS";
@@ -662,6 +667,8 @@ class systems extends plugin
       $ui = get_userinfo();
 
       $tabs = array(
+          "ArpNewDevice"=> array("CLASS"=>"TERMTABS",     "TABCLASS" =>"termtabs",      "ACL"=> "incoming/systems"),
+          "NewDevice"   => array("CLASS"=>"TERMTABS",     "TABCLASS" =>"termtabs",      "ACL"=> "incoming/systems"),
           "terminal"    => array("CLASS"=>"TERMTABS",     "TABCLASS" =>"termtabs",      "ACL"=> "terminal/termgeneric"),
           "workstation" => array("CLASS"=>"WORKTABS",     "TABCLASS" =>"worktabs",      "ACL"=> "workstation/workgeneric"),
           "server"      => array("CLASS"=>"SERVTABS",     "TABCLASS" =>"servtabs",      "ACL"=> "server/servgeneric"),
@@ -723,7 +730,7 @@ class systems extends plugin
     /* Finish user edit is triggered by the tabulator dialog, so
        the user wants to save edited data. Check and save at this
        point. */
-    if ((isset($_POST['edit_finish'])) && (isset($this->systab->config)) || $save_object_directly){
+    if ((isset($_POST['edit_finish']) || isset($_POST['edit_apply'])) && (isset($this->systab->config)) || $save_object_directly){
 
       /* Check tabs, will feed message array */
       $message = array();
@@ -733,7 +740,7 @@ class systems extends plugin
         $found = false;
 
         /* Set gotoMode to active if we there was an ogroup selected . (save_object_directly) */
-        foreach(array("workgeneric"=>"active","servgeneric"=>"active","termgeneric"=>"graphic") as $tab => $value){
+        foreach(array("workgeneric"=>"active","servgeneric"=>"active","termgeneric"=>"active") as $tab => $value){
           if(isset($this->systab->by_object[$tab]->gotoMode)) {
             $found = true;
             $this->systab->by_object[$tab]->gotoMode = $value;
@@ -796,15 +803,16 @@ class systems extends plugin
           $ldap->cd($this->config->current['BASE']);
         }
 
-        /* Terminal has been saved successfully, remove lock from
-           LDAP. */
-        if ($this->dn != "new"){
-          del_lock ($this->dn);
-        }
+        /* Terminal has been saved successfully, remove lock from LDAP. */
+        if (!isset($_POST['edit_apply'])){
+          if ($this->dn != "new"){
+            del_lock ($this->dn);
+          }
 
-        unset ($this->systab);
-        $this->systab= NULL;
-        session::un_set('objectinfo');
+          unset ($this->systab);
+          $this->systab= NULL;
+          session::un_set('objectinfo');
+        }
       } else {
         /* Ok. There seem to be errors regarding to the tab data,
            show message and continue as usual. */
@@ -852,7 +860,7 @@ class systems extends plugin
           $dialog = TRUE;
         }  
       }
-      if(isset($this->systab->by_object[$this->systab->current]->netConfigDNS) && 
+      if(isset($this->systab->current) && isset($this->systab->by_object[$this->systab->current]->netConfigDNS) && 
         $this->systab->by_object[$this->systab->current]->netConfigDNS->dialog){
         $dialog = TRUE;
       }
@@ -991,7 +999,7 @@ class systems extends plugin
 
     /* Attributes to fetch */
     $sys_attrs        = array("cn", "description", "macAddress", "objectClass", "sambaDomainName","gotoMode");
-    $sys_categories   = array("terminal", "workstation", "server", "phone" ,"printer");
+    $sys_categories   = array("terminal", "workstation", "server", "phone" ,"printer","incoming");
 
     /* Add FAIstate to attributes if FAI is activated */
     $tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs'));
@@ -1026,7 +1034,7 @@ class systems extends plugin
 
     /* Search for incoming objects */ 
     $filter = "(|(&".$userregex."(objectClass=goHard)(cn=".$this->DivListSystem->Regex.")))";
-    $res = array_merge($res,get_list($filter,$sys_categories, get_ou('incomingou'),get_ou('incomingou').$base,$sys_attrs, GL_NONE | GL_SIZELIMIT));
+    $res = array_merge($res,get_list($filter,$sys_categories, get_ou('incomingou').$base,$sys_attrs, GL_NONE | GL_SIZELIMIT));
 
     /* Get all gotoTerminal's */
     foreach ($res as $value){
@@ -1062,7 +1070,6 @@ class systems extends plugin
 
       /* Detect type of object and create an entry for $this->terminals */
       $terminal = array();
-
       if (in_array_ics('gotoTerminal', $value["objectClass"])){
 
         /* check acl */