ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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)
 Constructor. More...
 
 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 ($a_rcp)
 set mail recipients More...
 
 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)
 Set ref id. More...
 
 getRefId ()
 get reference id More...
 
 getObjId ()
 get object id More...
 
 setObjId ($a_obj_id)
 set obj id More...
 
 getObjType ()
 Get object type. More...
 
 setAdditionalInformation ($a_info)
 Additional information for creating notification mails. More...
 
 getAdditionalInformation ()
 Get additional information for generating notification mails. More...
 
 sendMail ($a_rcp, $a_type, $a_parse_recipients=true)
 Send Mail. More...
 
 getBlockBorder ()
 Get (ascii) block border. More...
 

Data Fields

const TYPE_FEEDBACK_FILE_ADDED = 20
 
const TYPE_SUBMISSION_UPLOAD = 30
 
- 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)
 Set mail subject. More...
 
 getSubject ()
 Get mail subject. More...
 
 setBody ($a_body)
 Set mail body. More...
 
 appendBody ($a_body)
 Append body text. More...
 
 getBody ()
 Get body. More...
 
 initLanguage ($a_usr_id)
 Init language. More...
 
 initLanguageByIso2Code ($a_code='')
 Init language by ISO2 code. More...
 
 setLanguage ($a_language)
 A language. More...
 
 getLanguage ()
 get language object More...
 
 getLanguageText ($a_keyword)
 Replace new lines. More...
 
 getObjectTitle ($a_shorten=false)
 Get object title. More...
 
 initMail ()
 Init mail. More...
 
 getMail ()
 Get mail object. More...
 
 createPermanentLink ($a_params=array(), $a_append='')
 Create a permanent link for an object. More...
 
 userToString ($a_usr_id)
 Utility function. More...
 
 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 20 of file class.ilExerciseMailNotification.php.

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

Member Function Documentation

◆ getAssignmentId()

ilExerciseMailNotification::getAssignmentId ( )

Get assignment id.

Returns
int assignment id

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

Referenced by send().

41  {
42  return $this->ass_id;
43  }
+ 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 130 of file class.ilExerciseMailNotification.php.

References ilMailNotification\getLanguage().

Referenced by send().

131  {
132  parent::initLanguage($a_usr_id);
133  $this->getLanguage()->loadLanguageModule('exc');
134  }
getLanguage()
get language object
+ 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 49 of file class.ilExerciseMailNotification.php.

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

50  {
51  global $ilUser;
52 
53  // parent::send();
54 
55  include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
56 
57  switch($this->getType())
58  {
59  case self::TYPE_FEEDBACK_FILE_ADDED:
60 
61  foreach($this->getRecipients() as $rcp)
62  {
63  $this->initLanguage($rcp);
64  $this->initMail();
65  $this->setSubject(
66  sprintf($this->getLanguageText('exc_msg_new_feedback_file_uploaded'),
67  $this->getObjectTitle(true))
68  );
69  $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
70  $this->appendBody("\n\n");
71  $this->appendBody(
72  $this->getLanguageText('exc_msg_new_feedback_file_uploaded2'));
73  $this->appendBody("\n");
74  $this->appendBody(
75  $this->getLanguageText('obj_exc').": ".$this->getObjectTitle(true));
76  $this->appendBody("\n");
77  $this->appendBody(
78  $this->getLanguageText('exc_assignment').": ".
80  $this->appendBody("\n\n");
81  $this->appendBody($this->getLanguageText('exc_mail_permanent_link'));
82  $this->appendBody("\n");
83  $this->appendBody($this->createPermanentLink(array(), '_'.$this->getAssignmentId()).
84  '#fb'.$this->getAssignmentId());
85  $this->getMail()->appendInstallationSignature(true);
86 
87  $this->sendMail(array($rcp),array('system'));
88  }
89  break;
90 
91  case self::TYPE_SUBMISSION_UPLOAD:
92 
93  foreach($this->getRecipients() as $rcp)
94  {
95  $this->initLanguage($rcp);
96  $this->initMail();
97  $this->setSubject(
98  sprintf($this->getLanguageText('exc_submission_notification_subject'),
99  $this->getObjectTitle(true))
100  );
101  $this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
102  $this->appendBody("\n\n");
103  $this->appendBody(
104  sprintf($this->getLanguageText('exc_submission_notification_body'), $this->getObjectTitle(true)));
105  $this->appendBody("\n");
106  $this->appendBody(
107  $this->getLanguageText('exc_assignment').": ".
109  $this->appendBody("\n");
110  $this->appendBody(
111  $this->getLanguageText('user').": ".
112  $ilUser->getFullName());
113  $this->appendBody("\n\n");
114  $this->appendBody(sprintf($this->getLanguageText('exc_submission_notification_link'),
115  $this->createPermanentLink()));
116  $this->getMail()->appendInstallationSignature(true);
117 
118  $this->sendMail(array($rcp),array('system'));
119  }
120  break;
121  }
122  return true;
123  }
getLanguage()
get language object
getType()
Get notification type.
setBody($a_body)
Set mail body.
sendMail($a_rcp, $a_type, $a_parse_recipients=true)
Send Mail.
getLanguageText($a_keyword)
Replace new lines.
setSubject($a_subject)
Set mail subject.
getObjectTitle($a_shorten=false)
Get object title.
static getSalutation($a_usr_id, $a_language=null)
Get salutation.
initLanguage($a_usr_id)
Add language module exc.
getRecipients()
get array of recipients
createPermanentLink($a_params=array(), $a_append='')
Create a permanent link for an object.
global $ilUser
Definition: imgupload.php:15
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 30 of file class.ilExerciseMailNotification.php.

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

Field Documentation

◆ TYPE_FEEDBACK_FILE_ADDED

const ilExerciseMailNotification::TYPE_FEEDBACK_FILE_ADDED = 20

◆ TYPE_SUBMISSION_UPLOAD

const ilExerciseMailNotification::TYPE_SUBMISSION_UPLOAD = 30

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