Code

Added wake action to gotomasses
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Aug 2007 07:00:30 +0000 (07:00 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Aug 2007 07:00:30 +0000 (07:00 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7093 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/addons/gotomasses/class_goto_task.inc
plugins/addons/gotomasses/class_gotomasses.inc

index f67fd7f115a6a6b7e4a23d47dfbc5d1252218d2a..60a7765398b1d3a478f545f2723b454f8bf31e61 100644 (file)
@@ -64,8 +64,10 @@ class goto_task extends plugin
     foreach($_POST as $name => $value){
       if(preg_match("/^remove_/",$name)){
         $value = preg_replace("/^remove_([0-9]*)_(x|y)$/i","\\1",$name);
-        if(isset($this->Target[$value])){
+        if(isset($this->Target[$value]) && $this->Action != "initial_install"){
           unset($this->Target[$value]);
+        }elseif(isset($this->Initial_Target[$value]) && $this->Action == "initial_install"){
+          unset($this->Initial_Target[$value]);
         }
       }
     }
index b908533926bf6e65569bec8ce3eba8b7b10771ac..dc2bb580ed7f0e843595837c1fd5797729f52536 100644 (file)
@@ -25,12 +25,10 @@ class gotomasses extends plugin
   
     /* Include config object */
     $this->config= $config;
-
     $this->load_gotomasses_data();
   }
 
 
-
   function execute()
   {
     $smarty = get_smarty();
@@ -293,11 +291,15 @@ class gotomasses extends plugin
     foreach($this->tasks as $task){
       $str .= "\n#".trim($task['Comment']);
       $str .= "\n";
-      $str .= str_pad($task['Minute'] ,5," ")." ";
-      $str .= str_pad($task['Hour']   ,5," ")." ";
-      $str .= str_pad($task['Day']    ,5," ")." ";
-      $str .= str_pad($task['Month']  ,5," ")." ";
-      $str .= str_pad($task['Weekday'],5," ")." ";
+      if($task['Action'] == "initial_install"){
+        $str .= "*     *     *     *     *     ";
+      }else{
+        $str .= str_pad($task['Minute'] ,5," ")." ";
+        $str .= str_pad($task['Hour']   ,5," ")." ";
+        $str .= str_pad($task['Day']    ,5," ")." ";
+        $str .= str_pad($task['Month']  ,5," ")." ";
+        $str .= str_pad($task['Weekday'],5," ")." ";
+      }
       $str .= str_pad($task['Action'] ,5," ")." ";
       $str .= str_pad($task['OGroup'] ,5," ")." ";
       if($task['Action'] == "initial_install"){
@@ -368,6 +370,7 @@ class gotomasses extends plugin
                             "update"          => _("Update"),
                             "reinstall"       => _("(Re)Install"),
                             "rescan"          => _("Rescan"),
+                            "wake"            => _("Wake"),
                             "memcheck"        => _("Memory check"));
     return($actions);
   }