38 $this->subject_lang_id = $a_lang_id;
43 $this->subject_direct = trim($a_text);
48 $this->introduction = $a_lang_id;
53 $this->introduction_direct = trim($a_text);
58 $this->task = $a_lang_id;
63 $this->reason = $a_lang_id;
68 $this->goto_caption = $a_lang_id;
73 $this->changed_by = $a_id;
82 bool $a_multiline =
false,
83 bool $a_lang_direct =
false
85 $this->additional[$a_lang_id] = array(trim($a_value), $a_multiline, $a_lang_direct);
98 ?
string $a_goto_additional =
null,
99 string $a_permission =
"read"
101 $this->all_ref_ids = null;
104 if ($this->getObjId()) {
105 if (!$this->getRefId()) {
107 if (!$this->is_in_wsp) {
109 if (count($ref_ids) === 1) {
110 $this->ref_id = array_shift($ref_ids);
112 $this->all_ref_ids = $ref_ids;
115 } elseif ($this->is_in_wsp) {
116 $this->ref_id = $this->wsp_tree->lookupNodeId($this->getObjId());
120 if (!$this->goto_caption) {
121 $this->goto_caption =
"url";
125 $recipient_ids = array();
126 foreach (array_unique($a_user_ids) as $user_id) {
128 if ($this->changed_by === $user_id) {
131 if ($this->composeAndSendMail($user_id, $a_goto_additional, $a_permission)) {
132 $recipient_ids[] = $user_id;
136 return $recipient_ids;
144 ?
string $a_goto_additional =
null,
145 string $a_permission =
"read",
146 bool $a_append_signature_direct =
false
148 $find_ref_id = false;
149 $this->initLanguage($a_user_id);
152 if ($this->subject_direct) {
153 $this->setSubject($this->subject_direct);
156 sprintf($this->getLanguageText($this->subject_lang_id), $this->getObjectTitle(
true))
161 $this->appendBody(
"\n\n");
163 if ($this->introduction) {
164 $this->appendBody($this->getLanguageText($this->introduction));
165 $this->appendBody(
"\n\n");
168 if ($this->introduction_direct) {
169 $this->appendBody($this->introduction_direct);
170 $this->appendBody(
"\n\n");
174 $this->appendBody($this->getLanguageText($this->task));
175 $this->appendBody(
"\n\n");
179 if ($this->getObjId()) {
180 $this->appendBody($this->getLanguageText(
"obj_" . $this->getObjType()) .
": " .
181 $this->getObjectTitle() .
"\n");
183 if (count($this->additional) > 0) {
184 foreach ($this->additional as $lang_id => $item) {
187 $caption = (!$item[2])
188 ? $this->getLanguageText($lang_id)
195 $this->appendBody($caption . $item[0] .
"\n");
200 $this->appendBody(
"\n" . $caption .
201 $this->getBlockBorder() .
203 $this->getBlockBorder() .
"\n");
207 $this->body = trim($this->body);
208 $this->appendBody(
"\n\n");
210 if ($this->changed_by) {
211 $this->appendBody($this->getLanguageText(
"system_notification_installation_changed_by") .
": " .
213 $this->appendBody(
"\n\n");
216 if ($this->getObjId()) {
218 if (!$this->getRefId() && $this->all_ref_ids) {
220 foreach ($this->all_ref_ids as
$ref_id) {
221 if ($this->isRefIdAccessible($a_user_id,
$ref_id, $a_permission)) {
229 if ($this->getRefId() &&
231 !$this->isRefIdAccessible($a_user_id, $this->getRefId(), $a_permission)) {
235 $goto = $this->createPermanentLink(array(), (
string) $a_goto_additional);
237 $this->appendBody($this->getLanguageText($this->goto_caption) .
": " .
239 $this->appendBody(
"\n\n");
248 $this->appendBody($this->getLanguageText($this->reason));
249 $this->appendBody(
"\n\n");
255 $this->body = trim($this->body);
257 if (!$a_append_signature_direct) {
258 $this->getMail()->appendInstallationSignature(
true);
271 ?
string $a_goto_additional =
null,
272 string $a_permission =
"read"
274 if ($this->compose($a_user_id, $a_goto_additional, $a_permission)) {
275 $this->sendMail(array($a_user_id), is_numeric($a_user_id));
286 ?
string $a_goto_additional =
null,
287 string $a_permission =
"read",
288 bool $a_append_signature_direct =
false
290 if ($this->compose($a_user_id, $a_goto_additional, $a_permission, $a_append_signature_direct)) {
Base class for course/group mail notifications.
static _getAutoGeneratedMessageString(ilLanguage $lang=null)
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
static _getInstallationSignature()
static _getAllReferences(int $id)
get all reference ids for object ID
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setTaskLangId(string $a_lang_id)
setIntroductionLangId(string $a_lang_id)
setSubjectLangId(string $a_lang_id)
sendMailAndReturnRecipients(array $a_user_ids, ?string $a_goto_additional=null, string $a_permission="read")
Send notification(s)
setGotoLangId(string $a_lang_id)
compose(int $a_user_id, ?string $a_goto_additional=null, string $a_permission="read", bool $a_append_signature_direct=false)
Compose notification to single recipient.
setIntroductionDirect(string $a_text)
composeAndGetMessage(int $a_user_id, ?string $a_goto_additional=null, string $a_permission="read", bool $a_append_signature_direct=false)
Compose notification to single recipient.
composeAndSendMail(int $a_user_id, ?string $a_goto_additional=null, string $a_permission="read")
Send notification to single recipient.
setReasonLangId(string $a_lang_id)
addAdditionalInfo(string $a_lang_id, string $a_value, bool $a_multiline=false, bool $a_lang_direct=false)
Add additional information.
setChangedByUserId(int $a_id)
string $introduction_direct
setSubjectDirect(string $a_text)
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:
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...