Code

Fixed tagging
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Jun 2006 08:21:50 +0000 (08:21 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 27 Jun 2006 08:21:50 +0000 (08:21 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3930 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/departments/class_departmentGeneric.inc

index 6dd6ff7de85406c7652c6bf4220f60ed8f4c0291..f31c70f338708d8f36c233a0736a686aded17e2a 100644 (file)
@@ -260,12 +260,11 @@ class department extends plugin
                return $message;
        }
 
-
-       /* Save to LDAP */
-       function save()
-       {
+  
+  /* Prepare Unit tag */
+  function prepare_unit_tag()
+  {
                $ldap= $this->config->get_ldap_link();
-
                /* Add tag objects if needed */
                if ($this->is_administrational_unit){
       if(!in_array_ics("gosaAdministrativeUnit",$this->objectclasses)){
@@ -294,8 +293,17 @@ class department extends plugin
                                }
                                $this->gosaUnitTag= preg_replace("/\./", "", $sec.$usec);
                        }
-               }
+               }else{
+      $this->gosaUnitTag = "";
+    }
+  }
 
+
+       /* Save to LDAP */
+       function save()
+       {
+               $ldap= $this->config->get_ldap_link();
+    $this->prepare_unit_tag();
                plugin::save();
 
                /* Remove tag information if needed */
@@ -368,6 +376,8 @@ class department extends plugin
        /* Tag objects to have the gosaAdministrativeUnitTag */
        function tag_objects($OnlySetTagFlag = false)
        {
+    $this->prepare_unit_tag();
+
     if(!$OnlySetTagFlag){
       $smarty= get_smarty();
       echo "<!-- headers.tpl-->".$smarty->fetch(get_template_path('headers.tpl'));