Code

Updated user list
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Mar 2008 14:09:04 +0000 (14:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Mar 2008 14:09:04 +0000 (14:09 +0000)
-Added notification event

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

gosa-core/plugins/admin/users/class_divListUsers.inc
gosa-core/plugins/admin/users/class_userManagement.inc

index 6ba71d7146ce0c1b179a3d397662bc91b6ed6c1c..8a7c5570fbed64d7317400a5091b9ef8d785a0a7 100644 (file)
@@ -167,6 +167,13 @@ class divListUsers extends MultiSelectWindow
     $s.= "..|<img src='images/edittrash.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
 
+    if(class_available("DaemonEvent_notify")){
+      $events  = DaemonEvent::get_event_types();
+      $event = $events['BY_CLASS']['DaemonEvent_notify'];
+      $s.= "..|---|\n";
+      $s.= "..|".$event['MenuImage']."&nbsp;".$event['s_Menu_Name']."|trigger_event_DaemonEvent_notify\n";
+    }
+
     /* Add multiple copy & cut icons */
     if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){
       $s.= "..|---|\n";
index 05592ae2c6477532df72cf094dbd2a9fe9b86b3b..04a17bc485c896e04848d0dd389d6663d682e18b 100644 (file)
@@ -151,6 +151,51 @@ class userManagement extends plugin
       $s_action = "del_multiple";
     }
 
+    if(isset($_POST['menu_action']) && preg_match("/^trigger_event_DaemonEvent_notify/",$_POST['menu_action'])){
+      $s_action = "notify";
+    }
+
+    /********************
+      Create notification event 
+     ********************/
+
+    if($s_action == "notify"){
+       
+      $ids = $this->list_get_selected_items();
+      $uids = array();
+      foreach($ids as $id){
+        $uids[] = $this->list[$id]['uid'][0];
+      }
+      if(count($uids)){
+        $this->usertab = new DaemonEvent_notify($this->config);
+        $this->usertab->add_targets($uids);
+      }
+      
+    }
+
+    /* Abort event dialog */
+    if(isset($_POST['abort_event_dialog'])){
+      $this->usertab = FALSE;
+    }
+
+    /* Save event */
+    if(isset($_POST['save_event_dialog'])){
+      $o_queue = new gosaSupportDaemon();
+      $o_queue->append($this->usertab);
+      if($o_queue->is_error()){
+        msg_dialog::display(_("Daemon"),sprintf(_("Something went wrong while talking to the daemon: %s."),
+              $o_queue->get_error()),ERROR_DIALOG);
+      }else{
+        $this->usertab = FALSE;
+      }
+    }
+
+    /* Display event */
+    if($this->usertab instanceof DaemonEvent){
+      $this->usertab->save_object();
+      return($this->usertab->execute());
+    }
+
 
     /********************
       Copy & Paste 
@@ -857,6 +902,7 @@ class userManagement extends plugin
 
     /* Show tab dialog if object is present */
     if(isset($this->usertab->config)){
+
       $display= $this->usertab->execute();
 
       /* Don't show buttons if tab dialog requests this */