ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilExerciseMailNotification Class Reference
+ Inheritance diagram for ilExerciseMailNotification:
+ Collaboration diagram for ilExerciseMailNotification:

Public Member Functions

 __construct ()
 Constructor.
 setAssignmentId ($a_val)
 Set assignment id.
 getAssignmentId ()
 Get assignment id.
 send ()
 Send notifications.
- Public Member Functions inherited from ilMailNotification
 setType ($a_type)
 Set notification type.
 getType ()
 Get notification type.
 setSender ($a_usr_id)
 Set sender of mail.
 getSender ()
 get sender of mail
 setRecipients ($a_rcp)
 set mail recipients
 getRecipients ()
 get array of recipients
 setRefId ($a_id)
 Set ref id.
 getRefId ()
 get reference id
 getObjId ()
 get object id
 setObjId ($a_obj_id)
 set obj id
 getObjType ()
 Get object type.
 setAdditionalInformation ($a_info)
 Additional information for creating notification mails.
 getAdditionalInformation ()
 Get additional information for generating notification mails.
 sendMail ($a_rcp, $a_type, $a_parse_recipients=true)
 Send Mail.

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.
- Protected Member Functions inherited from ilMailNotification
 setSubject ($a_subject)
 Set mail subject.
 getSubject ()
 Get mail subject.
 setBody ($a_body)
 Set mail body.
 appendBody ($a_body)
 Append body text.
 getBody ()
 Get body.
 setLanguage ($a_language)
 A language.
 getLanguage ()
 get language object
 getLanguageText ($a_keyword)
 Replace new lines.
 getObjectTitle ($a_shorten=false)
 Get object title.
 initMail ()
 Init mail.
 getMail ()
 Get mail object.
 createPermanentLink ($a_params=array(), $a_append= '')
 Create a permanent link for an object.
 userToString ($a_usr_id)
 Utility function.

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

ilExerciseMailNotification::__construct ( )

Constructor.

Returns

Reimplemented from ilMailNotification.

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

Member Function Documentation

ilExerciseMailNotification::getAssignmentId ( )

Get assignment id.

Returns
int assignment id

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

Referenced by send().

{
return $this->ass_id;
}

+ Here is the caller graph for this function:

ilExerciseMailNotification::initLanguage (   $a_usr_id)
protected

Add language module exc.

Parameters
object$a_usr_id
Returns

Reimplemented from ilMailNotification.

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

References ilMailNotification\getLanguage().

Referenced by send().

{
$this->getLanguage()->loadLanguageModule('exc');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilExerciseMailNotification::send ( )

Send notifications.

Returns

Reimplemented from ilMailNotification.

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

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

{
global $ilUser;
include_once("./Modules/Exercise/classes/class.ilExAssignment.php");
switch($this->getType())
{
case self::TYPE_FEEDBACK_FILE_ADDED:
foreach($this->getRecipients() as $rcp)
{
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject(
sprintf($this->getLanguageText('exc_msg_new_feedback_file_uploaded'),
$this->getObjectTitle(true))
);
$this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody(
$this->getLanguageText('exc_msg_new_feedback_file_uploaded2'));
$this->appendBody("\n");
$this->appendBody(
$this->getLanguageText('obj_exc').": ".$this->getObjectTitle(true));
$this->appendBody("\n");
$this->appendBody(
$this->getLanguageText('exc_assignment').": ".
$this->appendBody("\n\n");
$this->appendBody($this->getLanguageText('exc_mail_permanent_link'));
$this->appendBody("\n");
$this->appendBody($this->createPermanentLink());
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp),array('system'));
}
break;
case self::TYPE_SUBMISSION_UPLOAD:
foreach($this->getRecipients() as $rcp)
{
$this->initLanguage($rcp);
$this->initMail();
$this->setSubject(
sprintf($this->getLanguageText('exc_submission_notification_subject'),
$this->getObjectTitle(true))
);
$this->setBody(ilMail::getSalutation($rcp,$this->getLanguage()));
$this->appendBody("\n\n");
$this->appendBody(
sprintf($this->getLanguageText('exc_submission_notification_body'), $this->getObjectTitle(true)));
$this->appendBody("\n");
$this->appendBody(
$this->getLanguageText('exc_assignment').": ".
$this->appendBody("\n");
$this->appendBody(
$this->getLanguageText('user').": ".
$ilUser->getFullName());
$this->appendBody("\n\n");
$this->appendBody(sprintf($this->getLanguageText('exc_submission_notification_link'),
$this->createPermanentLink()));
$this->getMail()->appendInstallationSignature(true);
$this->sendMail(array($rcp),array('system'));
}
break;
}
return true;
}

+ Here is the call graph for this function:

ilExerciseMailNotification::setAssignmentId (   $a_val)

Set assignment id.

Parameters
intassignment id

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

{
$this->ass_id = $a_val;
}

Field Documentation

const ilExerciseMailNotification::TYPE_FEEDBACK_FILE_ADDED = 20
const ilExerciseMailNotification::TYPE_SUBMISSION_UPLOAD = 30

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