Code

Fixed template loading
[gosa.git] / gosa-plugins / goto / addons / goto / class_gotomasses.inc
index 5aa837e6c5c2ec8c6f2a17da1205895692102edb..dcc2e935057ad4a9b1638ce469b7335977cb3ec3 100644 (file)
@@ -45,6 +45,8 @@ class gotomasses extends plugin
   var $range    = 25;
   var $start    = 0;
 
+  var $recently_removed = array();
+
   function gotomasses(&$config, $dn= NULL)
   {
     /* Include config object */
@@ -121,6 +123,19 @@ class gotomasses extends plugin
     }
 
 
+    /************
+     * Import CSV file  
+     ************/
+    
+    if($s_action == "import_file"){
+      $this->dialog = new goto_import_file($this->config,$this);
+    }
+  
+    if(isset($_POST['import_abort'])){
+      $this->dialog = FALSE;
+    }
+
+
     /************
      * Handle Priority modifications  
      ************/
@@ -329,6 +344,7 @@ class gotomasses extends plugin
     }
     if($this->acl_is_removeable()){
       $s.= "..|---|\n";
+      $s.= "..|<img src='images/lists/import.png' alt='' border='0' class='center'>&nbsp;"._("Import")."|import_file\n";
       $s.= "..|<img src='images/lists/trash.png' alt='' border='0' class='center'>&nbsp;"._("Remove")."|remove_multiple\n";
     }
     if(preg_match("/w/",$this->getacl(""))){
@@ -500,9 +516,8 @@ class gotomasses extends plugin
         /* Real percent */
         } else {
          if (preg_match('/install/', $task['HEADERTAG'])){
-            $status = "<iframe style='border:0px;width:80px;height:13px; margin:0px; padding:0px;' 
-                          src='getFAIstatus.php?mac=".$task['MACADDRESS']."'>
-                        </iframe>";
+            $status = "<img src='progress.php?x=80&y=13&p=".$task['PROGRESS']."' alt=''
+                          id='progress_".preg_replace("/:/","_",$task['MACADDRESS'])."'>";
           } else {
             $status = preg_replace('/ /', '&nbsp;', _("in progress"));
           }
@@ -682,6 +697,8 @@ class gotomasses extends plugin
       $tmp = new DaemonEvent_faireboot($this->config);
       $tmp->add_targets($update_ids);
       $tmp->set_type(TRIGGERED_EVENT);
+      $this->recently_removed = $update_ids;
+      
       if(!$this->o_queue->append($tmp)){
         msg_dialog::display(_("Error"), sprintf(_("Cannot update queue entry: %s"),$id) , ERROR_DIALOG);
         return(FALSE);
@@ -772,8 +789,14 @@ class gotomasses extends plugin
     $this->entries = array();
     
     foreach($entries as $entry){
+    
+      /* Skip entries which will be removed within the next seconds */
+      if(isset($entry['MACADDRESS']) && in_array($entry['MACADDRESS'],$this->recently_removed)){
+        continue;
+      }
       $this->entries[$entry['ID']]= $entry;
     }
+    $this->recently_removed = array();
   }