ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilMemberExportSettingsGUI Class Reference

Export settings gui. More...

+ Collaboration diagram for ilMemberExportSettingsGUI:

Public Member Functions

 __construct ($a_parent_type, $a_parent_obj_id=0)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 

Data Fields

const TYPE_PRINT_VIEW_SETTINGS = 'print_view'
 
const TYPE_EXPORT_SETTINGS = 'member_export'
 
const TYPE_PRINT_VIEW_MEMBERS = 'prv_members'
 

Protected Member Functions

 printViewSettings (ilPropertyFormGUI $form=null)
 Show print view settings. More...
 
 initForm ($a_type)
 init settings form More...
 
 savePrintViewSettings ()
 Save print view settings. More...
 

Private Member Functions

 getLang ()
 Get language. More...
 

Private Attributes

 $parent_type = ''
 
 $parent_obj_id = 0
 

Detailed Description

Export settings gui.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 11 of file class.ilMemberExportSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMemberExportSettingsGUI::__construct (   $a_parent_type,
  $a_parent_obj_id = 0 
)

Constructor.

Definition at line 25 of file class.ilMemberExportSettingsGUI.php.

26 {
27 $this->parent_type = $a_parent_type;
28 $this->parent_obj_id = $a_parent_obj_id;
29
30 $this->ctrl = $GLOBALS['DIC']['ilCtrl'];
31 $this->lng = $GLOBALS['DIC']['lng'];
32 $this->lng->loadLanguageModule('crs');
33 $this->lng->loadLanguageModule('mem');
34 }
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

References $GLOBALS.

Member Function Documentation

◆ executeCommand()

ilMemberExportSettingsGUI::executeCommand ( )

Execute command.

Definition at line 49 of file class.ilMemberExportSettingsGUI.php.

50 {
51 $next_class = $this->ctrl->getNextClass($this);
52 $cmd = $this->ctrl->getCmd('printViewSettings');
53
54
55 switch ($next_class) {
56 default:
57 $this->$cmd();
58 break;
59 }
60 return true;
61 }

◆ getLang()

ilMemberExportSettingsGUI::getLang ( )
private

Get language.

Returns
ilLanguage

Definition at line 40 of file class.ilMemberExportSettingsGUI.php.

41 {
42 return $this->lng;
43 }
$lng

References $lng.

Referenced by initForm().

+ Here is the caller graph for this function:

◆ initForm()

ilMemberExportSettingsGUI::initForm (   $a_type)
protected

init settings form

Definition at line 79 of file class.ilMemberExportSettingsGUI.php.

80 {
81 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
83 $form->setFormAction($this->ctrl->getFormAction($this));
84 $form->setTitle($this->getLang()->txt('mem_' . $a_type . '_form'));
85
86 // profile fields
87 $fields['name'] = $GLOBALS['DIC']['lng']->txt('name');
88 $fields['login'] = $GLOBALS['DIC']['lng']->txt('login');
89 $fields['email'] = $GLOBALS['DIC']['lng']->txt('email');
90
91 include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
92 include_once 'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
93 include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
94 include_once('Services/User/classes/class.ilUserDefinedFields.php');
95
96 $field_info = ilExportFieldsInfo::_getInstanceByType($this->parent_type);
97 $field_info->sortExportFields();
98
99 foreach ($field_info->getExportableFields() as $field) {
100 switch ($field) {
101 case 'username':
102 case 'firstname':
103 case 'lastname':
104 case 'email':
105 continue 2;
106 }
107
108 // Check if default enabled
109 $fields[$field] = $GLOBALS['DIC']['lng']->txt($field);
110 }
111
112
113 // udf
114 include_once './Services/User/classes/class.ilUserDefinedFields.php';
116 $exportable = array();
117 if ($this->parent_type == 'crs') {
118 $exportable = $udf->getCourseExportableFields();
119 } elseif ($this->parent_type == 'grp') {
120 $exportable = $udf->getGroupExportableFields();
121 }
122 foreach ((array) $exportable as $field_id => $udf_data) {
123 $fields['udf_' . $field_id] = $udf_data['field_name'];
124 }
125
126
127 $ufields = new ilCheckboxGroupInputGUI($GLOBALS['DIC']['lng']->txt('user_detail'), 'preset');
128 foreach ($fields as $id => $name) {
129 $ufields->addOption(new ilCheckboxOption($name, $id));
130 }
131 $form->addItem($ufields);
132
133
134 include_once './Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
136 if ($this->parent_type == 'crs') {
137 if ($privacy->enabledCourseAccessTimes()) {
138 $ufields->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('last_access'), 'access'));
139 }
140 }
141 if ($this->parent_type == 'grp') {
142 if ($privacy->enabledGroupAccessTimes()) {
143 $ufields->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('last_access'), 'access'));
144 }
145 }
146 $ufields->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('crs_status'), 'status'));
147 $ufields->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('crs_passed'), 'passed'));
148
149
150 $blank = new ilTextInputGUI($GLOBALS['DIC']['lng']->txt('event_blank_columns'), 'blank');
151 $blank->setMulti(true);
152 $form->addItem($blank);
153
154 $roles = new ilCheckboxGroupInputGUI($GLOBALS['DIC']['lng']->txt('event_user_selection'), 'selection_of_users');
155
156 $roles->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('event_tbl_admin'), 'role_adm'));
157 if ($this->parent_type == 'crs') {
158 $roles->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('event_tbl_tutor'), 'role_tut'));
159 }
160 $roles->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('event_tbl_member'), 'role_mem'));
161
162 if (!$this->parent_obj_id) {
163 $subscriber = new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('event_user_selection_include_requests'), 'subscr');
164 $roles->addOption($subscriber);
165
166 $waiting_list = new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('event_user_selection_include_waiting_list'), 'wlist');
167 $roles->addOption($waiting_list);
168 }
169 $form->addItem($roles);
170
171 switch ($a_type) {
173 $form->addCommandButton('savePrintViewSettings', $this->getLang()->txt('save'));
174 break;
175 }
176
177 include_once "Services/User/classes/class.ilUserFormSettings.php";
178 $identifier = $this->parent_type . 's_pview';
179 if ($this->parent_obj_id) {
180 $identifier_for_object = $identifier . '_' . $this->parent_obj_id;
181 }
182
183 $settings = new ilUserFormSettings($identifier_for_object, -1);
184 if (!$settings->hasStoredEntry()) {
185 // use default settings
186 $settings = new ilUserFormSettings($identifier, -1);
187 }
188 $settings->exportToForm($form);
189
190 return $form;
191 }
This class represents a property in a property form.
This class represents an option in a checkbox group.
static _getInstanceByType($a_type)
Get Singleton Instance.
static _getInstance()
Get instance of ilPrivacySettings.
This class represents a property form user interface.
This class represents a text property in a property form.
static _getInstance()
Get instance.
if(!array_key_exists('StateId', $_REQUEST)) $id
if(isset($_POST['submit'])) $form
$a_type
Definition: workflow.php:92

References $a_type, $form, $GLOBALS, $id, $name, $parent_obj_id, ilPrivacySettings\_getInstance(), ilUserDefinedFields\_getInstance(), ilExportFieldsInfo\_getInstanceByType(), getLang(), and TYPE_PRINT_VIEW_SETTINGS.

Referenced by printViewSettings(), and savePrintViewSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ printViewSettings()

ilMemberExportSettingsGUI::printViewSettings ( ilPropertyFormGUI  $form = null)
protected

Show print view settings.

Definition at line 67 of file class.ilMemberExportSettingsGUI.php.

68 {
69 if (!$form instanceof ilPropertyFormGUI) {
70 $form = $this->initForm(self::TYPE_PRINT_VIEW_SETTINGS);
71 }
72
73 $GLOBALS['DIC']['tpl']->setContent($form->getHTML());
74 }

References $form, $GLOBALS, and initForm().

+ Here is the call graph for this function:

◆ savePrintViewSettings()

ilMemberExportSettingsGUI::savePrintViewSettings ( )
protected

Save print view settings.

Definition at line 196 of file class.ilMemberExportSettingsGUI.php.

197 {
198 $form = $this->initForm(self::TYPE_PRINT_VIEW_SETTINGS);
199 if ($form->checkInput()) {
200 $form->setValuesByPost();
201
202 include_once "Services/User/classes/class.ilUserFormSettings.php";
203
206
207 $identifier = $this->parent_type . 's_pview';
208 if ($this->parent_obj_id) {
209 $identifier .= '_' . $this->parent_obj_id;
210 }
211
212 $settings = new ilUserFormSettings($identifier, -1);
213 $settings->importFromForm($form);
214 $settings->store();
215
216 ilUtil::sendSuccess($GLOBALS['DIC']['lng']->txt('settings_saved'));
217 $GLOBALS['DIC']['ilCtrl']->redirect($this, 'printViewSettings');
218 }
219 }
static deleteAllForPrefix($a_prefix)
Delete all entries for prefix.

References $form, $GLOBALS, $parent_obj_id, ilUserFormSettings\deleteAllForPrefix(), and initForm().

+ Here is the call graph for this function:

Field Documentation

◆ $parent_obj_id

ilMemberExportSettingsGUI::$parent_obj_id = 0
private

Definition at line 19 of file class.ilMemberExportSettingsGUI.php.

Referenced by initForm(), and savePrintViewSettings().

◆ $parent_type

ilMemberExportSettingsGUI::$parent_type = ''
private

Definition at line 18 of file class.ilMemberExportSettingsGUI.php.

◆ TYPE_EXPORT_SETTINGS

const ilMemberExportSettingsGUI::TYPE_EXPORT_SETTINGS = 'member_export'

Definition at line 14 of file class.ilMemberExportSettingsGUI.php.

◆ TYPE_PRINT_VIEW_MEMBERS

const ilMemberExportSettingsGUI::TYPE_PRINT_VIEW_MEMBERS = 'prv_members'

Definition at line 15 of file class.ilMemberExportSettingsGUI.php.

◆ TYPE_PRINT_VIEW_SETTINGS

const ilMemberExportSettingsGUI::TYPE_PRINT_VIEW_SETTINGS = 'print_view'

Definition at line 13 of file class.ilMemberExportSettingsGUI.php.

Referenced by initForm().


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