18declare(strict_types=1);
58 $this->
access = ilMyStaffAccess::getInstance();
62 $this->
setId(
'myst_lc');
66 $this->
setRowTemplate(
'tpl.list_courses_row.html',
"Services/MyStaff");
98 'filters' => $this->
filter,
110 $arr_usr_id = $this->
access->getUsersForUserOperationAndContext(
111 $DIC->user()->getId(),
112 ilMyStaffAccess::ACCESS_ENROLMENTS_ORG_UNIT_OPERATION,
113 ilMyStaffAccess::COURSE_CONTEXT
116 $list_courses_fetcher = new \ILIAS\MyStaff\ListCourses\ilMStListCourses(
$DIC);
117 $result = $list_courses_fetcher->getData($arr_usr_id, $options);
118 $this->
setMaxCount($result->getTotalDatasetCount());
119 $data = $result->getDataset();
122 $data = array_map(
function (\
ILIAS\MyStaff\ListCourses\ilMStListCourse $it): array {
134 $item->readFromSession();
135 $this->
filter[
'crs_title'] = $item->getValue();
140 $item->setSelectText(
$DIC->language()->txt(
"mst_select_course"));
141 $item->setHeaderMessage(
$DIC->language()->txt(
"mst_please_select_course"));
142 $item->setClickableTypes(array(ilMyStaffAccess::COURSE_CONTEXT));
144 $item->readFromSession();
146 $this->
filter[
"course"] = $item->getValue();
150 $item->setOptions(array(
151 "" =>
$DIC->language()->txt(
"mst_opt_all"),
152 \
ILIAS\MyStaff\ListCourses\ilMStListCourse::MEMBERSHIP_STATUS_REQUESTED =>
$DIC->language()->txt(
'mst_memb_status_requested'),
153 \
ILIAS\MyStaff\ListCourses\ilMStListCourse::MEMBERSHIP_STATUS_WAITINGLIST =>
$DIC->language()->txt(
'mst_memb_status_waitinglist'),
154 \
ILIAS\MyStaff\ListCourses\ilMStListCourse::MEMBERSHIP_STATUS_REGISTERED =>
$DIC->language()->txt(
'mst_memb_status_registered'),
157 $item->readFromSession();
158 $this->
filter[
"memb_status"] = $item->getValue();
164 $item->setOptions(array(
165 "" =>
$DIC->language()->txt(
"mst_opt_all"),
172 $item->readFromSession();
173 $this->
filter[
"lp_status"] = $item->getValue();
181 $DIC->language()->txt(
"login") .
"/" .
$DIC->language()->txt(
"email") .
"/" .
$DIC->language()
187 $item->readFromSession();
188 $this->
filter[
'user'] = $item->getValue();
192 $options[0] =
$DIC->language()->txt(
'mst_opt_all');
193 foreach ($paths as $org_ref_id =>
$path) {
194 $options[$org_ref_id] =
$path;
197 $item->setOptions($options);
199 $item->readFromSession();
200 $this->
filter[
'org_unit'] = $item->getValue();
206 if (isset($this->orgu_names)) {
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);
224 if ($this->selectable_columns_cached) {
239 $cols[
'crs_title'] = array(
240 'txt' =>
$DIC->language()->txt(
'crs_title'),
243 'sort_field' =>
'crs_title',
245 $cols[
'usr_reg_status'] = array(
246 'txt' =>
$DIC->language()->txt(
'member_status'),
249 'sort_field' =>
'reg_status',
252 $cols[
'usr_lp_status'] = array(
253 'txt' =>
$DIC->language()->txt(
'learning_progress'),
256 'sort_field' =>
'lp_status',
260 if ($arr_searchable_user_columns[
'login'] ??
false) {
261 $cols[
'usr_login'] = array(
262 'txt' =>
$DIC->language()->txt(
'login'),
265 'sort_field' =>
'usr_login',
268 if ($arr_searchable_user_columns[
'firstname'] ??
false) {
269 $cols[
'usr_firstname'] = array(
270 'txt' =>
$DIC->language()->txt(
'firstname'),
273 'sort_field' =>
'usr_firstname',
276 if ($arr_searchable_user_columns[
'lastname'] ??
false) {
277 $cols[
'usr_lastname'] = array(
278 'txt' =>
$DIC->language()->txt(
'lastname'),
281 'sort_field' =>
'usr_lastname',
285 if ($arr_searchable_user_columns[
'email'] ??
false) {
286 $cols[
'usr_email'] = array(
287 'txt' =>
$DIC->language()->txt(
'email'),
290 'sort_field' =>
'usr_email',
294 if ($arr_searchable_user_columns[
'org_units'] ??
false) {
295 $cols[
'usr_assinged_orgus'] = array(
296 'txt' =>
$DIC->language()->txt(
'objs_orgu'),
311 $sort = $v[
'sort_field'] ??
"";
318 $this->
addColumn($DIC->language()->txt(
'actions'));
328 final protected function fillRow(array $a_set): void
332 $set = array_pop($a_set);
334 $propGetter = Closure::bind(
function ($prop) {
335 return $this->$prop ??
null;
340 case 'usr_assinged_orgus':
341 $this->tpl->setCurrentBlock(
'td');
342 $this->tpl->setVariable(
346 $this->tpl->parseCurrentBlock();
348 case 'usr_reg_status':
349 $this->tpl->setCurrentBlock(
'td');
350 $this->tpl->setVariable(
352 \
ILIAS\MyStaff\ListCourses\ilMStListCourse::getMembershipStatusText($set->getUsrRegStatus())
354 $this->tpl->parseCurrentBlock();
356 case 'usr_lp_status':
357 $this->tpl->setCurrentBlock(
'td');
359 $this->tpl->parseCurrentBlock();
362 if ($propGetter($k) !==
null) {
363 $this->tpl->setCurrentBlock(
'td');
364 $this->tpl->setVariable(
366 (is_array($propGetter($k)) ? implode(
", ", $propGetter($k)) : $propGetter($k))
368 $this->tpl->parseCurrentBlock();
370 $this->tpl->setCurrentBlock(
'td');
371 $this->tpl->setVariable(
'VALUE',
' ');
372 $this->tpl->parseCurrentBlock();
379 $actions->setListTitle(
$DIC->language()->txt(
"actions"));
380 $actions->setId($set->getUsrId() .
"-" . $set->getCrsRefId());
382 $mst_lco_usr_id = $set->getUsrId();
383 $mst_lco_crs_ref_id = $set->getCrsRefId();
385 if (
$DIC->access()->checkAccess(
"visible",
"", $mst_lco_crs_ref_id)) {
395 'user_id' => $mst_lco_usr_id,
396 'object_reference.deleted' =>
null
397 ), array(
'user_id' =>
'=',
'object_reference.deleted' =>
'!='))->
get() as $org_unit_assignment) {
398 if (
$DIC->access()->checkAccess(
"read",
"", $org_unit_assignment->getOrguId())) {
401 $actions->addItem($org_units[$org_unit_assignment->getOrguId()],
'', $link);
405 $DIC->ctrl()->setParameterByClass(ilMStListCoursesGUI::class,
'mst_lco_usr_id', $mst_lco_usr_id);
406 $DIC->ctrl()->setParameterByClass(ilMStListCoursesGUI::class,
'mst_lco_crs_ref_id', $mst_lco_crs_ref_id);
408 $actions = ilMyStaffGUI::extendActionMenuWithUserActions(
411 rawurlencode($this->
ctrl->getLinkTargetByClass(
412 "ilMStListCoursesGUI",
417 $this->tpl->setVariable(
'ACTIONS', $actions->getHTML());
418 $this->tpl->parseCurrentBlock();
423 $set = array_pop($a_set);
427 $a_excel->
setCell($a_row, $col, $v);
434 $set = array_pop($a_set);
444 $propGetter = Closure::bind(
function ($prop) {
445 return $this->$prop ??
null;
446 }, $my_staff_course, $my_staff_course);
448 $field_values = array();
451 case 'usr_assinged_orgus':
454 case 'usr_reg_status':
457 case 'usr_lp_status':
461 $field_values[$k] = strip_tags($propGetter($k) ??
"");
466 return $field_values;
static innerjoin( $tablename, $on_this, $on_external, array $fields=array(' *'), string $operator='=', bool $both_external=false)
static getMembershipStatusText(int $status)
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.
const LP_STATUS_COMPLETED_NUM
const LP_STATUS_COMPLETED
const LP_STATUS_IN_PROGRESS_NUM
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_FAILED_NUM
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS
static _getStaticLink(?int $a_ref_id, string $a_type='', bool $a_fallback_goto=true, string $append="")
Get static link.
Class ilMStListCoursesGUI.
Class ilMStListCoursesTableGUI.
fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set)
Excel Version of Fill Row.
getTextRepresentationOfOrgUnits()
getSelectableColumns()
Get selectable columns.
getTextRepresentationOfUsersOrgUnits(int $user_id)
getFieldValuesForExport(\ILIAS\MyStaff\ListCourses\ilMStListCourse $my_staff_course)
array $selectable_columns_cached
fillRowCSV(ilCSVWriter $a_csv, array $a_set)
CSV Version of Fill Row.
__construct(ilMStListCoursesGUI $parent_obj, $parent_cmd=ilMStListCoursesGUI::CMD_INDEX)
static getUserLpStatusAsText(ilMStListCourse $my_staff_course)
static getUserLpStatusAsHtml(ilMStListCourse $my_staff_course)
static _enabledLearningProgress()
static _lookupObjectId(int $ref_id)
static _lookupTitle(int $obj_id)
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.
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
Class ChatMainBarProvider \MainMenu\Provider.