ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilTestMailNotification Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilTestMailNotification:
+ Collaboration diagram for ilTestMailNotification:

Public Member Functions

 __construct ()
 
 sendSimpleNotification ($owner_id, $title, $usr_data)
 Send a simple notification to the owner of the test. More...
 
 sendAdvancedNotification ($owner_id, $title, $usr_data, $file_names)
 send an advanced notification to the owner of the test More...
 
- Public Member Functions inherited from ilMailNotification
 __construct (bool $a_is_personal_workspace=false)
 
 setType (int $a_type)
 
 getType ()
 
 setSender (int $a_usr_id)
 
 getSender ()
 
 setRecipients (array $a_rcp)
 
 getRecipients ()
 
 setAttachments (array $a_att)
 
 getAttachments ()
 
 setLangModules (array $a_modules)
 
 getUserLanguage (int $a_usr_id)
 
 setRefId (int $a_id)
 
 getRefId ()
 
 getObjId ()
 
 setObjId (int $a_obj_id)
 
 getObjType ()
 
 setAdditionalInformation (array $a_info)
 
 getAdditionalInformation ()
 
 sendMail (array $a_rcp, bool $a_parse_recipients=true)
 
 getBlockBorder ()
 

Additional Inherited Members

- Data Fields inherited from ilMailNotification
const SUBJECT_TITLE_LENGTH = 60
 
- Protected Member Functions inherited from ilMailNotification
 setSubject (string $a_subject)
 
 getSubject ()
 
 setBody (string $a_body)
 
 appendBody (string $a_body)
 
 getBody ()
 
 initLanguage (int $a_usr_id)
 
 initLanguageByIso2Code (string $a_code='')
 
 setLanguage (ilLanguage $a_language)
 
 getLanguage ()
 
 getLanguageText (string $a_keyword)
 
 getObjectTitle (bool $a_shorten=false)
 
 initMail ()
 
 getMail ()
 
 createPermanentLink (array $a_params=[], string $a_append='')
 
 userToString (int $a_usr_id)
 
 isRefIdAccessible (int $a_user_id, int $a_ref_id, string $a_permission="read")
 
- Protected Attributes inherited from ilMailNotification
int $type
 
int $sender
 
ilMail $mail = null
 
string $subject = ''
 
string $body = ''
 
array $attachments = []
 
ilLanguage $language
 
array $lang_modules = []
 
array $recipients = []
 
int $ref_id
 
int $obj_id = 0
 
string $obj_type = ''
 
array $additional_info = []
 
bool $is_in_wsp
 
ilWorkspaceTree $wsp_tree
 
ilWorkspaceAccessHandler $wsp_access_handler
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilTestMailNotification

Author
Nadia Ahmad nahma.nosp@m.d@da.nosp@m.tabay.nosp@m..de
Version
$Id:$

Definition at line 26 of file class.ilTestMailNotification.php.

Constructor & Destructor Documentation

◆ __construct()

ilTestMailNotification::__construct ( )

Definition at line 28 of file class.ilTestMailNotification.php.

References ILIAS\GlobalScreen\Provider\__construct().

29  {
31  }
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ sendAdvancedNotification()

ilTestMailNotification::sendAdvancedNotification (   $owner_id,
  $title,
  $usr_data,
  $file_names 
)

send an advanced notification to the owner of the test

Parameters
int$owner_id
string$title
string$usr_data
array$file_names

Definition at line 74 of file class.ilTestMailNotification.php.

References ilMailNotification\appendBody(), ilDatePresentation\formatDate(), ilMailNotification\getLanguage(), ilMailNotification\getMail(), ilMail\getSalutation(), IL_CAL_UNIX, ilMailNotification\initLanguage(), ilMailNotification\initMail(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ilMailNotification\sendMail(), ilMailNotification\setAttachments(), ilMailNotification\setBody(), ilMailNotification\setSubject(), and ilDatePresentation\setUseRelativeDates().

75  {
76  $this->initLanguage($owner_id);
77  $this->language->loadLanguageModule('assessment');
78 
79  $this->initMail();
80  $this->setSubject(sprintf($this->language->txt('tst_user_finished_test'), $title));
81  $this->setBody(ilMail::getSalutation($owner_id, $this->getLanguage()));
82  $this->appendBody("\n\n");
83  $this->appendBody($this->language->txt('user_has_finished_a_test'));
84  $this->appendBody("\n\n");
85 
86  $this->appendBody($this->language->txt('title') . ': ' . $title);
87  $this->appendBody("\n");
88  $this->appendBody($this->language->txt('tst_participant') . ': ' . $usr_data);
89  $this->appendBody("\n");
90 
92  $this->appendBody($this->language->txt('tst_finished') . ': ' . ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX)));
93  $this->appendBody("\n\n");
94 
95  $this->appendBody($this->language->txt('tst_attached_xls_file'));
96  $this->appendBody("\n\n");
97 
98  $this->appendBody($this->language->txt('tst_notification_explanation_admin'));
99  $this->appendBody("\n");
100 
101  $this->setAttachments($file_names);
102  $this->getMail()->appendInstallationSignature(true);
103 
104  $this->sendMail(array($owner_id));
105  }
sendMail(array $a_rcp, bool $a_parse_recipients=true)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const IL_CAL_UNIX
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
setSubject(string $a_subject)
static setUseRelativeDates(bool $a_status)
set use relative dates
+ Here is the call graph for this function:

◆ sendSimpleNotification()

ilTestMailNotification::sendSimpleNotification (   $owner_id,
  $title,
  $usr_data 
)

Send a simple notification to the owner of the test.

Parameters
int$owner_id
string$title
string$usr_data

Definition at line 40 of file class.ilTestMailNotification.php.

References ilMailNotification\appendBody(), ilDatePresentation\formatDate(), ilMailNotification\getLanguage(), ilMailNotification\getMail(), ilMail\getSalutation(), IL_CAL_UNIX, ilMailNotification\initLanguage(), ilMailNotification\initMail(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ilMailNotification\sendMail(), ilMailNotification\setBody(), ilMailNotification\setSubject(), and ilDatePresentation\setUseRelativeDates().

41  {
42  $this->initLanguage($owner_id);
43  $this->language->loadLanguageModule('assessment');
44  $this->initMail();
45  $this->setSubject(sprintf($this->language->txt('tst_user_finished_test'), $title));
46  $this->setBody(ilMail::getSalutation($owner_id, $this->getLanguage()));
47  $this->appendBody("\n\n");
48  $this->appendBody($this->language->txt('user_has_finished_a_test'));
49  $this->appendBody("\n\n");
50 
51  $this->appendBody($this->language->txt('title') . ': ' . $title);
52  $this->appendBody("\n");
53  $this->appendBody($this->language->txt('tst_participant') . ': ' . $usr_data);
54  $this->appendBody("\n");
55 
57  $this->appendBody($this->language->txt('tst_finished') . ': ' . ilDatePresentation::formatDate(new ilDateTime(time(), IL_CAL_UNIX)));
58  $this->appendBody("\n\n");
59 
60  $this->appendBody($this->language->txt('tst_notification_explanation_admin'));
61  $this->appendBody("\n");
62  $this->getMail()->appendInstallationSignature(true);
63 
64  $this->sendMail(array($owner_id));
65  }
sendMail(array $a_rcp, bool $a_parse_recipients=true)
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const IL_CAL_UNIX
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
setSubject(string $a_subject)
static setUseRelativeDates(bool $a_status)
set use relative dates
+ Here is the call graph for this function:

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