19 declare(strict_types=1);
42 $this->
settings = $domain->settings();
43 $this->
access = $domain->access();
53 bool $a_changed =
false 66 $recipients = $settings->get(
"comments_noti_recip",
'');
67 $recipients = explode(
",", $recipients);
78 $sub_obj_id =
$context->getSubObjId();
83 if (($sub_obj_id === 0 && $obj_type !==
"blp") || in_array($obj_type, array(
"pg",
"wpg"),
true)) {
85 $type_lv =
"obj_" . $obj_type;
89 if ($obj_type ===
"wpg") {
90 $type_lv =
"obj_wiki";
92 if ($obj_type ===
"pg") {
95 if ($obj_type ===
"blp") {
97 $type_lv =
"obj_blog";
99 if ($obj_type ===
"pfpg") {
101 $type_lv =
"portfolio";
103 if ($obj_type ===
"dcl") {
105 $type_lv =
"obj_dcl";
108 foreach ($recipients as
$r) {
112 foreach ($ref_ids as
$ref_id) {
113 if ($access->checkAccessOfUser(
$user_id,
"read",
"", $ref_id)) {
114 if ($sub_obj_id === 0 && $obj_type !==
"blog") {
115 $link = \ilLink::_getLink($ref_id);
116 } elseif ($obj_type ===
"wpg") {
124 } elseif ($obj_type ===
"pg") {
125 $link = ILIAS_HTTP_PATH .
'/goto.php?client_id=' .
CLIENT_ID .
"&target=pg_" . $sub_obj_id .
"_" .
$ref_id;
129 if ($obj_type ===
"blp") {
132 if ($obj_type ===
"pfpg") {
133 $link = ILIAS_HTTP_PATH .
'/goto.php?client_id=' .
CLIENT_ID .
"&target=prtf_" . $rep_obj_id;
138 $ulng->loadLanguageModule(
'note');
141 $subject = sprintf($ulng->txt(
'note_comment_notification_subjectc'), $obj_title .
" (" . $ulng->txt($type_lv) .
")");
143 $subject = sprintf($ulng->txt(
'note_comment_notification_subject'), $obj_title .
" (" . $ulng->txt($type_lv) .
")");
149 $message .= $note->getText() .
"\n\n";
152 $message .= $ulng->txt(
'note_comment_notification_link') .
": " . $link .
"\n\n";
155 $message .= $ulng->txt(
'note_comment_notification_reason') .
"\n\n";
158 $mail_obj->appendInstallationSignature(
true);
179 foreach ($observer as $item) {
185 $param[] = $note->getId();
186 call_user_func_array($item,
$param);
Notes internal repo service.
InternalRepoService $repo
InternalDataService $data
static _lookupFullname(int $a_user_id)
static _getAllReferences(int $id)
get all reference ids for object ID
static lookupTitle(int $a_page_id, string $lang="-")
static _lookupId($a_user_str)
Repository internal data service.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
static _lookupTitle(int $obj_id)
static _getLanguageOfUser(int $a_usr_id)
Get language object of user.
notifyObserver(array $observer, string $action, Note $note)
Notify observers on update/create.
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
__construct(InternalDataService $data, InternalRepoService $repo, InternalDomainService $domain)
sendNotifications(Note $note, bool $a_changed=false)
Sends all comments to a list of accounts configured in the global administration. ...
static makeUrlTitle(string $a_par)
InternalDomainService $domain
static _lookupLogin(int $a_user_id)