From f2c9444994de1dd404c6cd3e5d2d18b4423f3397 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 4 Mar 2008 13:14:53 +0000 Subject: [PATCH] Updated group management -Better event handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9312 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../plugins/admin/groups/class_divListGroup.inc | 14 ++++++++------ .../admin/groups/class_groupManagement.inc | 17 +++++++++++------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/gosa-core/plugins/admin/groups/class_divListGroup.inc b/gosa-core/plugins/admin/groups/class_divListGroup.inc index ab32f37de..802f19f10 100644 --- a/gosa-core/plugins/admin/groups/class_divListGroup.inc +++ b/gosa-core/plugins/admin/groups/class_divListGroup.inc @@ -193,14 +193,16 @@ class divListGroup extends MultiSelectWindow " "._("Remove")."|"."remove_multiple|\n"; /* Add event tag */ - if(class_available("DaemonEvent_notify")){ - $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(class_available("DaemonEvent")){ + $events = DaemonEvent::get_event_types(USER_EVENT); + 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 */ if(is_object($this->parent->CopyPasteHandler) && preg_match("/(c.*w|w.*c)/",$acl_all)){ $s.= "..|---|\n"; diff --git a/gosa-core/plugins/admin/groups/class_groupManagement.inc b/gosa-core/plugins/admin/groups/class_groupManagement.inc index 7a764e80e..6b64a03eb 100644 --- a/gosa-core/plugins/admin/groups/class_groupManagement.inc +++ b/gosa-core/plugins/admin/groups/class_groupManagement.inc @@ -148,8 +148,8 @@ 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"; + if(isset($_POST['menu_action']) && preg_match("/^event/",$_POST['menu_action'])){ + $s_action = $_POST['menu_action']; } $smarty= get_smarty(); @@ -160,16 +160,21 @@ class groupManagement extends plugin 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->grouplist[$id]['cn'][0]; } if(count($uids)){ - $this->grouptab = new DaemonEvent_notify($this->config); - $this->grouptab->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->grouptab = new $type['CLASS_NAME']($this->config); + $this->grouptab->add_targets($uids); + $this->grouptab->set_type(TRIGGERED_EVENT); + } } } -- 2.30.2