From: hickert Date: Fri, 23 Jun 2006 11:56:25 +0000 (+0000) Subject: Made department tagging && recursive move PHP 4compatible X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8651a7b364ee2f95ce59b99166de7467ed33c269;p=gosa.git Made department tagging && recursive move PHP 4compatible git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3872 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_tabs.inc b/include/class_tabs.inc index e0e8dbe42..6a9959e1a 100644 --- a/include/class_tabs.inc +++ b/include/class_tabs.inc @@ -240,6 +240,7 @@ class tabs } else { $obj->remove_from_parent(); } + $this->by_object[$key]= $obj; } return (0); } diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index c508b614e..8a2528b27 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -43,7 +43,6 @@ class department extends plugin var $MustBeMoved = ""; var $MoveDestination = ""; var $MoveSource = ""; - var $MoveOu = ""; /* attribute list for save action */ var $attributes = array("ou", "description", "businessCategory", "st", @@ -242,7 +241,7 @@ class department extends plugin /* Save to LDAP */ - function save() + function save($skipSave = false) { $ldap= $this->config->get_ldap_link(); @@ -285,7 +284,9 @@ class department extends plugin $this->gosaUnitTag= ""; } - plugin::save(); + if(!$skipSave){ + plugin::save(); + } /* Remove tag information if needed */ if (!$this->is_administrational_unit){ @@ -303,24 +304,25 @@ class department extends plugin } } - /* Write back to ldap */ - $ldap= $this->config->get_ldap_link(); - $ldap->cat($this->dn, array('dn')); - $a= $ldap->fetch(); - $ldap->cd($this->dn); - - if (count($a)){ - $this->cleanup(); - $ldap->modify ($this->attrs); - - $this->handle_post_events('modify'); - } else { - $ldap->add($this->attrs); - $this->handle_post_events('add'); - } - - show_ldap_error($ldap->get_error(), _("Saving department failed")); + if(!$skipSave){ + /* Write back to ldap */ + $ldap= $this->config->get_ldap_link(); + $ldap->cat($this->dn, array('dn')); + $a= $ldap->fetch(); + $ldap->cd($this->dn); + + if (count($a)){ + $this->cleanup(); + $ldap->modify ($this->attrs); + + $this->handle_post_events('modify'); + } else { + $ldap->add($this->attrs); + $this->handle_post_events('add'); + } + show_ldap_error($ldap->get_error(), _("Saving department failed")); + } /* The parameter forces only to set must_be_tagged, and don't touch any objects This will be done later */ $this->tag_objects(true); diff --git a/plugins/admin/departments/class_departmentManagement.inc b/plugins/admin/departments/class_departmentManagement.inc index dbfcab0b4..5185e3e7b 100644 --- a/plugins/admin/departments/class_departmentManagement.inc +++ b/plugins/admin/departments/class_departmentManagement.inc @@ -218,7 +218,7 @@ class departmentManagement extends plugin /* Save current changes */ if(!$this->AfterSaveProcedure){ - $this->deptabs->save(true); + $this->deptabs->save(); } /* Check if we have to tag this department */ diff --git a/plugins/admin/departments/tabs_department.inc b/plugins/admin/departments/tabs_department.inc index deccb02c4..b966f7e9d 100644 --- a/plugins/admin/departments/tabs_department.inc +++ b/plugins/admin/departments/tabs_department.inc @@ -36,18 +36,18 @@ class deptabs extends tabs $this->by_object['department']->MustBeMoved = true; $this->by_object['department']->MoveDestination = $new_dn; $this->by_object['department']->MoveSource = $this->dn; - $this->by_object['department']->MoveOu = $ou; - $this->dn = $this->dn; - $baseobject->dn = $this->dn; $this->by_object['department']->ou = $baseobject->attrs['ou'][0]; - $this->by_object['department'] = $baseobject; - return(tabs::save(TRUE)); + $ret = tabs::save(TRUE); + $this->by_object['department']->save(true); + return($ret); } }else{ - $this->dn= $new_dn; - $baseobject->dn= $this->dn; + $this->dn = $new_dn; + $baseobject->dn = $this->dn; + $ret = tabs::save(TRUE); + $baseobject->save(true); $this->by_object['department']= $baseobject; - return(tabs::save(TRUE)); + return($ret); } } }