ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
FormMailCodesGUI Class Reference

Class FormMailCodesGUI. More...

+ Inheritance diagram for FormMailCodesGUI:
+ Collaboration diagram for FormMailCodesGUI:

Public Member Functions

 __construct ($guiclass)
 
 getSavedMessages ()
 
 getMailMessage ()
 
- Public Member Functions inherited from ilPropertyFormGUI
 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 setTableWidth ($a_width)
 Set table width. More...
 
 getTableWidth ()
 get table width More...
 
 setMode ($a_mode)
 Set Mode ('std', 'subform'). More...
 
 getMode ()
 Get Mode ('std', 'subform'). More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setTitleIcon ($a_titleicon)
 Set TitleIcon. More...
 
 getTitleIcon ()
 Get TitleIcon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setShowTopButtons ($a_val)
 Get show top buttons. More...
 
 getShowTopButtons ()
 Set show top buttons. More...
 
 addItem ($a_item)
 Add Item (Property, SectionHeader). More...
 
 removeItemByPostVar ($a_post_var)
 Remove Item. More...
 
 getItemByPostVar ($a_post_var)
 Get Item by POST variable. More...
 
 setItems ($a_items)
 Set Items. More...
 
 getItems ()
 Get Items. More...
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage ($a_val)
 Set disable standard message. More...
 
 getDisableStandardMessage ()
 Get disable standard message. More...
 
 getHideLabels ()
 Get a value indicating whether the labels should be hidden or not. More...
 
 setHideLabels ($a_value=true)
 Set a value indicating whether the labels should be hidden or not. More...
 
 setValuesByArray ($a_values, $a_restrict_to_value_keys=false)
 Set form values from an array. More...
 
 setValuesByPost ()
 Set form values from POST values. More...
 
 checkInput ()
 Check Post Input. More...
 
 getInput ($a_post_var, $ensureValidation=true)
 Returns the value of a HTTP-POST variable, identified by the passed id. More...
 
 addCustomProperty ($a_title, $a_html, $a_info="", $a_alert="", $a_required=false)
 Add a custom property. More...
 
 addCommandButton ($a_cmd, $a_text, $a_id="")
 Add Command button. More...
 
 getCommandButtons ()
 Return all Command buttons. More...
 
 clearCommandButtons ()
 Remove all command buttons. More...
 
 getContent ()
 Get Content. More...
 
 insertItem ($item, $a_sub_item=false)
 
 getHTML ()
 
 getFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload ($a_field, $a_index=null, $a_sub_index=null)
 Was any file uploaded? More...
 
 moveFileUpload ($a_target_directory, $a_field, $a_target_name=null, $a_index=null, $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction ($a_formaction)
 Set FormAction. More...
 
 getFormAction ()
 Get FormAction. More...
 
 setTarget ($a_target)
 Set Target. More...
 
 getTarget ()
 Get Target. More...
 
 setMultipart ($a_multipart)
 Set Enctype Multipart/Formdata true/false. More...
 
 getMultipart ()
 Get Enctype Multipart/Formdata true/false. More...
 
 setId ($a_id)
 Set Id. More...
 
 getId ()
 Get Id. More...
 
 setName ($a_name)
 Set Name. More...
 
 getName ()
 Get Name. More...
 
 setKeepOpen ($a_keepopen)
 Set Keep Form Tag Open. More...
 
 getKeepOpen ()
 Get Keep Form Tag Open. More...
 
 setOpenTag ($a_open)
 Enable/Disable Open Form Tag. More...
 
 getOpenTag ()
 Get Open Form Tag Enabled. More...
 
 setCloseTag ($a_val)
 Set close tag. More...
 
 getCloseTag ()
 Get close tag. More...
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 getHTML ()
 Get HTML. More...
 
 getContent ()
 Get Content. More...
 

Private Attributes

 $lng
 
 $guiclass
 
 $subject
 
 $messagetype
 
 $sendtype
 
 $savedmessages
 
 $mailmessage
 
 $savemessage
 
 $savemessagetitle
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 hideRequired ($a_type)
 
 rebuildUploadedFiles ()
 try to rebuild files More...
 
- Protected Attributes inherited from ilPropertyFormGUI
 $mode = "std"
 
 $check_input_called = false
 
 $disable_standard_message = false
 
 $top_anchor = "il_form_top"
 
 $titleicon = false
 
 $description = ""
 
 $tbl_width = false
 
 $show_top_buttons = true
 
 $hide_labels = false
 
- Protected Attributes inherited from ilFormGUI
 $formaction
 
 $multipart = false
 
 $keepopen = false
 
 $opentag = true
 
 $id
 
 $name
 
 $prevent_double_submission = false
 

Detailed Description

Class FormMailCodesGUI.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Version
$Id$

Definition at line 37 of file FormMailCodesGUI.php.

Constructor & Destructor Documentation

◆ __construct()

FormMailCodesGUI::__construct (   $guiclass)

Definition at line 49 of file FormMailCodesGUI.php.

References $_GET, $guiclass, $ilSetting, $ilUser, $lng, $options, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilRadioGroupInputGUI\addOption(), array, ilMailGlobalServices\getMailObjectRefId(), ilUtil\sendInfo(), ilFormGUI\setFormAction(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), ilTextInputGUI\setSize(), and ilPropertyFormGUI\setTitle().

50  {
51  parent::__construct();
52 
53  global $lng;
54  global $ilAccess;
55  global $ilSetting;
56  global $ilUser;
57  global $rbacsystem;
58 
59  $this->lng = $lng;
60  $this->guiclass = $guiclass;
61 
62  $this->setFormAction($guiclass->ctrl->getFormAction($this->guiclass));
63  $this->setTitle($this->lng->txt('compose'));
64 
65  $this->subject = new ilTextInputGUI($this->lng->txt('subject'), 'm_subject');
66  $this->subject->setSize(50);
67  $this->subject->setRequired(true);
68  $this->addItem($this->subject);
69 
70  $this->sendtype = new ilRadioGroupInputGUI($this->lng->txt('recipients'), "m_notsent");
71  $this->sendtype->addOption(new ilCheckboxOption($this->lng->txt("send_to_all"), 0, ''));
72  $this->sendtype->addOption(new ilCheckboxOption($this->lng->txt("not_sent_only"), 1, ''));
73  $this->sendtype->addOption(new ilCheckboxOption($this->lng->txt("send_to_unanswered"), 3, ''));
74  $this->sendtype->addOption(new ilCheckboxOption($this->lng->txt("send_to_answered"), 2, ''));
75  $this->addItem($this->sendtype);
76 
77  $existingdata = $this->guiclass->getObject()->getExternalCodeRecipients();
78 
79  $existingcolumns = array();
80  if (count($existingdata))
81  {
82  $first = array_shift($existingdata);
83  foreach ($first as $key => $value)
84  {
85  if (strcmp($key, 'code') != 0 && strcmp($key, 'email') != 0 && strcmp($key, 'sent') != 0) array_push($existingcolumns, '[' . $key . ']');
86  }
87  }
88 
89  $settings = $this->guiclass->getObject()->getUserSettings($ilUser->getId(), 'savemessage');
90  if (count($settings))
91  {
92  $options = array(0 => $this->lng->txt('please_select'));
93  foreach ($settings as $setting)
94  {
95  $options[$setting['settings_id']] = $setting['title'];
96  }
97  $this->savedmessages = new ilSelectInputGUI($this->lng->txt("saved_messages"), "savedmessage");
98  $this->savedmessages->setOptions($options);
99  $this->addItem($this->savedmessages);
100  }
101 
102  $this->mailmessage = new ilTextAreaInputGUI($this->lng->txt('message_content'), 'm_message');
103  $this->mailmessage->setRequired(true);
104  $this->mailmessage->setCols(80);
105  $this->mailmessage->setRows(10);
106  $this->mailmessage->setInfo(sprintf($this->lng->txt('message_content_info'), join($existingcolumns, ', ')));
107  $this->addItem($this->mailmessage);
108 
109  // save message
110  $this->savemessage = new ilCheckboxInputGUI('', "savemessage");
111  $this->savemessage->setOptionTitle($this->lng->txt("save_reuse_message"));
112  $this->savemessage->setValue(1);
113 
114  $this->savemessagetitle = new ilTextInputGUI($this->lng->txt('save_reuse_title'), 'savemessagetitle');
115  $this->savemessagetitle->setSize(60);
116  $this->savemessage->addSubItem($this->savemessagetitle);
117 
118  $this->addItem($this->savemessage);
119 
120  if (count($settings))
121  {
122  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) $this->addCommandButton("deleteSavedMessage", $this->lng->txt("delete_saved_message"));
123  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) $this->addCommandButton("insertSavedMessage", $this->lng->txt("insert_saved_message"));
124  }
125 
126  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && $rbacsystem->checkAccess('smtp_mail', ilMailGlobalServices::getMailObjectRefId()))
127  {
128  if(!(int)$ilSetting->get('prevent_smtp_globally'))
129  {
130  $this->addCommandButton("sendCodesMail", $this->lng->txt("send"));
131  }
132  else
133  {
134  ilUtil::sendInfo($lng->txt("cant_send_email_smtp_disabled"));
135  }
136  }
137  else
138  {
139  ilUtil::sendInfo($lng->txt("cannot_send_emails"));
140 
141  }
142  }
This class represents an option in a checkbox group.
This class represents a selection list property in a property form.
$_GET["client_id"]
This class represents a checkbox property in a property form.
setFormAction($a_formaction)
Set FormAction.
addItem($a_item)
Add Item (Property, SectionHeader).
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
This class represents a property in a property form.
addOption($a_option)
Add Option.
setTitle($a_title)
Set Title.
if(!is_array($argv)) $options
setSize($a_size)
Set Size.
This class represents a text property in a property form.
addCommandButton($a_cmd, $a_text, $a_id="")
Add Command button.
$ilUser
Definition: imgupload.php:18
setOptions($a_options)
Set Options.
Create styles array
The data for the language used.
global $ilSetting
Definition: privfeed.php:17
This class represents a text area property in a property form.
static getMailObjectRefId()
Determines the reference id of the mail object and stores this information in a local cache variable...
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

Member Function Documentation

◆ getMailMessage()

FormMailCodesGUI::getMailMessage ( )

Definition at line 149 of file FormMailCodesGUI.php.

References $mailmessage.

150  {
151  return $this->mailmessage;
152  }

◆ getSavedMessages()

FormMailCodesGUI::getSavedMessages ( )

Definition at line 144 of file FormMailCodesGUI.php.

References $savedmessages.

145  {
146  return $this->savedmessages;
147  }

Field Documentation

◆ $guiclass

FormMailCodesGUI::$guiclass
private

Definition at line 40 of file FormMailCodesGUI.php.

Referenced by __construct().

◆ $lng

FormMailCodesGUI::$lng
private

Definition at line 39 of file FormMailCodesGUI.php.

Referenced by __construct().

◆ $mailmessage

FormMailCodesGUI::$mailmessage
private

Definition at line 45 of file FormMailCodesGUI.php.

Referenced by getMailMessage().

◆ $messagetype

FormMailCodesGUI::$messagetype
private

Definition at line 42 of file FormMailCodesGUI.php.

◆ $savedmessages

FormMailCodesGUI::$savedmessages
private

Definition at line 44 of file FormMailCodesGUI.php.

Referenced by getSavedMessages().

◆ $savemessage

FormMailCodesGUI::$savemessage
private

Definition at line 46 of file FormMailCodesGUI.php.

◆ $savemessagetitle

FormMailCodesGUI::$savemessagetitle
private

Definition at line 47 of file FormMailCodesGUI.php.

◆ $sendtype

FormMailCodesGUI::$sendtype
private

Definition at line 43 of file FormMailCodesGUI.php.

◆ $subject

FormMailCodesGUI::$subject
private

Definition at line 41 of file FormMailCodesGUI.php.


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