24 include_once(
"Services/Block/classes/class.ilBlockGUI.php");
45 #include_once "./include/inc.mail.php";
46 include_once
'./Services/User/classes/class.ilObjUser.php';
47 include_once
"Services/Mail/classes/class.ilMailbox.php";
48 include_once
"Services/Mail/classes/class.ilMail.php";
103 $next_class = $ilCtrl->getNextClass();
104 $cmd = $ilCtrl->getCmd(
"getHTML");
106 return $this->
$cmd();
111 global $ilUser, $rbacsystem;
113 $umail =
new ilMail($ilUser->getId());
114 if(!$rbacsystem->checkAccess(
'mail_visible', $umail->getMailObjectReferenceId()))
139 $mbox =
new ilMailBox(
$_SESSION[
"AccountId"]);
140 $inbox = $mbox->getInboxFolder();
143 $mail_data = $umail->getMailsOfFolder($inbox);
144 $mail_counter = $umail->getMailCounterData();
147 $this->mails = array();
148 foreach ($mail_data as $mail)
151 if($mail[
"m_status"] ==
'unread' &&
152 in_array(
'normal',$mail[
'm_type']))
154 $this->mails[] = $mail;
179 if (count($this->mails) == 0)
198 $this->tpl->setCurrentBlock(
"image");
199 $this->tpl->setVariable(
"IMG_SENDER",
$user->getPersonalPicturePath(
"xxsmall"));
200 $this->tpl->setVariable(
"ALT_SENDER",
$user->getLogin());
201 $this->tpl->parseCurrentBlock();
202 $this->tpl->setCurrentBlock(
"long");
203 if($mail[
'sender_id'] != ANONYMOUS_USER_ID)
207 if(!($fullname =
$user->getFullname()))
209 $fullname = $lng->txt(
"unknown");
211 $this->tpl->setVariable(
"NEW_MAIL_FROM", $fullname);
213 $this->tpl->setVariable(
"NEW_MAIL_FROM_LOGIN",
$user->getLogin());
220 $this->tpl->setVariable(
"TXT_FROM", $lng->txt(
"from"));
221 $this->tpl->parseCurrentBlock();
225 if($mail[
'sender_id'] != ANONYMOUS_USER_ID)
227 $this->tpl->setCurrentBlock(
'short');
228 $this->tpl->setVariable(
'NEW_MAIL_FROM_LOGIN',
$user->getLogin());
229 $this->tpl->parseCurrentBlock();
233 $this->tpl->setCurrentBlock(
'short');
235 $this->tpl->parseCurrentBlock();
239 $this->tpl->setVariable(
"NEW_MAIL_SUBJ", htmlentities($mail[
"m_subject"],ENT_NOQUOTES,
'UTF-8'));
240 $ilCtrl->setParameter($this,
"mobj_id", $inbox);
241 $ilCtrl->setParameter($this,
"mail_id", $mail[
"mail_id"]);
242 $ilCtrl->setParameter($this,
"mail_mode", $this->mail_mode);
243 $this->tpl->setVariable(
"NEW_MAIL_LINK_READ",
244 $ilCtrl->getLinkTarget($this,
"showMail"));
245 $ilCtrl->clearParameters($this);
255 return '<div class="small">'.((int) count($this->mails)).
" ".$lng->txt(
"mails_pl").
"</div>";
265 include_once(
"./Services/Mail/classes/class.ilPDMailGUI.php");
268 include_once(
"./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
270 $content_block->setContent($mail_gui->getPDMailHTML(
$_GET[
"mail_id"],
272 $content_block->setTitle($lng->txt(
"message"));
273 $content_block->setColSpan(2);
275 $content_block->addHeaderCommand($ilCtrl->getLinkTargetByClass(
"ilpersonaldesktopgui",
"show"),
276 $lng->txt(
"selected_items_back"));
278 if (
$_GET[
"mail_mode"] !=
"system")
280 $content_block->addBlockCommand(
"ilias.php?baseClass=ilMailGUI&mail_id=".
281 $_GET[
"mail_id"].
"&mobj_id".
$_GET[
"mobj_id"].
"&type=reply",
283 $content_block->addBlockCommand(
"ilias.php?baseClass=ilMailGUI&mail_id=".
284 $_GET[
"mail_id"].
"&mobj_id".$_GET[
"mobj_id"].
"&type=read",
287 $ilCtrl->setParameter($this,
'mail_id', (
int) $_GET[
'mail_id']);
288 $content_block->addBlockCommand($ilCtrl->getLinkTarget($this,
'deleteMail'), $lng->txt(
'delete'));
294 $ilCtrl->setParameter($this,
"mail_id",
$_GET[
"mail_id"]);
295 $ilCtrl->setParameter($this,
"mobj_id",
$_GET[
"mobj_id"]);
296 $content_block->addBlockCommand(
297 $ilCtrl->getLinkTarget($this,
"deleteMail"),
298 $lng->txt(
"delete"));
299 $ilCtrl->clearParameters($this);
302 return $content_block->getHTML();
312 $lng->loadLanguageModule(
'mail');
315 $mbox =
new ilMailBox(
$_SESSION[
'AccountId']);
318 if(!
$_GET[
'mobj_id'])
320 $_GET[
'mobj_id'] = $mbox->getInboxFolder();
323 if ($umail->moveMailsToFolder(array(
$_GET[
'mail_id']),
324 $mbox->getTrashFolder()))
332 $ilCtrl->redirectByClass(
'ilpersonaldesktopgui',
'show');