19declare(strict_types=1);
54 $this->
setId(
'myst_lu');
58 $this->uiFactory =
$DIC->ui()->factory();
59 $this->uiRenderer =
$DIC->ui()->renderer();
61 $this->
profile = $DIC[
'user']->getProfile();
63 $this->
setRowTemplate(
'tpl.list_users_row.html',
"components/ILIAS/MyStaff");
94 $arr_usr_id = $this->
access->getUsersForUser($DIC->user()->getId());
97 'filters' => $this->
filter,
109 $result = $list_users_fetcher->getData($arr_usr_id, $options);
111 $this->
setMaxCount($result->getTotalDatasetCount());
112 $data = $result->getDataset();
126 $item = new \ilTextInputGUI(
127 $DIC->language()->txt(
"login") .
"/" .
$DIC->language()->txt(
"email") .
"/" .
$DIC->language()
132 $item->readFromSession();
133 $this->
filter[
'user'] = $item->getValue();
137 $options[0] =
$DIC->language()->txt(
'mst_opt_all');
138 foreach ($paths as $org_ref_id =>
$path) {
139 $options[$org_ref_id] =
$path;
141 $item = new \ilSelectInputGUI(
$DIC->language()->txt(
'obj_orgu'),
'org_unit');
142 $item->setOptions($options);
143 $item->addCustomAttribute(
"style='width:100%'");
145 $item->readFromSession();
146 $this->
filter[
'org_unit'] = $item->getValue();
152 if ($this->cached_selectable_columns) {
161 $arr_fields_without_table_sort = array(
164 'interests_help_offered',
165 'interests_help_looking',
170 if (!in_array($key, $arr_fields_without_table_sort)) {
171 $cols[$key][
'sort_field'] = $key;
175 foreach ($this->
profile->getAllUserDefinedFields() as $field) {
176 unset($cols[
"udf_" . $field->getIdentifier()]);
193 $sort = $v[
'sort_field'] ??
"";
199 $this->
addColumn($DIC->language()->txt(
'actions'));
205 if (isset($this->usr_orgu_names[
$user_id])) {
206 return $this->usr_orgu_names[
$user_id];
209 return $this->usr_orgu_names[
$user_id] = \ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits(
$user_id);
218 final protected function fillRow(array $a_set): void
220 $set = array_pop($a_set);
222 $propGetter = \Closure::bind(
function ($prop) {
223 return $this->$prop ??
null;
227 $this->tpl->setCurrentBlock(
'user_profile_picture');
228 $il_obj_user = $set->returnIlUserObj();
229 $avatar = $this->uiFactory->image()->standard($il_obj_user->getPersonalPicturePath(
'small'), $il_obj_user->getPublicName());
230 $this->tpl->setVariable(
'user_profile_picture', $this->uiRenderer->render($avatar));
231 $this->tpl->parseCurrentBlock();
236 $this->tpl->setCurrentBlock(
'td');
237 $this->tpl->setVariable(
241 $this->tpl->parseCurrentBlock();
244 $this->tpl->setCurrentBlock(
'td');
245 $this->tpl->setVariable(
'VALUE', $this->
language->txt(
'gender_' . $set->getGender()));
246 $this->tpl->parseCurrentBlock();
248 case 'interests_general':
249 $this->tpl->setCurrentBlock(
'td');
250 $this->tpl->setVariable(
'VALUE', ($set->returnIlUserObj()
251 ->getGeneralInterestsAsText() ? $set->returnIlUserObj()->getGeneralInterestsAsText() :
' '));
252 $this->tpl->parseCurrentBlock();
254 case 'interests_help_offered':
255 $this->tpl->setCurrentBlock(
'td');
256 $this->tpl->setVariable(
'VALUE', ($set->returnIlUserObj()
257 ->getOfferingHelpAsText() ? $set->returnIlUserObj()->getOfferingHelpAsText() :
' '));
258 $this->tpl->parseCurrentBlock();
260 case 'interests_help_looking':
261 $this->tpl->setCurrentBlock(
'td');
262 $this->tpl->setVariable(
'VALUE', ($set->returnIlUserObj()
263 ->getLookingForHelpAsText() ? $set->returnIlUserObj()->getLookingForHelpAsText() :
' '));
264 $this->tpl->parseCurrentBlock();
267 if ($propGetter($k) !==
null) {
268 $this->tpl->setCurrentBlock(
'td');
269 $this->tpl->setVariable(
271 (is_array($propGetter($k)) ? implode(
", ", $propGetter($k)) : $propGetter($k))
273 $this->tpl->parseCurrentBlock();
275 $this->tpl->setCurrentBlock(
'td');
276 $this->tpl->setVariable(
'VALUE',
' ');
277 $this->tpl->parseCurrentBlock();
283 $mst_lus_usr_id = $set->getUsrId();
287 if ($this->
access->hasCurrentUserAccessToCourseMemberships()) {
288 $this->
ctrl->setParameterByClass(\ilMStShowUserCoursesGUI::class,
'usr_id', $mst_lus_usr_id);
289 $actions[] = $this->uiFactory->link()->standard(
290 $this->
language->txt(
"mst_show_courses"),
291 $this->ctrl->getLinkTargetByClass([
292 \ilDashboardGUI::class,
293 \ilMyStaffGUI::class,
294 \ilMStShowUserGUI::class,
295 \ilMStShowUserCoursesGUI::class,
300 if ($this->
access->hasCurrentUserAccessToCertificates()) {
301 $this->
ctrl->setParameterByClass(\ilUserCertificateGUI::class,
'usr_id', $mst_lus_usr_id);
302 $actions[] = $this->uiFactory->link()->standard(
303 $this->
language->txt(
"mst_list_certificates"),
304 $this->ctrl->getLinkTargetByClass([
305 \ilDashboardGUI::class,
306 \ilMyStaffGUI::class,
307 \ilMStShowUserGUI::class,
308 \ilUserCertificateGUI::class,
313 if ($this->
access->hasCurrentUserAccessToCompetences()) {
314 $this->
ctrl->setParameterByClass(\ilMStShowUserCompetencesGUI::class,
'usr_id', $mst_lus_usr_id);
315 $actions[] = $this->uiFactory->link()->standard(
316 $this->
language->txt(
"mst_list_competences"),
317 $this->ctrl->getLinkTargetByClass([
318 \ilDashboardGUI::class,
319 \ilMyStaffGUI::class,
320 \ilMStShowUserGUI::class,
321 \ilMStShowUserCompetencesGUI::class,
327 $this->
ctrl->setParameterByClass(\ilMStListUsersGUI::class,
'mst_lus_usr_id', $mst_lus_usr_id);
329 $actions[] = \ilMyStaffGUI::extendActionMenuWithUserActions(
334 $dropdown = $this->uiFactory->dropdown()->standard($actions)->withLabel($this->
lng->txt(
"actions"));
335 $this->tpl->setVariable(
"ACTIONS", $this->uiRenderer->render($dropdown));
336 $this->tpl->parseCurrentBlock();
343 return rawurlencode(
$DIC->ctrl()->getLinkTargetByClass(
344 strtolower(\ilMyStaffGUI::class),
351 $set = array_pop($a_set);
355 $a_excel->
setCell($a_row, $col, $v);
362 $set = array_pop($a_set);
374 $propGetter = \Closure::bind(
function ($prop) {
375 return $this->$prop ??
null;
376 }, $my_staff_user, $my_staff_user);
378 $field_values = array();
386 $field_values[$k] =
$DIC->language()->txt(
'gender_' . $my_staff_user->
getGender());
388 case 'interests_general':
389 $field_values[$k] = $my_staff_user->
returnIlUserObj()->getGeneralInterestsAsText();
391 case 'interests_help_offered':
392 $field_values[$k] = $my_staff_user->
returnIlUserObj()->getOfferingHelpAsText();
394 case 'interests_help_looking':
395 $field_values[$k] = $my_staff_user->
returnIlUserObj()->getLookingForHelpAsText();
398 $field_values[$k] = strip_tags($propGetter($k) ??
"");
403 return $field_values;
Class ilMStListUsersTableGUI.
array $cached_selectable_columns
getSelectableColumns()
Get selectable columns.
ILIAS UI Factory $uiFactory
ILIAS UI Renderer $uiRenderer
fillRowCSV(\ilCSVWriter $a_csv, array $a_set)
getFieldValuesForExport(ilMStListUser $my_staff_user)
fillRowExcel(\ilExcel $a_excel, int &$a_row, array $a_set)
getTextRepresentationOfUsersOrgUnits(int $user_id)
__construct(\ilMStListUsersGUI $parent_obj, $parent_cmd=\ilMStListUsersGUI::CMD_INDEX)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
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.
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
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)