ILIAS  trunk Revision v11.0_alpha-1769-g99a433fe2dc
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator 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 ()
 
 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 $cached_selectable_columns = []
 
array $orgu_names = null
 
array $usr_orgu_names = []
 
ilMyStaffAccess $access
 
ILIAS UI Factory $ui_fac
 
ILIAS UI Renderer $ui_ren
 
- Protected Attributes inherited from ilTable2GUI
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_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 42 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().

43  {
44  global $DIC;
45 
46  $this->access = ilMyStaffAccess::getInstance();
47  $this->ui_fac = $DIC->ui()->factory();
48  $this->ui_ren = $DIC->ui()->renderer();
49 
50  $this->setPrefix('myst_lc');
51  $this->setFormName('myst_lc');
52  $this->setId('myst_lc');
53 
54  parent::__construct($parent_obj, $parent_cmd, '');
55 
56  $this->setRowTemplate('tpl.list_courses_row.html', "components/ILIAS/MyStaff");
57  $this->setFormAction($DIC->ctrl()->getFormAction($parent_obj));
58  $this->setDefaultOrderDirection('desc');
59 
60  $this->setShowRowsSelector(true);
61 
62  $this->setEnableTitle(true);
63  $this->setDisableFilterHiding(true);
64  $this->setEnableNumInfo(true);
65 
66  $this->setExportFormats(array(self::EXPORT_EXCEL, self::EXPORT_CSV));
67 
68  $this->setFilterCols(5);
69  $this->initFilter();
70 
71  $this->addColumns();
72 
73  $this->parseData();
74  }
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)
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
global $DIC
Definition: shib_login.php:22
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 295 of file class.ilMStListCoursesTableGUI.php.

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

Referenced by __construct().

295  : void
296  {
297  global $DIC;
298 
299  foreach ($this->getSelectableColumns() as $k => $v) {
300  if ($this->isColumnSelected($k)) {
301  $sort = $v['sort_field'] ?? "";
302  $this->addColumn($v['txt'], $sort);
303  }
304  }
305 
306  //Actions
307  if (!$this->getExportMode()) {
308  $this->addColumn($DIC->language()->txt('actions'));
309  }
310  }
isColumnSelected(string $col)
global $DIC
Definition: shib_login.php:22
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 318 of file class.ilMStListCoursesTableGUI.php.

References $DIC, ilObjOrgUnitTree\_getInstance(), ilLink\_getStaticLink(), ilObject\_isInTrash(), ilObject\_lookupObjectId(), ilObject\_lookupTitle(), ilMStListCoursesGUI\CMD_INDEX, ILIAS\Repository\ctrl(), ilTable2GUI\getSelectedColumns(), getTextRepresentationOfOrgUnits(), getTextRepresentationOfUsersOrgUnits(), ilMyStaffGUI\getUserLpStatusAsHtml(), ILIAS\Repository\lng(), and null.

318  : void
319  {
320  global $DIC;
321 
322  $set = array_pop($a_set);
323 
324  $propGetter = Closure::bind(function ($prop) {
325  return $this->$prop ?? null;
326  }, $set, $set);
327 
328  foreach ($this->getSelectedColumns() as $k => $v) {
329  switch ($k) {
330  case 'usr_assinged_orgus':
331  $this->tpl->setCurrentBlock('td');
332  $this->tpl->setVariable(
333  'VALUE',
334  $this->getTextRepresentationOfUsersOrgUnits($set->getUsrId())
335  );
336  $this->tpl->parseCurrentBlock();
337  break;
338  case 'usr_reg_status':
339  $this->tpl->setCurrentBlock('td');
340  $this->tpl->setVariable(
341  'VALUE',
342  \ILIAS\MyStaff\ListCourses\ilMStListCourse::getMembershipStatusText($set->getUsrRegStatus())
343  );
344  $this->tpl->parseCurrentBlock();
345  break;
346  case 'usr_lp_status':
347  $this->tpl->setCurrentBlock('td');
348  $this->tpl->setVariable('VALUE', ilMyStaffGUI::getUserLpStatusAsHtml($set));
349  $this->tpl->parseCurrentBlock();
350  break;
351  default:
352  if ($propGetter($k) !== null) {
353  $this->tpl->setCurrentBlock('td');
354  $this->tpl->setVariable(
355  'VALUE',
356  (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))
357  );
358  $this->tpl->parseCurrentBlock();
359  } else {
360  $this->tpl->setCurrentBlock('td');
361  $this->tpl->setVariable('VALUE', '&nbsp;');
362  $this->tpl->parseCurrentBlock();
363  }
364  break;
365  }
366  }
367 
368  $mst_lco_usr_id = $set->getUsrId();
369  $mst_lco_crs_ref_id = $set->getCrsRefId();
370 
371  $actions = [];
372 
373  if ($DIC->access()->checkAccess("visible", "", $mst_lco_crs_ref_id)) {
374  $link = ilLink::_getStaticLink($mst_lco_crs_ref_id, ilMyStaffAccess::COURSE_CONTEXT);
375  $actions[] = $this->ui_fac->link()->standard(
377  $link
378  );
379  };
380 
381  foreach (array_unique(ilObjOrgUnitTree::_getInstance()->getOrgUnitOfUser($mst_lco_usr_id)) as $orgu_id) {
382  if ($DIC->access()->checkAccess("read", "", $orgu_id) && !ilObject::_isInTrash($orgu_id)) {
383  $org_units = $this->getTextRepresentationOfOrgUnits();
384  if (isset($org_units[$orgu_id])) {
385  $link = ilLink::_getStaticLink($orgu_id, 'orgu');
386  $actions[] = $this->ui_fac->link()->standard($org_units[$orgu_id], $link);
387  }
388  }
389  }
390 
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);
393 
394  $actions[] = \ilMyStaffGUI::extendActionMenuWithUserActions(
395  $mst_lco_usr_id,
396  rawurlencode($this->ctrl->getLinkTargetByClass(
397  "ilMStListCoursesGUI",
399  ))
400  );
401 
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();
405  }
Interface Observer Contains several chained tasks and infos about them.
static getUserLpStatusAsHtml(ilMStListCourse $my_staff_course)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _lookupTitle(int $obj_id)
static _isInTrash(int $ref_id)
global $DIC
Definition: shib_login.php:22
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 418 of file class.ilMStListCoursesTableGUI.php.

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

418  : void
419  {
420  $set = array_pop($a_set);
421 
422  foreach ($this->getFieldValuesForExport($set) as $k => $v) {
423  $a_csv->addColumn($v);
424  }
425  $a_csv->addRow();
426  }
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 407 of file class.ilMStListCoursesTableGUI.php.

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

407  : void
408  {
409  $set = array_pop($a_set);
410 
411  $col = 0;
412  foreach ($this->getFieldValuesForExport($set) as $k => $v) {
413  $a_excel->setCell($a_row, $col, $v);
414  $col++;
415  }
416  }
getFieldValuesForExport(\ILIAS\MyStaff\ListCourses\ilMStListCourse $my_staff_course)
setCell(int $a_row, int $col, $value, ?string $datatype=null, bool $disable_strip_tags_for_strings=false)
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 428 of file class.ilMStListCoursesTableGUI.php.

References ilTable2GUI\getSelectedColumns(), getTextRepresentationOfUsersOrgUnits(), ilMyStaffGUI\getUserLpStatusAsText(), and null.

Referenced by fillRowCSV(), and fillRowExcel().

428  : array
429  {
430  $propGetter = Closure::bind(function ($prop) {
431  return $this->$prop ?? null;
432  }, $my_staff_course, $my_staff_course);
433 
434  $field_values = array();
435  foreach ($this->getSelectedColumns() as $k => $v) {
436  switch ($k) {
437  case 'usr_assinged_orgus':
438  $field_values[$k] = $this->getTextRepresentationOfUsersOrgUnits($my_staff_course->getUsrId());
439  break;
440  case 'usr_reg_status':
441  $field_values[$k] = \ILIAS\MyStaff\ListCourses\ilMStListCourse::getMembershipStatusText($my_staff_course->getUsrRegStatus());
442  break;
443  case 'usr_lp_status':
444  $field_values[$k] = ilMyStaffGUI::getUserLpStatusAsText($my_staff_course);
445  break;
446  default:
447  $field_values[$k] = strip_tags($propGetter($k) ?? "");
448  break;
449  }
450  }
451 
452  return $field_values;
453  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 212 of file class.ilMStListCoursesTableGUI.php.

References $cached_selectable_columns, and initSelectableColumns().

Referenced by addColumns().

212  : array
213  {
214  if ($this->cached_selectable_columns) {
216  }
217 
218  return $this->cached_selectable_columns = $this->initSelectableColumns();
219  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTextRepresentationOfOrgUnits()

ilMStListCoursesTableGUI::getTextRepresentationOfOrgUnits ( )
protected

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

References $orgu_names, and ilOrgUnitPathStorage\getTextRepresentationOfOrgUnits().

Referenced by fillRow(), and initFilter().

194  : array
195  {
196  if (isset($this->orgu_names)) {
197  return $this->orgu_names;
198  }
199 
200  return $this->orgu_names = ilOrgUnitPathStorage::getTextRepresentationOfOrgUnits();
201  }
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 203 of file class.ilMStListCoursesTableGUI.php.

References $user_id.

Referenced by fillRow(), and getFieldValuesForExport().

203  : string
204  {
205  if (isset($this->usr_orgu_names[$user_id])) {
206  return $this->usr_orgu_names[$user_id];
207  }
208 
209  return $this->usr_orgu_names[$user_id] = ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($user_id);
210  }
+ Here is the caller graph for this function:

◆ initFilter()

ilMStListCoursesTableGUI::initFilter ( )
final

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

References $DIC, $path, ilObjUserTracking\_enabledLearningProgress(), ilUserSearchOptions\_isEnabled(), ILIAS\Repository\access(), ilTable2GUI\addFilterItem(), ILIAS\Repository\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, ilSelectInputGUI\setOptions(), and ilRepositorySelectorInputGUI\setSelectText().

Referenced by __construct().

118  : void
119  {
120  global $DIC;
121 
122  $item = new ilTextInputGUI($DIC->language()->txt("crs_title"), "crs_title");
123  $this->addFilterItem($item);
124  $item->readFromSession();
125  $this->filter['crs_title'] = $item->getValue();
126 
127  // course members
128  $item = new ilRepositorySelectorInputGUI($DIC->language()->txt("usr_filter_coursemember"), "course");
129  //$item->setParent($this->getParentObject());
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));
133  $this->addFilterItem($item);
134  $item->readFromSession();
135  //$item->setParent($this->getParentObject());
136  $this->filter["course"] = $item->getValue();
137 
138  //membership status
139  $item = new ilSelectInputGUI($DIC->language()->txt('member_status'), 'memb_status');
140  $item->setOptions(array(
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'),
145  ));
146  $this->addFilterItem($item);
147  $item->readFromSession();
148  $this->filter["memb_status"] = $item->getValue();
149 
150  if (ilObjUserTracking::_enabledLearningProgress() && $this->access->hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser()) {
151  //learning progress status
152  $item = new ilSelectInputGUI($DIC->language()->txt('learning_progress'), 'lp_status');
153  //+1 because LP_STATUS_NOT_ATTEMPTED_NUM is 0.
154  $item->setOptions(array(
155  "" => $DIC->language()->txt("mst_opt_all"),
160  ));
161  $this->addFilterItem($item);
162  $item->readFromSession();
163  $this->filter["lp_status"] = $item->getValue();
164  $this->filter["lp_status"] = (int) $this->filter["lp_status"] - 1;
165  }
166 
167 
168 
169  //user
170  $item = new ilTextInputGUI(
171  $DIC->language()->txt("login") . "/" . $DIC->language()->txt("email") . "/" . $DIC->language()
172  ->txt("name"),
173  "user"
174  );
175 
176  $this->addFilterItem($item);
177  $item->readFromSession();
178  $this->filter['user'] = $item->getValue();
179 
180  if (ilUserSearchOptions::_isEnabled('org_units')) {
181  $paths = $this->getTextRepresentationOfOrgUnits();
182  $options[0] = $DIC->language()->txt('mst_opt_all');
183  foreach ($paths as $org_ref_id => $path) {
184  $options[$org_ref_id] = $path;
185  }
186  $item = new ilSelectInputGUI($DIC->language()->txt('obj_orgu'), 'org_unit');
187  $item->setOptions($options);
188  $this->addFilterItem($item);
189  $item->readFromSession();
190  $this->filter['org_unit'] = $item->getValue();
191  }
192  }
const LP_STATUS_COMPLETED_NUM
This class represents a selection list property in a property form.
addFilterItem(ilTableFilterItem $a_input_item, bool $a_optional=false)
const LP_STATUS_NOT_ATTEMPTED
const LP_STATUS_IN_PROGRESS_NUM
setOptions(array $a_options)
$path
Definition: ltiservices.php:29
const LP_STATUS_IN_PROGRESS
const LP_STATUS_FAILED
This class represents a repository selector in a property form.
global $DIC
Definition: shib_login.php:22
const LP_STATUS_NOT_ATTEMPTED_NUM
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
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 221 of file class.ilMStListCoursesTableGUI.php.

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

Referenced by getSelectableColumns().

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

◆ parseData()

ilMStListCoursesTableGUI::parseData ( )
protected

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

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

Referenced by __construct().

77  {
78  global $DIC;
79 
80  $this->setExternalSorting(true);
81  $this->setExternalSegmentation(true);
82  $this->setDefaultOrderField('crs_title');
83 
84  $this->determineLimit();
85  $this->determineOffsetAndOrder();
86 
87  $options = array(
88  'filters' => $this->filter,
89  'limit' => array(
90  'start' => $this->getOffset(),
91  'end' => $this->getLimit(),
92  ),
93  'count' => true,
94  'sort' => array(
95  'field' => $this->getOrderField(),
96  'direction' => $this->getOrderDirection(),
97  ),
98  );
99 
100  $arr_usr_id = $this->access->getUsersForUserOperationAndContext(
101  $DIC->user()->getId(),
102  ilMyStaffAccess::ACCESS_ENROLMENTS_ORG_UNIT_OPERATION,
103  ilMyStaffAccess::COURSE_CONTEXT
104  );
105 
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();
110 
111  // Workaround because the fillRow Method only accepts arrays
112  $data = array_map(function (\ILIAS\MyStaff\ListCourses\ilMStListCourse $it): array {
113  return [$it];
114  }, $data);
115  $this->setData($data);
116  }
setData(array $a_data)
Interface Observer Contains several chained tasks and infos about them.
setExternalSorting(bool $a_val)
setDefaultOrderField(string $a_defaultorderfield)
global $DIC
Definition: shib_login.php:22
filter(string $filter_id, $class_path, string $cmd, bool $activated=true, bool $expanded=true)
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 34 of file class.ilMStListCoursesTableGUI.php.

◆ $cached_selectable_columns

array ilMStListCoursesTableGUI::$cached_selectable_columns = []
protected

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

Referenced by getSelectableColumns().

◆ $filter

array ilMStListCoursesTableGUI::$filter = []
protected

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

◆ $orgu_names

array ilMStListCoursesTableGUI::$orgu_names = null
protected

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

Referenced by getTextRepresentationOfOrgUnits().

◆ $ui_fac

ILIAS UI Factory ilMStListCoursesTableGUI::$ui_fac
protected

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

◆ $ui_ren

ILIAS UI Renderer ilMStListCoursesTableGUI::$ui_ren
protected

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

◆ $usr_orgu_names

array ilMStListCoursesTableGUI::$usr_orgu_names = []
protected

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


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