ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\EmployeeTalk\Notification\Notification Class Reference
+ Collaboration diagram for ILIAS\EmployeeTalk\Notification\Notification:

Public Member Functions

 __construct (\ilObjUser $to, \ilObjUser $cc, int $talk_ref_id, string $talk_name, string $talk_description, string $talk_location, string $subject_key, string $message_key, string $attachment, bool $add_goto, string ... $dates,)
 
 send ()
 

Protected Member Functions

 getTalkGoto ()
 

Protected Attributes

ilObjUser $to
 
ilObjUser $cc
 
int $talk_ref_id
 
string $talk_name
 
string $talk_description
 
string $talk_location
 
string $subject_key
 
string $message_key
 
array $dates
 
bool $add_goto
 
string $attachment
 

Detailed Description

Definition at line 25 of file Notification.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\EmployeeTalk\Notification\Notification::__construct ( \ilObjUser  $to,
\ilObjUser  $cc,
int  $talk_ref_id,
string  $talk_name,
string  $talk_description,
string  $talk_location,
string  $subject_key,
string  $message_key,
string  $attachment,
bool  $add_goto,
string ...  $dates 
)

Definition at line 43 of file Notification.php.

55 {
56 $this->to = $to;
57 $this->cc = $cc;
58 $this->talk_ref_id = $talk_ref_id;
59 $this->talk_name = $talk_name;
60 $this->talk_description = $talk_description;
61 $this->talk_location = $talk_location;
62 $this->subject_key = $subject_key;
63 $this->message_key = $message_key;
64 $this->dates = $dates;
65 $this->add_goto = $add_goto;
66 $this->attachment = $attachment;
67 }
to(\GdImage $image, ?int $quality=null)
Currently this is the only way to make a FileStream from a GD image resource.

References ILIAS\EmployeeTalk\Notification\Notification\$add_goto, ILIAS\EmployeeTalk\Notification\Notification\$attachment, ILIAS\EmployeeTalk\Notification\Notification\$cc, ILIAS\EmployeeTalk\Notification\Notification\$dates, ILIAS\EmployeeTalk\Notification\Notification\$message_key, ILIAS\EmployeeTalk\Notification\Notification\$subject_key, ILIAS\EmployeeTalk\Notification\Notification\$talk_description, ILIAS\EmployeeTalk\Notification\Notification\$talk_location, ILIAS\EmployeeTalk\Notification\Notification\$talk_name, ILIAS\EmployeeTalk\Notification\Notification\$talk_ref_id, ILIAS\EmployeeTalk\Notification\Notification\$to, ILIAS\UI\examples\Symbol\Glyph\Attachment\attachment(), and ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\to().

+ Here is the call graph for this function:

Member Function Documentation

◆ getTalkGoto()

ILIAS\EmployeeTalk\Notification\Notification::getTalkGoto ( )
protected

Definition at line 138 of file Notification.php.

138 : string
139 {
140 return ILIAS_HTTP_PATH . '/goto.php?target=' . \ilObjEmployeeTalk::TYPE . '_' .
141 $this->talk_ref_id . '&client_id=' . CLIENT_ID;
142 }
const CLIENT_ID
Definition: constants.php:41

References CLIENT_ID, and ilObjEmployeeTalk\TYPE.

Referenced by ILIAS\EmployeeTalk\Notification\Notification\send().

+ Here is the caller graph for this function:

◆ send()

ILIAS\EmployeeTalk\Notification\Notification::send ( )

Definition at line 69 of file Notification.php.

69 : void
70 {
71 $notif = new \ilSystemNotification();
72 $notif->setLangModules(['etal', 'orgu']);
73 $attachment = new \ilFileDataMail(ANONYMOUS_USER_ID);
74
75 $subject = sprintf(
76 $notif->getUserLanguage($this->to->getId())->txt($this->subject_key),
77 $this->talk_name
78 );
79
80 $notif->setRefId($this->talk_ref_id);
81 $notif->setObjId(0);
82 $notif->setIntroductionLangId($this->message_key);
83
84 $notif->addAdditionalInfo(
85 'obj_etal',
86 $this->talk_name
87 );
88
89 if ($this->talk_description) {
90 $notif->addAdditionalInfo(
91 'description',
92 $this->talk_description
93 );
94 }
95
96 if ($this->talk_location) {
97 $notif->addAdditionalInfo(
98 'location',
99 $this->talk_location
100 );
101 }
102
103 $notif->addAdditionalInfo(
104 'superior',
105 $this->cc->getFullname()
106 );
107
108 $notif->addAdditionalInfo(
109 'notification_talks_date_list_header',
110 "- " . implode("\r\n- ", $this->dates),
111 true
112 );
113
114 if ($this->add_goto) {
115 $notif->addAdditionalInfo(
116 'url',
117 $this->getTalkGoto()
118 );
119 }
120
121 $attachment_name = 'appointments.ics';
122 $rcid = $attachment->createCollectionFromContent($attachment_name, $this->attachment);
123 $attachments = $rcid !== null
125 : MailAttachments::empty();
126
127 $mail = new \ilMail(ANONYMOUS_USER_ID);
128 $mail->enqueue(
129 $this->to->getLogin(),
130 $this->cc->getLogin(),
131 '',
132 $subject,
133 $notif->composeAndGetMessage($this->to->getId(), null, '', true),
134 $attachments
135 );
136 }
static fromIrss(ResourceCollectionIdentification $rcid)
const ANONYMOUS_USER_ID
Definition: constants.php:27

References ILIAS\EmployeeTalk\Notification\Notification\$attachment, ANONYMOUS_USER_ID, ILIAS\UI\examples\Symbol\Glyph\Attachment\attachment(), ILIAS\Mail\Attachments\MailAttachments\empty(), ILIAS\Mail\Attachments\MailAttachments\fromIrss(), ILIAS\EmployeeTalk\Notification\Notification\getTalkGoto(), and ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\to().

+ Here is the call graph for this function:

Field Documentation

◆ $add_goto

bool ILIAS\EmployeeTalk\Notification\Notification::$add_goto
protected

◆ $attachment

string ILIAS\EmployeeTalk\Notification\Notification::$attachment
protected

◆ $cc

ilObjUser ILIAS\EmployeeTalk\Notification\Notification::$cc
protected

◆ $dates

string[] ILIAS\EmployeeTalk\Notification\Notification::$dates
protected

◆ $message_key

string ILIAS\EmployeeTalk\Notification\Notification::$message_key
protected

◆ $subject_key

string ILIAS\EmployeeTalk\Notification\Notification::$subject_key
protected

◆ $talk_description

string ILIAS\EmployeeTalk\Notification\Notification::$talk_description
protected

◆ $talk_location

string ILIAS\EmployeeTalk\Notification\Notification::$talk_location
protected

◆ $talk_name

string ILIAS\EmployeeTalk\Notification\Notification::$talk_name
protected

◆ $talk_ref_id

int ILIAS\EmployeeTalk\Notification\Notification::$talk_ref_id
protected

◆ $to

ilObjUser ILIAS\EmployeeTalk\Notification\Notification::$to
protected

The documentation for this class was generated from the following file: