Code

Removed unused get_printer_list call
[gosa.git] / include / class_CopyPasteHandler.inc
index 4ec220be551b28193731719c6d999a5d3af27071..334bd988dc6e3c55e51552274d5b63439a1b3155 100644 (file)
@@ -124,9 +124,29 @@ class CopyPasteHandler {
     /* Cut & paste
      */
     if($this->cutCurrent){
-      $this->current->save();
-      $this->dialogOpen =false;
-      $this->Clear();
+
+      if(isset($_POST['PerformCopyPaste'])){
+        $msgs = $this->check();        
+        if(count ($msgs) ){
+          foreach( $msgs as $msg){
+            print_red($msg);
+          }
+        }else{
+          $this->current->save();
+          $this->dialogOpen =false;
+          $this->Clear();
+        }
+      }
+      if($this->current){
+        $smarty = get_smarty();
+        $smarty->assign("type","cut");
+        $smarty->assign("Complete",false);
+        $smarty->assign("AttributesToFix"," ");
+        $smarty->assign("SubDialog",$this->current->SubDialog);
+        $smarty->assign("objectDN"     ,$this->objectdn);
+        $smarty->assign("message", sprintf(_("You are going to paste the cutted entry '%s'."), $this->objectdn));
+        return($smarty->fetch(get_template_path("copyPasteDialog.tpl",FALSE)));
+      }
 
       /* Copy & paste
        */
@@ -139,17 +159,19 @@ class CopyPasteHandler {
           }
         }else{
           $this->current->save();
+          $this->lastdn = $this->current->dn;
           $this->dialogOpen =false;
           $this->Clear();
         }
       }
       if($this->current){
         $smarty = get_smarty();        
+        $smarty->assign("type","copy");
         $smarty->assign("Complete",false);
         $smarty->assign("AttributesToFix",$this->generateAttributesToFix());   
         $smarty->assign("SubDialog",$this->current->SubDialog);
         $smarty->assign("objectDN"              ,$this->objectdn);     
-        $smarty->assign("message", sprintf(_("You are going to copy the entry '%s'."), $this->objectdn));      
+        $smarty->assign("message", sprintf(_("You are going to paste the copied entry '%s'."), $this->objectdn));      
         return($smarty->fetch(get_template_path("copyPasteDialog.tpl",FALSE)));
       }
     }
@@ -215,7 +237,7 @@ class CopyPasteHandler {
       $Copy_Paste.= "<input type='image' name='editPaste' class='center'
         src='".$img."' alt='"._("Paste")."' title='".$this->GetCurrentDn()."'>&nbsp;";
     }else{
-      $Copy_Paste.= "<img class='center' src='images/cant_editpaste.png' alt='"._("Can't paste")."'>&nbsp;";
+      $Copy_Paste.= "<img class='center' src='images/cant_editpaste.png' alt=\""._("Can't paste")."\">&nbsp;";
     }
 
     return ($Copy_Paste);