39 public function __construct(
protected bool $is_in_wsp =
false)
47 $this->subject_lang_id = $a_lang_id;
52 $this->subject_direct = trim($a_text);
57 $this->introduction = $a_lang_id;
62 $this->introduction_direct = trim($a_text);
67 $this->task = $a_lang_id;
72 $this->reason = $a_lang_id;
77 $this->goto_caption = $a_lang_id;
82 $this->changed_by = $a_id;
91 bool $a_multiline =
false,
92 bool $a_lang_direct =
false
94 $this->additional[$a_lang_id] = array(trim($a_value), $a_multiline, $a_lang_direct);
107 ?
string $a_goto_additional =
null,
108 string $a_permission =
"read"
110 $this->all_ref_ids = null;
113 if ($this->getObjId()) {
114 if (!$this->getRefId()) {
116 if (!$this->is_in_wsp) {
118 if (count($ref_ids) === 1) {
119 $this->ref_id = array_shift($ref_ids);
121 $this->all_ref_ids = $ref_ids;
124 } elseif ($this->is_in_wsp) {
125 $this->ref_id = $this->wsp_tree->lookupNodeId($this->getObjId());
129 if (!$this->goto_caption) {
130 $this->goto_caption =
"url";
134 $recipient_ids = array();
135 foreach (array_unique($a_user_ids) as
$user_id) {
137 if ($this->changed_by ===
$user_id) {
140 if ($this->composeAndSendMail(
$user_id, $a_goto_additional, $a_permission)) {
145 return $recipient_ids;
153 ?
string $a_goto_additional =
null,
154 string $a_permission =
"read",
155 bool $a_append_signature_direct =
false
157 $find_ref_id = false;
158 $this->initLanguage($a_user_id);
160 if ($this->subject_direct) {
161 $this->setSubject($this->subject_direct);
164 sprintf($this->getLanguageText($this->subject_lang_id), $this->getObjectTitle(
true))
169 $this->appendBody(
"\n\n");
171 if ($this->introduction) {
172 $this->appendBody($this->getLanguageText($this->introduction));
173 $this->appendBody(
"\n\n");
176 if ($this->introduction_direct) {
177 $this->appendBody($this->introduction_direct);
178 $this->appendBody(
"\n\n");
182 $this->appendBody($this->getLanguageText($this->task));
183 $this->appendBody(
"\n\n");
187 if ($this->getObjId()) {
188 $this->appendBody($this->getLanguageText(
"obj_" . $this->getObjType()) .
": " .
189 $this->getObjectTitle() .
"\n");
191 if (count($this->additional) > 0) {
192 foreach ($this->additional as $lang_id => $item) {
195 $caption = (!$item[2])
196 ? $this->getLanguageText($lang_id)
203 $this->appendBody($caption . $item[0] .
"\n");
208 $this->appendBody(
"\n" . $caption .
209 $this->getBlockBorder() .
211 $this->getBlockBorder() .
"\n");
215 $this->body = trim($this->body);
216 $this->appendBody(
"\n\n");
218 if ($this->changed_by) {
219 $this->appendBody($this->getLanguageText(
"system_notification_installation_changed_by") .
": " .
221 $this->appendBody(
"\n\n");
224 if ($this->getObjId()) {
226 if (!$this->getRefId() && $this->all_ref_ids) {
228 foreach ($this->all_ref_ids as
$ref_id) {
229 if ($this->isRefIdAccessible($a_user_id,
$ref_id, $a_permission)) {
237 if ($this->getRefId() &&
239 !$this->isRefIdAccessible($a_user_id, $this->getRefId(), $a_permission)) {
243 $goto = $this->createPermanentLink(array(), (
string) $a_goto_additional);
245 $this->appendBody($this->getLanguageText($this->goto_caption) .
": " .
247 $this->appendBody(
"\n\n");
256 $this->appendBody($this->getLanguageText($this->reason));
257 $this->appendBody(
"\n\n");
263 $this->body = trim($this->body);
265 if (!$a_append_signature_direct) {
266 $this->getMail()->appendInstallationSignature(
true);
279 ?
string $a_goto_additional =
null,
280 string $a_permission =
"read"
282 if ($this->compose($a_user_id, $a_goto_additional, $a_permission)) {
283 $this->sendMail(array($a_user_id), is_numeric($a_user_id));
294 ?
string $a_goto_additional =
null,
295 string $a_permission =
"read",
296 bool $a_append_signature_direct =
false
298 if ($this->compose($a_user_id, $a_goto_additional, $a_permission, $a_append_signature_direct)) {
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
static _getInstallationSignature()
static _getAutoGeneratedMessageString(?ilLanguage $lang=null)
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)
__construct(protected bool $is_in_wsp=false)
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=null)
Default behaviour is:
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
if(!file_exists('../ilias.ini.php'))