Code

Enabled single cut and paste
[gosa.git] / plugins / admin / ogroups / class_ogroup.inc
index d9114eb4edaff2c9f40607d609611a0bf7a656ce..1a5db9bca3162789803ffcf7918338b605357f0f 100644 (file)
@@ -145,7 +145,7 @@ class ogroup extends plugin
 
     if(!$this->view_logged){
       $this->view_logged = TRUE;
-      @log::log("view","ogroups/".get_class($this),$this->dn);
+      new log("view","ogroups/".get_class($this),$this->dn);
     }
 
 
@@ -654,9 +654,9 @@ class ogroup extends plugin
     $ldap->$mode($this->attrs);
 
     if($mode == "add"){
-      @log::log("create","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+      new log("create","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }else{
-      @log::log("modify","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+      new log("modify","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
     }
 
     /* Trigger post signal */
@@ -678,12 +678,42 @@ class ogroup extends plugin
     $ldap->rmdir($this->dn);
     show_ldap_error($ldap->get_error(), sprintf(_("Removing of object group/generic with dn '%s' failed."),$this->dn));
 
-    @log::log("remove","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
+    new log("remove","ogroups/".get_class($this),$this->dn,array_keys($this->attrs),$ldap->get_error());
 
     /* Trigger remove signal */
     $this->handle_post_events("remove");
   }
 
+  
+  function PrepareForCopyPaste($source)
+  {
+    /* Update available object types */
+    if(isset($source['gosaGroupObjects'][0])){
+      $this->gosaGroupObjects =  $source['gosaGroupObjects'][0];
+    }
+
+    /* Reload tabs */
+    $this->parent->reload($this->gosaGroupObjects );
+   
+    /* Reload plugins */ 
+    foreach($this->parent->by_object as $name => $class ){
+      if(get_class($this) != $name) {
+        $this->parent->by_object[$name]->PrepareForCopyPaste($source);
+      }
+    }
+
+    /* Load member objects */
+    if (isset($source['member'])){
+      foreach ($source['member'] as $key => $value){
+        if ("$key" != "count"){
+          $value= @LDAP::convert($value);
+          $this->member["$value"]= "$value";
+        }
+      }
+    }
+
+  }
+
 
   function getCopyDialog()
   {