ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMStListCoursesTableGUI Class Reference

Class ilMStListCoursesTableGUI. More...

+ Inheritance diagram for ilMStListCoursesTableGUI:
+ Collaboration diagram for ilMStListCoursesTableGUI:

Public Member Functions

 __construct (ilMStListCoursesGUI $parent_obj, $parent_cmd=ilMStListCoursesGUI::CMD_INDEX)
 
 initFilter ()
 
 getSelectableColumns ()
 
- Public Member Functions inherited from ilTable2GUI
 __construct (?object $a_parent_obj, string $a_parent_cmd="", string $a_template_context="")
 
 setOpenFormTag (bool $a_val)
 
 getOpenFormTag ()
 
 setCloseFormTag (bool $a_val)
 
 getCloseFormTag ()
 
 determineLimit ()
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 
 isColumnSelected (string $col)
 
 getSelectedColumns ()
 
 resetOffset (bool $a_in_determination=false)
 
 initFilter ()
 
 getParentObject ()
 
 getParentCmd ()
 
 setTopAnchor (string $a_val)
 
 getTopAnchor ()
 
 setNoEntriesText (string $a_text)
 
 getNoEntriesText ()
 
 setIsDataTable (bool $a_val)
 
 getIsDataTable ()
 
 setEnableTitle (bool $a_enabletitle)
 
 getEnableTitle ()
 
 setEnableHeader (bool $a_enableheader)
 
 getEnableHeader ()
 
 setEnableNumInfo (bool $a_val)
 
 getEnableNumInfo ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setDescription (string $a_val)
 
 getDescription ()
 
 setOrderField (string $a_order_field)
 
 getOrderField ()
 
 setData (array $a_data)
 
 getData ()
 
 dataExists ()
 
 setPrefix (string $a_prefix)
 
 getPrefix ()
 
 addFilterItem (ilTableFilterItem $a_input_item, bool $a_optional=false)
 
 addFilterItemByMetaType (string $id, int $type=self::FILTER_TEXT, bool $a_optional=false, string $caption="")
 Add filter by standard type. More...
 
 getFilterItems (bool $a_optionals=false)
 
 getFilterItemByPostVar (string $a_post_var)
 
 setFilterCols (int $a_val)
 
 getFilterCols ()
 
 setDisableFilterHiding (bool $a_val=true)
 
 getDisableFilterHiding ()
 
 isFilterSelected (string $a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 
 determineSelectedFilters ()
 
 setCustomPreviousNext (string $a_prev_link, string $a_next_link)
 
 setFormAction (string $a_form_action, bool $a_multipart=false)
 
 getFormAction ()
 
 setFormName (string $a_name="")
 
 getFormName ()
 
 setId (string $a_val)
 
 getId ()
 
 setDisplayAsBlock (bool $a_val)
 
 getDisplayAsBlock ()
 
 setSelectAllCheckbox (string $a_select_all_checkbox, bool $a_select_all_on_top=false)
 
 setExternalSorting (bool $a_val)
 
 getExternalSorting ()
 
 setFilterCommand (string $a_val, string $a_caption="")
 
 getFilterCommand ()
 
 setResetCommand (string $a_val, string $a_caption="")
 
 getResetCommand ()
 
 setExternalSegmentation (bool $a_val)
 
 getExternalSegmentation ()
 
 setRowTemplate (string $a_template, string $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField (string $a_defaultorderfield)
 
 getDefaultOrderField ()
 
 setDefaultOrderDirection (string $a_defaultorderdirection)
 
 getDefaultOrderDirection ()
 
 setDefaultFilterVisiblity (bool $a_status)
 
 getDefaultFilterVisibility ()
 
 clearCommandButtons ()
 
 addCommandButton (string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
 addCommandButtonInstance (ilButtonBase $a_button)
 
 addMultiItemSelectionButton (string $a_sel_var, array $a_options, string $a_cmd, string $a_text, string $a_default_selection='')
 
 setCloseCommand (string $a_link)
 
 addMultiCommand (string $a_cmd, string $a_text)
 
 addHiddenInput (string $a_name, string $a_value)
 
 addHeaderCommand (string $a_href, string $a_text, string $a_target="", string $a_img="")
 
 setTopCommands (bool $a_val)
 
 getTopCommands ()
 
 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)
 
 getNavParameter ()
 
 setOrderLink (string $key, string $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder (bool $a_omit_offset=false)
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering (string $a_field)
 Should this field be sorted numeric? More...
 
 render ()
 
 writeFilterToSession ()
 
 resetFilter ()
 
 fillFooter ()
 
 getLinkbar (string $a_num)
 
 fillHiddenRow ()
 
 fillActionRow ()
 
 setHeaderHTML (string $html)
 
 storeProperty (string $type, string $value)
 
 loadProperty (string $type)
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext (string $id)
 
 getContext ()
 
 setShowRowsSelector (bool $a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 
 setShowTemplates (bool $a_value)
 
 getShowTemplates ()
 
 restoreTemplate (string $a_name)
 Restore state from template. More...
 
 saveTemplate (string $a_name)
 Save current state as template. More...
 
 deleteTemplate (string $a_name)
 
 getLimit ()
 
 getOffset ()
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode (bool $a_value=false)
 
 getPrintMode ()
 
 getExportMode ()
 
 exportData (int $format, bool $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand (bool $a_value)
 
 setRowSelectorLabel (string $row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission (bool $a_val)
 
 getPreventDoubleSubmission ()
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 
- Public Member Functions inherited from ilTableGUI
 __construct (array $a_data=[], bool $a_global_tpl=true)
 
 setTemplate (ilTemplate $a_tpl)
 
 getTemplateObject ()
 
 setData (array $a_data)
 Set table data. More...
 
 getData ()
 
 setTitle (string $a_title, string $a_icon="", string $a_icon_alt="")
 
 setHelp (string $a_help_page, string $a_help_icon, string $a_help_icon_alt="")
 
 setHeaderNames (array $a_header_names)
 
 getColumnCount ()
 
 setHeaderVars (array $a_header_vars, array $a_header_params=[])
 
 setColumnWidth (array $a_column_width)
 set table column widths More...
 
 setOneColumnWidth (string $a_column_width, int $a_column_number)
 
 setMaxCount (int $a_max_count)
 set max. More...
 
 setLimit (int $a_limit=0, int $a_default_limit=0)
 set max. More...
 
 getLimit ()
 
 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 separately) More...
 
 setOffset (int $a_offset)
 set dataset offset More...
 
 getOffset ()
 
 setOrderColumn (string $a_order_column="", string $a_default_column="")
 
 getOrderColumn ()
 
 setOrderDirection (string $a_order_direction)
 
 getOrderDirection ()
 
 setFooter (string $a_style, string $a_previous="", string $a_next="")
 
 enable (string $a_module_name)
 
 disable (string $a_module_name)
 
 sortData ()
 
 render ()
 
 renderHeader ()
 
 setOrderLink (string $key, string $order_dir)
 
 setStyle (string $a_element, string $a_style)
 
 getStyle (string $a_element)
 
 setBase (string $a_base)
 
 getBase ()
 
 getFormName ()
 get the name of the parent form More...
 
 setFormName (string $a_name="cmd")
 
 getSelectAllCheckbox ()
 get the name of the checkbox that should be toggled with a select all button More...
 
 setSelectAllCheckbox (string $a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton (string $btn_name, string $btn_value)
 

Protected Member Functions

 parseData ()
 
 getTextRepresentationOfOrgUnits ()
 
 getTextRepresentationOfUsersOrgUnits (int $user_id)
 
 initSelectableColumns ()
 
 fillRow (array $a_set)
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 
 getFieldValuesForExport (\ILIAS\MyStaff\ListCourses\ilMStListCourse $my_staff_course)
 
- Protected Member Functions inherited from ilTable2GUI
 getRequestedValues ()
 
 prepareOutput ()
 Anything that must be done before HTML is generated. More...
 
 isFilterVisible ()
 Check if filter is visible: manually shown (session, db) or default value set. More...
 
 isAdvMDFilter (ilAdvancedMDRecordGUI $a_gui, ilTableFilterItem $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow (array $a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilTableFilterItem $a_item)
 Get current filter value. More...
 
 setFilterValue (ilTableFilterItem $a_item, $a_value)
 
 fillMetaExcel (ilExcel $a_excel, int &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, int &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, int &$a_row, array $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV (ilCSVWriter $a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV (ilCSVWriter $a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV (ilCSVWriter $a_csv, array $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

array $filter = []
 
array $selectable_columns_cached = []
 
array $orgu_names = null
 
array $usr_orgu_names = []
 
ilMyStaffAccess $access
 
- Protected Attributes inherited from ilTable2GUI
string $requested_tmpl_delete
 
string $requested_tmpl_create
 
string $requested_nav_par2 = ""
 
string $requested_nav_par = ""
 
string $requested_nav_par1 = ""
 
ILIAS Table TableGUIRequest $table_request = null
 
array $selected_columns = []
 
ilCtrl $ctrl
 
object $parent_obj = null
 
string $parent_cmd = ""
 
string $close_command = ""
 
string $top_anchor = "il_table_top"
 
array $filters = array()
 
array $optional_filters = array()
 
string $filter_cmd = 'applyFilter'
 
string $reset_cmd = 'resetFilter'
 
int $filter_cols = 5
 
bool $ext_sort = false
 
bool $ext_seg = false
 
string $context = ""
 
array $mi_sel_buttons = []
 
bool $disable_filter_hiding = false
 
bool $top_commands = true
 
array $selectable_columns = array()
 
array $selected_column = array()
 
bool $show_templates = false
 
bool $show_rows_selector = true
 
bool $rows_selector_off = false
 
bool $nav_determined = false
 
bool $limit_determined = false
 
bool $filters_determined = false
 
bool $columns_determined = false
 
bool $open_form_tag = true
 
bool $close_form_tag = true
 
array $export_formats = []
 
int $export_mode = 0
 
bool $print_mode = false
 
bool $enable_command_for_all = false
 
bool $restore_filter = false
 
array $restore_filter_values = []
 
bool $default_filter_visibility = false
 
array $sortable_fields = array()
 
bool $prevent_double_submission = true
 
string $row_selector_label = ""
 
bool $select_all_on_top = false
 
array $sel_buttons = []
 
string $nav_value = ''
 
string $noentriestext = ''
 
string $css_row = ''
 
bool $display_as_block = false
 
string $description = ''
 
string $id = ""
 
bool $custom_prev_next = false
 
string $reset_cmd_txt = ""
 
string $defaultorderfield = ""
 
string $defaultorderdirection = ""
 
array $column = []
 
bool $datatable = false
 
bool $num_info = false
 
bool $form_multipart = false
 
array $row_data = []
 
string $order_field = ""
 
array $selected_filter = []
 
string $form_action = ""
 
string $formname = ""
 
string $sort_order = ""
 
array $buttons = []
 
array $multi = []
 
array $hidden_inputs = []
 
array $header_commands = []
 
string $row_template = ""
 
string $row_template_dir = ""
 
string $filter_cmd_txt = ""
 
string $custom_prev = ""
 
string $custom_next = ""
 
array $raw_post_data = null
 
ilGlobalTemplateInterface $main_tpl
 
- Protected Attributes inherited from ilTableGUI
string $sort_order
 
string $link_params
 
array $header_params
 
 $tpl
 
ilLanguage $lng
 

Private Member Functions

 addColumns ()
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 
- Static Public Member Functions inherited from ilTableGUI
static linkbar (string $AScript, int $AHits, int $ALimit, int $AOffset, array $AParams=array(), array $ALayout=array(), string $prefix='')
 
- Data Fields inherited from ilTable2GUI
const FILTER_TEXT = 1
 
const FILTER_SELECT = 2
 
const FILTER_DATE = 3
 
const FILTER_LANGUAGE = 4
 
const FILTER_NUMBER_RANGE = 5
 
const FILTER_DATE_RANGE = 6
 
const FILTER_DURATION_RANGE = 7
 
const FILTER_DATETIME_RANGE = 8
 
const FILTER_CHECKBOX = 9
 
const EXPORT_EXCEL = 1
 
const EXPORT_CSV = 2
 
const ACTION_ALL_LIMIT = 1000
 
- Data Fields inherited from ilTableGUI
string $title = ""
 
string $icon = ""
 
string $icon_alt = ""
 
string $help_page = ""
 
string $help_icon = ""
 
string $help_icon_alt = ""
 
array $header_names = []
 
array $header_vars = []
 
array $linkbar_vars = []
 
array $data = []
 
int $column_count = 0
 
array $column_width = []
 
int $max_count = 0
 
int $limit = 0
 
bool $max_limit = false
 
int $offset = 0
 
string $order_column = ""
 
string $order_direction = ""
 
string $footer_style = ""
 
string $footer_previous = ""
 
string $footer_next = ""
 
bool $lang_support = true
 
bool $global_tpl = false
 
string $form_name = ""
 
string $select_all_checkbox = ""
 
array $action_buttons = []
 
string $prefix = ""
 
string $base = ""
 
array $enabled
 
array $styles
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMStListCoursesTableGUI::__construct ( ilMStListCoursesGUI  $parent_obj,
  $parent_cmd = ilMStListCoursesGUI::CMD_INDEX 
)
Parameters
ilMStListCoursesGUI$parent_obj
string$parent_cmd

Definition at line 54 of file class.ilMStListCoursesTableGUI.php.

References $DIC, ilTable2GUI\$parent_cmd, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\Repository\access(), addColumns(), initFilter(), parseData(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDisableFilterHiding(), ilTable2GUI\setEnableNumInfo(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setExportFormats(), ilTable2GUI\setFilterCols(), ilTable2GUI\setFormAction(), ilTable2GUI\setFormName(), ilTable2GUI\setId(), ilTable2GUI\setPrefix(), ilTable2GUI\setRowTemplate(), and ilTable2GUI\setShowRowsSelector().

55  {
56  global $DIC;
57 
58  $this->access = ilMyStaffAccess::getInstance();
59 
60  $this->setPrefix('myst_lc');
61  $this->setFormName('myst_lc');
62  $this->setId('myst_lc');
63 
64  parent::__construct($parent_obj, $parent_cmd, '');
65 
66  $this->setRowTemplate('tpl.list_courses_row.html', "Services/MyStaff");
67  $this->setFormAction($DIC->ctrl()->getFormAction($parent_obj));
68  $this->setDefaultOrderDirection('desc');
69 
70  $this->setShowRowsSelector(true);
71 
72  $this->setEnableTitle(true);
73  $this->setDisableFilterHiding(true);
74  $this->setEnableNumInfo(true);
75 
76  $this->setExportFormats(array(self::EXPORT_EXCEL, self::EXPORT_CSV));
77 
78  $this->setFilterCols(5);
79  $this->initFilter();
80 
81  $this->addColumns();
82 
83  $this->parseData();
84  }
setExportFormats(array $formats)
Set available export formats.
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
setDisableFilterHiding(bool $a_val=true)
setFormName(string $a_name="")
setId(string $a_val)
global $DIC
Definition: feed.php:28
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
setDefaultOrderDirection(string $a_defaultorderdirection)
setEnableNumInfo(bool $a_val)
__construct(Container $dic, ilPlugin $plugin)
setFilterCols(int $a_val)
setPrefix(string $a_prefix)
+ Here is the call graph for this function:

Member Function Documentation

◆ addColumns()

ilMStListCoursesTableGUI::addColumns ( )
private

Definition at line 305 of file class.ilMStListCoursesTableGUI.php.

References $DIC, ilTable2GUI\addColumn(), ilTable2GUI\getExportMode(), getSelectableColumns(), and ilTable2GUI\isColumnSelected().

Referenced by __construct().

305  : void
306  {
307  global $DIC;
308 
309  foreach ($this->getSelectableColumns() as $k => $v) {
310  if ($this->isColumnSelected($k)) {
311  $sort = $v['sort_field'] ?? "";
312  $this->addColumn($v['txt'], $sort);
313  }
314  }
315 
316  //Actions
317  if (!$this->getExportMode()) {
318  $this->addColumn($DIC->language()->txt('actions'));
319  }
320  }
global $DIC
Definition: feed.php:28
isColumnSelected(string $col)
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)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillRow()

ilMStListCoursesTableGUI::fillRow ( array  $a_set)
finalprotected
Parameters
array<

Definition at line 328 of file class.ilMStListCoursesTableGUI.php.

References $DIC, ilLink\_getStaticLink(), ilObject\_lookupObjectId(), ilObject\_lookupTitle(), ilMStListCoursesGUI\CMD_INDEX, ILIAS\Repository\ctrl(), ilTable2GUI\getSelectedColumns(), getTextRepresentationOfOrgUnits(), getTextRepresentationOfUsersOrgUnits(), ilMyStaffGUI\getUserLpStatusAsHtml(), and ActiveRecord\innerjoin().

328  : void
329  {
330  global $DIC;
331 
332  $set = array_pop($a_set);
333 
334  $propGetter = Closure::bind(function ($prop) {
335  return $this->$prop ?? null;
336  }, $set, $set);
337 
338  foreach ($this->getSelectedColumns() as $k => $v) {
339  switch ($k) {
340  case 'usr_assinged_orgus':
341  $this->tpl->setCurrentBlock('td');
342  $this->tpl->setVariable(
343  'VALUE',
344  $this->getTextRepresentationOfUsersOrgUnits($set->getUsrId())
345  );
346  $this->tpl->parseCurrentBlock();
347  break;
348  case 'usr_reg_status':
349  $this->tpl->setCurrentBlock('td');
350  $this->tpl->setVariable(
351  'VALUE',
352  \ILIAS\MyStaff\ListCourses\ilMStListCourse::getMembershipStatusText($set->getUsrRegStatus())
353  );
354  $this->tpl->parseCurrentBlock();
355  break;
356  case 'usr_lp_status':
357  $this->tpl->setCurrentBlock('td');
358  $this->tpl->setVariable('VALUE', ilMyStaffGUI::getUserLpStatusAsHtml($set));
359  $this->tpl->parseCurrentBlock();
360  break;
361  default:
362  if ($propGetter($k) !== null) {
363  $this->tpl->setCurrentBlock('td');
364  $this->tpl->setVariable(
365  'VALUE',
366  (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))
367  );
368  $this->tpl->parseCurrentBlock();
369  } else {
370  $this->tpl->setCurrentBlock('td');
371  $this->tpl->setVariable('VALUE', '&nbsp;');
372  $this->tpl->parseCurrentBlock();
373  }
374  break;
375  }
376  }
377 
378  $actions = new ilAdvancedSelectionListGUI();
379  $actions->setListTitle($DIC->language()->txt("actions"));
380  $actions->setId($set->getUsrId() . "-" . $set->getCrsRefId());
381 
382  $mst_lco_usr_id = $set->getUsrId();
383  $mst_lco_crs_ref_id = $set->getCrsRefId();
384 
385  if ($DIC->access()->checkAccess("visible", "", $mst_lco_crs_ref_id)) {
386  $link = ilLink::_getStaticLink($mst_lco_crs_ref_id, ilMyStaffAccess::COURSE_CONTEXT);
387  $actions->addItem(
389  '',
390  $link
391  );
392  };
393 
394  foreach (ilOrgUnitUserAssignment::innerjoin('object_reference', 'orgu_id', 'ref_id')->where(array(
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())) {
399  $org_units = $this->getTextRepresentationOfOrgUnits();
400  $link = ilLink::_getStaticLink($org_unit_assignment->getOrguId(), 'orgu');
401  $actions->addItem($org_units[$org_unit_assignment->getOrguId()], '', $link);
402  }
403  }
404 
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);
407 
408  $actions = ilMyStaffGUI::extendActionMenuWithUserActions(
409  $actions,
410  $mst_lco_usr_id,
411  rawurlencode($this->ctrl->getLinkTargetByClass(
412  "ilMStListCoursesGUI",
414  ))
415  );
416 
417  $this->tpl->setVariable('ACTIONS', $actions->getHTML());
418  $this->tpl->parseCurrentBlock();
419  }
Class ChatMainBarProvider .
static getUserLpStatusAsHtml(ilMStListCourse $my_staff_course)
static innerjoin( $tablename, $on_this, $on_external, array $fields=array(' *'), string $operator='=', bool $both_external=false)
global $DIC
Definition: feed.php:28
static _lookupTitle(int $obj_id)
static _lookupObjectId(int $ref_id)
+ Here is the call graph for this function:

◆ fillRowCSV()

ilMStListCoursesTableGUI::fillRowCSV ( ilCSVWriter  $a_csv,
array  $a_set 
)
protected

Definition at line 432 of file class.ilMStListCoursesTableGUI.php.

References ilCSVWriter\addColumn(), ilCSVWriter\addRow(), and getFieldValuesForExport().

432  : void
433  {
434  $set = array_pop($a_set);
435 
436  foreach ($this->getFieldValuesForExport($set) as $k => $v) {
437  $a_csv->addColumn($v);
438  }
439  $a_csv->addRow();
440  }
addColumn(string $a_col)
getFieldValuesForExport(\ILIAS\MyStaff\ListCourses\ilMStListCourse $my_staff_course)
+ Here is the call graph for this function:

◆ fillRowExcel()

ilMStListCoursesTableGUI::fillRowExcel ( ilExcel  $a_excel,
int &  $a_row,
array  $a_set 
)
protected

Definition at line 421 of file class.ilMStListCoursesTableGUI.php.

References getFieldValuesForExport(), and ilExcel\setCell().

421  : void
422  {
423  $set = array_pop($a_set);
424 
425  $col = 0;
426  foreach ($this->getFieldValuesForExport($set) as $k => $v) {
427  $a_excel->setCell($a_row, $col, $v);
428  $col++;
429  }
430  }
getFieldValuesForExport(\ILIAS\MyStaff\ListCourses\ilMStListCourse $my_staff_course)
setCell(int $a_row, int $a_col, $a_value, ?string $a_datatype=null)
Set cell value.
+ Here is the call graph for this function:

◆ getFieldValuesForExport()

ilMStListCoursesTableGUI::getFieldValuesForExport ( \ILIAS\MyStaff\ListCourses\ilMStListCourse  $my_staff_course)
protected

Definition at line 442 of file class.ilMStListCoursesTableGUI.php.

References ILIAS\MyStaff\ListCourses\ilMStListCourse\getMembershipStatusText(), ilTable2GUI\getSelectedColumns(), getTextRepresentationOfUsersOrgUnits(), and ilMyStaffGUI\getUserLpStatusAsText().

Referenced by fillRowCSV(), and fillRowExcel().

442  : array
443  {
444  $propGetter = Closure::bind(function ($prop) {
445  return $this->$prop ?? null;
446  }, $my_staff_course, $my_staff_course);
447 
448  $field_values = array();
449  foreach ($this->getSelectedColumns() as $k => $v) {
450  switch ($k) {
451  case 'usr_assinged_orgus':
452  $field_values[$k] = $this->getTextRepresentationOfUsersOrgUnits($my_staff_course->getUsrId());
453  break;
454  case 'usr_reg_status':
455  $field_values[$k] = \ILIAS\MyStaff\ListCourses\ilMStListCourse::getMembershipStatusText($my_staff_course->getUsrRegStatus());
456  break;
457  case 'usr_lp_status':
458  $field_values[$k] = ilMyStaffGUI::getUserLpStatusAsText($my_staff_course);
459  break;
460  default:
461  $field_values[$k] = strip_tags($propGetter($k) ?? "");
462  break;
463  }
464  }
465 
466  return $field_values;
467  }
static getUserLpStatusAsText(ilMStListCourse $my_staff_course)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectableColumns()

ilMStListCoursesTableGUI::getSelectableColumns ( )
final

Definition at line 222 of file class.ilMStListCoursesTableGUI.php.

References $selectable_columns_cached, and initSelectableColumns().

Referenced by addColumns().

222  : array
223  {
224  if ($this->selectable_columns_cached) {
226  }
227 
228  return $this->selectable_columns_cached = $this->initSelectableColumns();
229  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTextRepresentationOfOrgUnits()

ilMStListCoursesTableGUI::getTextRepresentationOfOrgUnits ( )
protected

Definition at line 204 of file class.ilMStListCoursesTableGUI.php.

References $orgu_names, and ilOrgUnitPathStorage\getTextRepresentationOfOrgUnits().

Referenced by fillRow(), and initFilter().

204  : array
205  {
206  if (isset($this->orgu_names)) {
207  return $this->orgu_names;
208  }
209 
210  return $this->orgu_names = ilOrgUnitPathStorage::getTextRepresentationOfOrgUnits();
211  }
static getTextRepresentationOfOrgUnits(bool $sort_by_title=true)
Get ref id path array.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTextRepresentationOfUsersOrgUnits()

ilMStListCoursesTableGUI::getTextRepresentationOfUsersOrgUnits ( int  $user_id)
protected

Definition at line 213 of file class.ilMStListCoursesTableGUI.php.

Referenced by fillRow(), and getFieldValuesForExport().

213  : string
214  {
215  if (isset($this->usr_orgu_names[$user_id])) {
216  return $this->usr_orgu_names[$user_id];
217  }
218 
219  return $this->usr_orgu_names[$user_id] = ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($user_id);
220  }
+ Here is the caller graph for this function:

◆ initFilter()

ilMStListCoursesTableGUI::initFilter ( )
final

Definition at line 128 of file class.ilMStListCoursesTableGUI.php.

References $DIC, $path, ilObjUserTracking\_enabledLearningProgress(), ilUserSearchOptions\_isEnabled(), ILIAS\Repository\access(), ilTable2GUI\addFilterItem(), ILIAS\UI\examples\Symbol\Glyph\Filter\filter(), getTextRepresentationOfOrgUnits(), ILIAS\Repository\int(), ilLPStatus\LP_STATUS_COMPLETED, ilLPStatus\LP_STATUS_COMPLETED_NUM, ilLPStatus\LP_STATUS_FAILED, ilLPStatus\LP_STATUS_FAILED_NUM, ilLPStatus\LP_STATUS_IN_PROGRESS, ilLPStatus\LP_STATUS_IN_PROGRESS_NUM, ilLPStatus\LP_STATUS_NOT_ATTEMPTED, ilLPStatus\LP_STATUS_NOT_ATTEMPTED_NUM, ILIAS\MyStaff\ListCourses\ilMStListCourse\MEMBERSHIP_STATUS_REGISTERED, ILIAS\MyStaff\ListCourses\ilMStListCourse\MEMBERSHIP_STATUS_REQUESTED, ILIAS\MyStaff\ListCourses\ilMStListCourse\MEMBERSHIP_STATUS_WAITINGLIST, and ilRepositorySelectorInputGUI\setSelectText().

Referenced by __construct().

128  : void
129  {
130  global $DIC;
131 
132  $item = new ilTextInputGUI($DIC->language()->txt("crs_title"), "crs_title");
133  $this->addFilterItem($item);
134  $item->readFromSession();
135  $this->filter['crs_title'] = $item->getValue();
136 
137  // course members
138  $item = new ilRepositorySelectorInputGUI($DIC->language()->txt("usr_filter_coursemember"), "course");
139  //$item->setParent($this->getParentObject());
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));
143  $this->addFilterItem($item);
144  $item->readFromSession();
145  //$item->setParent($this->getParentObject());
146  $this->filter["course"] = $item->getValue();
147 
148  //membership status
149  $item = new ilSelectInputGUI($DIC->language()->txt('member_status'), 'memb_status');
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'),
155  ));
156  $this->addFilterItem($item);
157  $item->readFromSession();
158  $this->filter["memb_status"] = $item->getValue();
159 
160  if (ilObjUserTracking::_enabledLearningProgress() && $this->access->hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser()) {
161  //learning progress status
162  $item = new ilSelectInputGUI($DIC->language()->txt('learning_progress'), 'lp_status');
163  //+1 because LP_STATUS_NOT_ATTEMPTED_NUM is 0.
164  $item->setOptions(array(
165  "" => $DIC->language()->txt("mst_opt_all"),
170  ));
171  $this->addFilterItem($item);
172  $item->readFromSession();
173  $this->filter["lp_status"] = $item->getValue();
174  $this->filter["lp_status"] = (int) $this->filter["lp_status"] - 1;
175  }
176 
177 
178 
179  //user
180  $item = new ilTextInputGUI(
181  $DIC->language()->txt("login") . "/" . $DIC->language()->txt("email") . "/" . $DIC->language()
182  ->txt("name"),
183  "user"
184  );
185 
186  $this->addFilterItem($item);
187  $item->readFromSession();
188  $this->filter['user'] = $item->getValue();
189 
190  if (ilUserSearchOptions::_isEnabled('org_units')) {
191  $paths = $this->getTextRepresentationOfOrgUnits();
192  $options[0] = $DIC->language()->txt('mst_opt_all');
193  foreach ($paths as $org_ref_id => $path) {
194  $options[$org_ref_id] = $path;
195  }
196  $item = new ilSelectInputGUI($DIC->language()->txt('obj_orgu'), 'org_unit');
197  $item->setOptions($options);
198  $this->addFilterItem($item);
199  $item->readFromSession();
200  $this->filter['org_unit'] = $item->getValue();
201  }
202  }
const LP_STATUS_COMPLETED_NUM
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS_NUM
$path
Definition: ltiservices.php:32
const LP_STATUS_IN_PROGRESS
global $DIC
Definition: feed.php:28
const LP_STATUS_FAILED
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const LP_STATUS_NOT_ATTEMPTED_NUM
const LP_STATUS_COMPLETED
const LP_STATUS_FAILED_NUM
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSelectableColumns()

ilMStListCoursesTableGUI::initSelectableColumns ( )
protected

Definition at line 231 of file class.ilMStListCoursesTableGUI.php.

References $cols, $DIC, ilObjUserTracking\_enabledLearningProgress(), ILIAS\Repository\access(), and ilUserSearchOptions\getSelectableColumnInfo().

Referenced by getSelectableColumns().

231  : array
232  {
233  global $DIC;
234 
235  $cols = array();
236 
237  $arr_searchable_user_columns = ilUserSearchOptions::getSelectableColumnInfo();
238 
239  $cols['crs_title'] = array(
240  'txt' => $DIC->language()->txt('crs_title'),
241  'default' => true,
242  'width' => 'auto',
243  'sort_field' => 'crs_title',
244  );
245  $cols['usr_reg_status'] = array(
246  'txt' => $DIC->language()->txt('member_status'),
247  'default' => true,
248  'width' => 'auto',
249  'sort_field' => 'reg_status',
250  );
251  if (ilObjUserTracking::_enabledLearningProgress() && $this->access->hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser()) {
252  $cols['usr_lp_status'] = array(
253  'txt' => $DIC->language()->txt('learning_progress'),
254  'default' => true,
255  'width' => 'auto',
256  'sort_field' => 'lp_status',
257  );
258  }
259 
260  if ($arr_searchable_user_columns['login'] ?? false) {
261  $cols['usr_login'] = array(
262  'txt' => $DIC->language()->txt('login'),
263  'default' => true,
264  'width' => 'auto',
265  'sort_field' => 'usr_login',
266  );
267  }
268  if ($arr_searchable_user_columns['firstname'] ?? false) {
269  $cols['usr_firstname'] = array(
270  'txt' => $DIC->language()->txt('firstname'),
271  'default' => true,
272  'width' => 'auto',
273  'sort_field' => 'usr_firstname',
274  );
275  }
276  if ($arr_searchable_user_columns['lastname'] ?? false) {
277  $cols['usr_lastname'] = array(
278  'txt' => $DIC->language()->txt('lastname'),
279  'default' => true,
280  'width' => 'auto',
281  'sort_field' => 'usr_lastname',
282  );
283  }
284 
285  if ($arr_searchable_user_columns['email'] ?? false) {
286  $cols['usr_email'] = array(
287  'txt' => $DIC->language()->txt('email'),
288  'default' => true,
289  'width' => 'auto',
290  'sort_field' => 'usr_email',
291  );
292  }
293 
294  if ($arr_searchable_user_columns['org_units'] ?? false) {
295  $cols['usr_assinged_orgus'] = array(
296  'txt' => $DIC->language()->txt('objs_orgu'),
297  'default' => true,
298  'width' => 'auto',
299  );
300  }
301 
302  return $cols;
303  }
global $DIC
Definition: feed.php:28
static getSelectableColumnInfo(bool $a_admin=false)
Get info of searchable fields for selectable columns in table gui.
$cols
Definition: xhr_table.php:11
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parseData()

ilMStListCoursesTableGUI::parseData ( )
protected

Definition at line 86 of file class.ilMStListCoursesTableGUI.php.

References ilTableGUI\$data, $DIC, ILIAS\Repository\access(), ilTable2GUI\determineLimit(), ilTable2GUI\determineOffsetAndOrder(), ILIAS\UI\examples\Symbol\Glyph\Filter\filter(), ilTable2GUI\getLimit(), ilTable2GUI\getOffset(), ilTableGUI\getOrderDirection(), ilTable2GUI\getOrderField(), ilTable2GUI\setData(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setExternalSorting(), and ilTableGUI\setMaxCount().

Referenced by __construct().

87  {
88  global $DIC;
89 
90  $this->setExternalSorting(true);
91  $this->setExternalSegmentation(true);
92  $this->setDefaultOrderField('crs_title');
93 
94  $this->determineLimit();
95  $this->determineOffsetAndOrder();
96 
97  $options = array(
98  'filters' => $this->filter,
99  'limit' => array(
100  'start' => $this->getOffset(),
101  'end' => $this->getLimit(),
102  ),
103  'count' => true,
104  'sort' => array(
105  'field' => $this->getOrderField(),
106  'direction' => $this->getOrderDirection(),
107  ),
108  );
109 
110  $arr_usr_id = $this->access->getUsersForUserOperationAndContext(
111  $DIC->user()->getId(),
112  ilMyStaffAccess::ACCESS_ENROLMENTS_ORG_UNIT_OPERATION,
113  ilMyStaffAccess::COURSE_CONTEXT
114  );
115 
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();
120 
121  // Workaround because the fillRow Method only accepts arrays
122  $data = array_map(function (\ILIAS\MyStaff\ListCourses\ilMStListCourse $it): array {
123  return [$it];
124  }, $data);
125  $this->setData($data);
126  }
setData(array $a_data)
Class ChatMainBarProvider .
global $DIC
Definition: feed.php:28
setExternalSorting(bool $a_val)
setDefaultOrderField(string $a_defaultorderfield)
determineOffsetAndOrder(bool $a_omit_offset=false)
setMaxCount(int $a_max_count)
set max.
setExternalSegmentation(bool $a_val)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilMyStaffAccess ilMStListCoursesTableGUI::$access
protected

Definition at line 48 of file class.ilMStListCoursesTableGUI.php.

◆ $filter

array ilMStListCoursesTableGUI::$filter = []
protected

Definition at line 44 of file class.ilMStListCoursesTableGUI.php.

◆ $orgu_names

array ilMStListCoursesTableGUI::$orgu_names = null
protected

Definition at line 46 of file class.ilMStListCoursesTableGUI.php.

Referenced by getTextRepresentationOfOrgUnits().

◆ $selectable_columns_cached

array ilMStListCoursesTableGUI::$selectable_columns_cached = []
protected

Definition at line 45 of file class.ilMStListCoursesTableGUI.php.

Referenced by getSelectableColumns().

◆ $usr_orgu_names

array ilMStListCoursesTableGUI::$usr_orgu_names = []
protected

Definition at line 47 of file class.ilMStListCoursesTableGUI.php.


The documentation for this class was generated from the following file: