summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9ec5ed2)
raw | patch | inline | side by side (parent: 9ec5ed2)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 26 Apr 2006 04:42:22 +0000 (04:42 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 26 Apr 2006 04:42:22 +0000 (04:42 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3111 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/applications/class_applicationManagement.inc | patch | blob | history | |
plugins/admin/groups/class_groupManagement.inc | patch | blob | history |
diff --git a/plugins/admin/applications/class_applicationManagement.inc b/plugins/admin/applications/class_applicationManagement.inc
index 2eaa67e2164a5f6e906e5efd81d892148ab12257..f82a5013e5a185116a6890eec0370511559934c1 100644 (file)
var $ui= NULL;
var $acl= "";
- var $CopyPasteHandler ;
+ var $CopyPasteHandler = NULL;
var $Release = "";
var $Releases = array();
- var $enableCopyPaste = false;
var $enableReleaseManagement = false;
$this->config= $config;
$this->ui= $ui;
- if( (isset($this->config->data['MAIN']['ENABLECOPYPASTE']))
+ if((isset($this->config->data['MAIN']['ENABLECOPYPASTE']))
&&
(preg_match("/true/i",$this->config->data['MAIN']['ENABLECOPYPASTE'] ))){
- $this->enableCopyPaste = true;
+ $this->CopyPasteHandler = new CopyPasteHandler($this->config);
}
- $this->CopyPasteHandler = new CopyPasteHandler($this->config);
-
/* Check if we should enable the release selection */
$tmp = search_config($this->config->data,"faiManagement","CLASS");
if(!empty($tmp)){
/* Only perform copy / paste if it is enabled
*/
- if($this->enableCopyPaste){
-
- /* Paste copied/cutted object in here
- */
- if(($s_action == "editPaste") || ($this->CopyPasteHandler->stillOpen())){
- $this->CopyPasteHandler->save_object();
- $this->CopyPasteHandler->SetVar("base", $_SESSION['CurrentMainBase']);
-
- if($str = $this->CopyPasteHandler->execute()) {
- return($str);
- }
- }
-
-
- /* Copy current object to CopyHandler
- */
- if($s_action == "copy"){
- $this->CopyPasteHandler->Clear();
- $dn = $this->applications[$s_entry]['dn'];
- $obj = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn);
- $objNew = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], "new");
- $this->CopyPasteHandler->Copy($obj,$objNew);
- }
-
-
- /* Copy current object to CopyHandler
- */
- if($s_action == "cut"){
- $this->CopyPasteHandler->Clear();
- $dn = $this->applications[$s_entry]['dn'];
- $obj = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn);
- $this->CopyPasteHandler->Cut($obj);
- }
+ if($this->CopyPasteHandler){
+ if($str = $this->copyPasteHandling($s_action,$s_entry)){
+ return($str);
+ };
}
/* New application? */
}
}
- if($this->enableCopyPaste){
+ if($this->CopyPasteHandler){
$Copy_Paste = " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
if($this->CopyPasteHandler->isCurrentObjectPastAble()){
- if($this->enableCopyPaste){
+ if($this->CopyPasteHandler){
$actions = "<input class='center' type='image'
src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
$actions.= "<input class='center' type='image'
}
+ function copyPasteHandling($s_action,$s_entry)
+ {
+ /* Paste copied/cutted object in here
+ */
+ echo "jo";
+ if(($s_action == "editPaste") || ($this->CopyPasteHandler->stillOpen())){
+ $this->CopyPasteHandler->save_object();
+ $this->CopyPasteHandler->SetVar("base", $_SESSION['CurrentMainBase']);
+
+ if($str = $this->CopyPasteHandler->execute()) {
+ return($str);
+ }
+ }
+
+ /* Copy current object to CopyHandler
+ */
+ if($s_action == "copy"){
+ $this->CopyPasteHandler->Clear();
+ $dn = $this->applications[$s_entry]['dn'];
+ $obj = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn);
+ $objNew = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], "new");
+ $this->CopyPasteHandler->Copy($obj,$objNew);
+ }
+
+ /* Copy current object to CopyHandler
+ */
+ if($s_action == "cut"){
+ $this->CopyPasteHandler->Clear();
+ $dn = $this->applications[$s_entry]['dn'];
+ $obj = new apptabs($this->config, $this->config->data['TABS']['APPSTABS'], $dn);
+ $this->CopyPasteHandler->Cut($obj);
+ }
+ }
+
/* Save data to object */
function save_object()
{
diff --git a/plugins/admin/groups/class_groupManagement.inc b/plugins/admin/groups/class_groupManagement.inc
index 70bb5499a921cc48af95917a893655b7c6ff29f9..75b1dbf6746331e617afc64dbe85b48ba6b9f8f2 100644 (file)
var $ui= NULL;
var $acl= "";
- var $CopyPasteHandler ;
- var $enableCopyPaste = false;
+ var $CopyPasteHandler = NULL;
function groupManagement ($config, $ui)
{
$this->ui= $ui;
if((isset($this->config->data['MAIN']['ENABLECOPYPASTE']))&&(preg_match("/true/i",$this->config->data['MAIN']['ENABLECOPYPASTE']))){
- $this->enableCopyPaste = true;
+ $this->CopyPasteHandler = new CopyPasteHandler($this->config);
}
- $this->CopyPasteHandler = new CopyPasteHandler($this->config);
/* Get global filter config */
if (!is_global("groupfilter")){
return($message);
}
- /* Only perform copy / paste if it is enabled
+ /* Only perform copy&paste requests if it is enabled
*/
- if($this->enableCopyPaste){
-
- /* Paste copied/cutted object in here
- */
- if(($s_action == "editPaste") || ($this->CopyPasteHandler->stillOpen())){
- $this->CopyPasteHandler->save_object();
- $this->CopyPasteHandler->SetVar("base",$_SESSION['CurrentMainBase']);
- if($str = $this->CopyPasteHandler->execute()){
- return( $str);
- };
- /* Ensure that the new object is shown in the list now */
- $this->relaod();
- }
-
-
- /* Copy current object to CopyHandler
- */
- if($s_action == "copy"){
- $this->CopyPasteHandler->Clear();
-
- $dn = $this->grouplist[trim($s_entry)]['dn'];
- $acl = get_permissions ($dn, $this->ui->subtreeACL);
-
- $obj = new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn);
- $objNew = new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], "new");
- $obj->set_acl($acl);
- $objNew->set_acl($acl);
- $this->CopyPasteHandler->Copy($obj,$objNew);
- }
-
-
- /* Copy current object to CopyHandler
- */
- if($s_action == "cut"){
- $this->CopyPasteHandler->Clear();
- $dn = $this->grouplist[trim($s_entry)]['dn'];
- $acl= get_permissions ($dn, $this->ui->subtreeACL);
-
- $obj= new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn);
- $obj->set_acl($acl);
-
- $this->CopyPasteHandler->Cut($obj);
+ if($this->CopyPasteHandler){
+ if($str = $this->copyPasteHandling($s_action,$s_entry)){
+ echo $str;
}
}
-
/* New group? */
if ($s_action=="new"){
/* Create paste icon
*/
- if($this->enableCopyPaste){
+ if($this->CopyPasteHandler){
$Copy_Paste = " <img class='center' src='images/list_seperator.png' align='middle' alt='' height='16' width='1'> ";
if($this->CopyPasteHandler->isCurrentObjectPastAble()){
if($this->CopyPasteHandler->isCurrentCutted()){
"</div>";
- if($this->enableCopyPaste){
+ if($this->CopyPasteHandler){
$actions = "<input class='center' type='image'
src='images/editcut.png' alt='"._("cut")."' name='cut_%KEY%' title='"._("Cut this entry")."'> ";
$actions.= "<input class='center' type='image'
}
+
+
+ /* Perform copy & paste requests
+ If copy&paste is in progress this returns a dialog to fix required attributes
+ */
+ function copyPasteHandling($s_action,$s_entry)
+ {
+ /* Paste copied/cutted object in here
+ */
+ if(($s_action == "editPaste") || ($this->CopyPasteHandler->stillOpen())){
+ $this->CopyPasteHandler->save_object();
+ $this->CopyPasteHandler->SetVar("base",$_SESSION['CurrentMainBase']);
+ if($str = $this->CopyPasteHandler->execute()){
+ return( $str);
+ };
+ /* Ensure that the new object is shown in the list now */
+ $this->relaod();
+ }
+
+
+ /* Copy current object to CopyHandler
+ */
+ if($s_action == "copy"){
+ $this->CopyPasteHandler->Clear();
+
+ $dn = $this->grouplist[trim($s_entry)]['dn'];
+ $acl = get_permissions ($dn, $this->ui->subtreeACL);
+
+ $obj = new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn);
+ $objNew = new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], "new");
+ $obj->set_acl($acl);
+ $objNew->set_acl($acl);
+ $this->CopyPasteHandler->Copy($obj,$objNew);
+ }
+
+
+ /* Copy current object to CopyHandler
+ */
+ if($s_action == "cut"){
+ $this->CopyPasteHandler->Clear();
+ $dn = $this->grouplist[trim($s_entry)]['dn'];
+ $acl= get_permissions ($dn, $this->ui->subtreeACL);
+
+ $obj= new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $dn);
+ $obj->set_acl($acl);
+
+ $this->CopyPasteHandler->Cut($obj);
+ }
+ }
+
/* Save data to object */
function save_object()
{