ILIAS  release_7 Revision v7.30-3-g800a261c036
ilIndividualAssessmentPrimitiveInternalNotificator Class Reference

Notificate user using internal mail system. More...

+ Inheritance diagram for ilIndividualAssessmentPrimitiveInternalNotificator:
+ Collaboration diagram for ilIndividualAssessmentPrimitiveInternalNotificator:

Public Member Functions

 __construct ()
 
 withReciever (ilIndividualAssessmentMember $member)
 Define the member, that should recieve the message.
Parameters
ilIndividualAssessmentMember$member
Returns
ilIndividualAssessmentNotificator $this
More...
 
 withOccasionFailed ()
 Set message mode to failed.
Returns
ilIndividualAssessmentNotificator $this
More...
 
 withOccasionCompleted ()
 Set message mode to completed.
Returns
ilIndividualAssessmentNotificator $this
More...
 
 send ()
 Send message. More...
 
- Public Member Functions inherited from ilMailNotification
 __construct ($a_is_personal_workspace=false)
 
 setType ($a_type)
 Set notification type. More...
 
 getType ()
 Get notification type. More...
 
 setSender ($a_usr_id)
 Set sender of mail. More...
 
 getSender ()
 get sender of mail More...
 
 setRecipients (array $a_rcp)
 
 getRecipients ()
 get array of recipients More...
 
 setAttachments ($a_att)
 Set attachments. More...
 
 getAttachments ()
 Get attachments. More...
 
 setLangModules (array $a_modules)
 Set lang modules. More...
 
 getUserLanguage ($a_usr_id)
 Get user language. More...
 
 setRefId ($a_id)
 
 getRefId ()
 
 getObjId ()
 
 setObjId ($a_obj_id)
 
 getObjType ()
 Get object type. More...
 
 setAdditionalInformation (array $a_info)
 Additional information for creating notification mails. More...
 
 getAdditionalInformation ()
 
 sendMail (array $a_rcp, $a_parse_recipients=true)
 
 getBlockBorder ()
 Get (ascii) block border. More...
 
 withReciever (ilIndividualAssessmentMember $member)
 Define the member, that should recieve the message. More...
 
 withOccasionFailed ()
 Set message mode to failed. More...
 
 withOccasionCompleted ()
 Set message mode to completed. 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

 $occasion
 
 $reciever
 
- Protected Attributes inherited from ilMailNotification
 $type = null
 
 $sender = null
 
 $mail = null
 
 $subject = ''
 
 $body = ''
 
 $attachments = array()
 
 $language = null
 
 $lang_modules = array()
 
 $recipients = array()
 
 $ref_id = null
 
 $obj_id = null
 
 $obj_type = null
 
 $additional_info = array()
 
 $is_in_wsp
 
 $wsp_tree
 
 $wsp_access_handler
 

Additional Inherited Members

- Protected Member Functions inherited from ilMailNotification
 setSubject ($a_subject)
 
 getSubject ()
 
 setBody ($a_body)
 
 appendBody ($a_body)
 Append body text. More...
 
 getBody ()
 
 initLanguage ($a_usr_id)
 Init language. More...
 
 initLanguageByIso2Code ($a_code='')
 Init language by ISO2 code. More...
 
 setLanguage ($a_language)
 
 getLanguage ()
 
 getLanguageText ($a_keyword)
 
 getObjectTitle ($a_shorten=false)
 
 initMail ()
 
 getMail ()
 
 createPermanentLink ($a_params=array(), $a_append='')
 
 userToString ($a_usr_id)
 
 isRefIdAccessible ($a_user_id, $a_ref_id, $a_permission="read")
 Check if ref id is accessible for user. More...
 

Detailed Description

Notificate user using internal mail system.

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

Constructor & Destructor Documentation

◆ __construct()

ilIndividualAssessmentPrimitiveInternalNotificator::__construct ( )

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

17 {
19 $this->setLangModules(array('iass'));
20 }
setLangModules(array $a_modules)
Set lang 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 56 of file class.ilIndividualAssessmentPrimitiveInternalNotificator.php.

57 {
58 if (!$this->reciever instanceof ilIndividualAssessmentMember || !in_array($this->occasion, array(self::OCCASION_COMPLETED,self::OCCASION_FAILED))) {
59 throw new ilIndividualAssessmentException('can\'t notify');
60 }
61 $this->initLanguage($this->reciever->id());
62 $this->initMail();
63 $subject = $this->occasion === self::OCCASION_COMPLETED
64 ? $this->getLanguageText('iass_subj_notification_completed')
65 : $this->getLanguageText('iass_subj_notification_failed');
66 $message = $this->occasion === self::OCCASION_COMPLETED
67 ? $this->getLanguageText('iass_mess_notification_completed')
68 : $this->getLanguageText('iass_mess_notification_failed');
69 $assessment_title = $this->reciever->assessment()->getTitle();
70 $this->setSubject(
71 sprintf($subject, $assessment_title)
72 );
73 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
74 $this->appendBody("\n\n");
75 $this->appendBody(sprintf($message, $assessment_title));
76 $this->appendBody("\n\n");
77 $this->appendBody($this->reciever->record());
78 $this->appendBody("\n\n");
79 $this->appendBody($this->createPermanentLink());
80 $this->getMail()->appendInstallationSignature(true);
81 $this->sendMail(array($this->reciever->id()));
82 }
Edit the record of a user, set LP.
appendBody($a_body)
Append body text.
sendMail(array $a_rcp, $a_parse_recipients=true)
initLanguage($a_usr_id)
Init language.
createPermanentLink($a_params=array(), $a_append='')
static getSalutation($a_usr_id, ilLanguage $a_language=null)
$message
Definition: xapiexit.php:14

References $message, ilMailNotification\$subject, ilMailNotification\appendBody(), ilMailNotification\createPermanentLink(), ilMailNotification\getLanguage(), ilMailNotification\getLanguageText(), ilMailNotification\getMail(), ilMail\getSalutation(), ilMailNotification\initLanguage(), ilMailNotification\initMail(), ilMailNotification\sendMail(), ilMailNotification\setBody(), and ilMailNotification\setSubject().

+ Here is the call graph for this function:

◆ withOccasionCompleted()

ilIndividualAssessmentPrimitiveInternalNotificator::withOccasionCompleted ( )

Set message mode to completed.

Returns
ilIndividualAssessmentNotificator $this

Implements ilIndividualAssessmentNotificator.

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

47 {
48 $clone = clone $this;
49 $clone->occasion = self::OCCASION_COMPLETED;
50 return $clone;
51 }

References OCCASION_COMPLETED.

◆ withOccasionFailed()

ilIndividualAssessmentPrimitiveInternalNotificator::withOccasionFailed ( )

Set message mode to failed.

Returns
ilIndividualAssessmentNotificator $this

Implements ilIndividualAssessmentNotificator.

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

37 {
38 $clone = clone $this;
39 $clone->occasion = self::OCCASION_FAILED;
40 return $clone;
41 }

References OCCASION_FAILED.

◆ withReciever()

ilIndividualAssessmentPrimitiveInternalNotificator::withReciever ( ilIndividualAssessmentMember  $member)

Define the member, that should recieve the message.

Parameters
ilIndividualAssessmentMember$member
Returns
ilIndividualAssessmentNotificator $this

Implements ilIndividualAssessmentNotificator.

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

26 {
27 $clone = clone $this;
28 $clone->reciever = $member;
29 $clone->ref_id = $member->assessment()->getRefId();
30 return $clone;
31 }

References ilIndividualAssessmentMember\assessment().

+ Here is the call graph for this function:

Field Documentation

◆ $occasion

ilIndividualAssessmentPrimitiveInternalNotificator::$occasion
protected

◆ $reciever

ilIndividualAssessmentPrimitiveInternalNotificator::$reciever
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: