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

Export settings gui. More...

+ Collaboration diagram for ilMemberExportSettingsGUI:

Public Member Functions

 __construct (string $a_parent_type, int $a_parent_obj_id=0)
 Constructor. More...
 
 executeCommand ()
 

Protected Member Functions

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

Protected Attributes

const TYPE_PRINT_VIEW_SETTINGS = 'print_view'
 
const TYPE_EXPORT_SETTINGS = 'member_export'
 
const TYPE_PRINT_VIEW_MEMBERS = 'prv_members'
 
ilGlobalTemplateInterface $tpl
 
ilCtrlInterface $ctrl
 
ilLanguage $lng
 
ilRbacSystem $rbacsystem
 

Private Member Functions

 getLang ()
 

Private Attributes

string $parent_type = ''
 
int $parent_obj_id = 0
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
Profile $profile
 

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 28 of file class.ilMemberExportSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

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

Constructor.

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

49 {
50 global $DIC;
51
52 $this->parent_type = $a_parent_type;
53 $this->parent_obj_id = $a_parent_obj_id;
54
55 $this->tpl = $DIC->ui()->mainTemplate();
56 $this->ctrl = $DIC->ctrl();
57 $this->lng = $DIC->language();
58 $this->lng->loadLanguageModule('crs');
59 $this->lng->loadLanguageModule('mem');
60 $this->rbacsystem = $DIC->rbac()->system();
61 $this->http = $DIC->http();
62 $this->refinery = $DIC->refinery();
63 $this->profile = $DIC['user']->getProfile();
64 }
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\profile(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilMemberExportSettingsGUI::executeCommand ( )

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

71 : void
72 {
73 $next_class = $this->ctrl->getNextClass($this);
74 $cmd = $this->ctrl->getCmd('printViewSettings');
75
76 switch ($next_class) {
77 default:
78 $this->$cmd();
79 break;
80 }
81 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getLang()

ilMemberExportSettingsGUI::getLang ( )
private

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

67 {
68 return $this->lng;
69 }
language handling

References $lng.

Referenced by initForm().

+ Here is the caller graph for this function:

◆ initForm()

ilMemberExportSettingsGUI::initForm ( string  $a_type)
protected

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

92 {
93 $form = new ilPropertyFormGUI();
94 $form->setFormAction($this->ctrl->getFormAction($this));
95 $form->setTitle($this->getLang()->txt('mem_' . $a_type . '_form'));
96
97 // profile fields
98 $fields['name'] = $this->lng->txt('name');
99 $fields['login'] = $this->lng->txt('login');
100 $fields['email'] = $this->lng->txt('email');
101
102 $field_info = ilExportFieldsInfo::_getInstanceByType($this->parent_type);
103 $field_info->sortExportFields();
104
105 foreach ($field_info->getExportableFields() as $field) {
106 switch ($field) {
107 case 'username':
108 case 'firstname':
109 case 'lastname':
110 case 'email':
111 continue 2;
112 }
113
114 // Check if default enabled
115 $fields[$field] = $this->lng->txt($field);
116 }
117
118 // udf
119 $exportable = $this->profile->getVisibleUserDefinedFields(Context::buildFromObjectType($this->type));
120 foreach ($exportable as $field) {
121 $fields['udf_' . $field->getIdentifier()] = $field->getLabel($this->lng);
122 }
123
124 $ufields = new ilCheckboxGroupInputGUI($this->lng->txt('user_detail'), 'preset');
125 foreach ($fields as $id => $name) {
126 $ufields->addOption(new ilCheckboxOption($name, $id));
127 }
128 $form->addItem($ufields);
129
131 if ($this->parent_type === 'crs') {
132 if ($privacy->enabledCourseAccessTimes()) {
133 $ufields->addOption(new ilCheckboxOption($this->lng->txt('last_access'), 'access'));
134 }
135 }
136 if ($this->parent_type === 'grp') {
137 if ($privacy->enabledGroupAccessTimes()) {
138 $ufields->addOption(new ilCheckboxOption($this->lng->txt('last_access'), 'access'));
139 }
140 }
141 $ufields->addOption(new ilCheckboxOption($this->lng->txt('crs_status'), 'status'));
142 $ufields->addOption(new ilCheckboxOption($this->lng->txt('crs_passed'), 'passed'));
143
144 $blank = new ilTextInputGUI($this->lng->txt('event_blank_columns'), 'blank');
145 $blank->setMulti(true);
146 $form->addItem($blank);
147
148 $roles = new ilCheckboxGroupInputGUI($this->lng->txt('event_user_selection'), 'selection_of_users');
149
150 $roles->addOption(new ilCheckboxOption($this->lng->txt('event_tbl_admin'), 'role_adm'));
151 if ($this->parent_type === 'crs') {
152 $roles->addOption(new ilCheckboxOption($this->lng->txt('event_tbl_tutor'), 'role_tut'));
153 }
154 $roles->addOption(new ilCheckboxOption($this->lng->txt('event_tbl_member'), 'role_mem'));
155
156 if (!$this->parent_obj_id) {
157 $subscriber = new ilCheckboxOption($this->lng->txt('event_user_selection_include_requests'), 'subscr');
158 $roles->addOption($subscriber);
159
160 $waiting_list = new ilCheckboxOption($this->lng->txt('event_user_selection_include_waiting_list'), 'wlist');
161 $roles->addOption($waiting_list);
162 }
163 $form->addItem($roles);
164
165 switch ($a_type) {
167
168 $ref_id = 0;
169 if ($this->http->wrapper()->query()->has('ref_id')) {
170 $ref_id = $this->http->wrapper()->query()->retrieve(
171 'ref_id',
172 $this->refinery->kindlyTo()->int()
173 );
174 }
175
176 if ($this->rbacsystem->checkAccess('write', $ref_id)) {
177 $form->addCommandButton('savePrintViewSettings', $this->getLang()->txt('save'));
178 }
179 break;
180 }
181
182 $identifier = $this->parent_type . 's_pview';
183 if ($this->parent_obj_id) {
184 $identifier_for_object = $identifier . '_' . $this->parent_obj_id;
185 } else {
186 $identifier_for_object = $identifier . '_0';
187 }
188
189 $settings = new ilUserFormSettings($identifier_for_object, -1);
190 if (!$settings->hasStoredEntry()) {
191 // use default settings
192 $settings = new ilUserFormSettings($identifier, -1);
193 }
194 $settings->exportToForm($form);
195
196 return $form;
197 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This class represents a property in a property form.
This class represents an option in a checkbox group.
static _getInstanceByType(string $a_type)
Get Singleton Instance.
This class represents a property form user interface.
This class represents a text property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$ref_id
Definition: ltiauth.php:66

References $id, $parent_obj_id, $ref_id, ilExportFieldsInfo\_getInstanceByType(), ILIAS\Repository\ctrl(), ilPrivacySettings\getInstance(), getLang(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\profile(), ILIAS\Repository\refinery(), 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

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

83 : void
84 {
85 if (!$form instanceof ilPropertyFormGUI) {
86 $form = $this->initForm(self::TYPE_PRINT_VIEW_SETTINGS);
87 }
88 $this->tpl->setContent($form->getHTML());
89 }

References initForm().

+ Here is the call graph for this function:

◆ savePrintViewSettings()

ilMemberExportSettingsGUI::savePrintViewSettings ( )
protected

Save print view settings.

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

202 : void
203 {
204 $form = $this->initForm(self::TYPE_PRINT_VIEW_SETTINGS);
205 if ($form->checkInput()) {
206 $form->setValuesByPost();
207
210
211 $identifier = $this->parent_type . 's_pview';
212 if ($this->parent_obj_id) {
213 $identifier .= '_' . $this->parent_obj_id;
214 }
215
216 $settings = new ilUserFormSettings($identifier, -1);
217 $settings->importFromForm($form);
218 $settings->store();
219
220 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
221 $this->ctrl->redirect($this, 'printViewSettings');
222 }
223 }
static deleteAllForPrefix(string $a_prefix)
Delete all entries for prefix.

References $parent_obj_id, ILIAS\Repository\ctrl(), ilUserFormSettings\deleteAllForPrefix(), initForm(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrlInterface ilMemberExportSettingsGUI::$ctrl
protected

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

◆ $http

ILIAS HTTP Services ilMemberExportSettingsGUI::$http
private

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

◆ $lng

ilLanguage ilMemberExportSettingsGUI::$lng
protected

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

Referenced by getLang().

◆ $parent_obj_id

int ilMemberExportSettingsGUI::$parent_obj_id = 0
private

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

Referenced by initForm(), and savePrintViewSettings().

◆ $parent_type

string ilMemberExportSettingsGUI::$parent_type = ''
private

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

◆ $profile

Profile ilMemberExportSettingsGUI::$profile
private

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

◆ $rbacsystem

ilRbacSystem ilMemberExportSettingsGUI::$rbacsystem
protected

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

◆ $refinery

ILIAS Refinery Factory ilMemberExportSettingsGUI::$refinery
private

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

◆ $tpl

ilGlobalTemplateInterface ilMemberExportSettingsGUI::$tpl
protected

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

◆ TYPE_EXPORT_SETTINGS

const ilMemberExportSettingsGUI::TYPE_EXPORT_SETTINGS = 'member_export'
protected

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

◆ TYPE_PRINT_VIEW_MEMBERS

const ilMemberExportSettingsGUI::TYPE_PRINT_VIEW_MEMBERS = 'prv_members'
protected

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

◆ TYPE_PRINT_VIEW_SETTINGS

const ilMemberExportSettingsGUI::TYPE_PRINT_VIEW_SETTINGS = 'print_view'
protected

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

Referenced by initForm().


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