4 include_once
'Services/Block/classes/class.ilBlockGUI.php';
5 include_once
'Services/Mail/classes/class.ilMailUserCache.php';
24 include_once
'Services/User/classes/class.ilObjUser.php';
25 include_once
'Services/Mail/classes/class.ilMailbox.php';
26 include_once
'Services/Mail/classes/class.ilMail.php';
78 $cmd = $ilCtrl->getCmd(
'getHTML');
87 $umail =
new ilMail($ilUser->getId());
88 if(!$rbacsystem->checkAccess(
'internal_mail', $umail->getMailObjectReferenceId()))
111 $umail =
new ilMail($ilUser->getId());
112 $mbox =
new ilMailBox($ilUser->getId());
113 $this->inbox = $mbox->getInboxFolder();
118 'status' =>
'unread',
144 if(count($this->mails) == 0)
163 $this->tpl->touchBlock(
'usr_image_space');
164 if($user && $user->getId() != ANONYMOUS_USER_ID)
166 $this->tpl->setVariable(
'PUBLIC_NAME_LONG', $user->getPublicName());
167 $this->tpl->setVariable(
'IMG_SENDER', $user->getPersonalPicturePath(
'xxsmall'));
168 $this->tpl->setVariable(
'ALT_SENDER', $user->getPublicName());
172 $this->tpl->setVariable(
'PUBLIC_NAME_LONG', $mail[
'import_name'] .
' (' . $lng->txt(
'user_deleted') .
')');
174 $this->tpl->setCurrentBlock(
'image_container');
175 $this->tpl->touchBlock(
'image_container');
176 $this->tpl->parseCurrentBlock();
180 $this->tpl->setVariable(
'PUBLIC_NAME_LONG', ilMail::_getIliasMailerName());
182 $this->tpl->setVariable(
'ALT_SENDER', ilMail::_getIliasMailerName());
189 if($user && $user->getId() != ANONYMOUS_USER_ID)
191 $this->tpl->setVariable(
'PUBLIC_NAME_SHORT', $user->getPublicName());
195 $this->tpl->setVariable(
'PUBLIC_NAME_SHORT', $mail[
'import_name'] .
' (' . $lng->txt(
'user_deleted') .
')');
199 $this->tpl->setVariable(
'PUBLIC_NAME_SHORT', ilMail::_getIliasMailerName());
203 $this->tpl->setVariable(
'NEW_MAIL_SUBJ', htmlentities($mail[
'm_subject'], ENT_NOQUOTES,
'UTF-8'));
204 $ilCtrl->setParameter($this,
'mobj_id', $this->inbox);
205 $ilCtrl->setParameter($this,
'mail_id', $mail[
'mail_id']);
206 $ilCtrl->setParameter($this,
'mail_mode', $this->mail_mode);
207 $this->tpl->setVariable(
'NEW_MAIL_LINK_READ', $ilCtrl->getLinkTarget($this,
'showMail'));
208 $ilCtrl->clearParameters($this);
218 return '<div class="small">' . ((int)count($this->mails)) .
" " . $lng->txt(
"mails_pl") .
"</div>";
228 include_once(
"./Services/Mail/classes/class.ilPDMailGUI.php");
231 include_once(
"./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
233 $content_block->setContent($mail_gui->getPDMailHTML(
$_GET[
"mail_id"],
235 $content_block->setTitle($lng->txt(
"message"));
236 $content_block->setColSpan(2);
238 $content_block->addHeaderCommand($ilCtrl->getLinkTargetByClass(
"ilpersonaldesktopgui",
"show"),
239 $lng->txt(
"selected_items_back"));
241 if(
$_GET[
"mail_mode"] !=
"system")
243 $content_block->addBlockCommand(
"ilias.php?baseClass=ilMailGUI&mail_id=" .
244 $_GET[
"mail_id"] .
"&mobj_id=" .
$_GET[
"mobj_id"] .
"&type=reply",
246 $content_block->addBlockCommand(
"ilias.php?baseClass=ilMailGUI&mail_id=" .
247 $_GET[
"mail_id"] .
"&mobj_id=" . $_GET[
"mobj_id"] .
"&type=read",
250 $ilCtrl->setParameter($this,
'mail_id', (
int)$_GET[
'mail_id']);
251 $content_block->addBlockCommand($ilCtrl->getLinkTarget($this,
'deleteMail'), $lng->txt(
'delete'));
257 $ilCtrl->setParameter($this,
"mail_id",
$_GET[
"mail_id"]);
258 $ilCtrl->setParameter($this,
"mobj_id",
$_GET[
"mobj_id"]);
259 $content_block->addBlockCommand(
260 $ilCtrl->getLinkTarget($this,
"deleteMail"),
261 $lng->txt(
"delete"));
262 $ilCtrl->clearParameters($this);
265 return $content_block->getHTML();
275 $lng->loadLanguageModule(
'mail');
278 $mbox =
new ilMailBox(
$_SESSION[
'AccountId']);
280 if(!
$_GET[
'mobj_id'])
282 $_GET[
'mobj_id'] = $mbox->getInboxFolder();
285 if($umail->moveMailsToFolder(array(
$_GET[
'mail_id']),
286 $mbox->getTrashFolder())
295 $ilCtrl->redirectByClass(
'ilpersonaldesktopgui',
'show');
305 foreach($data as $mail)
307 if($mail[
'sender_id'] && $mail[
'sender_id'] != ANONYMOUS_USER_ID)
309 $usr_ids[$mail[
'sender_id']] = $mail[
'sender_id'];
313 ilMailUserCache::preloadUserObjects($usr_ids);