Code

Terminal/Workstation tabs;
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 23 Nov 2006 06:52:13 +0000 (06:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 23 Nov 2006 06:52:13 +0000 (06:52 +0000)
Assign cn from generic tab to all other tabs.
Else checks like cn=="default" will not work in all non generic tabs.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5206 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/tabs_terminal.inc
plugins/admin/systems/tabs_workstation.inc

index 7e98d82a8b32e33630dc57923185b513faf44c38..cac248e2ec5f80e7b5a332908440beddba8d9573 100644 (file)
@@ -35,6 +35,12 @@ class termtabs extends tabs
       $this->by_object['termstartup']->gotoTerminalPath=
         $this->by_object['termgeneric']->gotoTerminalPath;
     }
+   
+    /* Assign current cn to all other plugins */ 
+    $baseobject= $this->by_object['termgeneric'];
+    foreach ($this->by_object as $key => $obj){
+      $this->by_object[$key]->cn= $baseobject->cn;
+    }
   }
 
 
index 34298b095e7818f9a10ce20f89bfecb98ee40e95..7dcafd2c829c9da6c4f61d86e06adb745b1a540b 100644 (file)
@@ -29,6 +29,13 @@ class worktabs extends tabs
   function save_object($save_current= FALSE)
   {
     tabs::save_object($save_current);
+
+    /* Assign current cn to all other plugins */
+    $baseobject= $this->by_object['termgeneric'];
+    foreach ($this->by_object as $key => $obj){
+      $this->by_object[$key]->dn= $this->dn;
+      $this->by_object[$key]->cn= $baseobject->cn;
+    }
   }
 
 
@@ -47,8 +54,10 @@ class worktabs extends tabs
 
     tabs::save(TRUE);
 
-    if(($this->by_object['printgeneric']->is_account==false)&&($this->by_object['printgeneric']->initially_was_account==true)){
-      $this->by_object['printgeneric']->remove_from_parent();
+    if(isset($this->by_object['printgeneric'])){
+      if(($this->by_object['printgeneric']->is_account==false)&&($this->by_object['printgeneric']->initially_was_account==true)){
+        $this->by_object['printgeneric']->remove_from_parent();
+      }
     }
 
     /* Fix tagging if needed */