18declare(strict_types=1);
64 $this->
setId(
'myst_lu');
68 $this->uiFactory =
$DIC->ui()->factory();
69 $this->uiRenderer =
$DIC->ui()->renderer();
72 $this->
setRowTemplate(
'tpl.list_users_row.html',
"Services/MyStaff");
103 $arr_usr_id = $this->
access->getUsersForUser($DIC->user()->getId());
106 'filters' => $this->
filter,
118 $result = $list_users_fetcher->getData($arr_usr_id, $options);
120 $this->
setMaxCount($result->getTotalDatasetCount());
121 $data = $result->getDataset();
136 $DIC->language()->txt(
"login") .
"/" .
$DIC->language()->txt(
"email") .
"/" .
$DIC->language()
141 $item->readFromSession();
142 $this->
filter[
'user'] = $item->getValue();
146 $options[0] =
$DIC->language()->txt(
'mst_opt_all');
147 foreach ($paths as $org_ref_id =>
$path) {
148 $options[$org_ref_id] =
$path;
151 $item->setOptions($options);
152 $item->addCustomAttribute(
"style='width:100%'");
154 $item->readFromSession();
155 $this->
filter[
'org_unit'] = $item->getValue();
161 if ($this->selectable_columns_cached) {
170 $arr_fields_without_table_sort = array(
173 'interests_help_offered',
174 'interests_help_looking',
179 if (!in_array(
$key, $arr_fields_without_table_sort)) {
185 foreach ($user_defined_fields->getDefinitions() as $field => $definition) {
186 unset(
$cols[
"udf_" . $field]);
203 $sort = $v[
'sort_field'] ??
"";
209 $this->
addColumn($DIC->language()->txt(
'actions'));
215 if (isset($this->usr_orgu_names[$user_id])) {
216 return $this->usr_orgu_names[$user_id];
219 return $this->usr_orgu_names[$user_id] = \ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($user_id);
228 final protected function fillRow(array $a_set): void
232 $set = array_pop($a_set);
234 $propGetter = Closure::bind(
function ($prop) {
235 return $this->$prop ??
null;
239 $this->tpl->setCurrentBlock(
'user_profile_picture');
240 $il_obj_user = $set->returnIlUserObj();
241 $avatar = $this->uiFactory->image()->standard($il_obj_user->getPersonalPicturePath(
'small'), $il_obj_user->getPublicName());
242 $this->tpl->setVariable(
'user_profile_picture', $this->uiRenderer->render($avatar));
243 $this->tpl->parseCurrentBlock();
248 $this->tpl->setCurrentBlock(
'td');
249 $this->tpl->setVariable(
253 $this->tpl->parseCurrentBlock();
256 $this->tpl->setCurrentBlock(
'td');
257 $this->tpl->setVariable(
'VALUE',
$DIC->language()->txt(
'gender_' . $set->getGender()));
258 $this->tpl->parseCurrentBlock();
260 case 'interests_general':
261 $this->tpl->setCurrentBlock(
'td');
262 $this->tpl->setVariable(
'VALUE', ($set->returnIlUserObj()
263 ->getGeneralInterestsAsText() ? $set->returnIlUserObj()->getGeneralInterestsAsText() :
' '));
264 $this->tpl->parseCurrentBlock();
266 case 'interests_help_offered':
267 $this->tpl->setCurrentBlock(
'td');
268 $this->tpl->setVariable(
'VALUE', ($set->returnIlUserObj()
269 ->getOfferingHelpAsText() ? $set->returnIlUserObj()->getOfferingHelpAsText() :
' '));
270 $this->tpl->parseCurrentBlock();
272 case 'interests_help_looking':
273 $this->tpl->setCurrentBlock(
'td');
274 $this->tpl->setVariable(
'VALUE', ($set->returnIlUserObj()
275 ->getLookingForHelpAsText() ? $set->returnIlUserObj()->getLookingForHelpAsText() :
' '));
276 $this->tpl->parseCurrentBlock();
279 if ($propGetter($k) !==
null) {
280 $this->tpl->setCurrentBlock(
'td');
281 $this->tpl->setVariable(
283 (is_array($propGetter($k)) ? implode(
", ", $propGetter($k)) : $propGetter($k))
285 $this->tpl->parseCurrentBlock();
287 $this->tpl->setCurrentBlock(
'td');
288 $this->tpl->setVariable(
'VALUE',
' ');
289 $this->tpl->parseCurrentBlock();
296 $actions->setListTitle($this->
language->txt(
"actions"));
297 $actions->setId(strval($set->getUsrId()));
299 $mst_lus_usr_id = $set->getUsrId();
301 if ($this->
access->hasCurrentUserAccessToCourseMemberships()) {
302 $DIC->ctrl()->setParameterByClass(\ilMStShowUserCoursesGUI::class,
'usr_id', $mst_lus_usr_id);
304 $DIC->language()->txt(
'mst_show_courses'),
306 $DIC->ctrl()->getLinkTargetByClass(array(
307 \ilDashboardGUI::class,
309 \ilMStShowUserGUI::class,
310 \ilMStShowUserCoursesGUI::class,
315 if ($this->
access->hasCurrentUserAccessToCertificates()) {
316 $DIC->ctrl()->setParameterByClass(\ilUserCertificateGUI::class,
'usr_id', $mst_lus_usr_id);
318 $DIC->language()->txt(
'mst_list_certificates'),
320 $DIC->ctrl()->getLinkTargetByClass(array(
321 \ilDashboardGUI::class,
323 \ilMStShowUserGUI::class,
324 \ilUserCertificateGUI::class,
329 if ($this->
access->hasCurrentUserAccessToCompetences()) {
330 $DIC->ctrl()->setParameterByClass(\ilMStShowUserCompetencesGUI::class,
'usr_id', $mst_lus_usr_id);
332 $DIC->language()->txt(
'mst_list_competences'),
334 $DIC->ctrl()->getLinkTargetByClass(array(
335 \ilDashboardGUI::class,
337 \ilMStShowUserGUI::class,
338 \ilMStShowUserCompetencesGUI::class,
343 $this->
ctrl->setParameterByClass(\ilMStListUsersGUI::class,
'mst_lus_usr_id', $mst_lus_usr_id);
345 $actions = ilMyStaffGUI::extendActionMenuWithUserActions(
351 $this->tpl->setVariable(
'ACTIONS', $actions->getHTML());
352 $this->tpl->parseCurrentBlock();
359 return rawurlencode(
$DIC->ctrl()->getLinkTargetByClass(
360 strtolower(ilMyStaffGUI::class),
367 $set = array_pop($a_set);
371 $a_excel->
setCell($a_row, $col, $v);
378 $set = array_pop($a_set);
390 $propGetter = Closure::bind(
function ($prop) {
391 return $this->$prop ??
null;
392 }, $my_staff_user, $my_staff_user);
394 $field_values = array();
402 $field_values[$k] =
$DIC->language()->txt(
'gender_' . $my_staff_user->
getGender());
404 case 'interests_general':
405 $field_values[$k] = $my_staff_user->
returnIlUserObj()->getGeneralInterestsAsText();
407 case 'interests_help_offered':
408 $field_values[$k] = $my_staff_user->
returnIlUserObj()->getOfferingHelpAsText();
410 case 'interests_help_looking':
411 $field_values[$k] = $my_staff_user->
returnIlUserObj()->getLookingForHelpAsText();
414 $field_values[$k] = strip_tags($propGetter($k) ??
"");
419 return $field_values;
Class ilMStListUsersTableGUI.
array $selectable_columns_cached
__construct(ilMStListUsersGUI $parent_obj, $parent_cmd=ilMStListUsersGUI::CMD_INDEX)
getSelectableColumns()
Get selectable columns.
ILIAS UI Factory $uiFactory
ILIAS UI Renderer $uiRenderer
getFieldValuesForExport(ilMStListUser $my_staff_user)
getTextRepresentationOfUsersOrgUnits(int $user_id)
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
Excel Version of Fill Row.
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
CSV Version of Fill Row.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilOrgUnitPathStorage.
static getTextRepresentationOfOrgUnits(bool $sort_by_title=true)
Get ref id path array.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
isColumnSelected(string $col)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
determineOffsetAndOrder(bool $a_omit_offset=false)
setEnableNumInfo(bool $a_val)
setExportFormats(array $formats)
Set available export formats.
setExternalSegmentation(bool $a_val)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setEnableTitle(bool $a_enabletitle)
setFormName(string $a_name="")
setPrefix(string $a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
setFormAction(string $a_form_action, bool $a_multipart=false)
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setDefaultOrderField(string $a_defaultorderfield)
setDisableFilterHiding(bool $a_val=true)
setExternalSorting(bool $a_val)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setFilterCols(int $a_val)
setData(array $a_data)
Set table data.
setMaxCount(int $a_max_count)
set max.
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...
static _isEnabled($a_key)
static getSelectableColumnInfo(bool $a_admin=false)
Get info of searchable fields for selectable columns in table gui.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc