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";
109 $this->additional[$a_lang_id] = array(trim($a_value), (
bool)$a_multiline);
120 public function sendMail(array $a_user_ids, $a_goto_additional = null, $a_permission =
"read")
122 $this->all_ref_ids = null;
130 if(!$this->is_in_wsp)
133 if(
sizeof($ref_ids) == 1)
135 $this->ref_id = array_shift($ref_ids);
139 $this->all_ref_ids = $ref_ids;
143 else if($this->is_in_wsp)
145 $this->ref_id = $this->wsp_tree->lookupNodeId($this->
getObjId());
149 if(!$this->goto_caption)
151 $this->goto_caption =
"url";
155 $recipient_ids = array();
156 foreach(array_unique($a_user_ids) as $user_id)
159 if($this->changed_by == $user_id)
166 $recipient_ids[] = $user_id;
170 return $recipient_ids;
182 public function compose($a_user_id, $a_goto_additional = null, $a_permission =
"read", $a_append_signature_direct =
false)
194 if($this->introduction)
200 if($this->introduction_direct)
202 $this->
appendBody($this->introduction_direct);
218 if(
sizeof($this->additional))
220 foreach($this->additional as $lang_id => $item)
236 $this->body = trim($this->body);
239 if($this->changed_by)
249 if(!$this->
getRefId() && $this->all_ref_ids)
252 foreach($this->all_ref_ids as
$ref_id)
280 $this->ref_id = null;
293 $this->body = trim($this->body);
295 if(!$a_append_signature_direct)
297 $this->
getMail()->appendInstallationSignature(
true);
317 if($this->
compose($a_user_id, $a_goto_additional, $a_permission))
319 parent::sendMail(array($a_user_id), array(
'system'), is_numeric($a_user_id));
334 public function composeAndGetMessage($a_user_id, $a_goto_additional = null, $a_permission =
"read", $a_append_signature_direct =
false)
336 if($this->
compose($a_user_id, $a_goto_additional, $a_permission, $a_append_signature_direct))