/** * Send notification about team status * * @param int $a_exc_ref_id * @param int $a_user_id * @param string $a_action */ public function sendNotification($a_exc_ref_id, $a_user_id, $a_action) { global $ilUser; // no need to notify current user if ($ilUser->getId() == $a_user_id) { return; } include_once "./Services/Notification/classes/class.ilSystemNotification.php"; $ntf = new ilSystemNotification(); $ntf->setLangModules(array("exc")); $ntf->setRefId($a_exc_ref_id); $ntf->setChangedByUserId($ilUser->getId()); $ntf->setSubjectLangId('exc_team_notification_subject_' . $a_action); $ntf->setIntroductionLangId('exc_team_notification_body_' . $a_action); $ntf->addAdditionalInfo("exc_assignment", $this->getTitle()); $ntf->setGotoLangId('exc_team_notification_link'); $ntf->setReasonLangId('exc_team_notification_reason'); $ntf->sendMail(array($a_user_id)); }
protected function sendNotifications() { global $ilUser; // recipients include_once "./Services/Notification/classes/class.ilNotification.php"; $users = ilNotification::getNotificationsForObject(ilNotification::TYPE_POLL, $this->object->getId(), null, true); if (!sizeof($users)) { return; } include_once "./Services/Notification/classes/class.ilSystemNotification.php"; $ntf = new ilSystemNotification(); $ntf->setLangModules(array("poll")); $ntf->setRefId($this->ref_id); if ($this->object->getNonAnonymous()) { $ntf->setChangedByUserId($ilUser->getId()); } $ntf->setSubjectLangId('poll_vote_notification_subject'); $ntf->setIntroductionLangId('poll_vote_notification_body'); $ntf->setGotoLangId('poll_vote_notification_link'); $ntf->setReasonLangId('poll_vote_notification_reason'); $notified = $ntf->sendMail($users, null, "read"); ilNotification::updateNotificationTime(ilNotification::TYPE_POLL, $this->object->getId(), $notified); }
static function sendNotification($a_action, $a_in_wsp, $a_blog_node_id, $a_posting_id, $a_comment = null) { global $ilUser; // get blog object id (repository or workspace) if ($a_in_wsp) { include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php"; include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php"; $tree = new ilWorkspaceTree($ilUser->getId()); // owner of tree is irrelevant $blog_obj_id = $tree->lookupObjectId($a_blog_node_id); $access_handler = new ilWorkspaceAccessHandler($tree); } else { $blog_obj_id = ilObject::_lookupObjId($a_blog_node_id); $access_handler = null; } if (!$blog_obj_id) { return; } include_once "./Modules/Blog/classes/class.ilBlogPosting.php"; $posting = new ilBlogPosting($a_posting_id); // #11138 $ignore_threshold = $a_action == "comment"; // approval handling $admin_only = false; if (!$posting->isApproved()) { $blog = new self($blog_obj_id, false); if ($blog->hasApproval()) { switch ($a_action) { case "update": // un-approved posting was updated - no notifications return; case "new": // un-approved posting was activated - admin-only notification $admin_only = true; $ignore_threshold = true; break; } } } // recipients include_once "./Services/Notification/classes/class.ilNotification.php"; $users = ilNotification::getNotificationsForObject(ilNotification::TYPE_BLOG, $blog_obj_id, $a_posting_id, $ignore_threshold); if (!sizeof($users)) { return; } include_once "./Services/Notification/classes/class.ilSystemNotification.php"; $ntf = new ilSystemNotification($a_in_wsp); $ntf->setLangModules(array("blog")); $ntf->setRefId($a_blog_node_id); $ntf->setChangedByUserId($ilUser->getId()); $ntf->setSubjectLangId('blog_change_notification_subject'); $ntf->setIntroductionLangId('blog_change_notification_body_' . $a_action); $ntf->addAdditionalInfo('blog_posting', $posting->getTitle()); if ($a_comment) { $ntf->addAdditionalInfo('comment', $a_comment, true); } $ntf->setGotoLangId('blog_change_notification_link'); $ntf->setReasonLangId('blog_change_notification_reason'); $notified = $ntf->sendMail($users, "_" . $a_posting_id, $admin_only ? "write" : "read"); ilNotification::updateNotificationTime(ilNotification::TYPE_BLOG, $blog_obj_id, $notified); }