ILIAS  Release_4_0_x_branch Revision 61816
 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 ()

Private Attributes

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

Detailed Description

Constructor & Destructor Documentation

ilMailFormGUI::__construct ( )

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

References $_GET, $_POST, $ilCtrl, $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();
}
$this->ctrl->saveParameter($this, 'mobj_id');
}

Member Function Documentation

ilMailFormGUI::cancelSearch ( )

Definition at line 477 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 485 of file class.ilMailFormGUI.php.

References $_POST, $_SESSION, $files, 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"],
$_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 71 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 '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 835 of file class.ilMailFormGUI.php.

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

{
global $ilUser, $rbacsystem;
include_once 'Services/JSON/classes/class.ilJsonUtil.php';
include_once 'Services/Mail/classes/class.ilMailForm.php';
$search = $_REQUEST["query"];
$result = new stdClass();
$result->response = new stdClass();
$result->response->results = array();
if (!$search)
{
$result->response->total = 0;
}
$mailFormObj = new ilMailForm;
$result = $mailFormObj->getRecipientAsync("%" .$search. "%", $search);
}

+ Here is the call graph for this function:

ilMailFormGUI::mailAttachment ( )

Definition at line 543 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 531 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 525 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 537 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 513 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 180 of file class.ilMailFormGUI.php.

References $_POST, $_SESSION, $files, 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"],
$_SESSION["draft"],
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);
$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());
$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 433 of file class.ilMailFormGUI.php.

References $_POST, $_SESSION, 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 NO TYPE IS GIVEN SEARCH IN BOTH 'system' and 'addressbook'
if(!$_SESSION["mail_search_type_system"] &&
!$_SESSION["mail_search_type_addressbook"])
{
$_SESSION["mail_search_type_system"] = 1;
$_SESSION["mail_search_type_addressbook"] = 1;
$ilUser->writePref("mail_search", "all");
}
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 321 of file class.ilMailFormGUI.php.

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

{
global $ilUser;
// 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(),
$_POST["m_type"],
ilUtil::securePlainString($_POST["m_email"]),
ilUtil::securePlainString($_POST["m_subject"]),
ilUtil::securePlainString($_POST["m_message"]),
ilUtil::securePlainString($_POST['use_placeholders'])
);
if ($_SESSION["search_crs"])
{
$this->ctrl->setParameterByClass("ilmailsearchcoursesgui", "cmd", "showMembers");
}
$this->ctrl->setParameterByClass("ilmailsearchcoursesgui", "ref", "mail");
$this->ctrl->redirectByClass("ilmailsearchcoursesgui");
}

+ Here is the call graph for this function:

ilMailFormGUI::searchGroupsTo ( )

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

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

{
global $ilUser;
// 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(),
$_POST["m_type"],
ilUtil::securePlainString($_POST["m_email"]),
ilUtil::securePlainString($_POST["m_subject"]),
ilUtil::securePlainString($_POST["m_message"]),
ilUtil::securePlainString($_POST['use_placeholders'])
);
$this->ctrl->setParameterByClass("ilmailsearchgroupsgui", "ref", "mail");
$this->ctrl->redirectByClass("ilmailsearchgroupsgui");
}

+ Here is the call graph for this function:

ilMailFormGUI::searchRcpBc ( )

Definition at line 395 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 387 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 251 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 519 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 259 of file class.ilMailFormGUI.php.

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

Referenced by search().

{
global $ilUser, $ilCtrl;
$this->tpl->setVariable("HEADER", $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(),
$_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);
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 122 of file class.ilMailFormGUI.php.

References $_POST, $files, $key, ilUtil\securePlainString(), ilUtil\sendInfo(), and showForm().

{
global $ilUser;
// decode post values
$files = array();
if(is_array($_POST['attachments']))
{
foreach($_POST['attachments'] as $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,
// $_POST['m_type'],
$m_type,
ilUtil::securePlainString($_POST['use_placeholders'])
)
)
{
if(is_array($_POST['attachments']))
{
foreach($_POST['attachments'] as $key => $value)
{
$_POST['attachments'][$key] = urldecode($value);
}
}
ilUtil::sendInfo($errorMessage);
}
else
{
$this->umail->savePostData($ilUser->getId(), array(), "", "", "", "", "", "", "", "");
#$this->ctrl->setParameterByClass("ilmailfoldergui", "mobj_id", $this->mbox->getSentFolder());
$this->ctrl->setParameterByClass('ilmailgui', 'type', 'message_sent');
$this->ctrl->redirectByClass('ilmailgui');
}
$this->showForm();
}

+ Here is the call graph for this function:

ilMailFormGUI::showForm ( )

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

References $_GET, $_POST, $_SESSION, $data, $error, $ilCtrl, $key, $lng, $size, elseif(), ilUtil\securePlainString(), ilUtil\sendInfo(), ilCheckboxInputGUI\setOptionTitle(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), and ilTextAreaInputGUI\setValue().

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

{
global $rbacsystem, $ilUser, $ilCtrl, $lng;
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mail_new.html", "Services/Mail");
$this->tpl->setVariable("HEADER", $this->lng->txt("mail"));
$this->lng->loadLanguageModule("crs");
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"] = $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'] = $_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"));
//$dsSchema = array('response.results', 'login', 'firstname', 'lastname');
$dsSchema = array("resultsList" => 'response.results',
"fields" => array('login', 'firstname', 'lastname'));
$dsFormatCallback = 'formatAutoCompleteResults';
$dsDataLink = $ilCtrl->getLinkTarget($this, 'lookupRecipientAsync');
$dsDelimiter = array(',');
// 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->setDataSourceSchema($dsSchema);
$inp->setDataSourceResultFormat($dsFormatCallback);
$inp->setDataSourceDelimiter($dsDelimiter);
$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->setDataSourceSchema($dsSchema);
$inp->setDataSourceResultFormat($dsFormatCallback);
$inp->setDataSourceDelimiter($dsDelimiter);
$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->setDataSourceSchema($dsSchema);
$inp->setDataSourceResultFormat($dsFormatCallback);
$inp->setDataSourceDelimiter($dsDelimiter);
$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 $key => $data)
{
$hidden = new ilHiddenInputGUI('attachments[]');
$hidden->setValue(urlencode($data));
$form_gui->addItem($hidden);
$size = round(filesize($this->mfile->getMailPath() . '/' . $ilUser->getId() . "_" . $data) / 1024);
if ($size < 1) $size = 1;
$label = $data . " [" . number_format($size, 0, ".", "") . " KByte]";
$att->addItem($label);
}
}
$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'));
$form_gui->addCommandButton('saveDraft', $this->lng->txt('save_message'));
$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 403 of file class.ilMailFormGUI.php.

References $_POST, 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 39 of file class.ilMailFormGUI.php.

ilMailFormGUI::$lng = null
private

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

Referenced by __construct(), and showForm().

ilMailFormGUI::$mbox = null
private

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

ilMailFormGUI::$mfile = null
private

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

ilMailFormGUI::$tpl = null
private

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

Referenced by __construct().

ilMailFormGUI::$umail = null
private

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


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