ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 23 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 41 of file Notification.php.

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().

53  {
54  $this->to = $to;
55  $this->cc = $cc;
56  $this->talk_ref_id = $talk_ref_id;
57  $this->talk_name = $talk_name;
58  $this->talk_description = $talk_description;
59  $this->talk_location = $talk_location;
60  $this->subject_key = $subject_key;
61  $this->message_key = $message_key;
62  $this->dates = $dates;
63  $this->add_goto = $add_goto;
64  $this->attachment = $attachment;
65  }
attachment()
description: > Example for rendring a attachment glyph.
Definition: attachment.php:41
to(\GdImage $image, ?int $quality=null)
Currently this is the only way to make a FileStream from a GD image resource.
+ 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.

References CLIENT_ID, and ilObjEmployeeTalk\TYPE.

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

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
+ Here is the caller graph for this function:

◆ send()

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

Definition at line 67 of file Notification.php.

References ILIAS\EmployeeTalk\Notification\Notification\$talk_name, ANONYMOUS_USER_ID, ILIAS\UI\examples\Symbol\Glyph\Attachment\attachment(), ILIAS\EmployeeTalk\Notification\Notification\getTalkGoto(), null, and ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\to().

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

67  : void
68  {
69  $notif = new \ilSystemNotification();
70  $notif->setLangModules(['etal', 'orgu']);
71  $attachment = new \ilFileDataMail(ANONYMOUS_USER_ID);
72 
73  $subject = sprintf(
74  $notif->getUserLanguage($this->to->getId())->txt($this->subject_key),
76  );
77 
78  $notif->setRefId($this->talk_ref_id);
79  $notif->setObjId(0);
80  $notif->setIntroductionLangId($this->message_key);
81 
82  $notif->addAdditionalInfo(
83  'obj_etal',
84  $this->talk_name
85  );
86 
87  if ($this->talk_description) {
88  $notif->addAdditionalInfo(
89  'description',
90  $this->talk_description
91  );
92  }
93 
94  if ($this->talk_location) {
95  $notif->addAdditionalInfo(
96  'location',
97  $this->talk_location
98  );
99  }
100 
101  $notif->addAdditionalInfo(
102  'superior',
103  $this->cc->getFullname()
104  );
105 
106  $notif->addAdditionalInfo(
107  'notification_talks_date_list_header',
108  "- " . implode("\r\n- ", $this->dates),
109  true
110  );
111 
112  if ($this->add_goto) {
113  $notif->addAdditionalInfo(
114  'url',
115  $this->getTalkGoto()
116  );
117  }
118 
119  $attachment_name = 'appointments.ics';
120  $attachment->storeAsAttachment(
121  $attachment_name,
122  $this->attachment
123  );
124 
125  $mail = new \ilMail(ANONYMOUS_USER_ID);
126  $mail->enqueue(
127  $this->to->getLogin(),
128  $this->cc->getLogin(),
129  '',
130  $subject,
131  $notif->composeAndGetMessage($this->to->getId(), null, '', true),
132  [$attachment_name]
133  );
134 
135  $attachment->unlinkFile($attachment_name);
136  }
attachment()
description: > Example for rendring a attachment glyph.
Definition: attachment.php:41
const ANONYMOUS_USER_ID
Definition: constants.php:27
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
to(\GdImage $image, ?int $quality=null)
Currently this is the only way to make a FileStream from a GD image resource.
+ Here is the call graph for this function:
+ Here is the caller 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

array 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: