From: hickert Date: Mon, 3 Mar 2008 14:08:49 +0000 (+0000) Subject: Updated group listing X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=e8f534808a971667bb73d66d62990df4f064e6c3;p=gosa.git Updated group listing -Added notification event git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@9243 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/groups/class_divListGroup.inc b/gosa-core/plugins/admin/groups/class_divListGroup.inc index f9acd3b86..1e3936133 100644 --- a/gosa-core/plugins/admin/groups/class_divListGroup.inc +++ b/gosa-core/plugins/admin/groups/class_divListGroup.inc @@ -172,6 +172,15 @@ class divListGroup extends MultiSelectWindow $s.= "..|". " "._("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']." ".$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/groups/class_groupManagement.inc b/gosa-core/plugins/admin/groups/class_groupManagement.inc index 07f0eb862..3ddaa108c 100644 --- a/gosa-core/plugins/admin/groups/class_groupManagement.inc +++ b/gosa-core/plugins/admin/groups/class_groupManagement.inc @@ -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' */