ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilExerciseMailNotification Class Reference
+ Inheritance diagram for ilExerciseMailNotification:
+ Collaboration diagram for ilExerciseMailNotification:

Public Member Functions

 __construct ()
 
 setAssignmentId ($a_val)
 Set assignment id. More...
 
 getAssignmentId ()
 Get assignment id. More...
 
 send ()
 Send notifications. 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 TYPE_FEEDBACK_FILE_ADDED = 20
 
const TYPE_SUBMISSION_UPLOAD = 30
 
const TYPE_FEEDBACK_TEXT_ADDED = 40
 
- Data Fields inherited from ilMailNotification
const SUBJECT_TITLE_LENGTH = 60
 

Protected Member Functions

 initLanguage ($a_usr_id)
 Add language module exc. More...
 
- 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...
 

Additional Inherited Members

- 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
 

Detailed Description

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilExerciseMailNotification.php.

Constructor & Destructor Documentation

◆ __construct()

ilExerciseMailNotification::__construct ( )

Definition at line 21 of file class.ilExerciseMailNotification.php.

22  {
23  parent::__construct();
24  }

Member Function Documentation

◆ getAssignmentId()

ilExerciseMailNotification::getAssignmentId ( )

Get assignment id.

Returns
int assignment id

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

Referenced by send().

42  {
43  return $this->ass_id;
44  }
+ Here is the caller graph for this function:

◆ initLanguage()

ilExerciseMailNotification::initLanguage (   $a_usr_id)
protected

Add language module exc.

Parameters
object$a_usr_id
Returns

Definition at line 163 of file class.ilExerciseMailNotification.php.

References ilMailNotification\getLanguage().

Referenced by send().

164  {
165  parent::initLanguage($a_usr_id);
166  $this->getLanguage()->loadLanguageModule('exc');
167  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send()

ilExerciseMailNotification::send ( )

Send notifications.

Returns

Definition at line 50 of file class.ilExerciseMailNotification.php.

References $ilUser, ilMailNotification\appendBody(), array, ilMailNotification\createPermanentLink(), getAssignmentId(), ilMailNotification\getLanguage(), ilMailNotification\getLanguageText(), ilMailNotification\getMail(), ilMailNotification\getObjectTitle(), ilMailNotification\getRecipients(), ilMailNotification\getType(), initLanguage(), ilMailNotification\initMail(), ilExAssignment\lookupTitle(), ilMailNotification\sendMail(), ilMailNotification\setBody(), and ilMailNotification\setSubject().

51  {
52  global $ilUser;
53 
54  // parent::send();
55 
56  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
57 
58  switch($this->getType())
59  {
60  case self::TYPE_FEEDBACK_FILE_ADDED:
61 
62  foreach($this->getRecipients() as $rcp)
63  {
64  $this->initLanguage($rcp);
65  $this->initMail();
66  $this->setSubject(
67  sprintf($this->getLanguageText('exc_msg_new_feedback_file_uploaded'),
68  $this->getObjectTitle(true))
69  );
70  $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
71  $this->appendBody("\n\n");
72  $this->appendBody(
73  $this->getLanguageText('exc_msg_new_feedback_file_uploaded2'));
74  $this->appendBody("\n");
75  $this->appendBody(
76  $this->getLanguageText('obj_exc').": ".$this->getObjectTitle(true));
77  $this->appendBody("\n");
78  $this->appendBody(
79  $this->getLanguageText('exc_assignment').": ".
81  $this->appendBody("\n\n");
82  $this->appendBody($this->getLanguageText('exc_mail_permanent_link'));
83  $this->appendBody("\n");
84  $this->appendBody($this->createPermanentLink(array(), '_'.$this->getAssignmentId()).
85  '#fb'.$this->getAssignmentId());
86  $this->getMail()->appendInstallationSignature(true);
87 
88  $this->sendMail(array($rcp),array('system'));
89  }
90  break;
91 
92  case self::TYPE_SUBMISSION_UPLOAD:
93 
94  foreach($this->getRecipients() as $rcp)
95  {
96  $this->initLanguage($rcp);
97  $this->initMail();
98  $this->setSubject(
99  sprintf($this->getLanguageText('exc_submission_notification_subject'),
100  $this->getObjectTitle(true))
101  );
102  $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
103  $this->appendBody("\n\n");
104  $this->appendBody(
105  sprintf($this->getLanguageText('exc_submission_notification_body'), $this->getObjectTitle(true)));
106  $this->appendBody("\n");
107  $this->appendBody(
108  $this->getLanguageText('exc_assignment').": ".
110  $this->appendBody("\n");
111  $this->appendBody(
112  $this->getLanguageText('user').": ".
113  $ilUser->getFullName());
114  $this->appendBody("\n\n");
115  $this->appendBody(sprintf($this->getLanguageText('exc_submission_notification_link'),
116  $this->createPermanentLink()));
117  $this->getMail()->appendInstallationSignature(true);
118 
119  $this->sendMail(array($rcp),array('system'));
120  }
121  break;
122 
123  case self::TYPE_FEEDBACK_TEXT_ADDED:
124 
125  foreach($this->getRecipients() as $rcp)
126  {
127  $this->initLanguage($rcp);
128  $this->initMail();
129  $this->setSubject(
130  sprintf($this->getLanguageText('exc_msg_new_feedback_text_uploaded'),
131  $this->getObjectTitle(true))
132  );
133  $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
134  $this->appendBody("\n\n");
135  $this->appendBody(
136  $this->getLanguageText('exc_msg_new_feedback_text_uploaded2'));
137  $this->appendBody("\n");
138  $this->appendBody(
139  $this->getLanguageText('obj_exc').": ".$this->getObjectTitle(true));
140  $this->appendBody("\n");
141  $this->appendBody(
142  $this->getLanguageText('exc_assignment').": ".
144  $this->appendBody("\n\n");
145  $this->appendBody($this->getLanguageText('exc_mail_permanent_link'));
146  $this->appendBody("\n");
147  $this->appendBody($this->createPermanentLink(array(), '_'.$this->getAssignmentId()).
148  '#fb'.$this->getAssignmentId());
149  $this->getMail()->appendInstallationSignature(true);
150 
151  $this->sendMail(array($rcp),array('system'));
152  }
153  break;
154  }
155  return true;
156  }
getType()
Get notification type.
getObjectTitle($a_shorten=false)
$ilUser
Definition: imgupload.php:18
initLanguage($a_usr_id)
Add language module exc.
Create styles array
The data for the language used.
sendMail(array $a_rcp, $a_type, $a_parse_recipients=true)
getRecipients()
get array of recipients
createPermanentLink($a_params=array(), $a_append='')
appendBody($a_body)
Append body text.
static lookupTitle($a_id)
Lookup title.
+ Here is the call graph for this function:

◆ setAssignmentId()

ilExerciseMailNotification::setAssignmentId (   $a_val)

Set assignment id.

Parameters
intassignment id

Definition at line 31 of file class.ilExerciseMailNotification.php.

32  {
33  $this->ass_id = $a_val;
34  }

Field Documentation

◆ TYPE_FEEDBACK_FILE_ADDED

const ilExerciseMailNotification::TYPE_FEEDBACK_FILE_ADDED = 20

◆ TYPE_FEEDBACK_TEXT_ADDED

const ilExerciseMailNotification::TYPE_FEEDBACK_TEXT_ADDED = 40

◆ TYPE_SUBMISSION_UPLOAD

const ilExerciseMailNotification::TYPE_SUBMISSION_UPLOAD = 30

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