19 declare(strict_types=1);
46 $this->
access = ilMyStaffAccess::getInstance();
47 $this->ui_fac = $DIC->ui()->factory();
48 $this->ui_ren = $DIC->ui()->renderer();
52 $this->
setId(
'myst_lc');
56 $this->
setRowTemplate(
'tpl.list_courses_row.html',
"components/ILIAS/MyStaff");
57 $this->
setFormAction($DIC->ctrl()->getFormAction($parent_obj));
88 'filters' => $this->
filter,
100 $arr_usr_id = $this->
access->getUsersForUserOperationAndContext(
101 $DIC->user()->getId(),
102 ilMyStaffAccess::ACCESS_ENROLMENTS_ORG_UNIT_OPERATION,
103 ilMyStaffAccess::COURSE_CONTEXT
106 $list_courses_fetcher = new \ILIAS\MyStaff\ListCourses\ilMStListCourses($DIC);
107 $result = $list_courses_fetcher->getData($arr_usr_id, $options);
108 $this->
setMaxCount($result->getTotalDatasetCount());
109 $data = $result->getDataset();
112 $data =
array_map(
function (\
ILIAS\MyStaff\ListCourses\ilMStListCourse $it): array {
122 $item =
new ilTextInputGUI($DIC->language()->txt(
"crs_title"),
"crs_title");
124 $item->readFromSession();
125 $this->
filter[
'crs_title'] = $item->getValue();
130 $item->
setSelectText($DIC->language()->txt(
"mst_select_course"));
131 $item->setHeaderMessage($DIC->language()->txt(
"mst_please_select_course"));
132 $item->setClickableTypes(array(ilMyStaffAccess::COURSE_CONTEXT));
134 $item->readFromSession();
136 $this->
filter[
"course"] = $item->getValue();
139 $item =
new ilSelectInputGUI($DIC->language()->txt(
'member_status'),
'memb_status');
141 "" => $DIC->language()->txt(
"mst_opt_all"),
142 \ILIAS\MyStaff\ListCourses\ilMStListCourse::MEMBERSHIP_STATUS_REQUESTED => $DIC->language()->txt(
'mst_memb_status_requested'),
143 \ILIAS\MyStaff\ListCourses\ilMStListCourse::MEMBERSHIP_STATUS_WAITINGLIST => $DIC->language()->txt(
'mst_memb_status_waitinglist'),
144 \ILIAS\MyStaff\ListCourses\ilMStListCourse::MEMBERSHIP_STATUS_REGISTERED => $DIC->language()->txt(
'mst_memb_status_registered'),
147 $item->readFromSession();
148 $this->
filter[
"memb_status"] = $item->getValue();
152 $item =
new ilSelectInputGUI($DIC->language()->txt(
'learning_progress'),
'lp_status');
155 "" => $DIC->language()->txt(
"mst_opt_all"),
162 $item->readFromSession();
163 $this->
filter[
"lp_status"] = $item->getValue();
171 $DIC->language()->txt(
"login") .
"/" . $DIC->language()->txt(
"email") .
"/" . $DIC->language()
177 $item->readFromSession();
178 $this->
filter[
'user'] = $item->getValue();
182 $options[0] = $DIC->language()->txt(
'mst_opt_all');
183 foreach ($paths as $org_ref_id =>
$path) {
184 $options[$org_ref_id] =
$path;
186 $item =
new ilSelectInputGUI($DIC->language()->txt(
'obj_orgu'),
'org_unit');
189 $item->readFromSession();
190 $this->
filter[
'org_unit'] = $item->getValue();
196 if (isset($this->orgu_names)) {
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);
214 if ($this->cached_selectable_columns) {
229 $cols[
'crs_title'] = array(
230 'txt' => $DIC->language()->txt(
'crs_title'),
233 'sort_field' =>
'crs_title',
235 $cols[
'usr_reg_status'] = array(
236 'txt' => $DIC->language()->txt(
'member_status'),
239 'sort_field' =>
'reg_status',
242 $cols[
'usr_lp_status'] = array(
243 'txt' => $DIC->language()->txt(
'learning_progress'),
246 'sort_field' =>
'lp_status',
250 if ($arr_searchable_user_columns[
'login'] ??
false) {
251 $cols[
'usr_login'] = array(
252 'txt' => $DIC->language()->txt(
'login'),
255 'sort_field' =>
'usr_login',
258 if ($arr_searchable_user_columns[
'firstname'] ??
false) {
259 $cols[
'usr_firstname'] = array(
260 'txt' => $DIC->language()->txt(
'firstname'),
263 'sort_field' =>
'usr_firstname',
266 if ($arr_searchable_user_columns[
'lastname'] ??
false) {
267 $cols[
'usr_lastname'] = array(
268 'txt' => $DIC->language()->txt(
'lastname'),
271 'sort_field' =>
'usr_lastname',
275 if ($arr_searchable_user_columns[
'email'] ??
false) {
276 $cols[
'usr_email'] = array(
277 'txt' => $DIC->language()->txt(
'email'),
280 'sort_field' =>
'usr_email',
284 if ($arr_searchable_user_columns[
'org_units'] ??
false) {
285 $cols[
'usr_assinged_orgus'] = array(
286 'txt' => $DIC->language()->txt(
'objs_orgu'),
301 $sort = $v[
'sort_field'] ??
"";
308 $this->
addColumn($DIC->language()->txt(
'actions'));
318 final protected function fillRow(array $a_set): void
322 $set = array_pop($a_set);
324 $propGetter = Closure::bind(
function ($prop) {
325 return $this->$prop ??
null;
330 case 'usr_assinged_orgus':
331 $this->tpl->setCurrentBlock(
'td');
332 $this->tpl->setVariable(
336 $this->tpl->parseCurrentBlock();
338 case 'usr_reg_status':
339 $this->tpl->setCurrentBlock(
'td');
340 $this->tpl->setVariable(
342 \
ILIAS\MyStaff\ListCourses\ilMStListCourse::getMembershipStatusText($set->getUsrRegStatus())
344 $this->tpl->parseCurrentBlock();
346 case 'usr_lp_status':
347 $this->tpl->setCurrentBlock(
'td');
349 $this->tpl->parseCurrentBlock();
352 if ($propGetter($k) !==
null) {
353 $this->tpl->setCurrentBlock(
'td');
354 $this->tpl->setVariable(
356 (is_array($propGetter($k)) ? implode(
", ", $propGetter($k)) : $propGetter($k))
358 $this->tpl->parseCurrentBlock();
360 $this->tpl->setCurrentBlock(
'td');
361 $this->tpl->setVariable(
'VALUE',
' ');
362 $this->tpl->parseCurrentBlock();
368 $mst_lco_usr_id = $set->getUsrId();
369 $mst_lco_crs_ref_id = $set->getCrsRefId();
373 if ($DIC->access()->checkAccess(
"visible",
"", $mst_lco_crs_ref_id)) {
375 $actions[] = $this->ui_fac->link()->standard(
384 if (isset($org_units[$orgu_id])) {
386 $actions[] = $this->ui_fac->link()->standard($org_units[$orgu_id], $link);
391 $DIC->ctrl()->setParameterByClass(ilMStListCoursesGUI::class,
'mst_lco_usr_id', $mst_lco_usr_id);
392 $DIC->ctrl()->setParameterByClass(ilMStListCoursesGUI::class,
'mst_lco_crs_ref_id', $mst_lco_crs_ref_id);
394 $actions[] = \ilMyStaffGUI::extendActionMenuWithUserActions(
396 rawurlencode($this->
ctrl->getLinkTargetByClass(
397 "ilMStListCoursesGUI",
402 $dropdown = $this->ui_fac->dropdown()->standard($actions)->withLabel($this->
lng->txt(
"actions"));
403 $this->tpl->setVariable(
"ACTIONS", $this->ui_ren->render($dropdown));
404 $this->tpl->parseCurrentBlock();
409 $set = array_pop($a_set);
413 $a_excel->
setCell($a_row, $col, $v);
420 $set = array_pop($a_set);
430 $propGetter = Closure::bind(
function ($prop) {
431 return $this->$prop ??
null;
432 }, $my_staff_course, $my_staff_course);
434 $field_values = array();
437 case 'usr_assinged_orgus':
440 case 'usr_reg_status':
441 $field_values[$k] = \ILIAS\MyStaff\ListCourses\ilMStListCourse::getMembershipStatusText($my_staff_course->getUsrRegStatus());
443 case 'usr_lp_status':
447 $field_values[$k] = strip_tags($propGetter($k) ??
"");
452 return $field_values;
const LP_STATUS_COMPLETED_NUM
setExportFormats(array $formats)
Set available export formats.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFormAction(string $a_form_action, bool $a_multipart=false)
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
setEnableTitle(bool $a_enabletitle)
Interface Observer Contains several chained tasks and infos about them.
const LP_STATUS_NOT_ATTEMPTED
getFieldValuesForExport(\ILIAS\MyStaff\ListCourses\ilMStListCourse $my_staff_course)
const LP_STATUS_IN_PROGRESS_NUM
setDisableFilterHiding(bool $a_val=true)
Class ilMStListCoursesTableGUI.
setFormName(string $a_name="")
static getUserLpStatusAsHtml(ilMStListCourse $my_staff_course)
const LP_STATUS_IN_PROGRESS
array $cached_selectable_columns
static getTextRepresentationOfOrgUnits(bool $sort_by_title=true)
Get ref id path array.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
setExternalSorting(bool $a_val)
static _enabledLearningProgress()
isColumnSelected(string $col)
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
Set cell value.
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
static _lookupTitle(int $obj_id)
setDefaultOrderField(string $a_defaultorderfield)
__construct(ilMStListCoursesGUI $parent_obj, $parent_cmd=ilMStListCoursesGUI::CMD_INDEX)
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
static _isInTrash(int $ref_id)
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
setDefaultOrderDirection(string $a_defaultorderdirection)
static _lookupObjectId(int $ref_id)
static getUserLpStatusAsText(ilMStListCourse $my_staff_course)
getTextRepresentationOfUsersOrgUnits(int $user_id)
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
const LP_STATUS_NOT_ATTEMPTED_NUM
static getSelectableColumnInfo(bool $a_admin=false)
Get info of searchable fields for selectable columns in table gui.
setEnableNumInfo(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
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)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
const LP_STATUS_COMPLETED
ILIAS UI Renderer $ui_ren
getTextRepresentationOfOrgUnits()
static _isEnabled($a_key)
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
const LP_STATUS_FAILED_NUM
setFilterCols(int $a_val)
setExternalSegmentation(bool $a_val)
setPrefix(string $a_prefix)