ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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_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...
 

Protected Attributes

 $user
 
- 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

Constructor & Destructor Documentation

◆ __construct()

ilExerciseMailNotification::__construct ( )

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

24 {
25 global $DIC;
26
27 $this->user = $DIC->user();
29 }
user()
Definition: user.php:4
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ getAssignmentId()

ilExerciseMailNotification::getAssignmentId ( )

Get assignment id.

Returns
int assignment id

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

47 {
48 return $this->ass_id;
49 }

Referenced by send().

+ 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

Reimplemented from ilMailNotification.

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

208 {
209 parent::initLanguage($a_usr_id);
210 $this->getLanguage()->loadLanguageModule('exc');
211 }

References ilMailNotification\getLanguage().

Referenced by send().

+ 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 55 of file class.ilExerciseMailNotification.php.

56 {
58 // parent::send();
59
60 switch ($this->getType()) {
62
63 foreach ($this->getRecipients() as $rcp) {
64 $this->initLanguage($rcp);
65 $this->initMail();
66 $this->setSubject(
67 sprintf(
68 $this->getLanguageText('exc_msg_new_feedback_file_uploaded'),
69 $this->getObjectTitle(true)
70 )
71 );
72 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
73 $this->appendBody("\n\n");
74 $this->appendBody(
75 $this->getLanguageText('exc_msg_new_feedback_file_uploaded2')
76 );
77 $this->appendBody("\n");
78 $this->appendBody(
79 $this->getLanguageText('obj_exc') . ": " . $this->getObjectTitle(true)
80 );
81 $this->appendBody("\n");
82 $this->appendBody(
83 $this->getLanguageText('exc_assignment') . ": " .
85 );
86 $this->appendBody("\n\n");
87 $this->appendBody($this->getLanguageText('exc_mail_permanent_link'));
88 $this->appendBody("\n");
89 $this->appendBody($this->createPermanentLink(array(), '_' . $this->getAssignmentId()) .
90 '#fb' . $this->getAssignmentId());
91 $this->getMail()->appendInstallationSignature(true);
92
93 $this->sendMail(array($rcp));
94 }
95 break;
96
98
99 foreach ($this->getRecipients() as $rcp) {
100 $this->initLanguage($rcp);
101 $this->initMail();
102 $this->setSubject(
103 sprintf(
104 $this->getLanguageText('exc_submission_notification_subject'),
105 $this->getObjectTitle(true)
106 )
107 );
108 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
109 $this->appendBody("\n\n");
110 $this->appendBody(
111 sprintf($this->getLanguageText('exc_submission_notification_body'), $this->getObjectTitle(true))
112 );
113 $this->appendBody("\n");
114 $this->appendBody(
115 $this->getLanguageText('exc_assignment') . ": " .
117 );
118 $this->appendBody("\n");
119 $this->appendBody(
120 $this->getLanguageText('user') . ": " .
121 $ilUser->getFullName()
122 );
123 $this->appendBody("\n\n");
124 $this->appendBody(sprintf(
125 $this->getLanguageText('exc_submission_notification_link'),
126 $this->createPermanentLink()
127 ));
128
130 $this->appendBody("\n\n");
131
132 //new files uploaded
133 $assignment = new ilExAssignment($this->getAssignmentId());
134 $submission = new ilExSubmission($assignment, $ilUser->getId());
135
136 // since mails are sent immediately after upload the files should always be new
137 //if($submission->lookupNewFiles($submission->getTutor()))
138 //{
139 $this->appendBody(sprintf(
140 $this->getLanguageText('exc_submission_downloads_notification_link'),
141 $this->createPermanentLink(array(), "_" . $this->getAssignmentId() . "_" . $ilUser->getId() . "_setdownload")
142 ));
143 //}
144 //else
145 //{
146 // $this->appendBody(sprintf($this->getLanguageText('exc_submission_downloads_notification_link'),
147 // $this->getLanguageText("exc_submission_no_new_files")));
148 //}
149 }
150
151 $this->appendBody("\n\n");
152 $this->appendBody(sprintf(
153 $this->getLanguageText('exc_submission_and_grades_notification_link'),
154 $this->createPermanentLink(array(), "_" . $this->getAssignmentId() . "_grades")
155 ));
156
157 $this->getMail()->appendInstallationSignature(true);
158
159 $this->sendMail(array($rcp));
160 }
161 break;
162
164
165 foreach ($this->getRecipients() as $rcp) {
166 $this->initLanguage($rcp);
167 $this->initMail();
168 $this->setSubject(
169 sprintf(
170 $this->getLanguageText('exc_msg_new_feedback_text_uploaded'),
171 $this->getObjectTitle(true)
172 )
173 );
174 $this->setBody(ilMail::getSalutation($rcp, $this->getLanguage()));
175 $this->appendBody("\n\n");
176 $this->appendBody(
177 $this->getLanguageText('exc_msg_new_feedback_text_uploaded2')
178 );
179 $this->appendBody("\n");
180 $this->appendBody(
181 $this->getLanguageText('obj_exc') . ": " . $this->getObjectTitle(true)
182 );
183 $this->appendBody("\n");
184 $this->appendBody(
185 $this->getLanguageText('exc_assignment') . ": " .
187 );
188 $this->appendBody("\n\n");
189 $this->appendBody($this->getLanguageText('exc_mail_permanent_link'));
190 $this->appendBody("\n");
191 $this->appendBody($this->createPermanentLink(array(), '_' . $this->getAssignmentId()) .
192 '#fb' . $this->getAssignmentId());
193 $this->getMail()->appendInstallationSignature(true);
194
195 $this->sendMail(array($rcp));
196 }
197 break;
198 }
199 return true;
200 }
Exercise assignment.
static lookupTitle($a_id)
Lookup title.
static lookupType($a_id)
Lookup type.
Exercise submission //TODO: This class has to much static methods related to delivered "files".
initLanguage($a_usr_id)
Add language module exc.
appendBody($a_body)
Append body text.
getType()
Get notification type.
sendMail(array $a_rcp, $a_parse_recipients=true)
getRecipients()
get array of recipients
getObjectTitle($a_shorten=false)
createPermanentLink($a_params=array(), $a_append='')
static getSalutation($a_usr_id, ilLanguage $a_language=null)
$ilUser
Definition: imgupload.php:18

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

+ Here is the call graph for this function:

◆ setAssignmentId()

ilExerciseMailNotification::setAssignmentId (   $a_val)

Set assignment id.

Parameters
intassignment id

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

37 {
38 $this->ass_id = $a_val;
39 }

Field Documentation

◆ $user

ilExerciseMailNotification::$user
protected

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

Referenced by send().

◆ 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: