Code

Updated ogroup c&p
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 15 Nov 2006 07:56:44 +0000 (07:56 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 15 Nov 2006 07:56:44 +0000 (07:56 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5121 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/ogroups/class_ogroup.inc
plugins/admin/ogroups/class_ogroupManagement.inc

index 7da3f528285d7113c49321c97c3782fb7f7773df..ed44e8ea46b873609ce008b4eac4352f98b23ce1 100644 (file)
@@ -690,10 +690,15 @@ class ogroup extends plugin
 
   function getCopyDialog()
   {
-    $str  = "";
-    $str .= _("Group name");
-    $str .= "&nbsp;<input type='text' name='cn' value='".$this->cn."'>";
-    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()
index bd6617025b7cbf91a12b499f677bf5603e284c5c..d6021660e2c1c41db1597ddde45c4dab61ab4a81 100644 (file)
@@ -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: