Code

Updated department tagging.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Feb 2008 09:44:07 +0000 (09:44 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 25 Feb 2008 09:44:07 +0000 (09:44 +0000)
-Fixed add / remove of department tagging

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

gosa-core/include/class_plugin.inc
gosa-core/plugins/admin/departments/class_departmentGeneric.inc

index acdcbfe085bdf04bd0e926118a3cac885ef7c76f..89642ff57d9b66df0757447e42d714e02fd5ad27 100644 (file)
@@ -88,6 +88,7 @@ class plugin
 
   /* Save unit tags */
   var $gosaUnitTag= "";
+  var $skipTagging= FALSE;
 
   /*!
     \brief Used standard values
@@ -966,6 +967,14 @@ class plugin
 
   function tag_attrs(&$at, $dn= "", $tag= "", $show= false)
   {
+    /* Skip tagging? 
+       If this is called from departmentGeneric, we have to skip this
+        tagging procedure. 
+     */
+    if($this->skipTagging){
+      return;
+    }
+
     /* No dn? Self-operation... */
     if ($dn == ""){
       $dn= $this->dn;
index a59500df8e2a5b76d6282611f8a75d2217320580..08c7f3b101b5cc4370570011d7a40acec93c8dd6 100644 (file)
@@ -315,6 +315,7 @@ class department extends plugin
         $this->gosaUnitTag= preg_replace("/\./", "", $sec.$usec);
       }
     }
+    $this->skipTagging = TRUE;
     plugin::save();
 
     $this->attrs['gosaUnitTag'] = $this->gosaUnitTag;
@@ -334,10 +335,7 @@ class department extends plugin
         }
       }
       $this->attrs['objectClass']= $tmp;
-
-      if(!$has_unit_tag && isset($this->attrs['gosaUnitTag'])){
-        $this->attrs['gosaUnitTag']= array();
-      }
+      $this->attrs['gosaUnitTag']= array();
       $this->gosaUnitTag = "";
     }