ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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_type, $a_parse_recipients=true)
 
 getBlockBorder ()
 Get (ascii) block border. 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 15 of file class.ilIndividualAssessmentPrimitiveInternalNotificator.php.

References array, and ilMailNotification\setLangModules().

15  {
16  parent::__construct();
17  $this->setLangModules(array('iass'));
18  }
setLangModules(array $a_modules)
Set lang modules.
Create styles array
The data for the language used.
+ Here is the call graph for this function:

Member Function Documentation

◆ send()

ilIndividualAssessmentPrimitiveInternalNotificator::send ( )

Send message.

Implements ilIndividualAssessmentNotificator.

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

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

51  {
52  if(! $this->reciever instanceof ilIndividualAssessmentMember || !in_array($this->occasion, array(self::OCCASION_COMPLETED,self::OCCASION_FAILED))) {
53  throw new ilIndividualAssessmentException('can\'t notify');
54  }
55  $this->initLanguage($this->reciever->id());
56  $this->initMail();
57  $subject = $this->occasion === self::OCCASION_COMPLETED
58  ? $this->getLanguageText('iass_subj_notification_completed')
59  : $this->getLanguageText('iass_subj_notification_failed');
60  $message = $this->occasion === self::OCCASION_COMPLETED
61  ? $this->getLanguageText('iass_mess_notification_completed')
62  : $this->getLanguageText('iass_mess_notification_failed');
63  $assessment_title = $this->reciever->assessment()->getTitle();
64  $this->setSubject(
65  sprintf($subject, $assessment_title)
66  );
67  $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
68  $this->appendBody("\n\n");
69  $this->appendBody(sprintf($message, $assessment_title));
70  $this->appendBody("\n\n");
71  $this->appendBody($this->reciever->record());
72  $this->appendBody("\n\n");
73  $this->appendBody($this->createPermanentLink());
74  $this->getMail()->appendInstallationSignature(true);
75  $this->sendMail(array($this->reciever->id()),array('system'));
76  }
initLanguage($a_usr_id)
Init language.
Create styles array
The data for the language used.
sendMail(array $a_rcp, $a_type, $a_parse_recipients=true)
Edit the record of a user, set LP.
createPermanentLink($a_params=array(), $a_append='')
appendBody($a_body)
Append body text.
+ Here is the call graph for this function:

◆ withOccasionCompleted()

ilIndividualAssessmentPrimitiveInternalNotificator::withOccasionCompleted ( )

Set message mode to completed.

Returns
ilIndividualAssessmentNotificator $this

Implements ilIndividualAssessmentNotificator.

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

42  {
43  $clone = clone $this;
44  $clone->occasion = self::OCCASION_COMPLETED;
45  return $clone;
46  }

◆ withOccasionFailed()

ilIndividualAssessmentPrimitiveInternalNotificator::withOccasionFailed ( )

Set message mode to failed.

Returns
ilIndividualAssessmentNotificator $this

Implements ilIndividualAssessmentNotificator.

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

33  {
34  $clone = clone $this;
35  $clone->occasion = self::OCCASION_FAILED;
36  return $clone;
37  }

◆ withReciever()

ilIndividualAssessmentPrimitiveInternalNotificator::withReciever ( ilIndividualAssessmentMember  $member)

Define the member, that should recieve the message.

Parameters
ilIndividualAssessmentMember$member
Returns
ilIndividualAssessmentNotificator $this

Implements ilIndividualAssessmentNotificator.

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

References ilIndividualAssessmentMember\assessment().

23  {
24  $clone = clone $this;
25  $clone->reciever = $member;
26  $clone->ref_id = $member->assessment()->getRefId();
27  return $clone;
28  }
assessment()
Get the ilObjIndividualAssessment corresponding to this membership.
+ 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: