Code

Updated group listing
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Mar 2008 14:08:49 +0000 (14:08 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Mar 2008 14:08:49 +0000 (14:08 +0000)
-Added notification event

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

gosa-core/plugins/admin/groups/class_divListGroup.inc
gosa-core/plugins/admin/groups/class_groupManagement.inc

index f9acd3b8631dd6915830421d322747481ff61649..1e39361333c0445653d13a6ea182ca83e2eaf433 100644 (file)
@@ -172,6 +172,15 @@ class divListGroup extends MultiSelectWindow
     $s.= "..|<img src='images/edittrash.png' alt='' border='0' class='center'>".
       "&nbsp;"._("Remove")."|"."remove_multiple|\n";
 
+    /* Add event tag */
+    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 07f0eb862dc1153e80604925211606e217415e18..3ddaa108ca91d5a292dc366c2a2969c58bd58c8a 100644 (file)
@@ -146,9 +146,56 @@ class groupManagement extends plugin
       $s_action = "multiple_edit";
     }
 
+    if(isset($_POST['menu_action']) && preg_match("/^trigger_event_DaemonEvent_notify/",$_POST['menu_action'])){
+      $s_action = "notify";
+    }
 
     $smarty= get_smarty();
 
+
+
+    /********************
+      Create notification event
+     ********************/
+
+    if($s_action == "notify"){
+
+      $ids = $this->list_get_selected_items();
+      $uids = array();
+      foreach($ids as $id){
+        $uids[] = $this->grouplist[$id]['cn'][0];
+      }
+      if(count($uids)){
+        $this->grouptab = new DaemonEvent_notify($this->config);
+        $this->grouptab->add_targets($uids);
+      }
+    }
+
+    /* Abort event dialog */
+    if(isset($_POST['abort_event_dialog'])){
+      $this->grouptab = FALSE;
+    }
+
+    /* Save event */
+    if(isset($_POST['save_event_dialog'])){
+      $o_queue = new gosaSupportDaemon();
+      $o_queue->append($this->grouptab);
+      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->grouptab = FALSE;
+      }
+    }
+
+    /* Display event */
+    if($this->grouptab instanceof DaemonEvent){
+      $this->grouptab->save_object();
+      return($this->grouptab->execute());
+    }
+
+
+
     /********************
       Copy & Paste Handling  ...
      ********************/
@@ -175,7 +222,7 @@ class groupManagement extends plugin
            react on this. */
         $this->dn= "new";
 
-        /* Create new usertab object */
+        /* Create new grouptab object */
         $this->grouptab= new grouptabs($this->config, $this->config->data['TABS']['GROUPTABS'], $this->dn);
 
         /* Set up the group ACL's for this 'dn' */