ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
FormMailCodesGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 __construct (ilSurveyParticipantsGUI $guiclass)
 
 getSavedMessages ()
 
 getMailMessage ()
 
- Public Member Functions inherited from ilPropertyFormGUI
 __construct ()
 
 executeCommand ()
 
 setTableWidth (string $a_width)
 
 getTableWidth ()
 
 setMode (string $a_mode)
 
 getMode ()
 
 setTitle (string $a_title)
 
 getTitle ()
 
 setTitleIcon (string $a_titleicon)
 
 getTitleIcon ()
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setShowTopButtons (bool $a_val)
 
 getShowTopButtons ()
 
 setForceTopButtons (bool $a_val)
 
 getForceTopButtons ()
 
 addItem ($a_item)
 
 removeItemByPostVar (string $a_post_var, bool $a_remove_unused_headers=false)
 
 getItemByPostVar (string $a_post_var)
 
 setItems (array $a_items)
 
 getItems ()
 
 getInputItemsRecursive ()
 returns a flat array of all input items including the possibly existing subitems recursively More...
 
 setDisableStandardMessage (bool $a_val)
 
 getDisableStandardMessage ()
 
 getHideLabels ()
 
 setHideLabels (bool $a_value=true)
 
 setValuesByArray (array $a_values, bool $a_restrict_to_value_keys=false)
 
 setValuesByPost ()
 
 checkInput ()
 
 getInput (string $a_post_var, bool $ensureValidation=true)
 Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-POST variable, identified by the passed postvar. More...
 
 addCommandButton (string $a_cmd, string $a_text, string $a_id="")
 
 getCommandButtons ()
 
 clearCommandButtons ()
 
 getContent ()
 
 insertItem ( $item, bool $a_sub_item=false)
 
 addAsyncOnloadCode (string $code)
 
 getHTML ()
 
 getHTMLAsync ()
 
 getFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 Get file upload data. More...
 
 hasFileUpload (string $a_field, ?string $a_index=null, ?string $a_sub_index=null)
 
 moveFileUpload (string $a_target_directory, string $a_field, ?string $a_target_name=null, ?string $a_index=null, ?string $a_sub_index=null)
 Move upload to target directory. More...
 
- Public Member Functions inherited from ilFormGUI
 setFormAction (string $a_formaction)
 
 getFormAction ()
 
 setTarget (string $a_target)
 
 getTarget ()
 
 setMultipart (bool $a_multipart)
 
 getMultipart ()
 
 setId (string $a_id)
 
 getId ()
 
 setName (string $a_name)
 
 getName ()
 
 setKeepOpen (bool $a_keepopen)
 
 getKeepOpen ()
 
 setOpenTag (bool $a_open)
 
 getOpenTag ()
 
 setCloseTag (bool $a_val)
 
 getCloseTag ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 getHTML ()
 
 getContent ()
 

Protected Attributes

ILIAS Survey Editing EditingGUIRequest $request
 
ilSurveyParticipantsGUI $guiclass
 
ilTextInputGUI $subject
 
ilRadioGroupInputGUI $sendtype
 
ilSelectInputGUI $savedmessages
 
ilTextAreaInputGUI $mailmessage
 
ilCheckboxInputGUI $savemessage
 
ilTextInputGUI $savemessagetitle
 
- Protected Attributes inherited from ilPropertyFormGUI
bool $required_text = false
 
ilLanguage $lng
 
ilCtrl $ctrl
 
ilTemplate $tpl
 
ilObjUser $user = null
 
ilSetting $settings = null
 
string $mode = "std"
 
bool $check_input_called = false
 
bool $disable_standard_message = false
 
string $top_anchor = "il_form_top"
 
string $title = ''
 
string $titleicon = ""
 
string $description = ""
 
string $tbl_width = ""
 
bool $show_top_buttons = true
 
bool $hide_labels = false
 
bool $force_top_buttons = false
 
HTTP Services $http
 
Refinery Factory $refinery = null
 
ilGlobalTemplateInterface $global_tpl = null
 
 $onload_code = []
 
- Protected Attributes inherited from ilFormGUI
string $formaction = ""
 
bool $multipart = false
 
bool $keepopen = false
 
bool $opentag = true
 
string $id = ''
 
string $name = ''
 
string $target = ''
 
bool $prevent_double_submission = false
 

Additional Inherited Members

- Protected Member Functions inherited from ilPropertyFormGUI
 getRequestedPostVar ()
 
 getFileHash ()
 
 hideRequired (string $a_type)
 
 appendOnloadCode (string $html)
 
 rebuildUploadedFiles ()
 
 checkForRequiredField ()
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class FormMailCodesGUI

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

Definition at line 24 of file FormMailCodesGUI.php.

Constructor & Destructor Documentation

◆ __construct()

FormMailCodesGUI::__construct ( ilSurveyParticipantsGUI  $guiclass)

Definition at line 35 of file FormMailCodesGUI.php.

37 {
38 global $DIC;
39 $main_tpl = $DIC->ui()->mainTemplate();
40
42
43 $ilAccess = $DIC->access();
44 $ilSetting = $DIC->settings();
45 $ilUser = $DIC->user();
46 $this->request = $DIC->survey()
47 ->internal()
48 ->gui()
49 ->editing()
50 ->request();
51
53
54 $this->guiclass = $guiclass;
55
56 $this->setFormAction($this->ctrl->getFormAction($this->guiclass));
57 $this->setTitle($this->lng->txt('compose'));
58
59 $this->subject = new ilTextInputGUI($this->lng->txt('subject'), 'm_subject');
60 $this->subject->setSize(50);
61 $this->subject->setRequired(true);
62 $this->addItem($this->subject);
63
64 $this->sendtype = new ilRadioGroupInputGUI($this->lng->txt('recipients'), "m_notsent");
65 $this->sendtype->addOption(new ilCheckboxOption($this->lng->txt("send_to_all"), 0, ''));
66 $this->sendtype->addOption(new ilCheckboxOption($this->lng->txt("not_sent_only"), 1, ''));
67 $this->sendtype->addOption(new ilCheckboxOption($this->lng->txt("send_to_unanswered"), 3, ''));
68 $this->sendtype->addOption(new ilCheckboxOption($this->lng->txt("send_to_answered"), 2, ''));
69 $this->addItem($this->sendtype);
70
71 $existingdata = $this->guiclass->getObject()->getExternalCodeRecipients();
72
73 $existingcolumns = array();
74 if (count($existingdata)) {
75 $first = array_shift($existingdata);
76 foreach ($first as $key => $value) {
77 if (strcmp($key, 'code') !== 0 && strcmp($key, 'email') !== 0 && strcmp($key, 'sent') !== 0) {
78 $existingcolumns[] = '[' . $key . ']';
79 }
80 }
81 }
82
83 $settings = $this->guiclass->getObject()->getUserSettings($ilUser->getId(), 'savemessage');
84 if (count($settings)) {
85 $options = array(0 => $this->lng->txt('please_select'));
86 foreach ($settings as $setting) {
87 $options[$setting['settings_id']] = $setting['title'];
88 }
89 $this->savedmessages = new ilSelectInputGUI($this->lng->txt("saved_messages"), "savedmessage");
90 $this->savedmessages->setOptions($options);
91 $this->addItem($this->savedmessages);
92 }
93
94 $this->mailmessage = new ilTextAreaInputGUI($this->lng->txt('message_content'), 'm_message');
95 $this->mailmessage->setRequired(true);
96 $this->mailmessage->setCols(80);
97 $this->mailmessage->setRows(10);
98 $this->mailmessage->setInfo(sprintf($this->lng->txt('message_content_info'), implode(', ', $existingcolumns)));
99 $this->addItem($this->mailmessage);
100
101 // save message
102 $this->savemessage = new ilCheckboxInputGUI('', "savemessage");
103 $this->savemessage->setOptionTitle($this->lng->txt("save_reuse_message"));
104 $this->savemessage->setValue(1);
105
106 $this->savemessagetitle = new ilTextInputGUI($this->lng->txt('save_reuse_title'), 'savemessagetitle');
107 $this->savemessagetitle->setSize(60);
108 $this->savemessage->addSubItem($this->savemessagetitle);
109
110 $this->addItem($this->savemessage);
111
112 if (count($settings)) {
113 if ($ilAccess->checkAccess("write", "", $this->request->getRefId())) {
114 $this->addCommandButton("deleteSavedMessage", $this->lng->txt("delete_saved_message"));
115 }
116 if ($ilAccess->checkAccess("write", "", $this->request->getRefId())) {
117 $this->addCommandButton("insertSavedMessage", $this->lng->txt("insert_saved_message"));
118 }
119 }
120
121 if ((int) $ilSetting->get('mail_allow_external')) {
122 $this->addCommandButton("sendCodesMail", $this->lng->txt("send"));
123 } else {
124 $main_tpl->setOnScreenMessage('info', $lng->txt("cant_send_email_smtp_disabled"));
125 }
126 }
ilSurveyParticipantsGUI $guiclass
This class represents a checkbox property in a property form.
This class represents an option in a checkbox group.
setFormAction(string $a_formaction)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
This class represents a property in a property form.
This class represents a selection list property in a property form.
This class represents a text area property in a property form.
This class represents a text property in a property form.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $ilSetting
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26

References $DIC, $guiclass, $ilSetting, ilPropertyFormGUI\$lng, ilPropertyFormGUI\$settings, ILIAS\GlobalScreen\Provider\__construct(), ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), ilPropertyFormGUI\setTitle(), and ilLanguage\txt().

+ Here is the call graph for this function:

Member Function Documentation

◆ getMailMessage()

FormMailCodesGUI::getMailMessage ( )

Definition at line 133 of file FormMailCodesGUI.php.

134 {
135 return $this->mailmessage;
136 }
ilTextAreaInputGUI $mailmessage

References $mailmessage.

◆ getSavedMessages()

FormMailCodesGUI::getSavedMessages ( )

Definition at line 128 of file FormMailCodesGUI.php.

129 {
131 }
ilSelectInputGUI $savedmessages

References $savedmessages.

Field Documentation

◆ $guiclass

ilSurveyParticipantsGUI FormMailCodesGUI::$guiclass
protected

Definition at line 27 of file FormMailCodesGUI.php.

Referenced by __construct().

◆ $mailmessage

ilTextAreaInputGUI FormMailCodesGUI::$mailmessage
protected

Definition at line 31 of file FormMailCodesGUI.php.

Referenced by getMailMessage().

◆ $request

ILIAS Survey Editing EditingGUIRequest FormMailCodesGUI::$request
protected

Definition at line 26 of file FormMailCodesGUI.php.

◆ $savedmessages

ilSelectInputGUI FormMailCodesGUI::$savedmessages
protected

Definition at line 30 of file FormMailCodesGUI.php.

Referenced by getSavedMessages().

◆ $savemessage

ilCheckboxInputGUI FormMailCodesGUI::$savemessage
protected

Definition at line 32 of file FormMailCodesGUI.php.

◆ $savemessagetitle

ilTextInputGUI FormMailCodesGUI::$savemessagetitle
protected

Definition at line 33 of file FormMailCodesGUI.php.

◆ $sendtype

ilRadioGroupInputGUI FormMailCodesGUI::$sendtype
protected

Definition at line 29 of file FormMailCodesGUI.php.

◆ $subject

ilTextInputGUI FormMailCodesGUI::$subject
protected

Definition at line 28 of file FormMailCodesGUI.php.


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