4 require_once
'Services/Mail/classes/class.ilMail.php';
17 public function getPDMailHTML($a_mail_id, $a_mobj_id)
19 global
$lng, $rbacsystem, $ilias;
21 $lng->loadLanguageModule(
'mail');
27 if(!$rbacsystem->checkAccess(
'internal_mail', $umail->getMailObjectReferenceId()))
29 $ilias->raiseError($lng->txt(
'permission_denied'), $ilias->error_obj->WARNING);
32 $umail->markRead(array($a_mail_id));
33 $mail_data = $umail->getMail($a_mail_id);
35 $tpl =
new ilTemplate(
'tpl.pd_mail.html',
true,
true,
'Services/Mail');
38 if($mail_data[
'attachments'])
40 foreach($mail_data[
'attachments'] as
$file)
42 $tpl->setCurrentBlock(
'a_row');
43 $tpl->setVariable(
'HREF_DOWNLOAD',
44 'ilias.php?baseClass=ilMailGUI&type=deliverFile&mail_id=' .
$_GET[
'mail_id'] .
45 '&filename=' . md5($file));
46 $tpl->setVariable(
'FILE_NAME', $file);
47 $tpl->setVariable(
'TXT_DOWNLOAD', $lng->txt(
'download'));
48 $tpl->parseCurrentBlock();
50 $tpl->setCurrentBlock(
'attachment');
51 $tpl->setVariable(
'TXT_ATTACHMENT', $lng->txt(
'attachments'));
52 $tpl->parseCurrentBlock();
55 $tpl->setVariable(
'TXT_FROM', $lng->txt(
'from'));
61 if($sender && $sender->getId() != ANONYMOUS_USER_ID)
63 $tpl->setCurrentBlock(
'pers_image');
64 $tpl->setVariable(
'IMG_SENDER', $sender->getPersonalPicturePath(
'xsmall'));
65 $tpl->setVariable(
'ALT_SENDER', $sender->getPublicName());
66 $tpl->parseCurrentBlock();
68 $tpl->setVariable(
'PUBLIC_NAME', $sender->getPublicName());
72 $tpl->setVariable(
'PUBLIC_NAME', $mail_data[
'import_name'] .
' (' . $lng->txt(
'user_deleted') .
')');
76 $tpl->setCurrentBlock(
'pers_image');
78 $tpl->setVariable(
'ALT_SENDER', ilMail::_getIliasMailerName());
79 $tpl->parseCurrentBlock();
80 $tpl->setVariable(
'PUBLIC_NAME', ilMail::_getIliasMailerName());
83 $tpl->setVariable(
'TXT_TO', $lng->txt(
'mail_to'));
84 $tpl->setVariable(
'TO', $umail->formatNamesForOutput($mail_data[
'rcp_to']));
86 if($mail_data[
'rcp_cc'])
88 $tpl->setCurrentBlock(
'cc');
89 $tpl->setVariable(
'TXT_CC', $lng->txt(
'cc'));
90 $tpl->setVariable(
'CC', $umail->formatNamesForOutput($mail_data[
'rcp_cc']));
91 $tpl->parseCurrentBlock();
94 $tpl->setVariable(
'TXT_SUBJECT', $lng->txt(
'subject'));
95 $tpl->setVariable(
'SUBJECT', htmlspecialchars($mail_data[
'm_subject']));
97 $tpl->setVariable(
'TXT_DATE', $lng->txt(
'date'));
100 $tpl->setVariable(
'TXT_MESSAGE', $lng->txt(
'message'));