47 $this->
access = ilMyStaffAccess::getInstance();
48 $this->ui_fac = $DIC->ui()->factory();
49 $this->ui_ren = $DIC->ui()->renderer();
51 $this->usr_id = $DIC->http()->request()->getQueryParams()[
'usr_id'];
55 $this->
setId(
'myst_su');
58 $this->
setRowTemplate(
'tpl.list_user_courses_row.html',
"components/ILIAS/MyStaff");
59 $this->
setFormAction($DIC->ctrl()->getFormAction($parent_obj));
89 $arr_usr_id = $this->
access->getUsersForUserOperationAndContext(
90 $DIC->user()->getId(),
91 ilMyStaffAccess::ACCESS_ENROLMENTS_ORG_UNIT_OPERATION,
92 ilMyStaffAccess::COURSE_CONTEXT
97 'filters' => $this->
filter,
109 $user_courses_fetcher = new \ILIAS\MyStaff\Courses\ShowUser\ilMStShowUserCourses($DIC);
110 $result = $user_courses_fetcher->getData($arr_usr_id, $options);
111 $this->
setMaxCount($result->getTotalDatasetCount());
112 $data = $result->getDataset();
125 $item =
new ilTextInputGUI($DIC->language()->txt(
"crs_title"),
"crs_title");
127 $item->readFromSession();
128 $this->
filter[
'crs_title'] = $item->getValue();
132 $item->
setSelectText($DIC->language()->txt(
"mst_select_course"));
133 $item->setHeaderMessage($DIC->language()->txt(
"mst_please_select_course"));
134 $item->setClickableTypes(array(ilMyStaffAccess::COURSE_CONTEXT));
136 $item->readFromSession();
138 $this->
filter[
"course"] = $item->getValue();
141 $item =
new ilSelectInputGUI($DIC->language()->txt(
'member_status'),
'memb_status');
143 "" => $DIC->language()->txt(
"mst_opt_all"),
144 ilMStListCourse::MEMBERSHIP_STATUS_REQUESTED => $DIC->language()->txt(
'mst_memb_status_requested'),
145 ilMStListCourse::MEMBERSHIP_STATUS_WAITINGLIST => $DIC->language()->txt(
'mst_memb_status_waitinglist'),
146 ilMStListCourse::MEMBERSHIP_STATUS_REGISTERED => $DIC->language()->txt(
'mst_memb_status_registered'),
149 $item->readFromSession();
150 $this->
filter[
"memb_status"] = $item->getValue();
154 $item =
new ilSelectInputGUI($DIC->language()->txt(
'learning_progress'),
'lp_status');
157 "" => $DIC->language()->txt(
"mst_opt_all"),
164 $item->readFromSession();
165 $this->
filter[
"lp_status"] = $item->getValue();
174 if ($this->columnDefinition !==
null) {
180 $cols[
'crs_title'] = array(
181 'txt' => $DIC->language()->txt(
'crs_title'),
184 'sort_field' =>
'crs_title',
186 $cols[
'usr_reg_status'] = array(
187 'txt' => $DIC->language()->txt(
'member_status'),
190 'sort_field' =>
'reg_status',
193 $cols[
'usr_lp_status'] = array(
194 'txt' => $DIC->language()->txt(
'learning_progress'),
197 'sort_field' =>
'lp_status',
201 $this->columnDefinition = $cols;
212 $sort = $v[
'sort_field'] ??
"";
218 $this->
addColumn($DIC->language()->txt(
'actions'));
224 if (isset($this->orgu_names)) {
235 $set = array_pop($a_set);
237 $propGetter = Closure::bind(
function ($prop) {
238 return $this->$prop ??
null;
243 case 'usr_reg_status':
244 $this->tpl->setCurrentBlock(
'td');
245 $this->tpl->setVariable(
247 $this->
getSpaceOrValue(ilMStListCourse::getMembershipStatusText($set->getUsrRegStatus()))
249 $this->tpl->parseCurrentBlock();
251 case 'usr_lp_status':
252 $this->tpl->setCurrentBlock(
'td');
253 $this->tpl->setVariable(
257 $this->tpl->parseCurrentBlock();
260 if ($propGetter($k) !==
null) {
261 $this->tpl->setCurrentBlock(
'td');
262 $this->tpl->setVariable(
264 (is_array($propGetter($k)) ? implode(
", ", $propGetter($k)) : $propGetter($k))
266 $this->tpl->parseCurrentBlock();
268 $this->tpl->setCurrentBlock(
'td');
269 $this->tpl->setVariable(
'VALUE',
' ');
270 $this->tpl->parseCurrentBlock();
276 $mst_lco_usr_id = $set->getUsrId();
277 $mst_lco_crs_ref_id = $set->getCrsRefId();
281 if ($DIC->access()->checkAccess(
"visible",
"", $mst_lco_crs_ref_id)) {
283 $actions[] = $this->ui_fac->link()->standard(
292 if (isset($org_units[$orgu_id])) {
294 $actions[] = $this->ui_fac->link()->standard($org_units[$orgu_id], $link);
299 $DIC->ctrl()->setParameterByClass(ilMStShowUserCoursesGUI::class,
'mst_lco_usr_id', $set->getUsrId());
300 $DIC->ctrl()->setParameterByClass(ilMStShowUserCoursesGUI::class,
'mst_lco_crs_ref_id', $set->getCrsRefId());
302 $actions[] = \ilMyStaffGUI::extendActionMenuWithUserActions(
304 rawurlencode($this->
ctrl->getLinkTargetByClass(
305 "ilMStShowUserCoursesGUI",
310 $dropdown = $this->ui_fac->dropdown()->standard($actions)->withLabel($this->
lng->txt(
"actions"));
311 $this->tpl->setVariable(
"ACTIONS", $this->ui_ren->render($dropdown));
312 $this->tpl->parseCurrentBlock();
317 $set = array_pop($a_set);
321 $a_excel->
setCell($a_row, $col, $v);
328 $set = array_pop($a_set);
338 $propGetter = Closure::bind(
function ($prop) {
339 return $this->$prop ??
null;
340 }, $my_staff_course, $my_staff_course);
342 $field_values = array();
346 case 'usr_reg_status':
347 $field_values[$k] = ilMStListCourse::getMembershipStatusText($my_staff_course->
getUsrRegStatus());
349 case 'usr_lp_status':
353 $field_values[$k] = strip_tags($propGetter($k) ??
"");
358 return $field_values;
364 if (empty($string)) {
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)
const LP_STATUS_NOT_ATTEMPTED
getTextRepresentationOfOrgUnits()
const LP_STATUS_IN_PROGRESS_NUM
setDisableFilterHiding(bool $a_val=true)
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
setFormName(string $a_name="")
static getUserLpStatusAsHtml(ilMStListCourse $my_staff_course)
const LP_STATUS_IN_PROGRESS
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)
getSpaceOrValue(string $string)
setDefaultOrderField(string $a_defaultorderfield)
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)
setDefaultOrderDirection(string $a_defaultorderdirection)
static _lookupObjectId(int $ref_id)
static getUserLpStatusAsText(ilMStListCourse $my_staff_course)
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
__construct(ilMStShowUserCoursesGUI $parent_obj, $parent_cmd=ilMStShowUserCoursesGUI::CMD_INDEX)
const LP_STATUS_NOT_ATTEMPTED_NUM
setEnableNumInfo(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
ILIAS UI Renderer $ui_ren
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)
getFieldValuesForExport(ilMStListCourse $my_staff_course)
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
Class ilMStShowUserCoursesTableGUI.
const LP_STATUS_COMPLETED
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)