24 #require_once "./include/inc.mail.php";
25 require_once
'./Services/User/classes/class.ilObjUser.php';
26 require_once
"Services/Mail/classes/class.ilMail.php";
43 global
$lng, $rbacsystem, $ilias;
45 $lng->loadLanguageModule(
"mail");
51 if (!$rbacsystem->checkAccess(
"mail_visible",$umail->getMailObjectReferenceId()))
53 $ilias->raiseError($lng->txt(
"permission_denied"),$ilias->error_obj->WARNING);
56 $umail->markRead(array($a_mail_id));
57 $mail_data = $umail->getMail($a_mail_id);
62 $tpl =
new ilTemplate(
"tpl.pd_mail.html",
true,
true,
"Services/Mail");
65 if($mail_data[
"attachments"])
67 foreach($mail_data[
"attachments"] as
$file)
69 $tpl->setCurrentBlock(
"a_row");
70 $tpl->setVariable(
"HREF_DOWNLOAD",
71 "ilias.php?baseClass=ilMailGUI&type=deliverFile&mail_id=".
$_GET[
"mail_id"].
72 "&filename=".md5($file));
73 $tpl->setVariable(
"FILE_NAME", $file);
74 $tpl->setVariable(
"TXT_DOWNLOAD", $lng->txt(
"download"));
75 $tpl->parseCurrentBlock();
77 $tpl->setCurrentBlock(
"attachment");
78 $tpl->setVariable(
"TXT_ATTACHMENT", $lng->txt(
"attachments"));
79 $tpl->parseCurrentBlock();
83 $tpl->setVariable(
"TXT_FROM", $lng->txt(
"from"));
84 $tmp_user =
new ilObjUser($mail_data[
"sender_id"]);
85 if($mail_data[
'sender_id'] != ANONYMOUS_USER_ID)
88 $tpl->setCurrentBlock(
"pers_image");
89 $tpl->setVariable(
"IMG_SENDER", $tmp_user->getPersonalPicturePath(
"xsmall"));
90 $tpl->setVariable(
"ALT_SENDER", $tmp_user->getFullname());
91 $tpl->parseCurrentBlock();
94 $tpl->setVariable(
"FROM", $tmp_user->getFullname());
97 if(!($login = $tmp_user->getLogin()))
99 $login = $mail_data[
"import_name"].
" (".$lng->txt(
"user_deleted").
")";
101 $tpl->setVariable(
"MAIL_LOGIN",$login);
106 $tpl->setCurrentBlock(
'pers_image');
107 $tpl->setVariable(
'IMG_SENDER', $tmp_user->getPersonalPicturePath(
'xsmall'));
108 $tpl->setVariable(
'ALT_SENDER', ilMail::_getIliasMailerName());
109 $tpl->parseCurrentBlock();
111 $tpl->setVariable(
'MAIL_LOGIN', ilMail::_getIliasMailerName());
116 $tpl->setVariable(
"TXT_TO", $lng->txt(
"mail_to"));
117 $tpl->setVariable(
"TO", $umail->formatNamesForOutput($mail_data[
'rcp_to']));
120 if($mail_data[
"rcp_cc"])
122 $tpl->setCurrentBlock(
"cc");
123 $tpl->setVariable(
"TXT_CC",$lng->txt(
"cc"));
124 $tpl->setVariable(
"CC", $umail->formatNamesForOutput($mail_data[
'rcp_cc']));
125 $tpl->parseCurrentBlock();
128 $tpl->setVariable(
"TXT_SUBJECT",$lng->txt(
"subject"));
129 $tpl->setVariable(
"SUBJECT",htmlspecialchars($mail_data[
"m_subject"]));
132 $tpl->setVariable(
"TXT_DATE", $lng->txt(
"date"));
156 $tpl->setVariable(
"TXT_MESSAGE", $lng->txt(
"message"));