From: hickert Date: Wed, 6 Jan 2010 12:14:42 +0000 (+0000) Subject: Enabled copy & paste X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7cd2d53f26290610cc7e7523457697dfc086c08a;p=gosa.git Enabled copy & paste git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15084 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc index f148505b1..c65f150a4 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -120,6 +120,50 @@ class faiManagement extends management } + function copyPasteHandler($action="",$target=array(),$all=array(), + $altTabClass ="", $altTabType = "", $altAclCategory="",$altAclPlugin="") + { + + // Collect real dns, the listed objects are grouped by their cn + $headpage = $this->getHeadpage(); + if($action == "copy"){ + foreach($target as $t){ + $entry = $headpage->getEntry($t); + + // Check for valid FAI objects + if(in_array('FAKE_OC_FAI', $entry['objectClass'])){ + foreach($entry['GROUPS'] as $g){ + $type = $this->get_type($g); + $this->cpHandler->add_to_queue($g['dn'],"copy",$type[0],$type[2],'fai',$this); + @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__,$dn,"Entry copied!"); + } + } + } + } + + // Initiate pasting + if($action == "paste"){ + $this->cpPastingStarted = TRUE; + } + + // Display any c&p dialogs, eg. object modifications required before pasting. + if($this->cpPastingStarted && $this->cpHandler->entries_queued()){ + $this->cpHandler->SetVar("base",$headpage->getBase()); + $data = $this->cpHandler->execute(); + FAI::save_release_changes_now(); + if(!empty($data)){ + return($data); + } + } + + // Automatically disable pasting process since there is no entry left to paste. + if(!$this->cpHandler->entries_queued()){ + $this->cpPastingStarted = FALSE; + } + return(""); + } + + function newEntry($action="",$target=array(),$all=array(), $altTabClass ="", $altTabType = "", $altAclCategory="") { /****************