56 $this->
setId(
'myst_lu');
60 $this->
setRowTemplate(
'tpl.list_users_row.html',
"Services/MyStaff");
61 $this->
setFormAction($DIC->ctrl()->getFormAction($parent_obj));
95 $arr_usr_id = $this->access->getUsersForUser($DIC->user()->getId());
98 'filters' => $this->
filter,
108 $count = $list_users_fetcher->getData($arr_usr_id, $options);
109 $options[
'limit'] = array(
113 $options[
'count'] =
false;
114 $data = $list_users_fetcher->getData($arr_usr_id, $options);
129 $item =
new ilTextInputGUI($DIC->language()->txt(
"login") .
"/" . $DIC->language()->txt(
"email") .
"/" . $DIC->language()
130 ->txt(
"name"),
"user");
135 $item->readFromSession();
136 $this->
filter[
'user'] = $item->getValue();
140 $options[0] = $DIC->language()->txt(
'mst_opt_all');
141 foreach ($paths as $org_ref_id => $path) {
142 $options[$org_ref_id] = $path;
144 $item =
new ilSelectInputGUI($DIC->language()->txt(
'obj_orgu'),
'org_unit');
145 $item->setOptions($options);
146 $item->addCustomAttribute(
"style='width:100%'");
148 $item->readFromSession();
149 $this->
filter[
'org_unit'] = $item->getValue();
155 if ($this->selectable_columns_cached) {
164 $arr_fields_without_table_sort = array(
167 'interests_help_offered',
168 'interests_help_looking',
173 if (!in_array($key, $arr_fields_without_table_sort)) {
174 $cols[$key][
'sort_field'] = $key;
179 foreach ($user_defined_fields->getDefinitions() as $field => $definition) {
180 unset(
$cols[
"udf_" . $field]);
201 if (isset($v[
'sort_field'])) {
202 $sort = $v[
'sort_field'];
206 $this->
addColumn($v[
'txt'], $sort, $v[
'width']);
211 $this->
addColumn($DIC->language()->txt(
'actions'));
217 if (isset($this->usr_orgu_names[$user_id])) {
218 return $this->usr_orgu_names[$user_id];
221 return $this->usr_orgu_names[$user_id] = \ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($user_id);
231 $propGetter = Closure::bind(
function ($prop) {
233 }, $my_staff_user, $my_staff_user);
236 $this->tpl->setCurrentBlock(
'user_profile_picture');
237 $f = $DIC->ui()->factory();
238 $renderer = $DIC->ui()->renderer();
239 $il_obj_user = $my_staff_user->returnIlUserObj();
240 $avatar =
$f->image()->standard($il_obj_user->getPersonalPicturePath(
'small'), $il_obj_user->getPublicName());
241 $this->tpl->setVariable(
'user_profile_picture', $renderer->render($avatar));
242 $this->tpl->parseCurrentBlock();
247 $this->tpl->setCurrentBlock(
'td');
249 $this->tpl->parseCurrentBlock();
252 $this->tpl->setCurrentBlock(
'td');
253 $this->tpl->setVariable(
'VALUE', $DIC->language()->txt(
'gender_' . $my_staff_user->getGender()));
254 $this->tpl->parseCurrentBlock();
256 case 'interests_general':
257 $this->tpl->setCurrentBlock(
'td');
258 $this->tpl->setVariable(
'VALUE', ($my_staff_user->returnIlUserObj()
259 ->getGeneralInterestsAsText() ? $my_staff_user->returnIlUserObj()->getGeneralInterestsAsText() :
' '));
260 $this->tpl->parseCurrentBlock();
262 case 'interests_help_offered':
263 $this->tpl->setCurrentBlock(
'td');
264 $this->tpl->setVariable(
'VALUE', ($my_staff_user->returnIlUserObj()
265 ->getOfferingHelpAsText() ? $my_staff_user->returnIlUserObj()->getOfferingHelpAsText() :
' '));
266 $this->tpl->parseCurrentBlock();
268 case 'interests_help_looking':
269 $this->tpl->setCurrentBlock(
'td');
270 $this->tpl->setVariable(
'VALUE', ($my_staff_user->returnIlUserObj()
271 ->getLookingForHelpAsText() ? $my_staff_user->returnIlUserObj()->getLookingForHelpAsText() :
' '));
272 $this->tpl->parseCurrentBlock();
275 if ($propGetter($k) !== null) {
276 $this->tpl->setCurrentBlock(
'td');
277 $this->tpl->setVariable(
'VALUE', (is_array($propGetter($k)) ? implode(
", ", $propGetter($k)) : $propGetter($k)));
278 $this->tpl->parseCurrentBlock();
280 $this->tpl->setCurrentBlock(
'td');
281 $this->tpl->setVariable(
'VALUE',
' ');
282 $this->tpl->parseCurrentBlock();
289 $actions->setListTitle($DIC->language()->txt(
"actions"));
290 $actions->setId($my_staff_user->getUsrId());
292 $mst_lus_usr_id = $my_staff_user->getUsrId();
294 if ($this->access->hasCurrentUserAccessToCourseMemberships()) {
295 $DIC->ctrl()->setParameterByClass(\ilMStShowUserCoursesGUI::class,
'usr_id', $mst_lus_usr_id);
296 $actions->addItem($DIC->language()->txt(
'mst_show_courses'),
'', $DIC->ctrl()->getLinkTargetByClass(array(
297 \ilDashboardGUI::class,
298 \ilMyStaffGUI::class,
299 \ilMStShowUserGUI::class,
300 \ilMStShowUserCoursesGUI::class,
304 if ($this->access->hasCurrentUserAccessToCertificates()) {
305 $DIC->ctrl()->setParameterByClass(\ilUserCertificateGUI::class,
'usr_id', $mst_lus_usr_id);
306 $actions->addItem($DIC->language()->txt(
'mst_list_certificates'),
'', $DIC->ctrl()->getLinkTargetByClass(array(
307 \ilDashboardGUI::class,
308 \ilMyStaffGUI::class,
309 \ilMStShowUserGUI::class,
310 \ilUserCertificateGUI::class,
314 if ($this->access->hasCurrentUserAccessToCompetences()) {
315 $DIC->ctrl()->setParameterByClass(\ilMStShowUserCompetencesGUI::class,
'usr_id', $mst_lus_usr_id);
316 $actions->addItem($DIC->language()->txt(
'mst_list_competences'),
'', $DIC->ctrl()->getLinkTargetByClass(array(
317 \ilDashboardGUI::class,
318 \ilMyStaffGUI::class,
319 \ilMStShowUserGUI::class,
320 \ilMStShowUserCompetencesGUI::class,
324 $this->ctrl->setParameterByClass(\ilMStListUsersGUI::class,
'mst_lus_usr_id', $mst_lus_usr_id);
326 $actions = \ilMyStaffGUI::extendActionMenuWithUserActions(
332 $this->tpl->setVariable(
'ACTIONS', $actions->getHTML());
333 $this->tpl->parseCurrentBlock();
346 return rawurlencode($DIC->ctrl()->getLinkTargetByClass(strtolower(ilMyStaffGUI::class),
ilMyStaffGUI::CMD_INDEX));
359 $a_excel->
setCell($a_row, $col, $v);
372 $a_csv->addColumn($v);
387 $propGetter = Closure::bind(
function ($prop) {
389 }, $my_staff_user, $my_staff_user);
391 $field_values = array();
399 $field_values[$k] = $DIC->language()->txt(
'gender_' . $my_staff_user->
getGender());
401 case 'interests_general':
402 $field_values[$k] = $my_staff_user->
returnIlUserObj()->getGeneralInterestsAsText();
404 case 'interests_help_offered':
405 $field_values[$k] = $my_staff_user->
returnIlUserObj()->getOfferingHelpAsText();
407 case 'interests_help_looking':
408 $field_values[$k] = $my_staff_user->
returnIlUserObj()->getLookingForHelpAsText();
411 $field_values[$k] = strip_tags($propGetter($k));
416 return $field_values;
setExternalSorting($a_val)
Set external sorting.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
setExportFormats(array $formats)
Set available export formats.
static _getInstance()
Get instance.
getTextRepresentationOfUsersOrgUnits(int $user_id)
__construct(ilMStListUsersGUI $parent_obj, $parent_cmd=ilMStListUsersGUI::CMD_INDEX)
setEnableNumInfo($a_val)
Set enable num info.
setFilterCols($a_val)
Set filter columns.
setExternalSegmentation($a_val)
Set external segmentation.
getProfileBackUrl()
Get profile back url.
getFieldValuesForExport(ilMStListUser $my_staff_user)
addFilterItem($a_input_item, $a_optional=false)
Add filter item.
determineLimit()
Determine the limit.
getOrderDirection()
Get order direction.
Class ilMStListUsersTableGUI.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
fillRowExcel(ilExcel $a_excel, &$a_row, $my_staff_user)
static getTextRepresentationOfOrgUnits($sort_by_title=true)
Get ref id path array.
static getSelectableColumnInfo($a_admin=false)
Get info of searchable fields for selectable columns in table gui.
setDisableFilterHiding($a_val=true)
Set disable filter hiding.
getSelectedColumns()
Get selected columns.
setCell($a_row, $a_col, $a_value, $a_datatype=null)
Set cell value.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
isColumnSelected($a_col)
Is given column selected?
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setFormName($a_formname="")
Set Form name.
__construct(Container $dic, ilPlugin $plugin)
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
$selectable_columns_cached
setMaxCount($a_max_count)
set max.
getExportMode()
Was export activated?
setEnableTitle($a_enabletitle)
Set Enable Title.
static _isEnabled($a_key)
fillRowCSV($a_csv, $my_staff_user)