From 8bdf73ee88e326344895d798124011c8c5c3ec54 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 3 Mar 2008 14:09:04 +0000 Subject: [PATCH] Updated user list -Added notification event git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9244 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/users/class_divListUsers.inc | 7 +++ .../admin/users/class_userManagement.inc | 46 +++++++++++++++++++ 2 files changed, 53 insertions(+) diff --git a/gosa-core/plugins/admin/users/class_divListUsers.inc b/gosa-core/plugins/admin/users/class_divListUsers.inc index 6ba71d714..8a7c5570f 100644 --- a/gosa-core/plugins/admin/users/class_divListUsers.inc +++ b/gosa-core/plugins/admin/users/class_divListUsers.inc @@ -167,6 +167,13 @@ class divListUsers extends MultiSelectWindow $s.= "..|". " "._("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']." ".$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"; diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index 05592ae2c..04a17bc48 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -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 */ -- 2.30.2