X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fadmin%2Fogroups%2Fclass_ogroupManagement.inc;h=f3a3ad2593eb9f6bb10cf2e6821a0b876f9d1251;hb=f1ca520daf95525953d6e03c5bb0abf7c2648171;hp=a852876df8eb608d018392f2b5c9831cafc87b05;hpb=8bc427075722dbf4a29020ba64cb4d4effb5dd99;p=gosa.git diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index a852876df..f3a3ad259 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -111,39 +111,12 @@ class ogroupManagement extends plugin Copy & Paste handling ****************/ - /* Only perform copy / paste if it is enabled - */ - if($this->CopyPasteHandler){ - - /* Paste copied/cutted object in here - */ - if(($s_action == "editPaste") || ($this->CopyPasteHandler->stillOpen())){ - $this->CopyPasteHandler->save_object(); - $this->CopyPasteHandler->SetVar("base", $this->DivListOGroup->selectedBase); - return($this->CopyPasteHandler->execute()); - } - - /* Copy current object to CopyHandler - */ - if($s_action == "copy"){ - $this->CopyPasteHandler->Clear(); - $dn = $this->ogrouplist[$s_entry]['dn']; - $obj = new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $dn); - $objNew = new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], "new"); - $this->CopyPasteHandler->Copy($obj,$objNew); - } - - /* Copy current object to CopyHandler - */ - if($s_action == "cut"){ - $this->CopyPasteHandler->Clear(); - $dn = $this->ogrouplist[$s_entry]['dn']; - $obj = new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $dn); - $this->CopyPasteHandler->Cut($obj); - } + /* Display the copy & paste dialog, if it is currently open */ + $ret = $this->copyPasteHandling($s_action,$s_entry); + if($ret){ + return($ret); } - /**************** Create a new object group ****************/ @@ -466,6 +439,46 @@ class ogroupManagement extends plugin reset ($this->ogrouplist); } + + function copyPasteHandling($s_action,$s_entry) + { + if($this->CopyPasteHandler){ + + /* Paste copied/cutted object in here + */ + if(($s_action == "editPaste") || ($this->CopyPasteHandler->stillOpen())){ + $this->CopyPasteHandler->save_object(); + $this->CopyPasteHandler->SetVar("base", $this->DivListOGroup->selectedBase); + return($this->CopyPasteHandler->execute()); + } + + /* Copy current object to CopyHandler + */ + if($s_action == "copy"){ + $this->CopyPasteHandler->Clear(); + $dn = $this->ogrouplist[$s_entry]['dn']; + $obj = new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $dn); + $objNew = new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], "new"); + + $types_of_tabs = $obj->by_object['ogroup']->gosaGroupObjects; + $objNew->by_object['ogroup']->gosaGroupObjects = $types_of_tabs; + $objNew->reload($types_of_tabs); + + $this->CopyPasteHandler->Copy($obj,$objNew); + } + + /* Copy current object to CopyHandler + */ + if($s_action == "cut"){ + $this->CopyPasteHandler->Clear(); + $dn = $this->ogrouplist[$s_entry]['dn']; + $obj = new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $dn); + $this->CopyPasteHandler->Cut($obj); + } + } + } + + function save_object() { $this->DivListOGroup->save_object();