4 include_once
'./Services/Mail/classes/class.ilMailNotification.php';
36 $this->subject_lang_id = (string) $a_lang_id;
46 $this->subject_direct = trim($a_text);
56 $this->introduction = (string) $a_lang_id;
66 $this->introduction_direct = trim($a_text);
76 $this->task = (string) $a_lang_id;
86 $this->reason = (string) $a_lang_id;
96 $this->goto_caption = (string) $a_lang_id;
106 $this->changed_by = (int) $a_id;
108 include_once
"Services/User/classes/class.ilUserUtil.php";
119 public function addAdditionalInfo($a_lang_id, $a_value, $a_multiline =
false, $a_lang_direct =
false)
121 $this->additional[$a_lang_id] = array(trim($a_value), (
bool) $a_multiline, (
bool) $a_lang_direct);
132 public function sendMail(array $a_user_ids, $a_goto_additional = null, $a_permission =
"read")
134 $this->all_ref_ids = null;
140 if (!$this->is_in_wsp) {
142 if (
sizeof($ref_ids) == 1) {
143 $this->ref_id = array_shift($ref_ids);
145 $this->all_ref_ids = $ref_ids;
148 } elseif ($this->is_in_wsp) {
149 $this->ref_id = $this->wsp_tree->lookupNodeId($this->
getObjId());
153 if (!$this->goto_caption) {
154 $this->goto_caption =
"url";
158 $recipient_ids = array();
159 foreach (array_unique($a_user_ids) as $user_id) {
161 if ($this->changed_by == $user_id) {
165 $recipient_ids[] = $user_id;
169 return $recipient_ids;
181 public function compose($a_user_id, $a_goto_additional = null, $a_permission =
"read", $a_append_signature_direct =
false)
186 if ($this->subject_direct) {
197 if ($this->introduction) {
202 if ($this->introduction_direct) {
203 $this->
appendBody($this->introduction_direct);
217 if (is_array($this->additional)) {
218 foreach ($this->additional as $lang_id => $item) {
221 $caption = (!$item[2])
229 $this->
appendBody($caption . $item[0] .
"\n");
241 $this->body = trim($this->body);
244 if ($this->changed_by) {
252 if (!$this->
getRefId() && $this->all_ref_ids) {
254 foreach ($this->all_ref_ids as
$ref_id) {
277 $this->ref_id = null;
289 $this->body = trim($this->body);
291 if (!$a_append_signature_direct) {
292 $this->
getMail()->appendInstallationSignature(
true);
310 if ($this->
compose($a_user_id, $a_goto_additional, $a_permission)) {
311 parent::sendMail(array($a_user_id), array(
'system'), is_numeric($a_user_id));
326 public function composeAndGetMessage($a_user_id, $a_goto_additional = null, $a_permission =
"read", $a_append_signature_direct =
false)
328 if ($this->
compose($a_user_id, $a_goto_additional, $a_permission, $a_append_signature_direct)) {
sendMail(array $a_user_ids, $a_goto_additional=null, $a_permission="read")
Send notification(s)
getLanguageText($a_keyword)
initLanguage($a_usr_id)
Init language.
isRefIdAccessible($a_user_id, $a_ref_id, $a_permission="read")
Check if ref id is accessible for user.
static _getAllReferences($a_id)
get all reference ids of object
setChangedByUserId($a_id)
Set changed by user id.
Base class for course/group mail notifications.
composeAndSendMail($a_user_id, $a_goto_additional=null, $a_permission="read")
Send notification to single recipient.
setSubjectDirect($a_text)
Set subject text.
setIntroductionDirect($a_text)
Set introduction text.
setTaskLangId($a_lang_id)
Set task lang id.
getObjectTitle($a_shorten=false)
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
getObjType()
Get object type.
setIntroductionLangId($a_lang_id)
Set introduction lang id.
addAdditionalInfo($a_lang_id, $a_value, $a_multiline=false, $a_lang_direct=false)
Add additional information.
compose($a_user_id, $a_goto_additional=null, $a_permission="read", $a_append_signature_direct=false)
Compose notification to single recipient.
getBlockBorder()
Get (ascii) block border.
createPermanentLink($a_params=array(), $a_append='')
setSubjectLangId($a_lang_id)
Set subject lang id.
static _getAutoGeneratedMessageString(ilLanguage $lang=null)
Get auto generated info string.
appendBody($a_body)
Append body text.
composeAndGetMessage($a_user_id, $a_goto_additional=null, $a_permission="read", $a_append_signature_direct=false)
Compose notification to single recipient.
setReasonLangId($a_lang_id)
Set reason lang id.
Wrapper classes for system notifications.
setGotoLangId($a_lang_id)
Set goto lang id.
static _getInstallationSignature()
static getSalutation($a_usr_id, ilLanguage $a_language=null)