Code

Added apply button to gotomasses
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 20 Aug 2007 12:06:47 +0000 (12:06 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 20 Aug 2007 12:06:47 +0000 (12:06 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7076 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index a9c81ba5e43cc3859fa0246422b8f0b9fcb60adb..f7b36a474bdac62a41e0f27b3ec546bb485ebdd1 100644 (file)
@@ -21,6 +21,7 @@ class goto_task extends plugin
   var $Actions  = array();
   var $OGroup   = "";
   var $OGroups  = array();
+  var $new      = FALSE;
   var $attributes     = array("OGroup","Minute","Hour","Day","Month","Weekday","Action","Comment","Target");
 
 
@@ -46,6 +47,8 @@ class goto_task extends plugin
           }
         }
       }
+    }else{
+      $this->new = TRUE;
     }
 
     /* Create ogroup select list */
@@ -161,6 +164,7 @@ class goto_task extends plugin
 
     $smarty->assign("Actions"     , $this->Actions);
     $smarty->assign("Target_list" , $divlist->DrawList());
+    $smarty->assign("new"      , $this->new);
     return ($smarty->fetch (get_template_path('goto_task.tpl', TRUE)));
   }
 
index ce1b6395c4ae57ebebf1e240ec1be53851a791eb..9af6b1777f787959e8685617231031fec13d3589 100644 (file)
@@ -88,7 +88,7 @@ class gotomasses extends plugin
     }
 
     /* Close dialog */
-    if(isset($_POST['save_goto_task']) && is_object($this->dialog)){
+    if((isset($_POST['save_goto_task']) || isset($_POST['apply_goto_task'])) && is_object($this->dialog) ){
       $this->dialog->save_object();
       $msgs = $this->dialog->check();
       if(count($msgs)){
@@ -101,12 +101,14 @@ class gotomasses extends plugin
         }else{
           $this->tasks[] = $this->dialog->save();
         }
-        $this->dialog = FALSE;
-        $this->current = -1;
+        if(!isset($_POST['apply_goto_task']) && $this->current != -1){
+          $this->dialog = FALSE;
+          $this->current = -1;
+        }
         $this->save();
       }
     }
+
     /* Display dialogs if currently opened */
     if(is_object($this->dialog)){
       $this->dialog->save_object();
index c673e2210106505bd1fa399673672b3c92b21000..3e8ce9ed52b91eda1d80582b22e26a64fbab8fca 100644 (file)
 </table>
 <input type='hidden' name='goto_task_posted' value='1'>
 <p style="text-align:right">
-       <input type='submit' name='close_goto_task' value='{t}Cancel{/t}'>
-       <input type='submit' name='save_goto_task' value='{t}Apply{/t}'>
+       <input type='submit' name='save_goto_task' value='{t}Ok{/t}'>
+{if !$new}
+       <input type='submit' name='apply_goto_task' value='{t}Apply{/t}'>
+{/if}
+       <input type='submit' name='close_goto_task' value='{t}Abort{/t}'>
 </p>