ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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, $a_remove_unused_headers=false)
 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...
 

Protected Attributes

 $guiclass
 
 $subject
 
 $sendtype
 
 $savedmessages
 
 $mailmessage
 
 $savemessage
 
 $savemessagetitle
 
- Protected Attributes inherited from ilPropertyFormGUI
 $lng
 
 $ctrl
 
 $tpl
 
 $user
 
 $settings
 
 $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
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 hideRequired ($a_type)
 
 rebuildUploadedFiles ()
 try to rebuild files More...
 

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 47 of file FormMailCodesGUI.php.

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

48  {
49  global $DIC;
50 
51  parent::__construct();
52 
53  $ilAccess = $DIC->access();
54  $ilSetting = $DIC->settings();
55  $ilUser = $DIC->user();
56  $rbacsystem = $DIC->rbac()->system();
57 
58  $lng = $this->lng;
59 
60  $this->guiclass = $guiclass;
61 
62  $this->setFormAction($this->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  $first = array_shift($existingdata);
82  foreach ($first as $key => $value) {
83  if (strcmp($key, 'code') != 0 && strcmp($key, 'email') != 0 && strcmp($key, 'sent') != 0) {
84  array_push($existingcolumns, '[' . $key . ']');
85  }
86  }
87  }
88 
89  $settings = $this->guiclass->getObject()->getUserSettings($ilUser->getId(), 'savemessage');
90  if (count($settings)) {
91  $options = array(0 => $this->lng->txt('please_select'));
92  foreach ($settings as $setting) {
93  $options[$setting['settings_id']] = $setting['title'];
94  }
95  $this->savedmessages = new ilSelectInputGUI($this->lng->txt("saved_messages"), "savedmessage");
96  $this->savedmessages->setOptions($options);
97  $this->addItem($this->savedmessages);
98  }
99 
100  $this->mailmessage = new ilTextAreaInputGUI($this->lng->txt('message_content'), 'm_message');
101  $this->mailmessage->setRequired(true);
102  $this->mailmessage->setCols(80);
103  $this->mailmessage->setRows(10);
104  $this->mailmessage->setInfo(sprintf($this->lng->txt('message_content_info'), join(', ', $existingcolumns)));
105  $this->addItem($this->mailmessage);
106 
107  // save message
108  $this->savemessage = new ilCheckboxInputGUI('', "savemessage");
109  $this->savemessage->setOptionTitle($this->lng->txt("save_reuse_message"));
110  $this->savemessage->setValue(1);
111 
112  $this->savemessagetitle = new ilTextInputGUI($this->lng->txt('save_reuse_title'), 'savemessagetitle');
113  $this->savemessagetitle->setSize(60);
114  $this->savemessage->addSubItem($this->savemessagetitle);
115 
116  $this->addItem($this->savemessage);
117 
118  if (count($settings)) {
119  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
120  $this->addCommandButton("deleteSavedMessage", $this->lng->txt("delete_saved_message"));
121  }
122  if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
123  $this->addCommandButton("insertSavedMessage", $this->lng->txt("insert_saved_message"));
124  }
125  }
126 
127  if ((int) $ilSetting->get('mail_allow_external')) {
128  $this->addCommandButton("sendCodesMail", $this->lng->txt("send"));
129  } else {
130  ilUtil::sendInfo($lng->txt("cant_send_email_smtp_disabled"));
131  }
132  }
This class represents an option in a checkbox group.
This class represents a selection list property in a property form.
global $DIC
Definition: saml.php:7
$_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.
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.
global $ilSetting
Definition: privfeed.php:17
This class represents a text area property in a property form.
$key
Definition: croninfo.php:18
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:

Member Function Documentation

◆ getMailMessage()

FormMailCodesGUI::getMailMessage ( )

Definition at line 139 of file FormMailCodesGUI.php.

References $mailmessage.

140  {
141  return $this->mailmessage;
142  }

◆ getSavedMessages()

FormMailCodesGUI::getSavedMessages ( )

Definition at line 134 of file FormMailCodesGUI.php.

References $savedmessages.

135  {
136  return $this->savedmessages;
137  }

Field Documentation

◆ $guiclass

FormMailCodesGUI::$guiclass
protected

Definition at line 39 of file FormMailCodesGUI.php.

Referenced by __construct().

◆ $mailmessage

FormMailCodesGUI::$mailmessage
protected

Definition at line 43 of file FormMailCodesGUI.php.

Referenced by getMailMessage().

◆ $savedmessages

FormMailCodesGUI::$savedmessages
protected

Definition at line 42 of file FormMailCodesGUI.php.

Referenced by getSavedMessages().

◆ $savemessage

FormMailCodesGUI::$savemessage
protected

Definition at line 44 of file FormMailCodesGUI.php.

◆ $savemessagetitle

FormMailCodesGUI::$savemessagetitle
protected

Definition at line 45 of file FormMailCodesGUI.php.

◆ $sendtype

FormMailCodesGUI::$sendtype
protected

Definition at line 41 of file FormMailCodesGUI.php.

◆ $subject

FormMailCodesGUI::$subject
protected

Definition at line 40 of file FormMailCodesGUI.php.


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