summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: afa7e64)
raw | patch | inline | side by side (parent: afa7e64)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 4 Mar 2008 13:12:06 +0000 (13:12 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 4 Mar 2008 13:12:06 +0000 (13:12 +0000) |
-Updated event handling
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9310 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9310 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/admin/users/class_divListUsers.inc | patch | blob | history | |
gosa-core/plugins/admin/users/class_userManagement.inc | patch | blob | history |
diff --git a/gosa-core/plugins/admin/users/class_divListUsers.inc b/gosa-core/plugins/admin/users/class_divListUsers.inc
index ac41162b4356e6e92749aa3c67f190790c379fa7..65c69f64a9aedef425f83cf6a73b776b38e16e61 100644 (file)
$s.= "..|<img src='images/edittrash.png' alt='' border='0' class='center'>".
" "._("Remove")."|"."remove_multiple|\n";
- if(class_available("DaemonEvent_notify")){
+ /* Add event tag */
+ if(class_available("DaemonEvent")){
$events = DaemonEvent::get_event_types(USER_EVENT);
- $event = $events['BY_CLASS']['DaemonEvent_notify'];
- $s.= "..|---|\n";
- $s.= "..|".$event['MenuImage']." ".$event['s_Menu_Name']."|trigger_event_DaemonEvent_notify\n";
+ if(count($events['BY_CLASS'])){
+ $s.= "..|---|\n";
+ foreach($events['BY_CLASS'] as $name => $event){
+ $s.= "..|".$event['MenuImage']." ".$event['s_Menu_Name']."|event_".$name."\n";
+ }
+ }
}
/* Add multiple copy & cut icons */
diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc
index 6b76035c61c4ad4c797a6c69fc0f6f70e3318198..9b695c8a7798fcbb97481f9f85653c3dbfa503a3 100644 (file)
$s_action = "del_multiple";
}
- if(isset($_POST['menu_action']) && preg_match("/^trigger_event_DaemonEvent_notify/",$_POST['menu_action'])){
- $s_action = "notify";
+ if(isset($_POST['menu_action']) && preg_match("/^event/",$_POST['menu_action'])){
+ $s_action = $_POST['menu_action'];
}
+
/********************
Create notification event
********************/
- if($s_action == "notify"){
-
+ if(preg_match("/^event_/",$s_action) && class_available("DaemonEvent")){
$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);
+ $events = DaemonEvent::get_event_types(USER_EVENT);
+ $event = preg_replace("/^event_/","",$s_action);
+ if(isset($events['BY_CLASS'][$event])){
+ $type = $events['BY_CLASS'][$event];
+ $this->usertab = new $type['CLASS_NAME']($this->config);
+ $this->usertab->add_targets($uids);
+ $this->usertab->set_type(TRIGGERED_EVENT);
+ }
}
-
}
/* Abort event dialog */