ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilIndividualAssessmentPrimitiveInternalNotificator Class Reference

Notifies user, using internal mail system. 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 (protected bool $is_in_wsp=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 ()
 

Data Fields

const OCCASION_FAILED = 0
 
const OCCASION_COMPLETED = 1
 
- Data Fields inherited from ilMailNotification
final 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 = []
 
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

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.

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

33  {
35  $this->setLangModules(array('iass'));
36  }
setLangModules(array $a_modules)
__construct(Container $dic, ilPlugin $plugin)
+ 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.

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

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  }
sendMail(array $a_rcp, bool $a_parse_recipients=true)
static getSalutation(int $a_usr_id, ?ilLanguage $a_language=null)
getLanguageText(string $a_keyword)
Edit the record of a user, set LP.
createPermanentLink(array $a_params=[], string $a_append='')
setSubject(string $a_subject)
$message
Definition: xapiexit.php:31
+ 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  }

◆ withOccasionFailed()

ilIndividualAssessmentPrimitiveInternalNotificator::withOccasionFailed ( )

Set message mode to failed.

Implements ilIndividualAssessmentNotificator.

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

54  {
55  $clone = clone $this;
56  $clone->occasion = self::OCCASION_FAILED;
57  return $clone;
58  }

◆ withReceiver()

ilIndividualAssessmentPrimitiveInternalNotificator::withReceiver ( ilIndividualAssessmentMember  $member)

Define the member, that should receive the message.

Implements ilIndividualAssessmentNotificator.

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

References ilIndividualAssessmentMember\assessment().

44  $clone = clone $this;
45  $clone->receiver = $member;
46  $clone->ref_id = $member->assessment()->getRefId();
47  return $clone;
48  }
+ Here is the call graph for this function:

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: