ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjMailGUI Class Reference

Class ilObjMailGUI for admin panel. More...

+ Inheritance diagram for ilObjMailGUI:
+ Collaboration diagram for ilObjMailGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference)
 Constructor public.
 viewObject ()
 list childs of current object
 saveObject ()
 save object
 importObject ()
 performImportObject ()
 uploadObject ()
 __initFileObject ()
 __initParserObject ($a_xml, $a_mode)
executeCommand ()
 execute command
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getTabs (&$tabs_gui)
 get tabs public
 _goto ($a_target)
 goto target group
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 getHTML ()
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 createObject ()
 create new object form
 cancelCreation ()
 cancel create action and go back to repository parent
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.

Private Member Functions

 initForm ()
 setDefaultValues ()

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root.
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root.
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false
const CFORM_NEW = 1
const CFORM_IMPORT = 2
const CFORM_CLONE = 3
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu.
 insertHeaderAction ($a_list_gui)
 Insert header action into main template.
 addHeaderAction ()
 Add header action menu.
 redrawHeaderActionObject ()
 Ajax call: redraw action header only.
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 initCreationForms ($a_new_type)
 Init creation froms.
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion)
 initCreateForm ($a_new_type)
 Init object creation form.
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types.
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates.
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen.
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position.
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook.
 initEditForm ()
 Init object edit form.
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form.
 getEditFormValues ()
 Get values for edit form.
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields.
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object.
 afterUpdate ()
 Post (successful) object update hook.
 initImportForm ($a_new_type)
 Init object import form.
 importFileObject ($parent_id=null)
 Import.
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook.
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 __showButton ($a_cmd, $a_text, $a_target= '')
 hitsperpageObject ()
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error.
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission.

Detailed Description

Class ilObjMailGUI for admin panel.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om $Id$

ilObjMailGUI: ilPermissionGUI

Definition at line 17 of file class.ilObjMailGUI.php.

Constructor & Destructor Documentation

ilObjMailGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference 
)

Constructor public.

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

{
$this->type = 'mail';
parent::__construct($a_data,$a_id,$a_call_by_reference, false);
$this->lng->loadLanguageModule('mail');
}

Member Function Documentation

ilObjMailGUI::__initFileObject ( )

Definition at line 277 of file class.ilObjMailGUI.php.

Referenced by importObject(), performImportObject(), and uploadObject().

{
include_once "./Services/Mail/classes/class.ilFileDataImportMail.php";
$this->file_obj =& new ilFileDataImportMail();
return true;
}

+ Here is the caller graph for this function:

ilObjMailGUI::__initParserObject (   $a_xml,
  $a_mode 
)

Definition at line 285 of file class.ilObjMailGUI.php.

Referenced by performImportObject(), and uploadObject().

{
include_once "Services/Mail/classes/class.ilMailImportParser.php";
if(!$a_xml)
{
return false;
}
$this->parser_obj =& new ilMailImportParser($a_xml,$a_mode);
return true;
}

+ Here is the caller graph for this function:

ilObjMailGUI::_goto (   $a_target)

goto target group

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

References $_GET, $_SESSION, $ilErr, ilObjectGUI\$lng, ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, ilUtil\redirect(), and ilUtil\sendFailure().

{
global $ilAccess, $ilErr, $lng, $rbacsystem;
require_once 'Services/Mail/classes/class.ilMail.php';
$mail = new ilMail($_SESSION["AccountId"]);
if($rbacsystem->checkAccess('internal_mail', $mail->getMailObjectReferenceId()))
{
ilUtil::redirect("ilias.php?baseClass=ilMailGUI");
}
else
{
if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID))
{
$_GET["cmd"] = "frameset";
$_GET["target"] = "";
$_GET["ref_id"] = ROOT_FOLDER_ID;
$_GET["baseClass"] = "ilRepositoryGUI";
ilUtil::sendFailure(sprintf($lng->txt("msg_no_perm_read_item"),
include("ilias.php");
}
}
$ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
}

+ Here is the call graph for this function:

& ilObjMailGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 299 of file class.ilObjMailGUI.php.

References $cmd, $ret, and ilObjectGUI\prepareOutput().

{
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
switch($next_class)
{
case 'ilpermissiongui':
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
default:
if(!$cmd)
{
$cmd = "view";
}
$cmd .= "Object";
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilObjMailGUI::getAdminTabs ( $tabs_gui)

administration tabs show only permissions and trash folder

Reimplemented from ilObjectGUI.

Definition at line 326 of file class.ilObjMailGUI.php.

References getTabs().

{
$this->getTabs($tabs_gui);
}

+ Here is the call graph for this function:

ilObjMailGUI::getTabs ( $tabs_gui)

get tabs public

Parameters
objecttabs gui object

Reimplemented from ilObjectGUI.

Definition at line 336 of file class.ilObjMailGUI.php.

Referenced by getAdminTabs().

{
global $rbacsystem;
if ($rbacsystem->checkAccess("visible,read",$this->object->getRefId()))
{
$tabs_gui->addTarget("settings",
$this->ctrl->getLinkTarget($this, "view"), array("view", 'save', ""), "", "");
}
if ($rbacsystem->checkAccess('edit_permission',$this->object->getRefId()))
{
$tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"), array("perm","info","owner"), 'ilpermissiongui');
}
}

+ Here is the caller graph for this function:

ilObjMailGUI::importObject ( )

Definition at line 182 of file class.ilObjMailGUI.php.

References ilObjectGUI\$lng, and __initFileObject().

{
global $rbacsystem,$lng;
if (!$rbacsystem->checkAccess('write',$this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->WARNING);
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.mail_import.html", "Services/Mail");
// GET ALREADY CREATED UPLOADED XML FILE
$this->__initFileObject();
if($this->file_obj->findXMLFile())
{
$this->tpl->setVariable("TXT_IMPORTED_FILE",$lng->txt("checked_files"));
$this->tpl->setVariable("XML_FILE",basename($this->file_obj->getXMLFile()));
$this->tpl->setVariable("BTN_IMPORT",$this->lng->txt("import"));
}
$this->tpl->setVariable("FORMACTION",
$this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_IMPORT_MAIL",$this->lng->txt("table_mail_import"));
$this->tpl->setVariable("TXT_IMPORT_FILE",$this->lng->txt("mail_import_file"));
$this->tpl->setVariable("BTN_CANCEL",$this->lng->txt("cancel"));
$this->tpl->setVariable("BTN_UPLOAD",$this->lng->txt("upload"));
return true;
}

+ Here is the call graph for this function:

ilObjMailGUI::initForm ( )
private

Definition at line 45 of file class.ilObjMailGUI.php.

References $si, IL_MAIL_BOTH, IL_MAIL_EMAIL, IL_MAIL_LOCAL, ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilTextInputGUI\setSize(), ilCheckboxInputGUI\setValue(), and USER_FOLDER_ID.

Referenced by saveObject(), and viewObject().

{
include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this, 'save'));
$this->form->setTitle($this->lng->txt('general_settings'));
// Subject prefix
$pre = new ilTextInputGUI($this->lng->txt('mail_subject_prefix'),'mail_subject_prefix');
$pre->setSize(12);
$pre->setMaxLength(32);
$pre->setInfo($this->lng->txt('mail_subject_prefix_info'));
$this->form->addItem($pre);
// incoming type
include_once 'Services/Mail/classes/class.ilMailOptions.php';
$options = array(
IL_MAIL_LOCAL => $this->lng->txt('mail_incoming_local'),
IL_MAIL_EMAIL => $this->lng->txt('mail_incoming_smtp'),
IL_MAIL_BOTH => $this->lng->txt('mail_incoming_both')
);
$si = new ilSelectInputGUI($this->lng->txt('mail_incoming'), 'mail_incoming_mail');
$si->setOptions($options);
$this->ctrl->setParameterByClass('ilobjuserfoldergui', 'ref_id', USER_FOLDER_ID);
$si->setInfo(sprintf($this->lng->txt('mail_settings_incoming_type_see_also'), $this->ctrl->getLinkTargetByClass('ilobjuserfoldergui', 'settings')));
$this->ctrl->clearParametersByClass('ilobjuserfoldergui');
$this->form->addItem($si);
// noreply address
$ti = new ilTextInputGUI($this->lng->txt('mail_external_sender_noreply'), 'mail_external_sender_noreply');
$ti->setInfo($this->lng->txt('info_mail_external_sender_noreply'));
$ti->setMaxLength(255);
$this->form->addItem($ti);
$system_sender_name = new ilTextInputGUI($this->lng->txt('mail_system_sender_name'), 'mail_system_sender_name');
$system_sender_name->setInfo($this->lng->txt('mail_system_sender_name_info'));
$system_sender_name->setMaxLength(255);
$this->form->addItem($system_sender_name);
$cb = new ilCheckboxInputGUI($this->lng->txt('mail_use_pear_mail'), 'pear_mail_enable');
$cb->setInfo($this->lng->txt('mail_use_pear_mail_info'));
$cb->setValue(1);
$this->form->addItem($cb);
// prevent smtp mails
$cb = new ilCheckboxInputGUI($this->lng->txt('mail_prevent_smtp_globally'), 'prevent_smtp_globally');
$cb->setValue(1);
$this->form->addItem($cb);
$cron_mail = new ilSelectInputGUI($this->lng->txt('cron_mail_notification'), 'mail_notification');
$cron_options = array(
0 => $this->lng->txt('cron_mail_notification_never'),
1 => $this->lng->txt('cron_mail_notification_cron')
);
$cron_mail->setOptions($cron_options);
$cron_mail->setInfo($this->lng->txt('cron_mail_notification_desc'));
$this->form->addItem($cron_mail);
// section header
$sh->setTitle($this->lng->txt('mail').' ('.$this->lng->txt('internal_system').')');
$this->form->addItem($sh);
// max attachment size
$ti = new ilTextInputGUI($this->lng->txt('mail_maxsize_attach'), 'mail_maxsize_attach');
$ti->setInfo($this->lng->txt('kb'));
$ti->setMaxLength(10);
$ti->setSize(10);
$this->form->addItem($ti);
// Course/Group member notification
$mn->setTitle($this->lng->txt('mail_member_notification'));
$this->form->addItem($mn);
// Course member notification
$cn = new ilCheckboxInputGUI($this->lng->txt('mail_enable_crs_member_notification'), 'mail_crs_member_notification');
$cn->setInfo($this->lng->txt('mail_enable_crs_member_notification_info'));
$this->form->addItem($cn);
// Group member notification
$gn = new ilCheckboxInputGUI($this->lng->txt('mail_enable_grp_member_notification'), 'mail_grp_member_notification');
$gn->setInfo($this->lng->txt('mail_enable_grp_member_notification_info'));
$this->form->addItem($gn);
$this->form->addCommandButton('save', $this->lng->txt('save'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjMailGUI::performImportObject ( )

Definition at line 212 of file class.ilObjMailGUI.php.

References ilObjectGUI\$lng, __initFileObject(), __initParserObject(), and ilUtil\sendInfo().

{
global $rbacsystem,$lng;
if (!$rbacsystem->checkAccess('write',$this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->WARNING);
}
$this->__initFileObject();
$this->file_obj->findXMLFile();
$this->__initParserObject($this->file_obj->getXMLFile(),"import");
$this->parser_obj->startParsing();
$number = $this->parser_obj->getCountImported();
ilUtil::sendInfo($lng->txt("import_finished")." ".$number,true);
$this->ctrl->redirect($this, "import");
}

+ Here is the call graph for this function:

ilObjMailGUI::saveObject ( )

save object

public

Reimplemented from ilObjectGUI.

Definition at line 152 of file class.ilObjMailGUI.php.

References $ilSetting, initForm(), and ilUtil\sendSuccess().

{
global $ilAccess,$ilSetting;
if(!$ilAccess->checkAccess('write,read', '', $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
}
$this->initForm();
if($this->form->checkInput())
{
$this->ilias->setSetting('mail_subject_prefix',$this->form->getInput('mail_subject_prefix'));
$this->ilias->setSetting('mail_incoming_mail', (int)$this->form->getInput('mail_incoming_mail'));
$this->ilias->setSetting('mail_maxsize_attach', $this->form->getInput('mail_maxsize_attach'));
$this->ilias->setSetting('pear_mail_enable', (int)$this->form->getInput('pear_mail_enable'));
$this->ilias->setSetting('mail_external_sender_noreply', $this->form->getInput('mail_external_sender_noreply'));
$this->ilias->setSetting('prevent_smtp_globally', (int)$this->form->getInput('prevent_smtp_globally'));
$this->ilias->setSetting('mail_notification', (int)$this->form->getInput('mail_notification'));
$ilSetting->set('mail_crs_member_notification', (int) $this->form->getInput('mail_crs_member_notification'));
$ilSetting->set('mail_grp_member_notification', (int) $this->form->getInput('mail_grp_member_notification'));
$ilSetting->set('mail_system_sender_name', $this->form->getInput('mail_system_sender_name'));
ilUtil::sendSuccess($this->lng->txt('saved_successfully'));
}
$this->form->setValuesByPost();
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

ilObjMailGUI::setDefaultValues ( )
private

Definition at line 135 of file class.ilObjMailGUI.php.

Referenced by viewObject().

{
$settings = $this->ilias->getAllSettings();
$this->form->setValuesByArray(array(
'mail_subject_prefix' => $settings['mail_subject_prefix'] ? $settings['mail_subject_prefix'] : '[ILIAS]',
'mail_incoming_mail' => (int)$settings['mail_incoming_mail'],
'pear_mail_enable' => $settings['pear_mail_enable'] ? true : false,
'mail_external_sender_noreply' => $settings['mail_external_sender_noreply'],
'prevent_smtp_globally' => ($settings['prevent_smtp_globally'] == '1') ? true : false,
'mail_maxsize_attach' => $settings['mail_maxsize_attach'],
'mail_notification' => $settings['mail_notification'],
'mail_crs_member_notification' => isset($settings['mail_crs_member_notification']) ? $settings['mail_crs_member_notification'] : 1,
'mail_grp_member_notification' => isset($settings['mail_grp_member_notification']) ? $settings['mail_grp_member_notification'] : 1,
'mail_system_sender_name' => $settings['mail_system_sender_name']
));
}

+ Here is the caller graph for this function:

ilObjMailGUI::uploadObject ( )

Definition at line 232 of file class.ilObjMailGUI.php.

References ilObjectGUI\$lng, __initFileObject(), __initParserObject(), and ilUtil\sendInfo().

{
global $rbacsystem,$lng;
if (!$rbacsystem->checkAccess('write',$this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt("msg_no_perm_write"),$this->ilias->error_obj->WARNING);
}
$this->__initFileObject();
if(!$this->file_obj->storeUploadedFile($_FILES["importFile"])) // STEP 1 save file in ...import/mail
{
$this->message = $lng->txt("import_file_not_valid");
$this->file_obj->unlinkLast();
}
else if(!$this->file_obj->unzip())
{
$this->message = $lng->txt("cannot_unzip_file"); // STEP 2 unzip uplaoded file
$this->file_obj->unlinkLast();
}
else if(!$this->file_obj->findXMLFile()) // STEP 3 getXMLFile
{
$this->message = $lng->txt("cannot_find_xml");
$this->file_obj->unlinkLast();
}
else if(!$this->__initParserObject($this->file_obj->getXMLFile(),"check"))
{
$this->message = $lng->txt("error_parser"); // STEP 4 init sax parser
}
else if(!$this->parser_obj->startParsing())
{
$this->message = $lng->txt("users_not_imported").":<br/>"; // STEP 5 start parsing
$this->message .= $this->parser_obj->getNotAssignableUsers();
}
// FINALLY CHECK ERROR
if(!$this->message)
{
$this->message = $lng->txt("uploaded_and_checked");
}
ilUtil::sendInfo($this->message,true);
$this->ctrl->redirect($this, "import");
}

+ Here is the call graph for this function:

ilObjMailGUI::viewObject ( )

list childs of current object

public

Reimplemented from ilObjectGUI.

Definition at line 31 of file class.ilObjMailGUI.php.

References initForm(), and setDefaultValues().

{
global $ilAccess;
if(!$ilAccess->checkAccess('write,read', '', $this->object->getRefId()))
{
$this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->WARNING);
}
$this->initForm();
$this->setDefaultValues();
$this->tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:


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