ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
 
 $dic
 

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

30 {
31 global $DIC;
32 $this->dic = $DIC;
33 $this->parent_type = $a_parent_type;
34 $this->parent_obj_id = $a_parent_obj_id;
35
36 $this->ctrl = $GLOBALS['DIC']['ilCtrl'];
37 $this->lng = $GLOBALS['DIC']['lng'];
38 $this->lng->loadLanguageModule('crs');
39 $this->lng->loadLanguageModule('mem');
40 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
$DIC
Definition: xapitoken.php:46

References $DIC, and $GLOBALS.

Member Function Documentation

◆ executeCommand()

ilMemberExportSettingsGUI::executeCommand ( )

Execute command.

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

56 {
57 $next_class = $this->ctrl->getNextClass($this);
58 $cmd = $this->ctrl->getCmd('printViewSettings');
59
60
61 switch ($next_class) {
62 default:
63 $this->$cmd();
64 break;
65 }
66 return true;
67 }

◆ getLang()

ilMemberExportSettingsGUI::getLang ( )
private

Get language.

Returns
ilLanguage

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

47 {
48 return $this->lng;
49 }
$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 85 of file class.ilMemberExportSettingsGUI.php.

86 {
87 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
88 $form = new ilPropertyFormGUI();
89 $form->setFormAction($this->ctrl->getFormAction($this));
90 $form->setTitle($this->getLang()->txt('mem_' . $a_type . '_form'));
91
92 // profile fields
93 $fields['name'] = $GLOBALS['DIC']['lng']->txt('name');
94 $fields['login'] = $GLOBALS['DIC']['lng']->txt('login');
95 $fields['email'] = $GLOBALS['DIC']['lng']->txt('email');
96
97 include_once('Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
98 include_once 'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php';
99 include_once('Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
100 include_once('Services/User/classes/class.ilUserDefinedFields.php');
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] = $GLOBALS['DIC']['lng']->txt($field);
116 }
117
118
119 // udf
120 include_once './Services/User/classes/class.ilUserDefinedFields.php';
122 $exportable = array();
123 if ($this->parent_type == 'crs') {
124 $exportable = $udf->getCourseExportableFields();
125 } elseif ($this->parent_type == 'grp') {
126 $exportable = $udf->getGroupExportableFields();
127 }
128 foreach ((array) $exportable as $field_id => $udf_data) {
129 $fields['udf_' . $field_id] = $udf_data['field_name'];
130 }
131
132
133 $ufields = new ilCheckboxGroupInputGUI($GLOBALS['DIC']['lng']->txt('user_detail'), 'preset');
134 foreach ($fields as $id => $name) {
135 $ufields->addOption(new ilCheckboxOption($name, $id));
136 }
137 $form->addItem($ufields);
138
139
140 include_once './Services/PrivacySecurity/classes/class.ilPrivacySettings.php';
142 if ($this->parent_type == 'crs') {
143 if ($privacy->enabledCourseAccessTimes()) {
144 $ufields->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('last_access'), 'access'));
145 }
146 }
147 if ($this->parent_type == 'grp') {
148 if ($privacy->enabledGroupAccessTimes()) {
149 $ufields->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('last_access'), 'access'));
150 }
151 }
152 $ufields->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('crs_status'), 'status'));
153 $ufields->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('crs_passed'), 'passed'));
154
155
156 $blank = new ilTextInputGUI($GLOBALS['DIC']['lng']->txt('event_blank_columns'), 'blank');
157 $blank->setMulti(true);
158 $form->addItem($blank);
159
160 $roles = new ilCheckboxGroupInputGUI($GLOBALS['DIC']['lng']->txt('event_user_selection'), 'selection_of_users');
161
162 $roles->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('event_tbl_admin'), 'role_adm'));
163 if ($this->parent_type == 'crs') {
164 $roles->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('event_tbl_tutor'), 'role_tut'));
165 }
166 $roles->addOption(new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('event_tbl_member'), 'role_mem'));
167
168 if (!$this->parent_obj_id) {
169 $subscriber = new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('event_user_selection_include_requests'), 'subscr');
170 $roles->addOption($subscriber);
171
172 $waiting_list = new ilCheckboxOption($GLOBALS['DIC']['lng']->txt('event_user_selection_include_waiting_list'), 'wlist');
173 $roles->addOption($waiting_list);
174 }
175 $form->addItem($roles);
176
177 switch ($a_type) {
179 if ($this->dic->rbac()->system()->checkAccess('write', $_GET['ref_id'])) {
180 $form->addCommandButton('savePrintViewSettings', $this->getLang()->txt('save'));
181 }
182 break;
183 }
184
185 include_once "Services/User/classes/class.ilUserFormSettings.php";
186 $identifier = $this->parent_type . 's_pview';
187 if ($this->parent_obj_id) {
188 $identifier_for_object = $identifier . '_' . $this->parent_obj_id;
189 }
190
191 $settings = new ilUserFormSettings($identifier_for_object, -1);
192 if (!$settings->hasStoredEntry()) {
193 // use default settings
194 $settings = new ilUserFormSettings($identifier, -1);
195 }
196 $settings->exportToForm($form);
197
198 return $form;
199 }
$_GET["client_id"]
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($format !==null) $name
Definition: metadata.php:230
$a_type
Definition: workflow.php:92

References $_GET, $a_type, $GLOBALS, $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 73 of file class.ilMemberExportSettingsGUI.php.

74 {
75 if (!$form instanceof ilPropertyFormGUI) {
76 $form = $this->initForm(self::TYPE_PRINT_VIEW_SETTINGS);
77 }
78
79 $GLOBALS['DIC']['tpl']->setContent($form->getHTML());
80 }

References $GLOBALS, and initForm().

+ Here is the call graph for this function:

◆ savePrintViewSettings()

ilMemberExportSettingsGUI::savePrintViewSettings ( )
protected

Save print view settings.

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

205 {
206 $form = $this->initForm(self::TYPE_PRINT_VIEW_SETTINGS);
207 if ($form->checkInput()) {
208 $form->setValuesByPost();
209
212
213 $identifier = $this->parent_type . 's_pview';
214 if ($this->parent_obj_id) {
215 $identifier .= '_' . $this->parent_obj_id;
216 }
217
218 $settings = new ilUserFormSettings($identifier, -1);
219 $settings->importFromForm($form);
220 $settings->store();
221
222 ilUtil::sendSuccess($GLOBALS['DIC']['lng']->txt('settings_saved'),true);
223 $GLOBALS['DIC']['ilCtrl']->redirect($this, 'printViewSettings');
224 }
225 }
static deleteAllForPrefix($a_prefix)
Delete all entries for prefix.

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

+ Here is the call graph for this function:

Field Documentation

◆ $dic

ilMemberExportSettingsGUI::$dic
private

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

◆ $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: