ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMailFormGUI Class Reference
+ Collaboration diagram for ilMailFormGUI:

Public Member Functions

 __construct ()
 executeCommand ()
 sendMessage ()
 saveDraft ()
 searchRcpTo ()
 searchUsers ($save=true)
 searchCoursesTo ()
 searchGroupsTo ()
 searchRcpCc ()
 searchRcpBc ()
 showSearchForm ()
 search ()
 cancelSearch ()
 editAttachments ()
 returnFromAttachments ()
 searchResults ()
 mailUser ()
 mailRole ()
 replyMail ()
 mailAttachment ()
 showForm ()
 lookupRecipientAsync ()
 cancelMail ()
 searchMailingListsTo ()

Private Attributes

 $tpl = null
 $ctrl = null
 $lng = null
 $umail = null
 $mbox = null
 $mfile = null

Detailed Description

Constructor & Destructor Documentation

ilMailFormGUI::__construct ( )

Definition at line 27 of file class.ilMailFormGUI.php.

References $_GET, $_POST, $ilCtrl, $ilUser, $lng, and $tpl.

{
global $tpl, $ilCtrl, $lng, $ilUser;
$this->tpl = $tpl;
$this->ctrl = $ilCtrl;
$this->lng = $lng;
$this->umail = new ilFormatMail($ilUser->getId());
$this->mfile = new ilFileDataMail($ilUser->getId());
$this->mbox = new ilMailBox($ilUser->getId());
if(isset($_POST['mobj_id']) && (int)$_POST['mobj_id'])
{
$_GET['mobj_id'] = $_POST['mobj_id'];
}
// IF THERE IS NO OBJ_ID GIVEN GET THE ID OF MAIL ROOT NODE
if(!(int)$_GET['mobj_id'])
{
$_GET['mobj_id'] = $this->mbox->getInboxFolder();
}
$_GET['mobj_id'] = (int)$_GET['mobj_id'];
$this->ctrl->saveParameter($this, 'mobj_id');
}

Member Function Documentation

ilMailFormGUI::cancelMail ( )
ilMailFormGUI::cancelSearch ( )

Definition at line 446 of file class.ilMailFormGUI.php.

References $_SESSION, and searchResults().

{
unset($_SESSION["mail_search"]);
#$this->showForm();
$this->searchResults();
}

+ Here is the call graph for this function:

ilMailFormGUI::editAttachments ( )

Definition at line 454 of file class.ilMailFormGUI.php.

References $_POST, $_SESSION, and ilUtil\securePlainString().

{
// decode post values
$files = array();
if(is_array($_POST['attachments']))
{
foreach($_POST['attachments'] as $value)
{
$files[] = urldecode($value);
}
}
// Note: For security reasons, ILIAS only allows Plain text messages.
$this->umail->savePostData($_SESSION["AccountId"],
$files,
$_POST["m_type"],
ilUtil::securePlainString($_POST['use_placeholders'])
);
$this->ctrl->redirectByClass("ilmailattachmentgui");
}

+ Here is the call graph for this function:

ilMailFormGUI::executeCommand ( )

Definition at line 52 of file class.ilMailFormGUI.php.

References $cmd.

{
$forward_class = $this->ctrl->getNextClass($this);
switch($forward_class)
{
case 'ilmailfoldergui':
include_once 'Services/Mail/classes/class.ilMailFolderGUI.php';
$this->ctrl->forwardCommand(new ilMailFolderGUI());
break;
case 'ilmailattachmentgui':
include_once 'Services/Mail/classes/class.ilMailAttachmentGUI.php';
$this->ctrl->setReturn($this, "returnFromAttachments");
$this->ctrl->forwardCommand(new ilMailAttachmentGUI());
break;
case 'ilmailsearchgui':
include_once 'Services/Contact/classes/class.ilMailSearchGUI.php';
$this->ctrl->setReturn($this, "searchResults");
$this->ctrl->forwardCommand(new ilMailSearchGUI());
break;
case 'ilmailsearchcoursesgui':
include_once 'Services/Contact/classes/class.ilMailSearchCoursesGUI.php';
$this->ctrl->setReturn($this, "searchResults");
$this->ctrl->forwardCommand(new ilMailSearchCoursesGUI());
break;
case 'ilmailinglistsgui':
include_once 'Services/Contact/classes/class.ilMailingListsGUI.php';
$this->ctrl->setReturn($this, 'searchResults');
$this->ctrl->forwardCommand(new ilMailingListsGUI());
break;
case 'ilmailsearchgroupsgui':
include_once 'Services/Contact/classes/class.ilMailSearchGroupsGUI.php';
$this->ctrl->setReturn($this, "searchResults");
$this->ctrl->forwardCommand(new ilMailSearchGroupsGUI());
break;
default:
if (!($cmd = $this->ctrl->getCmd()))
{
$cmd = "showForm";
}
$this->$cmd();
break;
}
return true;
}
ilMailFormGUI::lookupRecipientAsync ( )

Definition at line 809 of file class.ilMailFormGUI.php.

References $_REQUEST, $result, ilJsonUtil\encode(), and exit.

{
include_once 'Services/JSON/classes/class.ilJsonUtil.php';
include_once 'Services/Mail/classes/class.ilMailForm.php';
$search = $_REQUEST["term"];
$result = array();
if (!$search)
{
}
// #14768
$quoted = $search;
$quoted = str_replace('%', '\%', $quoted);
$quoted = str_replace('_', '\_', $quoted);
$mailFormObj = new ilMailForm;
$result = $mailFormObj->getRecipientAsync("%" .$quoted. "%", $search);
}

+ Here is the call graph for this function:

ilMailFormGUI::mailAttachment ( )

Definition at line 512 of file class.ilMailFormGUI.php.

References $_GET, and showForm().

{
$_GET["type"] = "attach";
$this->showForm();
}

+ Here is the call graph for this function:

ilMailFormGUI::mailRole ( )

Definition at line 500 of file class.ilMailFormGUI.php.

References $_GET, and showForm().

{
$_GET["type"] = "role";
$this->showForm();
}

+ Here is the call graph for this function:

ilMailFormGUI::mailUser ( )

Definition at line 494 of file class.ilMailFormGUI.php.

References $_GET, and showForm().

{
$_GET["type"] = "new";
$this->showForm();
}

+ Here is the call graph for this function:

ilMailFormGUI::replyMail ( )

Definition at line 506 of file class.ilMailFormGUI.php.

References $_GET, and showForm().

{
$_GET["type"] = "reply";
$this->showForm();
}

+ Here is the call graph for this function:

ilMailFormGUI::returnFromAttachments ( )

Definition at line 482 of file class.ilMailFormGUI.php.

References $_GET, and showForm().

{
$_GET["type"] = "attach";
$this->showForm();
}

+ Here is the call graph for this function:

ilMailFormGUI::saveDraft ( )

Definition at line 184 of file class.ilMailFormGUI.php.

References $_POST, $_SESSION, ilMailFormCall\getRefererRedirectUrl(), ilMailFormCall\isRefererStored(), ilUtil\redirect(), ilUtil\securePlainString(), ilUtil\sendInfo(), and showForm().

{
if(!$_POST['m_subject'])
{
$_POST['m_subject'] = 'No title';
}
$draftsId = $this->mbox->getDraftsFolder();
// decode post values
$files = array();
if(is_array($_POST['attachments']))
{
foreach($_POST['attachments'] as $value)
{
$files[] = urldecode($value);
}
}
if(isset($_SESSION["draft"]))
{
// Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
$this->umail->updateDraft($draftsId, $files,
$_POST["m_type"],
(int)$_SESSION["draft"],
(int)ilUtil::securePlainString($_POST['use_placeholders'])
);
#session_unregister("draft");
#ilUtil::sendInfo($this->lng->txt("mail_saved"),true);
#ilUtil::redirect("ilias.php?baseClass=ilMailGUI&mobj_id=".$mbox->getInboxFolder());
unset($_SESSION["draft"]);
ilUtil::sendInfo($this->lng->txt("mail_saved"), true);
else
$this->ctrl->redirectByClass("ilmailfoldergui");
}
else
{
if ($this->umail->sendInternalMail($draftsId,$_SESSION["AccountId"],$files,
// Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
'read',
$_POST["m_type"],
$_SESSION["AccountId"],
ilUtil::securePlainString($_POST['use_placeholders'])
)
)
{
ilUtil::sendInfo($this->lng->txt("mail_saved"),true);
#$this->ctrl->setParameterByClass("ilmailfoldergui", "mobj_id", $this->mbox->getDraftsFolder());
else
$this->ctrl->redirectByClass("ilmailfoldergui");
}
else
{
ilUtil::sendInfo($this->lng->txt("mail_send_error"));
}
}
$this->showForm();
}

+ Here is the call graph for this function:

ilMailFormGUI::search ( )

Definition at line 410 of file class.ilMailFormGUI.php.

References $_POST, $_SESSION, $ilUser, searchUsers(), and ilUtil\sendInfo().

{
global $ilUser;
$_SESSION["mail_search_search"] = $_POST["search"];
$_SESSION["mail_search_type_system"] = $_POST["type_system"];
$_SESSION["mail_search_type_addressbook"] = $_POST["type_addressbook"];
if (strlen(trim($_SESSION["mail_search_search"])) == 0)
{
ilUtil::sendInfo($this->lng->txt("mail_insert_query"));
#$this->showSearchForm();
$this->searchUsers(false);
}
else if(strlen(trim($_SESSION["mail_search_search"])) < 3)
{
$this->lng->loadLanguageModule('search');
ilUtil::sendInfo($this->lng->txt('search_minimum_three'));
#$this->showSearchForm();
$this->searchUsers(false);
}
else
{
$this->ctrl->setParameterByClass("ilmailsearchgui", "search", urlencode($_SESSION["mail_search_search"]));
if($_SESSION["mail_search_type_system"])
{
$this->ctrl->setParameterByClass("ilmailsearchgui", "system", 1);
}
if($_SESSION["mail_search_type_addressbook"])
{
$this->ctrl->setParameterByClass("ilmailsearchgui", "addressbook", 1);
}
$this->ctrl->redirectByClass("ilmailsearchgui");
}
}

+ Here is the call graph for this function:

ilMailFormGUI::searchCoursesTo ( )

Definition at line 340 of file class.ilMailFormGUI.php.

References $_SESSION.

{
$this->saveMailBeforeSearch();
if($_SESSION['search_crs'])
{
$this->ctrl->setParameterByClass('ilmailsearchcoursesgui', 'cmd', 'showMembers');
}
$this->ctrl->setParameterByClass('ilmailsearchcoursesgui', 'ref', 'mail');
$this->ctrl->redirectByClass('ilmailsearchcoursesgui');
}
ilMailFormGUI::searchGroupsTo ( )

Definition at line 356 of file class.ilMailFormGUI.php.

{
$this->saveMailBeforeSearch();
$this->ctrl->setParameterByClass('ilmailsearchgroupsgui', 'ref', 'mail');
$this->ctrl->redirectByClass('ilmailsearchgroupsgui');
}
ilMailFormGUI::searchMailingListsTo ( )

Definition at line 878 of file class.ilMailFormGUI.php.

{
$this->saveMailBeforeSearch();
$this->ctrl->setParameterByClass('ilmailinglistsgui', 'ref', 'mail');
$this->ctrl->redirectByClass('ilmailinglistsgui');
}
ilMailFormGUI::searchRcpBc ( )

Definition at line 372 of file class.ilMailFormGUI.php.

References $_SESSION, ilUtil\sendInfo(), and showSearchForm().

{
$_SESSION["mail_search"] = 'bc';
ilUtil::sendInfo($this->lng->txt("mail_insert_query"));
$this->showSearchForm();
}

+ Here is the call graph for this function:

ilMailFormGUI::searchRcpCc ( )

Definition at line 364 of file class.ilMailFormGUI.php.

References $_SESSION, ilUtil\sendInfo(), and showSearchForm().

{
$_SESSION["mail_search"] = 'cc';
ilUtil::sendInfo($this->lng->txt("mail_insert_query"));
$this->showSearchForm();
}

+ Here is the call graph for this function:

ilMailFormGUI::searchRcpTo ( )

Definition at line 263 of file class.ilMailFormGUI.php.

References $_SESSION, ilUtil\sendInfo(), and showSearchForm().

{
$_SESSION["mail_search"] = 'to';
ilUtil::sendInfo($this->lng->txt("mail_insert_query"));
$this->showSearchForm();
}

+ Here is the call graph for this function:

ilMailFormGUI::searchResults ( )

Definition at line 488 of file class.ilMailFormGUI.php.

References $_GET, and showForm().

Referenced by cancelSearch().

{
$_GET["type"] = "search_res";
$this->showForm();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMailFormGUI::searchUsers (   $save = true)

Definition at line 271 of file class.ilMailFormGUI.php.

References $_POST, $_SESSION, $ilCtrl, $ilUser, ilUtil\prepareFormOutput(), ilUtil\securePlainString(), ilCheckboxInputGUI\setChecked(), and ilTextInputGUI\setSize().

Referenced by search().

{
global $ilUser, $ilCtrl;
$this->tpl->setTitle($this->lng->txt("mail"));
if ($save)
{
// decode post values
$files = array();
if(is_array($_POST['attachments']))
{
foreach($_POST['attachments'] as $value)
{
$files[] = urldecode($value);
}
}
// Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
$this->umail->savePostData($ilUser->getId(),
$files,
$_POST["m_type"],
ilUtil::securePlainString($_POST["m_email"]),
ilUtil::securePlainString($_POST["m_subject"]),
ilUtil::securePlainString($_POST["m_message"]),
ilUtil::securePlainString($_POST['use_placeholders'])
);
}
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$form = new ilPropertyFormGUI();
$form->setId('search_rcp');
$form->setTitle($this->lng->txt('search_recipients'));
$form->setFormAction($ilCtrl->getFormAction($this, 'search'));
$inp = new ilTextInputGUI($this->lng->txt("search_for"), 'search');
$inp->setSize(30);
$dsDataLink = $ilCtrl->getLinkTarget($this, 'lookupRecipientAsync', '', true);
$inp->setDataSource($dsDataLink);
if (strlen(trim($_SESSION["mail_search_search"])) > 0)
{
$inp->setValue(ilUtil::prepareFormOutput(trim($_SESSION["mail_search_search"]), true));
}
$form->addItem($inp);
$chb = new ilCheckboxInputGUI($this->lng->txt("mail_search_addressbook"), 'type_addressbook');
if ($_SESSION['mail_search_type_addressbook'])
$chb->setChecked(true);
$inp->addSubItem($chb);
$chb = new ilCheckboxInputGUI($this->lng->txt("mail_search_system"), 'type_system');
if ($_SESSION['mail_search_type_system'])
$chb->setChecked(true);
$inp->addSubItem($chb);
$form->addCommandButton('search', $this->lng->txt("search"));
$form->addCommandButton('cancelSearch', $this->lng->txt("cancel"));
$this->tpl->setContent($form->getHtml());
$this->tpl->show();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMailFormGUI::sendMessage ( )

Definition at line 110 of file class.ilMailFormGUI.php.

References $_POST, $ilUser, ilMailFormCall\getRefererRedirectUrl(), ilMailFormCall\isRefererStored(), ilUtil\redirect(), ilUtil\securePlainString(), ilUtil\sendInfo(), and showForm().

{
global $ilUser;
// decode post values
$files = array();
if(is_array($_POST['attachments']))
{
foreach($_POST['attachments'] as $value)
{
if(is_file($this->mfile->getMailPath() . '/' . $ilUser->getId() . "_" . urldecode($value)))
{
$files[] = urldecode($value);
}
}
}
// Remove \r
$f_message = str_replace("\r", '', ilUtil::securePlainString($_POST['m_message']));
// Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
$f_message = $this->umail->formatLinebreakMessage($f_message);
$this->umail->setSaveInSentbox(true);
$m_type = isset($_POST["m_type"]) ? $_POST["m_type"] : array("normal");
// Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
if($errorMessage = $this->umail->sendMail(
ilUtil::securePlainString($_POST['m_subject']), $f_message,
$files,
// $_POST['m_type'],
$m_type,
ilUtil::securePlainString($_POST['use_placeholders'])
)
)
{
if(is_array($_POST['attachments']))
{
foreach($_POST['attachments'] as $key => $value)
{
if(is_file($this->mfile->getMailPath() . '/' . $ilUser->getId() . "_" . urldecode($value)))
{
$_POST['attachments'][$key] = urldecode($value);
}
else
{
unset($_POST['attachments'][$key]);
}
}
}
ilUtil::sendInfo($errorMessage);
}
else
{
$this->umail->savePostData($ilUser->getId(), array(), "", "", "", "", "", "", "", "");
$this->ctrl->setParameterByClass('ilmailgui', 'type', 'message_sent');
{
ilUtil::sendInfo($this->lng->txt('mail_message_send'), true);
}
else
$this->ctrl->redirectByClass('ilmailgui');
}
$this->showForm();
}

+ Here is the call graph for this function:

ilMailFormGUI::showForm ( )

Definition at line 518 of file class.ilMailFormGUI.php.

References $_GET, $_POST, $_SESSION, $data, $ilCtrl, $ilUser, $lng, $size, ilFormat\formatSize(), ilMailFormCall\getSignature(), ilMailFormCall\isRefererStored(), ilUtil\securePlainString(), ilUtil\sendInfo(), ilCheckboxInputGUI\setOptionTitle(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), and ilTextAreaInputGUI\setValue().

Referenced by cancelMail(), mailAttachment(), mailRole(), mailUser(), replyMail(), returnFromAttachments(), saveDraft(), searchResults(), sendMessage(), and showSearchForm().

{
global $rbacsystem, $ilUser, $ilCtrl, $lng, $ilTabs;
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mail_new.html", "Services/Mail");
$this->tpl->setTitle($this->lng->txt("mail"));
$this->lng->loadLanguageModule("crs");
$ilTabs->setBackTarget($lng->txt('back'), $ilCtrl->getLinkTarget($this, 'cancelMail'));
switch($_GET["type"])
{
case 'reply':
if($_SESSION['mail_id'])
{
$_GET['mail_id'] = $_SESSION['mail_id'];
}
$mailData = $this->umail->getMail($_GET["mail_id"]);
$mailData["m_subject"] = $this->umail->formatReplySubject();
$mailData["m_message"] = $this->umail->formatReplyMessage();
$mailData["m_message"] = $this->umail->appendSignature();
// NO ATTACHMENTS FOR REPLIES
$mailData["attachments"] = array();
//$mailData["rcp_cc"] = $this->umail->formatReplyRecipientsForCC();
$mailData["rcp_cc"] = '';
$mailData["rcp_to"] = $this->umail->formatReplyRecipient();
$_SESSION["mail_id"] = "";
break;
case 'search_res':
$mailData = $this->umail->getSavedData();
/*if($_SESSION["mail_search_results"])
{
$mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results"],$_SESSION["mail_search"]);
}
unset($_SESSION["mail_search"]);
unset($_SESSION["mail_search_results"]);*/
if($_SESSION["mail_search_results_to"])
{
$mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results_to"], 'to');
}
if($_SESSION["mail_search_results_cc"])
{
$mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results_cc"], 'cc');
}
if($_SESSION["mail_search_results_bcc"])
{
$mailData = $this->umail->appendSearchResult($_SESSION["mail_search_results_bcc"], 'bc');
}
unset($_SESSION["mail_search_results_to"]);
unset($_SESSION["mail_search_results_cc"]);
unset($_SESSION["mail_search_results_bcc"]);
break;
case 'attach':
$mailData = $this->umail->getSavedData();
break;
case 'draft':
$_SESSION["draft"] = $_GET["mail_id"];
$mailData = $this->umail->getMail($_GET["mail_id"]);
break;
case 'forward':
$mailData = $this->umail->getMail($_GET["mail_id"]);
$mailData["rcp_to"] = $mailData["rcp_cc"] = $mailData["rcp_bcc"] = '';
$mailData["m_subject"] = $this->umail->formatForwardSubject();
$mailData["m_message"] = $this->umail->appendSignature();
if(count($mailData["attachments"]))
{
if($error = $this->mfile->adoptAttachments($mailData["attachments"],$_GET["mail_id"]))
{
}
}
break;
case 'new':
if($_GET['rcp_to'])
{
// Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
$mailData["rcp_to"] = ilUtil::securePlainString($_GET['rcp_to']);
}
else if($_SESSION['rcp_to'])
{
$mailData["rcp_to"] = $_SESSION['rcp_to'];
}
if($_GET['rcp_cc'])
{
// Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
$mailData["rcp_cc"] = ilUtil::securePlainString($_GET['rcp_cc']);
}
else if($_SESSION['rcp_cc'])
{
$mailData["rcp_cc"] = $_SESSION['rcp_cc'];
}
if($_GET['rcp_bcc'])
{
// Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
$mailData["rcp_bcc"] = ilUtil::securePlainString($_GET['rcp_bcc']);
}
else if($_SESSION['rcp_bcc'])
{
$mailData["rcp_bcc"] = $_SESSION['rcp_bcc'];
}
$mailData['m_message'] = '';
if(strlen($sig = ilMailFormCall::getSignature()))
{
$mailData['m_message'] = $sig;
$mailData['m_message'] .= chr(13).chr(10).chr(13).chr(10);
}
$mailData['m_message'] .= $this->umail->appendSignature();
$_SESSION['rcp_to'] = '';
$_SESSION['rcp_cc'] = '';
$_SESSION['rcp_bcc'] = '';
break;
case 'role':
if(is_array($_POST['roles']))
{
// Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
$mailData['rcp_to'] = ilUtil::securePlainString(implode(',',$_POST['roles']));
}
elseif(is_array($_SESSION['mail_roles']))
{
$mailData['rcp_to'] = ilUtil::securePlainString(implode(',', $_SESSION['mail_roles']));
}
$mailData['m_message'] = '';
if(strlen($sig = ilMailFormCall::getSignature()))
{
$mailData['m_message'] = $sig;
$mailData['m_message'] .= chr(13).chr(10).chr(13).chr(10);
}
$mailData['m_message'] .= $_POST["additional_message_text"].chr(13).chr(10).$this->umail->appendSignature();
$_POST["additional_message_text"] = "";
$_SESSION['mail_roles'] = "";
break;
case 'address':
$mailData["rcp_to"] = urldecode($_GET["rcp"]);
break;
default:
// GET DATA FROM POST
$mailData = $_POST;
// strip slashes
foreach ($mailData as $key => $value)
{
if (is_string($value))
{
// Note: For security reasons, ILIAS only allows Plain text strings in E-Mails.
$mailData[$key] = ilUtil::securePlainString($value);
}
}
break;
}
include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
$form_gui = new ilPropertyFormGUI();
$form_gui->setTitle($this->lng->txt('compose'));
$form_gui->setOpenTag(false);
$this->tpl->setVariable('FORM_ACTION', $this->ctrl->getFormAction($this, 'sendMessage'));
$this->tpl->setVariable('BUTTON_TO', $lng->txt("search_recipients"));
$this->tpl->setVariable('BUTTON_COURSES_TO', $lng->txt("mail_my_courses"));
$this->tpl->setVariable('BUTTON_GROUPS_TO', $lng->txt("mail_my_groups"));
$this->tpl->setVariable('BUTTON_MAILING_LISTS_TO', $lng->txt("mail_my_mailing_lists"));
$dsDataLink = $ilCtrl->getLinkTarget($this, 'lookupRecipientAsync', '', true);
// RECIPIENT
$inp = new ilTextInputGUI($this->lng->txt('mail_to'), 'rcp_to');
$inp->setRequired(true);
$inp->setSize(50);
$inp->setValue($mailData["rcp_to"]);
$inp->setDataSource($dsDataLink);
$inp->setMaxLength(null);
$form_gui->addItem($inp);
// CC
$inp = new ilTextInputGUI($this->lng->txt('cc'), 'rcp_cc');
$inp->setSize(50);
$inp->setValue($mailData["rcp_cc"]);
$inp->setDataSource($dsDataLink);
$inp->setMaxLength(null);
$form_gui->addItem($inp);
// BCC
$inp = new ilTextInputGUI($this->lng->txt('bc'), 'rcp_bcc');
$inp->setSize(50);
$inp->setValue($mailData["rcp_bcc"]);
$inp->setDataSource($dsDataLink);
$inp->setMaxLength(null);
$form_gui->addItem($inp);
// SUBJECT
$inp = new ilTextInputGUI($this->lng->txt('subject'), 'm_subject');
$inp->setSize(50);
$inp->setRequired(true);
$inp->setValue($mailData["m_subject"]);
$form_gui->addItem($inp);
// Attachments
include_once 'Services/Mail/classes/class.ilMailFormAttachmentFormPropertyGUI.php';
$att = new ilMailFormAttachmentPropertyGUI($this->lng->txt( ($mailData["attachments"]) ? 'edit' : 'add' ));
if (is_array($mailData["attachments"]) && count($mailData["attachments"]))
{
foreach($mailData["attachments"] as $data)
{
if(is_file($this->mfile->getMailPath() . '/' . $ilUser->getId() . "_" . $data))
{
$hidden = new ilHiddenInputGUI('attachments[]');
$form_gui->addItem($hidden);
$size = filesize($this->mfile->getMailPath() . '/' . $ilUser->getId() . "_" . $data);
$label = $data . " [" . ilFormat::formatSize($size) . "]";
$att->addItem($label);
$hidden->setValue(urlencode($data));
}
}
}
$form_gui->addItem($att);
// ONLY IF SYSTEM MAILS ARE ALLOWED
if($rbacsystem->checkAccess("system_message",$this->umail->getMailObjectReferenceId()))
{
$chb = new ilCheckboxInputGUI($this->lng->txt('type'), 'm_type[]');
$chb->setOptionTitle($this->lng->txt('system_message'));
$chb->setValue('system');
$chb->setChecked(false);
if(is_array($mailData["m_type"]) and in_array('system',$mailData["m_type"]))
{
$chb->setChecked(true);
}
$form_gui->addItem($chb);
}
// MESSAGE
$inp = new ilTextAreaInputGUI($this->lng->txt('message_content'), 'm_message');
//$inp->setValue(htmlspecialchars($mailData["m_message"], false));
$inp->setValue($mailData["m_message"]);
$inp->setRequired(false);
$inp->setCols(60);
$inp->setRows(10);
// PLACEHOLDERS
$chb = new ilCheckboxInputGUI($this->lng->txt('activate_serial_letter_placeholders'), 'use_placeholders');
$chb->setOptionTitle($this->lng->txt('activate_serial_letter_placeholders'));
$chb->setValue(1);
$chb->setChecked(false);
$form_gui->addItem($inp);
include_once 'Services/Mail/classes/class.ilMailFormPlaceholdersPropertyGUI.php';
$chb->addSubItem($prop);
if ($mailData['use_placeholders'])
{
$chb->setChecked(true);
}
$form_gui->addItem($chb);
$form_gui->addCommandButton('sendMessage', $this->lng->txt('send_mail'));
$form_gui->addCommandButton('saveDraft', $this->lng->txt('save_message'));
$form_gui->addCommandButton('cancelMail', $this->lng->txt('cancel'));
$this->tpl->parseCurrentBlock();
$this->tpl->setVariable('FORM', $form_gui->getHTML());
$this->tpl->addJavaScript('Services/Mail/js/ilMailComposeFunctions.js');
$this->tpl->show();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMailFormGUI::showSearchForm ( )

Definition at line 380 of file class.ilMailFormGUI.php.

References $_POST, $ilUser, ilUtil\prepareFormOutput(), and showForm().

Referenced by searchRcpBc(), searchRcpCc(), and searchRcpTo().

{
global $ilUser;
$this->tpl->setCurrentBlock("search");
$this->tpl->setVariable("TXT_SEARCH_FOR",$this->lng->txt("search_for"));
$this->tpl->setVariable("TXT_SEARCH_SYSTEM",$this->lng->txt("mail_search_system"));
$this->tpl->setVariable("TXT_SEARCH_ADDRESS",$this->lng->txt("mail_search_addressbook"));
if ($pref = $ilUser->getPref("mail_search"))
{
if ($pref == "system" || $pref == "all") $this->tpl->setVariable("SEARCH_SYSTEM_CHECKED", "checked=\"checked\"");
if ($pref == "addressbook" || $pref == "all") $this->tpl->setVariable("SEARCH_ADDRESS_CHECKED", "checked=\"checked\"");
}
else
{
$this->tpl->setVariable("SEARCH_SYSTEM_CHECKED", "checked=\"checked\"");
}
$this->tpl->setVariable("BUTTON_SEARCH",$this->lng->txt("search"));
$this->tpl->setVariable("BUTTON_CANCEL",$this->lng->txt("cancel"));
if (strlen(trim($_POST['search'])) > 0)
{
$this->tpl->setVariable("VALUE_SEARCH_FOR", ilUtil::prepareFormOutput(trim($_POST["search"]), true));
}
$this->tpl->parseCurrentBlock();
$this->showForm();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilMailFormGUI::$ctrl = null
private

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

ilMailFormGUI::$lng = null
private

Definition at line 21 of file class.ilMailFormGUI.php.

Referenced by __construct(), and showForm().

ilMailFormGUI::$mbox = null
private

Definition at line 24 of file class.ilMailFormGUI.php.

ilMailFormGUI::$mfile = null
private

Definition at line 25 of file class.ilMailFormGUI.php.

ilMailFormGUI::$tpl = null
private

Definition at line 19 of file class.ilMailFormGUI.php.

Referenced by __construct().

ilMailFormGUI::$umail = null
private

Definition at line 23 of file class.ilMailFormGUI.php.


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