diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc
index a852876df8eb608d018392f2b5c9831cafc87b05..f3a3ad2593eb9f6bb10cf2e6821a0b876f9d1251 100644 (file)
Copy & Paste handling
****************/
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
****************/
/****************
Create a new object group
****************/
reset ($this->ogrouplist);
}
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();
function save_object()
{
$this->DivListOGroup->save_object();