4 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
23 public function __construct($a_data,$a_id,$a_call_by_reference)
26 parent::__construct($a_data,$a_id,$a_call_by_reference,
false);
28 $this->lng->loadLanguageModule(
'mail');
35 if(!$ilAccess->checkAccess(
'write,read',
'', $this->object->getRefId()))
37 $this->
ilias->raiseError($this->lng->txt(
'msg_no_perm_write'), $this->
ilias->error_obj->WARNING);
42 $this->tpl->setContent($this->form->getHTML());
47 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
50 $this->form->setFormAction($this->ctrl->getFormAction($this,
'save'));
51 $this->form->setTitle($this->lng->txt(
'general_settings'));
54 $pre =
new ilTextInputGUI($this->lng->txt(
'mail_subject_prefix'),
'mail_subject_prefix');
56 $pre->setMaxLength(32);
57 $pre->setInfo($this->lng->txt(
'mail_subject_prefix_info'));
58 $this->form->addItem($pre);
61 include_once
'Services/Mail/classes/class.ilMailOptions.php';
69 $this->ctrl->setParameterByClass(
'ilobjuserfoldergui',
'ref_id',
USER_FOLDER_ID);
70 $si->setInfo(sprintf($this->lng->txt(
'mail_settings_incoming_type_see_also'), $this->ctrl->getLinkTargetByClass(
'ilobjuserfoldergui',
'settings')));
71 $this->ctrl->clearParametersByClass(
'ilobjuserfoldergui');
72 $this->form->addItem($si);
74 $send_html =
new ilCheckboxInputGUI($this->lng->txt(
'mail_send_html'),
'mail_send_html');
75 $send_html->
setInfo($this->lng->txt(
'mail_send_html_info'));
76 $send_html->setValue(1);
77 $this->form->addItem($send_html);
80 $ti =
new ilTextInputGUI($this->lng->txt(
'mail_external_sender_noreply'),
'mail_external_sender_noreply');
81 $ti->
setInfo($this->lng->txt(
'info_mail_external_sender_noreply'));
82 $ti->setMaxLength(255);
83 $this->form->addItem($ti);
85 $system_from_name =
new ilTextInputGUI($this->lng->txt(
'mail_system_from_name'),
'mail_system_from_name');
86 $system_from_name->
setInfo($this->lng->txt(
'mail_system_from_name_info'));
87 $system_from_name->setMaxLength(255);
88 $this->form->addItem($system_from_name);
90 $system_return_path =
new ilTextInputGUI($this->lng->txt(
'mail_system_return_path'),
'mail_system_return_path');
91 $system_return_path->
setInfo($this->lng->txt(
'mail_system_return_path_info'));
92 $system_return_path->setMaxLength(255);
93 $this->form->addItem($system_return_path);
96 $cb =
new ilCheckboxInputGUI($this->lng->txt(
'mail_prevent_smtp_globally'),
'prevent_smtp_globally');
98 $this->form->addItem($cb);
100 $cron_mail =
new ilSelectInputGUI($this->lng->txt(
'cron_mail_notification'),
'mail_notification');
101 $cron_options =
array(
102 0 => $this->lng->txt(
'cron_mail_notification_never'),
103 1 => $this->lng->txt(
'cron_mail_notification_cron')
106 $cron_mail->setOptions($cron_options);
107 $cron_mail->setInfo($this->lng->txt(
'cron_mail_notification_desc'));
108 $this->form->addItem($cron_mail);
112 $sh->setTitle($this->lng->txt(
'mail').
' ('.$this->lng->txt(
'internal_system').
')');
113 $this->form->addItem($sh);
116 $ti =
new ilNumberInputGUI($this->lng->txt(
'mail_maxsize_attach'),
'mail_maxsize_attach');
118 $ti->setInfo($this->lng->txt(
'mail_max_size_attachments_total'));
119 $ti->setMaxLength(10);
121 $this->form->addItem($ti);
125 $mn->setTitle($this->lng->txt(
'mail_member_notification'));
126 $this->form->addItem($mn);
128 include_once
"Services/Administration/classes/class.ilAdministrationSettingsFormHandler.php";
135 $this->form->addCommandButton(
'save', $this->lng->txt(
'save'));
140 $settings = $this->
ilias->getAllSettings();
141 $this->form->setValuesByArray(
array(
142 'mail_subject_prefix' => $settings[
'mail_subject_prefix'] ? $settings[
'mail_subject_prefix'] :
'[ILIAS]',
143 'mail_incoming_mail' => (
int)$settings[
'mail_incoming_mail'],
144 'mail_send_html' => (
int)$settings[
'mail_send_html'],
145 'mail_external_sender_noreply' => $settings[
'mail_external_sender_noreply'],
146 'prevent_smtp_globally' => ($settings[
'prevent_smtp_globally'] ==
'1') ?
true :
false,
147 'mail_maxsize_attach' => $settings[
'mail_maxsize_attach'],
148 'mail_notification' => $settings[
'mail_notification'],
149 'mail_system_from_name' => $settings[
'mail_system_sender_name'],
150 'mail_system_return_path' => $settings[
'mail_system_return_path']
158 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
160 $this->
ilias->raiseError($this->lng->txt(
'msg_no_perm_write'), $this->
ilias->error_obj->WARNING);
164 if($this->form->checkInput())
166 $this->
ilias->setSetting(
'mail_send_html',$this->form->getInput(
'mail_send_html'));
167 $this->
ilias->setSetting(
'mail_subject_prefix',$this->form->getInput(
'mail_subject_prefix'));
168 $this->
ilias->setSetting(
'mail_incoming_mail', (
int)$this->form->getInput(
'mail_incoming_mail'));
169 $this->
ilias->setSetting(
'mail_maxsize_attach', $this->form->getInput(
'mail_maxsize_attach'));
170 $this->
ilias->setSetting(
'mail_external_sender_noreply', $this->form->getInput(
'mail_external_sender_noreply'));
171 $this->
ilias->setSetting(
'prevent_smtp_globally', (
int)$this->form->getInput(
'prevent_smtp_globally'));
172 $this->
ilias->setSetting(
'mail_notification', (
int)$this->form->getInput(
'mail_notification'));
173 $ilSetting->set(
'mail_system_sender_name', $this->form->getInput(
'mail_system_from_name'));
174 $ilSetting->set(
'mail_system_return_path', $this->form->getInput(
'mail_system_return_path'));
178 $this->form->setValuesByPost();
180 $this->tpl->setContent($this->form->getHTML());
185 global $rbacsystem,
$lng;
187 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
189 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->
ilias->error_obj->WARNING);
191 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.mail_import.html",
"Services/Mail");
195 if($this->file_obj->findXMLFile())
197 $this->tpl->setVariable(
"TXT_IMPORTED_FILE",$lng->txt(
"checked_files"));
198 $this->tpl->setVariable(
"XML_FILE",basename($this->file_obj->getXMLFile()));
200 $this->tpl->setVariable(
"BTN_IMPORT",$this->lng->txt(
"import"));
203 $this->tpl->setVariable(
"FORMACTION",
204 $this->ctrl->getFormAction($this));
205 $this->tpl->setVariable(
"TXT_IMPORT_MAIL",$this->lng->txt(
"table_mail_import"));
206 $this->tpl->setVariable(
"TXT_IMPORT_FILE",$this->lng->txt(
"mail_import_file"));
207 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
"cancel"));
208 $this->tpl->setVariable(
"BTN_UPLOAD",$this->lng->txt(
"upload"));
215 global $rbacsystem,
$lng;
217 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
219 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->
ilias->error_obj->WARNING);
222 $this->file_obj->findXMLFile();
224 $this->parser_obj->startParsing();
225 $number = $this->parser_obj->getCountImported();
228 $this->ctrl->redirect($this,
"import");
235 global $rbacsystem,
$lng;
237 if (!$rbacsystem->checkAccess(
'write',$this->object->getRefId()))
239 $this->
ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->
ilias->error_obj->WARNING);
243 if(!$this->file_obj->storeUploadedFile($_FILES[
"importFile"]))
245 $this->message = $lng->txt(
"import_file_not_valid");
246 $this->file_obj->unlinkLast();
248 else if(!$this->file_obj->unzip())
250 $this->message = $lng->txt(
"cannot_unzip_file");
251 $this->file_obj->unlinkLast();
253 else if(!$this->file_obj->findXMLFile())
255 $this->message = $lng->txt(
"cannot_find_xml");
256 $this->file_obj->unlinkLast();
260 $this->message = $lng->txt(
"error_parser");
262 else if(!$this->parser_obj->startParsing())
264 $this->message = $lng->txt(
"users_not_imported").
":<br/>";
265 $this->message .= $this->parser_obj->getNotAssignableUsers();
270 $this->message = $lng->txt(
"uploaded_and_checked");
274 $this->ctrl->redirect($this,
"import");
280 include_once
"./Services/Mail/classes/class.ilFileDataImportMail.php";
288 include_once
"Services/Mail/classes/class.ilMailImportParser.php";
307 $next_class = $this->ctrl->getNextClass($this);
308 $cmd = $this->ctrl->getCmd();
313 case 'ilpermissiongui':
314 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
316 $ret =& $this->ctrl->forwardCommand($perm_gui);
319 case 'ilmailtemplategui':
320 if(!$rbacsystem->checkAccess(
'write', $this->object->getRefId()))
322 $this->
ilias->raiseError($this->lng->txt(
'msg_no_perm_write'), $this->
ilias->error_obj->WARNING);
325 require_once
'Services/Mail/classes/class.ilMailTemplateGUI.php';
357 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
359 $this->tabs_gui->addTarget(
"settings",
360 $this->ctrl->getLinkTarget($this,
"view"),
array(
"view",
'save',
""),
"",
"");
363 if($rbacsystem->checkAccess(
'write', $this->object->getRefId()))
365 $this->tabs_gui->addTarget(
'mail_templates', $this->ctrl->getLinkTargetByClass(
'ilmailtemplategui',
'showTemplates'),
'',
'ilmailtemplategui');
368 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
370 $this->tabs_gui->addTarget(
"perm_settings",
371 $this->ctrl->getLinkTargetByClass(
array(get_class($this),
'ilpermissiongui'),
"perm"),
array(
"perm",
"info",
"owner"),
'ilpermissiongui');
378 public static function _goto($a_target)
382 require_once
'Services/Mail/classes/class.ilMail.php';
384 if($rbacsystem->checkAccess(
'internal_mail', $mail->getMailObjectReferenceId()))
391 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
393 $_GET[
"cmd"] =
"frameset";
394 $_GET[
"target"] =
"";
395 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
396 $_GET[
"baseClass"] =
"ilRepositoryGUI";
399 include(
"ilias.php");
403 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getTabs()
get tabs abstract method.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _lookupTitle($a_id)
lookup object title
__construct($a_data, $a_id, $a_call_by_reference)
Constructor public.
Class ilObjMailGUI for admin panel.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
prepareOutput($a_show_subobjects=true)
prepare output
if(!is_array($argv)) $options
__initParserObject($a_xml, $a_mode)
This class handles base functions for mail handling.
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
setSize($a_size)
Set Size.
This class represents a text property in a property form.
redirection script todo: (a better solution should control the processing via a xml file) ...
static _goto($a_target)
goto target group
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
This class handles all operations on files for the exercise object.
const USER_FOLDER_ID
Class ilObjUserFolder.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static redirect($a_script)
http redirect to other script
executeCommand()
execute command