ILIAS  release_8 Revision v8.24
ilIndividualAssessmentPrimitiveInternalNotificator 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 ilIndividualAssessmentPrimitiveInternalNotificator:
+ Collaboration diagram for ilIndividualAssessmentPrimitiveInternalNotificator:

Public Member Functions

 __construct ()
 
 withReceiver (ilIndividualAssessmentMember $member)
 Define the member, that should receive the message. More...
 
 withOccasionFailed ()
 Set message mode to failed. More...
 
 withOccasionCompleted ()
 Set message mode to complete. More...
 
 send ()
 Send message. 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 ()
 
 withReceiver (ilIndividualAssessmentMember $member)
 Define the member, that should receive the message. More...
 
 withOccasionFailed ()
 Set message mode to failed. More...
 
 withOccasionCompleted ()
 Set message mode to complete. More...
 
 send ()
 Send message. More...
 

Data Fields

const OCCASION_FAILED = 0
 
const OCCASION_COMPLETED = 1
 
- Data Fields inherited from ilMailNotification
const SUBJECT_TITLE_LENGTH = 60
 

Protected Attributes

int $occasion
 
ilIndividualAssessmentMember $receiver
 
- 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
 

Additional Inherited Members

- 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")
 

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 Notifies user, using internal mail system.

Definition at line 24 of file class.ilIndividualAssessmentPrimitiveInternalNotificator.php.

Constructor & Destructor Documentation

◆ __construct()

ilIndividualAssessmentPrimitiveInternalNotificator::__construct ( )

Definition at line 32 of file class.ilIndividualAssessmentPrimitiveInternalNotificator.php.

33 {
35 $this->setLangModules(array('iass'));
36 }
setLangModules(array $a_modules)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct(), and ilMailNotification\setLangModules().

+ Here is the call graph for this function:

Member Function Documentation

◆ send()

ilIndividualAssessmentPrimitiveInternalNotificator::send ( )

Send message.

Implements ilIndividualAssessmentNotificator.

Definition at line 73 of file class.ilIndividualAssessmentPrimitiveInternalNotificator.php.

73 : void
74 {
75 if (
76 !$this->receiver instanceof ilIndividualAssessmentMember ||
77 !in_array($this->occasion, array(self::OCCASION_COMPLETED, self::OCCASION_FAILED))
78 ) {
79 throw new ilIndividualAssessmentException('can\'t notify');
80 }
81 $this->initLanguage($this->receiver->id());
82 $this->initMail();
83 $subject = $this->occasion === self::OCCASION_COMPLETED
84 ? $this->getLanguageText('iass_subj_notification_completed')
85 : $this->getLanguageText('iass_subj_notification_failed');
86 $message = $this->occasion === self::OCCASION_COMPLETED
87 ? $this->getLanguageText('iass_mess_notification_completed')
88 : $this->getLanguageText('iass_mess_notification_failed');
89 $assessment_title = $this->receiver->assessment()->getTitle();
90 $this->setSubject(
91 sprintf($subject, $assessment_title)
92 );
93 $this->setBody(ilMail::getSalutation($this->receiver->id(), $this->getLanguage()));
94 $this->appendBody("\n\n");
95 $this->appendBody(sprintf($message, $assessment_title));
96 $this->appendBody("\n\n");
97 $this->appendBody($this->receiver->record());
98 $this->appendBody("\n\n");
99 $this->appendBody($this->createPermanentLink());
100 $this->getMail()->appendInstallationSignature(true);
101 $this->sendMail(array($this->receiver->id()));
102 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
sendMail(array $a_rcp, bool $a_parse_recipients=true)
createPermanentLink(array $a_params=[], string $a_append='')
getLanguageText(string $a_keyword)
setSubject(string $a_subject)
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
$message
Definition: xapiexit.php:32

References $message, and ilMail\getSalutation().

+ Here is the call graph for this function:

◆ withOccasionCompleted()

ilIndividualAssessmentPrimitiveInternalNotificator::withOccasionCompleted ( )

Set message mode to complete.

Implements ilIndividualAssessmentNotificator.

Definition at line 63 of file class.ilIndividualAssessmentPrimitiveInternalNotificator.php.

64 {
65 $clone = clone $this;
66 $clone->occasion = self::OCCASION_COMPLETED;
67 return $clone;
68 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ withOccasionFailed()

ilIndividualAssessmentPrimitiveInternalNotificator::withOccasionFailed ( )

◆ withReceiver()

ilIndividualAssessmentPrimitiveInternalNotificator::withReceiver ( ilIndividualAssessmentMember  $member)

Define the member, that should receive the message.

Implements ilIndividualAssessmentNotificator.

Definition at line 41 of file class.ilIndividualAssessmentPrimitiveInternalNotificator.php.

44 $clone = clone $this;
45 $clone->receiver = $member;
46 $clone->ref_id = $member->assessment()->getRefId();
47 return $clone;
48 }

Field Documentation

◆ $occasion

int ilIndividualAssessmentPrimitiveInternalNotificator::$occasion
protected

◆ $receiver

ilIndividualAssessmentMember ilIndividualAssessmentPrimitiveInternalNotificator::$receiver
protected

◆ OCCASION_COMPLETED

const ilIndividualAssessmentPrimitiveInternalNotificator::OCCASION_COMPLETED = 1

◆ OCCASION_FAILED

const ilIndividualAssessmentPrimitiveInternalNotificator::OCCASION_FAILED = 0

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