Code

Updated gotomasses
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Feb 2008 14:57:38 +0000 (14:57 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Feb 2008 14:57:38 +0000 (14:57 +0000)
-Updated target list.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8960 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/addons/gotomasses/events/class_DaemonEvent.inc
gosa-plugins/goto/addons/gotomasses/events/target_list.tpl

index e742f18867eb20d44176a648ef382dbec0a9132a..d62f9014e2b5d55a03e3b44f154e2ae1071a64bb 100644 (file)
@@ -35,6 +35,8 @@ class DaemonEvent
   protected $time_select_used = FALSE; // Indicates that we have used the timestamp select boxes.
   protected $target_list_used = FALSE; // Indicates that the target list was used.
 
+  protected $target_divlist = FALSE; // The divlist used by the target add dialog
+
   public function __construct($config,$data = array())
   {
     $this->data   = $data;
@@ -141,6 +143,16 @@ class DaemonEvent
   {
     $this->target_list_used = TRUE;
     $smarty = get_smarty();
+    if(!$this->target_divlist){ 
+      $this->target_divlist = new MultiSelectWindow($this->config,"EventTargets","gotomasses");
+      $this->target_divlist->SetSummary(_("Targets"));
+      $this->target_divlist->SetInformation(_("This dialog shows all available targets for your event, check the targets you want to add and use the 'Use' button to accept."));
+      $this->target_divlist->EnableCloseButton(FALSE); 
+      $this->target_divlist->EnableSaveButton(FALSE); 
+    }
+    
+    $smarty->assign("divlist",$this->target_divlist->Draw());
 
     return($smarty->fetch(get_template_path('target_list.tpl', TRUE, dirname(__FILE__))));
   }
@@ -150,13 +162,18 @@ class DaemonEvent
     if(isset($_POST['open_target_list'])){
       $this->target_list_used =TRUE;
     }
+    if($this->target_divlist){
+      $this->target_divlist->save_object();
+    }
     if($this->target_list_used){
       if(isset($_POST['abort_target_dialog'])){
         $this->target_list_used =FALSE;
+        $this->target_divlist = FALSE;
       }
       if(isset($_POST['save_target_dialog'])){
         $this->target_list_used =FALSE;
         echo "Targets auslesen";
+        $this->target_divlist = FALSE;
       }
     }
 
index 9e7fcfaf200e44b7f4cc4f13734ed1c36bc7ba82..589ff244c8cc11909dccdf21e3560ab4aaa30338 100644 (file)
@@ -1,9 +1,7 @@
-Target List .
-
-<input type='submit'>
+{$divlist}
 
 <p class='seperator'></p>
-<div style='text-align:right;width:100%;padding:5px;'>
+<div style='text-align:right;width:100%;padding-top:5px;padding-right:5px;padding-bottom:5px;'>
        <input type='submit' name='save_target_dialog' value='{t}Use{/t}'>&nbsp;
        <input type='submit' name='abort_target_dialog' value='{t}Close{/t}'>
 </div>