From: hickert Date: Thu, 6 Mar 2008 09:34:07 +0000 (+0000) Subject: Updated Tagging X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=328dee909ba4b0f59a089805845585b19e7c1ff7;p=gosa.git Updated Tagging -Tags wern't removed correctly git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9378 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index 4b10313b9..2e10d7215 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -224,6 +224,9 @@ class plugin unset($this->saved_attributes["$index"]["count"]); } + if(isset($this->attrs['gosaUnitTag'])){ + $this->saved_attributes['gosaUnitTag'] = $this->attrs['gosaUnitTag'][0]; + } } /* Save initial account state */ @@ -368,7 +371,7 @@ class plugin function cleanup() { foreach ($this->attrs as $index => $value){ - + /* Convert arrays with one element to non arrays, if the saved attributes are no array, too */ if (is_array($this->attrs[$index]) && @@ -1007,7 +1010,7 @@ class plugin } } } - + /* Remove tags that may already be here... */ remove_objectClass("gosaAdministrativeUnitTag", $at); if (isset($at['gosaUnitTag'])){ @@ -1019,6 +1022,15 @@ class plugin add_objectClass("gosaAdministrativeUnitTag", $at); $at['gosaUnitTag']= $tag; } + + /* Initially this object was tagged. + - But now, it is no longer inside a tagged department. + So force the remove of the tag. + (objectClass was already removed obove) + */ + if($tag == "" && $this->gosaUnitTag){ + $at['gosaUnitTag'] = array(); + } }