4 include_once
'./Services/Mail/classes/class.ilMailNotification.php';
35 $this->subject_lang_id = (
string) $a_lang_id;
45 $this->introduction = (
string) $a_lang_id;
55 $this->introduction_direct = trim($a_text);
65 $this->task = (
string) $a_lang_id;
75 $this->reason = (
string) $a_lang_id;
85 $this->goto_caption = (
string) $a_lang_id;
95 $this->changed_by = (int) $a_id;
97 include_once
"Services/User/classes/class.ilUserUtil.php";
108 public function addAdditionalInfo($a_lang_id, $a_value, $a_multiline =
false, $a_lang_direct =
false)
110 $this->additional[$a_lang_id] =
array(trim($a_value), (
bool) $a_multiline, (
bool) $a_lang_direct);
121 public function sendMail(
array $a_user_ids, $a_goto_additional = null, $a_permission =
"read")
123 $this->all_ref_ids = null;
129 if (!$this->is_in_wsp) {
131 if (
sizeof($ref_ids) == 1) {
132 $this->ref_id = array_shift($ref_ids);
134 $this->all_ref_ids = $ref_ids;
137 } elseif ($this->is_in_wsp) {
138 $this->ref_id = $this->wsp_tree->lookupNodeId($this->
getObjId());
142 if (!$this->goto_caption) {
143 $this->goto_caption =
"url";
147 $recipient_ids =
array();
148 foreach (array_unique($a_user_ids) as $user_id) {
150 if ($this->changed_by == $user_id) {
154 $recipient_ids[] = $user_id;
158 return $recipient_ids;
170 public function compose($a_user_id, $a_goto_additional = null, $a_permission =
"read", $a_append_signature_direct =
false)
182 if ($this->introduction) {
187 if ($this->introduction_direct) {
188 $this->
appendBody($this->introduction_direct);
202 if (
sizeof($this->additional)) {
203 foreach ($this->additional as $lang_id => $item) {
206 $caption = (!$item[2])
214 $this->
appendBody($caption . $item[0] .
"\n");
226 $this->body = trim($this->body);
229 if ($this->changed_by) {
237 if (!$this->
getRefId() && $this->all_ref_ids) {
239 foreach ($this->all_ref_ids as
$ref_id) {
262 $this->ref_id = null;
274 $this->body = trim($this->body);
276 if (!$a_append_signature_direct) {
277 $this->
getMail()->appendInstallationSignature(
true);
295 if ($this->
compose($a_user_id, $a_goto_additional, $a_permission)) {
296 parent::sendMail(
array($a_user_id),
array(
'system'), is_numeric($a_user_id));
311 public function composeAndGetMessage($a_user_id, $a_goto_additional = null, $a_permission =
"read", $a_append_signature_direct =
false)
313 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.
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.
Create styles array
The data for the language used.
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)