From 95dc8fdf321c05a5ec63459a042dcf9faca784c9 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 4 Mar 2008 13:14:34 +0000 Subject: [PATCH] Updated ogroup mangement. -Better event hanlding git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9311 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/ogroups/class_divListOGroup.inc | 13 ++++++++----- .../admin/ogroups/class_ogroupManagement.inc | 19 ++++++++++++------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc b/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc index d57e83166..e9df2b359 100644 --- a/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc +++ b/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc @@ -204,12 +204,15 @@ class divListOGroup extends MultiSelectWindow $s.= "..|". " "._("Remove")."|"."remove_multiple_ogroups/|\n"; - /* Add notification event */ - 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/ogroups/class_ogroupManagement.inc b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc index f9fac4e4f..07fcbeff7 100644 --- a/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc @@ -133,26 +133,31 @@ class ogroupManagement extends plugin } /* Hanlde notification event requests */ - 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->ogrouplist[$id]['cn'][0]; } if(count($uids)){ - $this->ogroup= new DaemonEvent_notify($this->config); - $this->ogroup->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->ogroup = new $type['CLASS_NAME']($this->config); + $this->ogroup->add_targets($uids); + $this->ogroup->set_type(TRIGGERED_EVENT); + } } - } /* Abort event dialog */ -- 2.30.2