Code

Updated copy paste method
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Apr 2006 08:53:57 +0000 (08:53 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Apr 2006 08:53:57 +0000 (08:53 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2986 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_CopyPasteHandler.inc
include/class_plugin.inc

index d8fb89ab3acf6febd495f617cc521ab4b3f70aa5..37e9a2e951c02c3c9d4acbbfd6295318a2c687e6 100644 (file)
@@ -62,14 +62,9 @@ class CopyPasteHandler {
     $this->objectdn    = $obj->dn;
     $this->current = $emptyObj;
     foreach($obj->by_object as $name => $obj){
-      foreach($obj->attributes as $attr){
-        $this->current->by_object[$name]->$attr = $obj->$attr;
-      }
-      if(isset($obj->CopyPasteVars)){
-        foreach($obj->CopyPasteVars as $attr){
-          $this->current->by_object[$name]->$attr = $obj->$attr;
-        }
-      }
+      
+      $this->current->by_object[$name]->PrepareForCopyPaste($obj);
+  
       foreach(array("is_account") as $attr){
         if(isset($obj->$attr)){
           $this->current->by_object[$name]->$attr = $obj->$attr;
index 1e6b5ba215374a72be520cf78f83e245dbc945ff..dc24a4b173747018dd277431e17cdded32e52fef 100644 (file)
@@ -750,6 +750,17 @@ class plugin
     return(array("string"=>"","status"=>""));
   }
 
+  function PrepareForCopyPaste($source){
+    $todo = $this->attributes;
+    if(isset($this->CopyPasteVars)){
+      $todo = array_merge($todo,$this->CopyPasteVars);
+    }
+
+    foreach($todo as $var){
+      $this->$var = $source->$var;
+    }
+  }
+
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
 ?>