summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c97773c)
raw | patch | inline | side by side (parent: c97773c)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 12 Jun 2007 07:29:08 +0000 (07:29 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 12 Jun 2007 07:29:08 +0000 (07:29 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6567 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/admin/groups/class_divListGroup.inc b/plugins/admin/groups/class_divListGroup.inc
index c578000169845f00249a249bb405d52529b35531..53e38f59eeeade32529650fe3cf389cf11186d0e 100644 (file)
/* Multiple options */
$listhead .= " <input class='center' type='image' align='middle' src='images/edittrash.png'
title='"._("Remove selected groups")."' alt='"._("Remove groups")."' name='remove_multiple_groups'> ";
-
+ $listhead .= " <input class='center' type='image' align='middle' src='images/editcopy.png'
+ title='"._("Copy selected group")."' alt='"._("Copy groups")."' name='multiple_copy_groups'> ";
+ $listhead .= " <input class='center' type='image' align='middle' src='images/editcut.png'
+ title='"._("cut selected group")."' alt='"._("Cut groups")."' name='multiple_cut_groups'> ";
$listhead .= "</div>";
$this->SetListHeader($listhead);
}
diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc
index cee95e213e33d6a900f9ac05d993e986a68150d1..7bbb1b803f311653bf913525160801e556aedd96 100644 (file)
function PrepareForCopyPaste($source)
{
- $this->FAIrelease = $this->InitialFAIrelease = $source->FAIrelease;
- $this->gosaMemberApplication = $source->gosaMemberApplication;
- $this->appoption = $source->appoption;
- $this->Categories = $source->Categories;
+ $s = new appgroup($this->config,$source['dn']);
+ $this->FAIrelease = $this->InitialFAIrelease = $s->FAIrelease;
+ $this->gosaMemberApplication = $s->gosaMemberApplication;
+ $this->appoption = $s->appoption;
+ $this->Categories = $s->Categories;
}
diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc
index de6a7fb56ad7de77806e33a394595e63ac1bc955..2e5aaa0cd45716e3dc3b4de42ac7353288a62b7b 100644 (file)
var $CopyPasteHandler = NULL;
var $DivListGroup = NULL;
var $ShowPrimaryCheckBox= false;
+ var $start_pasting_copied_objects = FALSE;
function groupManagement ($config, $ui)
{
$s_entry = preg_replace("/^cut_/i","",$key);
}elseif(preg_match("/^remove_multiple_groups/",$key)){
$s_action="del_multiple";
+ }elseif(preg_match("/^multiple_copy_groups/",$key)){
+ $s_action = "copy_multiple";
+ }elseif(preg_match("/^multiple_cut_groups/",$key)){
+ $s_action = "cut_multiple";
}
}
$s_entry = preg_replace("/_.$/","",$s_entry);
Copy & Paste Handling ...
********************/
- /* Only perform copy&paste requests if it is enabled
- */
- if($this->CopyPasteHandler){
- if($str = $this->copyPasteHandling($s_action,$s_entry)){
- return $str;
- }
+ /* Display the copy & paste dialog, if it is currently open */
+ $ret = $this->copyPasteHandling_from_queue($s_action);
+ if($ret){
+ return($ret);
}
}
-
- /* Perform copy & paste requests
- If copy&paste is in progress this returns a dialog to fix required attributes
- */
- function copyPasteHandling($s_action,$s_entry)
+ function copyPasteHandling_from_queue($s_action)
{
- /* Paste copied/cutted object in here
- */
- if(($s_action == "editPaste") || ($this->CopyPasteHandler->stillOpen())){
- $this->CopyPasteHandler->save_object();
- $this->CopyPasteHandler->SetVar("base",$this->DivListGroup->selectedBase);
- if($str = $this->CopyPasteHandler->execute()){
- return( $str);
- };
- /* Ensure that the new object is shown in the list now */
- $this->reload();
- }
-
- /* Copy current object to CopyHandler
- */
- if($s_action == "copy"){
+ /* Add entries to queue */
+ if($s_action == "copy_multiple" || $s_action == "cut_multiple"){
- $dn = $this->grouplist[trim($s_entry)]['dn'];
- $ui = get_userinfo();
- $acl_all = $ui->has_complete_category_acls($this->DivListGroup->selectedBase,"groups") ;
- if(preg_match("/(c.*w|w.*c)/",$acl_all)){
+ /* Cleanup object queue */
+ $this->CopyPasteHandler->cleanup_queue();
- $this->CopyPasteHandler->Clear();
- $obj = new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn);
- $obj->set_acl_base($dn);
- $objNew = new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], "new");
- $objNew->set_acl_base($dn);
+ /* Add new entries to CP queue */
+ foreach($this->list_get_selected_items() as $id){
+ $dn = $this->grouplist[$id]['dn'];
- $this->CopyPasteHandler->Copy($obj,$objNew);
- }else{
- print_red("You are not allowed to copy this entry.");
+ if($s_action == "copy_multiple"){
+ $this->CopyPasteHandler->add_to_queue($dn,"copy","grouptabs","GROUPTABS","groups");
+ }
+ if($s_action == "cut_multiple"){
+ $this->CopyPasteHandler->add_to_queue($dn,"cut","grouptabs","GROUPTABS","groups");
+ }
}
}
+ /* Start pasting entries */
+ if($s_action == "editPaste"){
+ $this->start_pasting_copied_objects = TRUE;
+ }
- /* Copy current object to CopyHandler
- */
- if($s_action == "cut"){
-
- $dn = $this->grouplist[trim($s_entry)]['dn'];
- $acl_all = $ui->has_complete_category_acls($this->selectedBase,"groups") ;
- if(preg_match("/(c.*w|w.*c)/",$acl_all)){
-
- $this->CopyPasteHandler->Clear();
- $obj= new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn);
- $obj->set_acl_base($dn);
- $this->CopyPasteHandler->Cut($obj);
- }else{
- print_red("You are not allowed to cut this entry.");
+ /* Return C&P dialog */
+ if($this->start_pasting_copied_objects && $this->CopyPasteHandler->entries_queued()){
+
+ /* Load entry from queue and set base */
+ $this->CopyPasteHandler->load_entry_from_queue();
+ $this->CopyPasteHandler->SetVar("base",$this->DivListGroup->selectedBase);
+
+ /* Get dialog */
+ $data = $this->CopyPasteHandler->execute();
+
+ /* Return dialog data */
+ if(!empty($data)){
+ return($data);
}
}
+
+ /* Automatically disable status for pasting */
+ if(!$this->CopyPasteHandler->entries_queued()){
+ $this->start_pasting_copied_objects = FALSE;
+ }
+ return("");
}
+
+
+
/* Save data to object */
function save_object()
{