Code

- Added a section how to report a bug
[gosa.git] / include / class_CopyPasteHandler.inc
index 963e3df67e8e7ccdf29027bc61ed80fc238bdecf..f50cef728cfed67a05c0c7fc85694e6cdb7086d8 100644 (file)
@@ -124,10 +124,18 @@ class CopyPasteHandler {
     /* Cut & paste
      */
     if($this->cutCurrent){
-      $this->current->save();
-      $this->dialogOpen =false;
-      $this->Clear();
 
+      $msgs = $this->check();  
+      if(count ($msgs) ){
+        foreach( $msgs as $msg){
+          print_red($msg);
+        }
+        $this->dialogOpen =false;
+      }else{
+        $this->current->save();
+        $this->dialogOpen =false;
+        $this->Clear();
+      }
       /* Copy & paste
        */
     }else{
@@ -139,6 +147,7 @@ class CopyPasteHandler {
           }
         }else{
           $this->current->save();
+          $this->lastdn = $this->current->dn;
           $this->dialogOpen =false;
           $this->Clear();
         }
@@ -193,9 +202,9 @@ class CopyPasteHandler {
   function check()
   {
     $ret = array();
-    foreach($this->    current->by_object as $obj){
+    foreach($this->    current->by_object as $key => $obj){
       if($obj->is_account){
-        $ret = array_merge($ret , $obj->check());
+        $ret = array_merge($ret , $this->current->by_object[$key]->check());
       }
     }
     return($ret);