summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 331b53e)
raw | patch | inline | side by side (parent: 331b53e)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 12 Jun 2007 13:23:15 +0000 (13:23 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 12 Jun 2007 13:23:15 +0000 (13:23 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6572 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc
index 09a89297c14dc21fb0f6e298376f68bac215cb57..7fe75e3d2ae31928f26fee79a7565187c1584bbc 100644 (file)
}
-
-
/* Save data to object */
function save_object()
{
diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc
index f7b1ffac7af94d12f5d095a0cba0ba3f17112d96..99aaf9d0d8401f477531385d9d9db79a5c7cce97 100644 (file)
$this->EnableSaveButton (false);
/* Dynamic action col, depending on snapshot icons */
- $action_col_size = 70;
+ $action_col_size = 110;
if($this->parent->snapshotEnabled()){
$action_col_size += 38;
}
/* Must we add an additional seperator */
$add_sep = false;
-
+
+ /* Get copy & paste icon */
+ $Copy_Paste ="";
+ if(preg_match("/(c.*w|w.*c)/",$all_module_acls) && $this->parent->CopyPasteHandler){
+ $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon();
+ $addsep = true;
+ }
+
/* Add default header */
$listhead = MultiSelectWindow::get_default_header();
$add_sep = true;
}
+ /* Assign copy & paste icons */
+ $listhead.= $Copy_Paste;
+
/* Handle create icons */
if(preg_match("/c/",$ui->get_permissions($this->selectedBase,"terminal/termgeneric"))){
$add_sep = true;
$listhead .= " <input class='center' type='image' align='middle' src='images/edittrash.png'
title='"._("Remove selected systems")."' alt='"._("Remove systems")."' name='remove_multiple_systems'> ";
+ $listhead .= " <input class='center' type='image' align='middle' src='images/editcopy.png'
+ title='"._("Copy selected system")."' alt='"._("Copy systems")."' name='multiple_copy_systems'> ";
+ $listhead .= " <input class='center' type='image' align='middle' src='images/editcut.png'
+ title='"._("cut selected system")."' alt='"._("Cut systems")."' name='multiple_cut_systems'> ";
+
$listhead .="</div>";
$this->SetListHeader($listhead);
$empty ="<img src='images/empty.png' style='width:16px ; height: 16px;' class='center' alt=''>";
/* Dynamic action col, depending on snapshot icons */
- $action_col_size = 70;
+ $action_col_size = 110;
if($this->parent->snapshotEnabled()){
$action_col_size += 38;
}
/* Get specific generic acls */
$acl = $ui->get_permissions($val['dn'],$tabs[$type]['ACL']);
- $action= "<input class='center' type='image' src='images/edit.png'
+ $action ="";
+ if(($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
+ $action.= "<input class='center' type='image'
+ src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
+ $action.= "<input class='center' type='image'
+ src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> ";
+ }
+ $action.= "<input class='center' type='image' src='images/edit.png'
alt='"._("edit")."' name='system_edit_%KEY%' title='"._("Edit system")."'>";
if(preg_match("/(c.*w|w.*c)/",$acl_all)){
$action.= $this->GetSnapShotActions($val['dn']);
$action.= $empty." ".$empty." ";
}
+
if(preg_match("/d/",$acl)){
$action.= "<input class='center' type='image' src='images/edittrash.png'
alt='"._("delete")."' name='system_del_%KEY%' title='"._("Delete system")."'>";
diff --git a/plugins/admin/systems/class_systemManagement.inc b/plugins/admin/systems/class_systemManagement.inc
index 2327883611e9728053b8f06e9914fa9150887875..704bfee508b5baafbcb293390d95c7d26316d665 100644 (file)
var $terminals= array();
var $ui = NULL;
var $DivListSystem;
+ var $start_pasting_copied_objects = FALSE;
+ var $CopyPasteHandler = NULL;
function systems ($config, $ui)
{
/* Creat dialog object */
$this->DivListSystem = new divListSystem($this->config,$this);
+
+ /* Copy & Paste enabled ?*/
+ if((isset($this->config->data['MAIN']['ENABLECOPYPASTE']))&&(preg_match("/true/i",$this->config->data['MAIN']['ENABLECOPYPASTE']))){
+ $this->CopyPasteHandler = new CopyPasteHandler($this->config);
+ }
}
+
function execute()
{
/* Call parent execute */
}elseif(preg_match("/newsystem_.*/i",$key)){
$s_action="newsystem";
$s_entry = preg_replace("/newsystem_/i","",$key);
+ }elseif(preg_match("/^multiple_copy_systems/",$key)){
+ $s_action = "copy_multiple";
+ }elseif(preg_match("/^multiple_cut_systems/",$key)){
+ $s_action = "cut_multiple";
+ }elseif(preg_match("/^editPaste.*/i",$key)){
+ $s_action="editPaste";
+ }elseif(preg_match("/^copy_.*/",$key)){
+ $s_action="copy";
+ $s_entry = preg_replace("/^copy_/i","",$key);
+ }elseif(preg_match("/^cut_.*/",$key)){
+ $s_action="cut";
+ $s_entry = preg_replace("/^cut_/i","",$key);
}
}
-
+
+
/* Incoming handling
* If someone made a systemtype and ogroup selection
* Display the new requested entry type ... servtab in case of server and so on.
}
+ /********************
+ Copy & Paste Handling ...
+ ********************/
+
+ /* Display the copy & paste dialog, if it is currently open */
+ $ret = $this->copyPasteHandling_from_queue($s_action,$s_entry);
+ if($ret){
+ return($ret);
+ }
+
+
/********************
Create FAI CD ...
********************/
}
+ function copyPasteHandling_from_queue($s_action,$s_entry)
+ {
+
+ $tabs = array(
+ "terminal" => array( "CLASS" =>"TERMTABS", "TABNAME" =>"termgeneric",
+ "TABCLASS" =>"termtabs", "ACL" =>"terminal"),
+ "workstation" => array( "CLASS" =>"WORKTABS", "TABNAME" =>"workgeneric",
+ "TABCLASS" =>"worktabs", "ACL" =>"workstation"),
+ "server" => array( "CLASS" =>"SERVTABS", "TABNAME" =>"servgeneric",
+ "TABCLASS" =>"servtabs", "ACL" =>"server"),
+ "printer" => array( "CLASS" =>"PRINTTABS", "TABNAME" =>"printgeneric",
+ "TABCLASS" =>"printtabs", "ACL" =>"printer"),
+ "phone" => array( "CLASS" =>"PHONETABS", "TABNAME" =>"phonegeneric",
+ "TABCLASS" =>"phonetabs", "ACL" =>"phone"),
+ "component" => array( "CLASS" =>"COMPONENTTABS","TABNAME" =>"componentgeneric",
+ "TABCLASS" =>"componenttabs","ACL" =>"component"));
+
+ /* Add a single entry to queue */
+ if($s_action == "cut" || $s_action == "copy"){
+
+ /* Cleanup object queue */
+ $this->CopyPasteHandler->cleanup_queue();
+ $dn = $this->terminals[$s_entry]['dn'];
+ $oc = $this->terminals[$s_entry]['objectClass'];
+ $type = $this->get_system_type($oc);
+
+ $tab_o = $tabs[$type]['CLASS'];
+ $tab_c = $tabs[$type]['TABCLASS'];
+ $acl = $tabs[$type]['ACL'];
+
+ $this->CopyPasteHandler->add_to_queue($dn,$s_action,$tab_c,$tab_o,$acl);
+ }
+
+ /* Add entries to queue */
+ if($s_action == "copy_multiple" || $s_action == "cut_multiple"){
+
+ /* Cleanup object queue */
+ $this->CopyPasteHandler->cleanup_queue();
+
+ /* Add new entries to CP queue */
+ foreach($this->list_get_selected_items() as $id){
+ $dn = $this->terminals[$id]['dn'];
+ $oc = $this->terminals[$id]['objectClass'];
+ $type = $this->get_system_type($oc);
+
+ $tab_o = $tabs[$type]['CLASS'];
+ $tab_c = $tabs[$type]['TABCLASS'];
+ $acl = $tabs[$type]['ACL'];
+
+ if($s_action == "copy_multiple"){
+ $this->CopyPasteHandler->add_to_queue($dn,"copy",$tab_c,$tab_o,$acl);
+ }
+ if($s_action == "cut_multiple"){
+ $this->CopyPasteHandler->add_to_queue($dn,"cut",$tab_c,$tab_o,$acl);
+ }
+ }
+ }
+
+ /* Start pasting entries */
+ if($s_action == "editPaste"){
+ $this->start_pasting_copied_objects = TRUE;
+ }
+
+ /* 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->DivListSystem->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("");
+ }
+
+
function get_system_type($classes)
{
$type= "";