From b9a665f8e5359cbfdf540f344f0419668521027f Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 15 Nov 2006 07:56:44 +0000 Subject: [PATCH] Updated ogroup c&p git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5121 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/ogroups/class_ogroup.inc | 13 ++-- .../admin/ogroups/class_ogroupManagement.inc | 66 +++++++++++-------- 2 files changed, 47 insertions(+), 32 deletions(-) diff --git a/plugins/admin/ogroups/class_ogroup.inc b/plugins/admin/ogroups/class_ogroup.inc index 7da3f5282..ed44e8ea4 100644 --- a/plugins/admin/ogroups/class_ogroup.inc +++ b/plugins/admin/ogroups/class_ogroup.inc @@ -690,10 +690,15 @@ class ogroup extends plugin function getCopyDialog() { - $str = ""; - $str .= _("Group name"); - $str .= " "; - return($str); + $str = ""; + + $smarty = get_smarty(); + $smarty->assign("cn", $this->cn); + $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__))); + $ret = array(); + $ret['string'] = $str; + $ret['status'] = ""; + return($ret); } function saveCopyDialog() diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index bd6617025..d6021660e 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -113,37 +113,13 @@ class ogroupManagement extends plugin /* 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 ****************/ @@ -456,6 +432,40 @@ class ogroupManagement extends plugin $this->DivListOGroup->save_object(); } + + 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"); + $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); + } + } + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: -- 2.30.2