ILIAS  release_7 Revision v7.30-3-g800a261c036
ilStudyProgrammeMembersTableGUI Class Reference

Class ilObjStudyProgrammeMembersTableGUI. More...

+ Inheritance diagram for ilStudyProgrammeMembersTableGUI:
+ Collaboration diagram for ilStudyProgrammeMembersTableGUI:

Public Member Functions

 __construct (int $prg_obj_id, int $prg_ref_id, ilObjStudyProgrammeMembersGUI $parent_obj, string $parent_cmd='', string $template_context='', ilStudyProgrammeProgressRepository $sp_user_progress_db, ilPRGPermissionsHelper $permissions, \ILIAS\Data\Factory $data_factory)
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 initFilter ()
 Init filter.Overwrite this to initialize all filter input property objects. More...
 
- Public Member Functions inherited from ilTable2GUI
 __construct ($a_parent_obj, $a_parent_cmd="", $a_template_context="")
 ilTable2GUI constructor. More...
 
 setOpenFormTag ($a_val)
 Set open form tag. More...
 
 getOpenFormTag ()
 Get open form tag. More...
 
 setCloseFormTag ($a_val)
 Set close form tag. More...
 
 getCloseFormTag ()
 Get close form tag. More...
 
 determineLimit ()
 Determine the limit. More...
 
 getSelectableColumns ()
 Get selectable columns. More...
 
 determineSelectedColumns ()
 Determine selected columns. More...
 
 isColumnSelected ($a_col)
 Is given column selected? More...
 
 getSelectedColumns ()
 Get selected columns. More...
 
 executeCommand ()
 Execute command. More...
 
 resetOffset ($a_in_determination=false)
 Reset offset. More...
 
 initFilter ()
 Init filter. More...
 
 getParentObject ()
 Get parent object. More...
 
 getParentCmd ()
 Get parent command. More...
 
 setTopAnchor ($a_val)
 Set top anchor. More...
 
 getTopAnchor ()
 Get top anchor. More...
 
 setNoEntriesText ($a_text)
 Set text for an empty table. More...
 
 getNoEntriesText ()
 Get text for an empty table. More...
 
 setIsDataTable ($a_val)
 Set is data table. More...
 
 getIsDataTable ()
 Get is data table. More...
 
 setEnableTitle ($a_enabletitle)
 Set Enable Title. More...
 
 getEnableTitle ()
 Get Enable Title. More...
 
 setEnableHeader ($a_enableheader)
 Set Enable Header. More...
 
 getEnableHeader ()
 Get Enable Header. More...
 
 setEnableNumInfo ($a_val)
 Set enable num info. More...
 
 getEnableNumInfo ()
 Get enable num info. More...
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 Set title and title icon. More...
 
 setDescription ($a_val)
 Set description. More...
 
 getDescription ()
 Get description. More...
 
 setOrderField ($a_order_field)
 set order column More...
 
 getOrderField ()
 
 setData ($a_data)
 set table data @access public More...
 
 getData ()
 
 dataExists ()
 
 setPrefix ($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) @access public More...
 
 getPrefix ()
 
 addFilterItem ($a_input_item, $a_optional=false)
 Add filter item. More...
 
 addFilterItemByMetaType ($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
 Add filter by standard type. More...
 
 getFilterItems ($a_optionals=false)
 Get filter items. More...
 
 getFilterItemByPostVar ($a_post_var)
 
 setFilterCols ($a_val)
 Set filter columns. More...
 
 getFilterCols ()
 Get filter columns. More...
 
 setDisableFilterHiding ($a_val=true)
 Set disable filter hiding. More...
 
 getDisableFilterHiding ()
 Get disable filter hiding. More...
 
 isFilterSelected ($a_col)
 Is given filter selected? More...
 
 getSelectedFilters ()
 Get selected filters. More...
 
 determineSelectedFilters ()
 Determine selected filters. More...
 
 setCustomPreviousNext ($a_prev_link, $a_next_link)
 Set custom previous/next links. More...
 
 setFormAction ($a_form_action, $a_multipart=false)
 Set Form action parameter. More...
 
 getFormAction ()
 Get Form action parameter. More...
 
 setFormName ($a_formname="")
 Set Form name. More...
 
 getFormName ()
 Get Form name. More...
 
 setId ($a_val)
 Set id. More...
 
 getId ()
 Get element id. More...
 
 setDisplayAsBlock ($a_val)
 Set display as block. More...
 
 getDisplayAsBlock ()
 Get display as block. More...
 
 getSelectAllCheckbox ()
 Get the name of the checkbox that should be toggled with a select all button. More...
 
 setSelectAllCheckbox ($a_select_all_checkbox, $a_select_all_on_top=false)
 Set the name of the checkbox that should be toggled with a select all button. More...
 
 setExternalSorting ($a_val)
 Set external sorting. More...
 
 getExternalSorting ()
 Get external sorting. More...
 
 setFilterCommand ($a_val, $a_caption=null)
 Set filter command. More...
 
 getFilterCommand ()
 Get filter command. More...
 
 setResetCommand ($a_val, $a_caption=null)
 Set reset filter command. More...
 
 getResetCommand ()
 Get reset filter command. More...
 
 setExternalSegmentation ($a_val)
 Set external segmentation. More...
 
 getExternalSegmentation ()
 Get external segmentation. More...
 
 setRowTemplate ($a_template, $a_template_dir="")
 Set row template. More...
 
 setDefaultOrderField ($a_defaultorderfield)
 Set Default order field. More...
 
 getDefaultOrderField ()
 Get Default order field. More...
 
 setDefaultOrderDirection ($a_defaultorderdirection)
 Set Default order direction. More...
 
 getDefaultOrderDirection ()
 Get Default order direction. More...
 
 setDefaultFilterVisiblity ($a_status)
 Set default filter visiblity. More...
 
 getDefaultFilterVisibility ()
 Get default filter visibility. More...
 
 clearCommandButtons ()
 
 addCommandButton ($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
 Add Command button. More...
 
 addCommandButtonInstance (ilButtonBase $a_button)
 Add Command button instance. More...
 
 addSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button. More...
 
 addMultiItemSelectionButton ($a_sel_var, $a_options, $a_cmd, $a_text, $a_default_selection='')
 Add Selection List + Command button for selected items. More...
 
 setCloseCommand ($a_link)
 Add command for closing table. More...
 
 addMultiCommand ($a_cmd, $a_text)
 Add Command button. More...
 
 addHiddenInput ($a_name, $a_value)
 Add Hidden Input field. More...
 
 addHeaderCommand ($a_href, $a_text, $a_target="", $a_img="")
 Add Header Command (Link) (Image needed for now) More...
 
 setTopCommands ($a_val)
 Set top commands (display command buttons on top of table, too) More...
 
 getTopCommands ()
 Get top commands (display command buttons on top of table, too) More...
 
 addColumn ( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
 Add a column to the header. More...
 
 getNavParameter ()
 
 setOrderLink ($sort_field, $order_dir)
 
 fillHeader ()
 
 determineOffsetAndOrder ($a_omit_offset=false)
 Determine offset and order. More...
 
 storeNavParameter ()
 
 getHTML ()
 Get HTML. More...
 
 numericOrdering ($a_field)
 Should this field be sorted numeric? More...
 
 render ()
 render table @access public More...
 
 writeFilterToSession ()
 Write filter values to session. More...
 
 resetFilter ()
 Reset filter. More...
 
 fillFooter ()
 Fill footer row. More...
 
 getLinkbar ($a_num)
 Get previous/next linkbar. More...
 
 fillHiddenRow ()
 
 fillActionRow ()
 Fill Action Row. More...
 
 setHeaderHTML ($html)
 set header html More...
 
 storeProperty ($type, $value)
 Store table property. More...
 
 loadProperty ($type)
 Load table property. More...
 
 getCurrentState ()
 get current settings for order, limit, columns and filter More...
 
 setContext ($id)
 Set context. More...
 
 getContext ()
 Get context. More...
 
 setShowRowsSelector ($a_value)
 Toggle rows-per-page selector. More...
 
 getShowRowsSelector ()
 Get rows-per-page selector state. More...
 
 setShowTemplates ($a_value)
 Toggle templates. More...
 
 getShowTemplates ()
 Get template state. More...
 
 restoreTemplate ($a_name)
 Restore state from template. More...
 
 saveTemplate ($a_name)
 Save current state as template. More...
 
 deleteTemplate ($a_name)
 Delete template. More...
 
 getLimit ()
 Get limit. More...
 
 getOffset ()
 Get offset. More...
 
 setExportFormats (array $formats)
 Set available export formats. More...
 
 setPrintMode ($a_value=false)
 Toogle print mode. More...
 
 getPrintMode ()
 Get print mode. More...
 
 getExportMode ()
 Was export activated? More...
 
 exportData ($format, $send=false)
 Export and optionally send current table data. More...
 
 setEnableAllCommand ($a_value)
 Enable actions for all entries in current result. More...
 
 setRowSelectorLabel ($row_selector_label)
 
 getRowSelectorLabel ()
 
 setPreventDoubleSubmission ($a_val)
 Set prevent double submission. More...
 
 getPreventDoubleSubmission ()
 Get prevent double submission. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 set max. More...
 
- Public Member Functions inherited from ilTableGUI
 __construct ($a_data=0, $a_global_tpl=true)
 Constructor. More...
 
 setTemplate ($a_tpl)
 set template @access public More...
 
getTemplateObject ()
 
 setData ($a_data)
 set table data @access public More...
 
 getData ()
 
 setTitle ($a_title, $a_icon=0, $a_icon_alt=0)
 set table title @access public More...
 
 setHelp ($a_help_page, $a_help_icon, $a_help_icon_alt=0)
 set table help page @access public More...
 
 setHeaderNames ($a_header_names)
 set table header names @access public More...
 
 getColumnCount ()
 Returns the column count based on the number of the header row columns @access public. More...
 
 setHeaderVars ($a_header_vars, $a_header_params=0)
 set table header vars @access public More...
 
 setColumnWidth ($a_column_width)
 set table column widths @access public More...
 
 setOneColumnWidth ($a_column_width, $a_column_number)
 set one table column width @access public More...
 
 setMaxCount ($a_max_count)
 set max. More...
 
 setLimit ($a_limit=0, $a_default_limit=0)
 set max. More...
 
 getLimit ()
 Get limit. More...
 
 setPrefix ($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) @access public More...
 
 setOffset ($a_offset)
 set dataset offset @access public More...
 
 getOffset ()
 Get offset. More...
 
 setOrderColumn ($a_order_column=0, $a_default_column=0)
 set order column @access public More...
 
 getOrderColumn ()
 Get order column. More...
 
 setOrderDirection ($a_order_direction)
 set order direction @access public More...
 
 getOrderDirection ()
 Get order direction. More...
 
 setFooter ($a_style, $a_previous=0, $a_next=0)
 set order direction @access public More...
 
 enable ($a_module_name)
 enables particular modules of table More...
 
 disable ($a_module_name)
 diesables particular modules of table More...
 
 sortData ()
 
 render ()
 render table @access public More...
 
 renderHeader ()
 
 setOrderLink ($key, $order_dir)
 
 setStyle ($a_element, $a_style)
 
 getStyle ($a_element)
 
 setBase ($a_base)
 Set Base script name (deprecated, only use this for workarounds). More...
 
 getBase ()
 Get Base script name (deprecated, only use this for workarounds). More...
 
 getFormName ()
 
 setFormName ($a_name="cmd")
 
 getSelectAllCheckbox ()
 
 setSelectAllCheckbox ($a_select_all_checkbox)
 
 clearActionButtons ()
 
 addActionButton ($btn_name, $btn_value)
 

Data Fields

const COLUMNS
 
const OPTION_ALL = -1
 
const VALIDITY_OPTION_VALID = 1
 
const VALIDITY_OPTION_INVALID = 3
 
const ORDER_MAPPING
 
- 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
 $title
 
 $icon
 
 $icon_alt
 
 $help_page
 
 $help_icon
 
 $help_icon_alt
 
 $header_names
 
 $header_vars
 
 $linkbar_vars
 
 $data
 
 $column_count
 
 $column_width
 
 $max_count
 
 $limit
 
 $max_limit = false
 
 $offset
 
 $order_column
 
 $order_direction
 
 $footer_style
 
 $footer_previous
 
 $footer_next
 
 $lang_support = true
 
 $global_tpl
 
 $form_name
 
 $select_all_checkbox
 
 $action_buttons
 
 $prefix
 
 $base = ""
 
 $enabled
 
 $styles
 

Protected Member Functions

 postOrder (array $list, \ILIAS\Data\Order $order)
 
 getOrdering ()
 
 getUserDateFormat ()
 
 fillRow ($a_set)
 Standard Version of Fill Row. More...
 
 getValueOrEmptyString (string $condition, string $value)
 
 buildActionDropDown (array $actions, int $prgrs_id, int $ass_id, int $usr_id)
 Builds the action menu for each row of the table. More...
 
 getLinkTargetForAction (string $action, int $prgrs_id, int $ass_id)
 Get ilias link for action. More...
 
 getCompletionLink (int $target_obj_id, int $target_ref_id)
 
 fetchData (int $prg_id, int $limit=null, int $offset=null, array $filter=[])
 Get data for table. More...
 
 countFetchData (int $prg_id, array $filter=[])
 Get maximum number of rows the table could have. More...
 
 getFrom ()
 
 getWhere (int $prg_id)
 Get the sql part WHERE. More...
 
 addMultiCommands ()
 Add multicommands to table. More...
 
 getMultiCommands ()
 Get possible multicommnds. More...
 
 getPossibleActions (int $node_id, int $root_prg_id, int $status)
 Get a list with possible actions on a progress record. More...
 
 getValidityOptions ()
 Get options of filter "validity". More...
 
 getStatusOptions ()
 Get options of filter "status". More...
 
 getFilterValues ()
 Get filter-values by field id. More...
 
 getFilterWhere (array $filter)
 Get the additional sql WHERE-part for filters. More...
 
 isPermissionControlledByOrguPosition ()
 
 getOrguValidUsersFilter ()
 
- Protected Member Functions inherited from ilTable2GUI
 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, $a_element)
 Check if filter element is based on adv md. More...
 
 fillRow ($a_set)
 Standard Version of Fill Row. More...
 
 getFilterValue (ilFormPropertyGUI $a_item)
 Get current filter value. More...
 
 SetFilterValue (ilFormPropertyGUI $a_item, $a_value)
 Set current filter value. More...
 
 fillMetaExcel (ilExcel $a_excel, &$a_row)
 Add meta information to excel export. More...
 
 fillHeaderExcel (ilExcel $a_excel, &$a_row)
 Excel Version of Fill Header. More...
 
 fillRowExcel (ilExcel $a_excel, &$a_row, $a_set)
 Excel Version of Fill Row. More...
 
 fillMetaCSV ($a_csv)
 Add meta information to csv export. More...
 
 fillHeaderCSV ($a_csv)
 CSV Version of Fill Header. More...
 
 fillRowCSV ($a_csv, $a_set)
 CSV Version of Fill Row. More...
 

Protected Attributes

 $prg_obj_id
 
 $prg_ref_id
 
 $prg_has_lp_children
 
 $db
 
 $ui_factory
 
 $ui_renderer
 
 $sp_user_progress_db
 
 $prg
 
 $permissions
 
 $may_edit_anything
 
 $user_ids_viewer_may_read_learning_progress_of
 
- Protected Attributes inherited from ilTable2GUI
 $ctrl
 
 $tpl
 
 $parent_obj
 
 $parent_cmd
 
 $close_command = ""
 
 $top_anchor = "il_table_top"
 
 $filters = array()
 
 $optional_filters = array()
 
 $filter_cmd = 'applyFilter'
 
 $reset_cmd = 'resetFilter'
 
 $filter_cols = 5
 
 $ext_sort = false
 
 $ext_seg = false
 
 $context = ""
 
 $mi_sel_buttons = []
 
 $disable_filter_hiding = false
 
 $selected_filter = false
 
 $top_commands = true
 
 $selectable_columns = array()
 
 $selected_column = array()
 
 $show_templates = false
 
 $show_rows_selector = true
 
 $rows_selector_off = false
 
 $nav_determined = false
 
 $limit_determined = false
 
 $filters_determined = false
 
 $columns_determined = false
 
 $open_form_tag = true
 
 $close_form_tag = true
 
 $export_formats = []
 
 $export_mode
 
 $print_mode
 
 $enable_command_for_all
 
 $restore_filter
 
 $restore_filter_values
 
 $default_filter_visibility = false
 
 $sortable_fields = array()
 
 $prevent_double_submission = true
 
 $row_selector_label
 
 $select_all_on_top = false
 
 $sel_buttons = []
 
- Protected Attributes inherited from ilTableGUI
 $tpl
 
 $lng
 

Additional Inherited Members

- Static Public Member Functions inherited from ilTable2GUI
static getAllCommandLimit ()
 Get maximum number of entries to enable actions for all. More...
 

Detailed Description

Class ilObjStudyProgrammeMembersTableGUI.

Definition at line 8 of file class.ilStudyProgrammeMembersTableGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilStudyProgrammeMembersTableGUI::__construct ( int  $prg_obj_id,
int  $prg_ref_id,
ilObjStudyProgrammeMembersGUI  $parent_obj,
string  $parent_cmd = '',
string  $template_context = '',
ilStudyProgrammeProgressRepository  $sp_user_progress_db,
ilPRGPermissionsHelper  $permissions,
\ILIAS\Data\Factory  $data_factory 
)

Definition at line 90 of file class.ilStudyProgrammeMembersTableGUI.php.

99 {
100 $this->setId("sp_member_list");
101 parent::__construct($parent_obj, $parent_cmd, $template_context);
102
103 $this->prg_obj_id = $prg_obj_id;
104 $this->prg_ref_id = $prg_ref_id;
105 $this->data_factory = $data_factory;
106 $this->permissions = $permissions;
107 $this->may_edit_anything = $this->permissions->mayAnyOf([ilOrgUnitOperation::OP_EDIT_INDIVIDUAL_PLAN, ilOrgUnitOperation::OP_MANAGE_MEMBERS]);
108 $this->user_ids_viewer_may_read_learning_progress_of = $this->permissions->getUserIdsSusceptibleTo(ilOrgUnitOperation::OP_READ_LEARNING_PROGRESS);
109
111 $this->prg_has_lp_children = $parent_obj->getStudyProgramme()->hasLPChildren();
112
113 global $DIC;
114 $this->db = $DIC['ilDB'];
115 $this->ui_factory = $DIC['ui.factory'];
116 $this->ui_renderer = $DIC['ui.renderer'];
117
118 $this->setEnableTitle(true);
119 $this->setTopCommands(false);
120 $this->setEnableHeader(true);
121 $this->setExternalSorting(true);
122 $this->setExternalSegmentation(true);
123 $this->setRowTemplate("tpl.members_table_row.html", "Modules/StudyProgramme");
124 $this->setShowRowsSelector(false);
125 $this->setFormAction($this->ctrl->getFormAction($parent_obj, "view"));
126 $this->addColumn("", "", "1", true);
127 $this->setEnableAllCommand(true);
128 $this->addMultiCommands();
129 $this->setDefaultOrderField('prgrs_id');
130 $this->setDefaultOrderDirection('ASC');
131
132 if ($this->may_edit_anything) {
133 $this->setSelectAllCheckbox($parent_obj::F_SELECTED_PROGRESS_IDS . '[]');
134 }
135
136 $selected = $this->getSelectedColumns();
137 foreach (self::COLUMNS as $column) {
138 list($col, $lng_var, $optional, $lp, $no_lp) = $column;
139
140 $show_by_lp = ($this->prg_has_lp_children && $lp) || (!$this->prg_has_lp_children && $no_lp);
141 $show_optional = !$optional || ($optional && array_key_exists($col, $selected));
142
143 if ($show_by_lp && $show_optional) {
144 $this->addColumn($this->lng->txt($lng_var), $col);
145 }
146 }
147
148 $this->sp_user_progress_db = $sp_user_progress_db;
149
150 $this->initFilter();
151 $filter_values = $this->getFilterValues();
152
154 $this->determineLimit();
155
156
157 $members_list = $this->fetchData(
159 $this->getLimit(),
160 $this->getOffset(),
161 $filter_values
162 );
163
164 $progress_ids = array_map(
165 function ($row) {
166 return (int) $row['prgrs_id'];
167 },
168 $members_list
169 );
170 $this->addHiddenInput(
171 $parent_obj::F_ALL_PROGRESS_IDS,
172 implode(',', $progress_ids)
173 );
174
175 $this->setMaxCount($this->countFetchData($prg_obj_id, $filter_values));
176 $this->setData(
177 $this->postOrder(
178 $members_list,
179 $this->getOrdering()
180 )
181 );
182 }
static getInstanceByRefId($a_ref_id)
fetchData(int $prg_id, int $limit=null, int $offset=null, array $filter=[])
Get data for table.
initFilter()
Init filter.Overwrite this to initialize all filter input property objects.
postOrder(array $list, \ILIAS\Data\Order $order)
countFetchData(int $prg_id, array $filter=[])
Get maximum number of rows the table could have.
addHiddenInput($a_name, $a_value)
Add Hidden Input field.
getSelectedColumns()
Get selected columns.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
setEnableHeader($a_enableheader)
Set Enable Header.
setExternalSorting($a_val)
Set external sorting.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
setEnableAllCommand($a_value)
Enable actions for all entries in current result.
setData($a_data)
set table data @access public
setEnableTitle($a_enabletitle)
Set Enable Title.
getLimit()
Get limit.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
getOffset()
Get offset.
setExternalSegmentation($a_val)
Set external segmentation.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
determineLimit()
Determine the limit.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
setMaxCount($a_max_count)
set max.
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ilTable2GUI\$parent_cmd, ilTable2GUI\$parent_obj, $permissions, $prg_obj_id, $prg_ref_id, $sp_user_progress_db, ILIAS\GlobalScreen\Provider\__construct(), ilTable2GUI\addColumn(), ilTable2GUI\addHiddenInput(), addMultiCommands(), countFetchData(), ilTable2GUI\determineLimit(), ilTable2GUI\determineOffsetAndOrder(), fetchData(), getFilterValues(), ilObjStudyProgramme\getInstanceByRefId(), ilTable2GUI\getLimit(), ilTable2GUI\getOffset(), getOrdering(), ilTable2GUI\getSelectedColumns(), initFilter(), ilOrgUnitOperation\OP_EDIT_INDIVIDUAL_PLAN, ilOrgUnitOperation\OP_MANAGE_MEMBERS, ilOrgUnitOperation\OP_READ_LEARNING_PROGRESS, postOrder(), ilTable2GUI\setData(), ilTable2GUI\setDefaultOrderDirection(), ilTable2GUI\setDefaultOrderField(), ilTable2GUI\setEnableAllCommand(), ilTable2GUI\setEnableHeader(), ilTable2GUI\setEnableTitle(), ilTable2GUI\setExternalSegmentation(), ilTable2GUI\setExternalSorting(), ilTable2GUI\setFormAction(), ilTable2GUI\setId(), ilTableGUI\setMaxCount(), ilTable2GUI\setRowTemplate(), ilTable2GUI\setSelectAllCheckbox(), ilTable2GUI\setShowRowsSelector(), and ilTable2GUI\setTopCommands().

+ Here is the call graph for this function:

Member Function Documentation

◆ addMultiCommands()

ilStudyProgrammeMembersTableGUI::addMultiCommands ( )
protected

Add multicommands to table.

Definition at line 673 of file class.ilStudyProgrammeMembersTableGUI.php.

673 : void
674 {
675 foreach ($this->getMultiCommands() as $cmd => $caption) {
676 $this->addMultiCommand($cmd, $caption);
677 }
678 }
addMultiCommand($a_cmd, $a_text)
Add Command button.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ buildActionDropDown()

ilStudyProgrammeMembersTableGUI::buildActionDropDown ( array  $actions,
int  $prgrs_id,
int  $ass_id,
int  $usr_id 
)
protected

Builds the action menu for each row of the table.

Definition at line 383 of file class.ilStudyProgrammeMembersTableGUI.php.

388 : string {
389 $parent = $this->getParentObject();
391
392 $view_individual_plan = $this->permissions->may(ilOrgUnitOperation::OP_VIEW_INDIVIDUAL_PLAN);
393 $edit_individual_plan = $this->permissions->may(ilOrgUnitOperation::OP_EDIT_INDIVIDUAL_PLAN);
394 $addremove_users = $this->permissions->may(ilOrgUnitOperation::OP_MANAGE_MEMBERS);
395
396 foreach ($actions as $action) {
397 switch ($action) {
400 if (!$edit_individual_plan) {
401 continue 2;
402 }
403 break;
405 if (!$view_individual_plan) {
406 continue 2;
407 }
408 break;
409
411 if (!$addremove_users) {
412 continue 2;
413 }
414 break;
415 }
416
417 $target = $this->getLinkTargetForAction($action, $prgrs_id, $ass_id);
418 $l->addItem($this->lng->txt("prg_$action"), $action, $target);
419 }
420
421 return $l->getHTML();
422 }
User interface class for advanced drop-down selection lists.
getLinkTargetForAction(string $action, int $prgrs_id, int $ass_id)
Get ilias link for action.
getParentObject()
Get parent object.

Referenced by fillRow().

+ Here is the caller graph for this function:

◆ countFetchData()

ilStudyProgrammeMembersTableGUI::countFetchData ( int  $prg_id,
array  $filter = [] 
)
protected

Get maximum number of rows the table could have.

Definition at line 601 of file class.ilStudyProgrammeMembersTableGUI.php.

601 : int
602 {
603 // TODO: Reimplement this in terms of ActiveRecord when innerjoin
604 // supports the required rename functionality
605 $query = "SELECT count(prgrs.id) as cnt" . PHP_EOL;
606 $query .= $this->getFrom();
607 $query .= $this->getWhere($prg_id);
608 $query .= $this->getFilterWhere($filter);
609
610 $res = $this->db->query($query);
611 $rec = $this->db->fetchAssoc($res);
612
613 return $rec["cnt"];
614 }
getFilterWhere(array $filter)
Get the additional sql WHERE-part for filters.
$query
foreach($_POST as $key=> $value) $res

References $query, and $res.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ fetchData()

ilStudyProgrammeMembersTableGUI::fetchData ( int  $prg_id,
int  $limit = null,
int  $offset = null,
array  $filter = [] 
)
protected

Get data for table.

Definition at line 453 of file class.ilStudyProgrammeMembersTableGUI.php.

458 : array {
459 // TODO: Reimplement this in terms of ActiveRecord when innerjoin
460 // supports the required rename functionality
461
462 $accredited = $this->db->quote(ilStudyProgrammeProgress::STATUS_ACCREDITED, 'integer');
463
464 $sql =
465 "SELECT" . PHP_EOL
466 . "prgrs.id AS prgrs_id," . PHP_EOL
467 . "pcp.firstname," . PHP_EOL
468 . "pcp.lastname," . PHP_EOL
469 . "pcp.login," . PHP_EOL
470 . "pcp.usr_id," . PHP_EOL
471 . "prgrs.usr_id," . PHP_EOL
472 . "prgrs.points," . PHP_EOL
473 . "prgrs.points_cur * ABS(prgrs.status - $accredited) /" . PHP_EOL
474 . " (GREATEST(ABS(prgrs.status - $accredited),1))" . PHP_EOL
475 . "+ prgrs.points * (1 - ABS(prgrs.status - $accredited) /" . PHP_EOL
476 . " (GREATEST(ABS(prgrs.status - $accredited),1))) AS points_current," . PHP_EOL
477 . "prgrs.last_change_by," . PHP_EOL
478 . "prgrs.status," . PHP_EOL
479 . "prgrs.individual," . PHP_EOL
480 . "blngs.title AS belongs_to," . PHP_EOL
481 . "cmpl_usr.login AS accredited_by," . PHP_EOL
482 . "cmpl_obj.title AS completion_by," . PHP_EOL
483 . "cmpl_obj.type AS completion_by_type," . PHP_EOL
484 . "prgrs.completion_by AS completion_by_id," . PHP_EOL
485 . "prgrs.assignment_id AS assignment_id," . PHP_EOL
486 . "prgrs.completion_date," . PHP_EOL
487 . "prgrs.vq_date," . PHP_EOL
488 . "prgrs.deadline AS prg_deadline," . PHP_EOL
489 . "ass.root_prg_id AS root_prg_id," . PHP_EOL
490 . "ass.last_change AS prg_assign_date," . PHP_EOL
491 . "ass.last_change_by AS prg_assingment_origin," . PHP_EOL
492 . "ass_usr.login AS prg_assigned_by," . PHP_EOL
493 . "CONCAT(pcp.firstname, pcp.lastname) AS name," . PHP_EOL
494 . "prgrs.individual AS custom_plan" . PHP_EOL
495 ;
496
497 $sql .= $this->getFrom();
498 $sql .= $this->getWhere($prg_id);
499 $sql .= $this->getFilterWhere($filter);
500 $sql .= $this->getOrguValidUsersFilter();
501
502 if ($limit !== null) {
503 $this->db->setLimit($limit, $offset !== null ? $offset : 0);
504 }
505
506 $res = $this->db->query($sql);
507 $now = new DateTimeImmutable();
508 $members_list = array();
509
510 while ($rec = $this->db->fetchAssoc($res)) {
511 $progress_id = (int) $rec['prgrs_id'];
512 $progress = $this->sp_user_progress_db->get($progress_id);
513
514 $rec["actions"] = $this->getPossibleActions(
515 $prg_id,
516 $rec["root_prg_id"],
517 $rec["status"]
518 );
519
520 $prg = ilObjStudyProgramme::getInstanceByObjId($progress->getNodeId());
521
522 $rec['points_required'] = number_format($progress->getAmountOfPoints());
523 $rec['points_current'] = number_format($progress->getCurrentAmountOfPoints());
524
525 if ($rec["status"] == ilStudyProgrammeProgress::STATUS_COMPLETED) {
526 //If the status completed is set by crs reference
527 //use crs title
528 if ($rec["completion_by_type"] == "crsr") {
529 $completion_id = $rec["completion_by_id"];
530 $obj_id = ilContainerReference::_lookupTargetId($completion_id);
531 $ref_id = ilContainerReference::_lookupTargetRefId($completion_id);
532 $rec["completion_by"] = $this->getCompletionLink($obj_id, $ref_id);
533 }
534
535 // If the status completed and there is a non-null completion_by field
536 // in the set, this means the completion was achieved by some leaf in
537 // the program tree.
538 if (!$rec["completion_by"]) {
539 $prgrs = $this->sp_user_progress_db->getByPrgIdAndAssignmentId(
540 $this->prg_obj_id,
541 $rec["assignment_id"]
542 );
544
545 $links = [];
546 $successful_children = $prg->getIdsOfSuccessfulChildren((int) $rec["assignment_id"]);
547 foreach ($successful_children as $entry) {
548 list($obj_id, $ref_id) = $entry;
549 $links[] = $this->getCompletionLink($obj_id, $ref_id);
550 }
551 $rec["completion_by"] = implode(", ", $links);
552 }
553 // This case should only occur if the status completed is set
554 // by an already deleted crs.
555 if (!$rec["completion_by"]) {
556 $title = ilObjectDataDeletionLog::get($rec["completion_by_id"]);
557 if (!is_null($title["title"])) {
558 $rec["completion_by"] = $title["title"];
559 }
560 }
561 } elseif ($rec["status"] == ilStudyProgrammeProgress::STATUS_ACCREDITED) {
562 $rec["completion_by"] = $rec["accredited_by"];
563 }
564
565 if (!$rec['completion_date']) {
566 $rec['completion_date'] = '';
567 }
568
569 $rec['vq_date'] = '';
570 if (!is_null($progress->getValidityOfQualification())
571 ) {
572 $rec['vq_date'] = $progress->getValidityOfQualification()->format($this->getUserDateFormat());
573 }
574
575 $rec['prg_validity'] = '-';
576 if (!is_null($progress->hasValidQualification($now))) {
577 $rec['prg_validity'] = $this->lng->txt('prg_not_valid');
578 if ($progress->hasValidQualification($now)) {
579 $rec['prg_validity'] = $this->lng->txt('prg_still_valid');
580 }
581 }
582
583 $rec['prg_deadline'] = null;
584 if ($progress->isSuccessful() === false
585 && !is_null($progress->getDeadline())
586 ) {
587 $rec['prg_deadline'] = $progress->getDeadline()->format($this->getUserDateFormat());
588 }
589
590 $usr_id = (int) $rec['usr_id'];
591 $rec["orgus"] = ilObjUser::lookupOrgUnitsRepresentation($usr_id);
592 $members_list[] = $rec;
593 }
594
595 return $members_list;
596 }
static _lookupTargetId($a_obj_id)
lookup target id
static _lookupTargetRefId($a_obj_id)
Lookup target ref_id.
static lookupOrgUnitsRepresentation($a_usr_id)
lokup org unit representation
getCompletionLink(int $target_obj_id, int $target_ref_id)
getPossibleActions(int $node_id, int $root_prg_id, int $status)
Get a list with possible actions on a progress record.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ fillRow()

ilStudyProgrammeMembersTableGUI::fillRow (   $a_set)
protected

Standard Version of Fill Row.

Most likely to be overwritten by derived class.

Parameters
array$a_setdata array

Reimplemented from ilTable2GUI.

Definition at line 237 of file class.ilStudyProgrammeMembersTableGUI.php.

237 : void
238 {
239 $usr_id = (int) $a_set['usr_id'];
240 if ($this->may_edit_anything) {
241 $this->tpl->setCurrentBlock("checkb");
242 $this->tpl->setVariable("ID", $a_set["prgrs_id"]);
243 $this->tpl->parseCurrentBlock();
244 }
245
246 $this->tpl->setVariable("FIRSTNAME", $a_set["firstname"]);
247 $this->tpl->setVariable("LASTNAME", $a_set["lastname"]);
248 $this->tpl->setVariable("LOGIN", $a_set["login"]);
249 $this->tpl->setVariable(
250 "STATUS",
252 in_array($usr_id, $this->user_ids_viewer_may_read_learning_progress_of),
253 $this->prg->statusToRepr($a_set["status"])
254 )
255 );
256 $this->tpl->setVariable("ASSIGN_DATE", $a_set["prg_assign_date"]);
257
258
259 $this->tpl->setVariable("POINTS_REQUIRED", $a_set["points_required"]);
260
261 if (!$this->prg_has_lp_children) {
262 $this->tpl->setCurrentBlock("points_current");
263 $this->tpl->setVariable(
264 "POINTS_CURRENT",
266 in_array($usr_id, $this->user_ids_viewer_may_read_learning_progress_of),
267 $a_set['points_current']
268 )
269 );
270 $this->tpl->parseCurrentBlock();
271 }
272
273
274 foreach ($this->getSelectedColumns() as $column) {
275 switch ($column) {
276 case "prg_orgus":
277 $this->tpl->setVariable("ORGUS", $a_set["orgus"]);
278 break;
279 case "prg_completion_date":
280 $completion_date = '';
281 if (in_array($usr_id, $this->user_ids_viewer_may_read_learning_progress_of)) {
282 $completion_date = $a_set["completion_date"];
283 }
284 $this->tpl->setVariable("COMPLETION_DATE", $completion_date);
285 break;
286
287 case "prg_completion_by":
288 if (is_null($a_set["completion_by"])) {
289 $this->tpl->touchBlock("comp_by");
290 } else {
291 $this->tpl->setVariable(
292 "COMPLETION_BY",
294 in_array($usr_id, $this->user_ids_viewer_may_read_learning_progress_of),
295 $a_set["completion_by"]
296 )
297 );
298 }
299
300 break;
301 case "prg_custom_plan":
302 $individual = $this->lng->txt("no");
303 if ($a_set["individual"]) {
304 $individual = $this->lng->txt("yes");
305 }
306
307 $this->tpl->setVariable(
308 "CUSTOM_PLAN",
309 $individual
310 );
311 break;
312
313 case "prg_belongs_to":
314 $this->tpl->setVariable("BELONGS_TO", $a_set["belongs_to"]);
315 break;
316 case "prg_expiry_date":
317 $this->tpl->setVariable(
318 "EXPIRY_DATE",
320 in_array($usr_id, $this->user_ids_viewer_may_read_learning_progress_of),
321 $a_set["vq_date"]
322 )
323 );
324 break;
325 case "prg_assigned_by":
326 $assigned_by = $a_set["prg_assigned_by"];
327 if (is_null($assigned_by)) {
329 $assignment_src = (int) $a_set['prg_assignment_origin'];
330 $assigned_by = $this->lng->txt('prg_autoassignment')
331 . ' ' . $this->lng->txt($srcs[$assignment_src]);
332 }
333 $this->tpl->setVariable("ASSIGNED_BY", $assigned_by);
334 break;
335 case "prg_deadline":
336 if (is_null($a_set["prg_deadline"])) {
337 $this->tpl->touchBlock("deadline");
338 } else {
339 $this->tpl->setVariable(
340 "DEADLINE",
342 in_array($usr_id, $this->user_ids_viewer_may_read_learning_progress_of),
343 $a_set["prg_deadline"]
344 )
345 );
346 }
347 break;
348 case "prg_validity":
349 $this->tpl->setVariable(
350 "VALIDITY",
352 in_array($usr_id, $this->user_ids_viewer_may_read_learning_progress_of),
353 $a_set['prg_validity']
354 )
355 );
356 break;
357
358 }
359 }
360 $this->tpl->setVariable(
361 "ACTIONS",
362 $this->buildActionDropDown(
363 $a_set["actions"],
364 $a_set["prgrs_id"],
365 $a_set["assignment_id"],
366 $usr_id
367 )
368 );
369 }
buildActionDropDown(array $actions, int $prgrs_id, int $ass_id, int $usr_id)
Builds the action menu for each row of the table.
getValueOrEmptyString(string $condition, string $value)

References buildActionDropDown(), ilTable2GUI\getSelectedColumns(), getValueOrEmptyString(), and ilStudyProgrammeAutoMembershipSource\SOURCE_MAPPING.

+ Here is the call graph for this function:

◆ getCompletionLink()

ilStudyProgrammeMembersTableGUI::getCompletionLink ( int  $target_obj_id,
int  $target_ref_id 
)
protected

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

432 : string
433 {
434 $link = '?';
435 if (ilObject::_exists($target_ref_id, true) &&
436 is_null(ilObject::_lookupDeletedDate($target_ref_id))
437 ) {
438 $title = ilObject::_lookupTitle($target_obj_id);
439 $url = ilLink::_getStaticLink($target_ref_id, "crs");
440 $link = $this->ui_renderer->render($this->ui_factory->link()->standard($title, $url));
441 } else {
442 $del_data = \ilObjectDataDeletionLog::get($target_obj_id);
443 if ($del_data) {
444 $link = $del_data['title'];
445 }
446 }
447 return $link;
448 }
static _lookupTitle($a_id)
lookup object title
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data@access public
static _lookupDeletedDate($a_ref_id)
only called in ilObjectGUI::insertSavedNodes
$url

References $url, ilObject\_exists(), ilLink\_getStaticLink(), ilObject\_lookupDeletedDate(), ilObject\_lookupTitle(), and ilObjectDataDeletionLog\get().

+ Here is the call graph for this function:

◆ getFilterValues()

ilStudyProgrammeMembersTableGUI::getFilterValues ( )
protected

Get filter-values by field id.

Definition at line 788 of file class.ilStudyProgrammeMembersTableGUI.php.

788 : array
789 {
790 $f = [];
791 foreach ($this->filters as $item) {
792 $f[$item->getFieldId()] = $this->getFilterValue($item);
793 }
794 return $f;
795 }
getFilterValue(ilFormPropertyGUI $a_item)
Get current filter value.

References Vendor\Package\$f.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ getFilterWhere()

ilStudyProgrammeMembersTableGUI::getFilterWhere ( array  $filter)
protected

Get the additional sql WHERE-part for filters.

Definition at line 800 of file class.ilStudyProgrammeMembersTableGUI.php.

800 : string
801 {
802 $buf = [''];
803
804 if (strlen($filter['name']) > 0) {
805 $name = substr($this->db->quote($filter['name'], "text"), 1, -1);
806 $name_filter =
807 'AND (' . PHP_EOL
808 . 'pcp.firstname LIKE \'%' . $name . '%\' OR' . PHP_EOL
809 . 'pcp.lastname LIKE \'%' . $name . '%\' OR' . PHP_EOL
810 . 'pcp.login LIKE \'%' . $name . '%\'' . PHP_EOL
811 . ')' . PHP_EOL
812 ;
813
814 $buf[] = $name_filter;
815 }
816
817 if ($filter['prg_status'] && (int) $filter['prg_status'] !== self::OPTION_ALL) {
818 $buf[] = 'AND prgrs.status = ' . $this->db->quote($filter['prg_status'], "integer");
819 }
820
821 $filter_success = 'prgrs.status IN ('
823 . ','
825 . ') ';
826
827 if ($filter['prg_validity'] && (int) $filter['prg_validity'] !== self::OPTION_ALL) {
828 if ((int) $filter['prg_validity'] === self::VALIDITY_OPTION_VALID) {
829 $filter_validity = 'AND (prgrs.vq_date >= NOW() OR prgrs.vq_date IS NULL)';
830 }
831 if ((int) $filter['prg_validity'] === self::VALIDITY_OPTION_INVALID) {
832 $filter_validity = 'AND prgrs.vq_date < NOW()';
833 }
834
835 $buf[] = 'AND ('
836 . $filter_success
837 . $filter_validity
838 . ')';
839 }
840
841 $exp_from = $filter['prg_expiry_date']['from'];
842 if (!is_null($exp_from)) {
843 $dat = $exp_from->get(IL_CAL_DATE);
844 $buf[] = 'AND ('
845 . $filter_success
846 . 'AND prgrs.vq_date >= \'' . $dat . ' 00:00:00\''
847 . ')';
848 }
849
850 $exp_to = $filter['prg_expiry_date']['to'];
851 if (!is_null($exp_to)) {
852 $dat = $exp_to->get(IL_CAL_DATE);
853 $buf[] = 'AND ('
854 . $filter_success
855 . 'AND prgrs.vq_date <= \'' . $dat . ' 23:59:59\''
856 . ')';
857 }
858
859 $conditions = implode(PHP_EOL, $buf);
860
861 return $conditions;
862 }
const IL_CAL_DATE
if($format !==null) $name
Definition: metadata.php:230

References $name, IL_CAL_DATE, ilStudyProgrammeProgress\STATUS_ACCREDITED, and ilStudyProgrammeProgress\STATUS_COMPLETED.

◆ getFrom()

ilStudyProgrammeMembersTableGUI::getFrom ( )
protected

Definition at line 616 of file class.ilStudyProgrammeMembersTableGUI.php.

616 : string
617 {
618 return
619 "FROM " . ilStudyProgrammeProgressDBRepository::TABLE . " prgrs" . PHP_EOL
620 . "JOIN usr_data pcp ON pcp.usr_id = prgrs.usr_id" . PHP_EOL
621 . "JOIN " . ilStudyProgrammeAssignmentDBRepository::TABLE . " ass" . PHP_EOL
622 . " ON ass.id = prgrs.assignment_id" . PHP_EOL
623 . "JOIN object_data blngs ON blngs.obj_id = ass.root_prg_id" . PHP_EOL
624 . "LEFT JOIN usr_data ass_usr ON ass_usr.usr_id = ass.last_change_by" . PHP_EOL
625 . "LEFT JOIN usr_data cmpl_usr ON cmpl_usr.usr_id = prgrs.completion_by" . PHP_EOL
626 . "LEFT JOIN object_data cmpl_obj ON cmpl_obj.obj_id = prgrs.completion_by" . PHP_EOL
627 ;
628 }

References ilStudyProgrammeAssignmentDBRepository\TABLE, and ilStudyProgrammeProgressDBRepository\TABLE.

◆ getLinkTargetForAction()

ilStudyProgrammeMembersTableGUI::getLinkTargetForAction ( string  $action,
int  $prgrs_id,
int  $ass_id 
)
protected

Get ilias link for action.

Definition at line 427 of file class.ilStudyProgrammeMembersTableGUI.php.

427 : string
428 {
429 return $this->getParentObject()->getLinkTargetForAction($action, $prgrs_id, $ass_id);
430 }

◆ getMultiCommands()

ilStudyProgrammeMembersTableGUI::getMultiCommands ( )
protected

Get possible multicommnds.

Returns
string[]

Definition at line 685 of file class.ilStudyProgrammeMembersTableGUI.php.

685 : array
686 {
687 $permissions_for_edit_individual_plan = [
688 'updateFromCurrentPlanMulti' => $this->lng->txt('prg_multi_update_from_current_plan'),
689 'markRelevantMulti' => $this->lng->txt('prg_multi_mark_relevant'),
690 'markNotRelevantMulti' => $this->lng->txt('prg_multi_unmark_relevant'),
691 'changeDeadlineMulti' => $this->lng->txt('prg_multi_change_deadline'),
692 'changeExpireDateMulti' => $this->lng->txt('prg_multi_change_expire_date'),
693 'markAccreditedMulti' => $this->lng->txt('prg_multi_mark_accredited'),
694 'unmarkAccreditedMulti' => $this->lng->txt('prg_multi_unmark_accredited')
695 ];
696
697 $permissions_for_manage = [
698 'removeUserMulti' => $this->lng->txt('prg_multi_remove_user')
699 ];
700
701 $perms = [];
702
703 if ($this->permissions->may(ilOrgUnitOperation::OP_EDIT_INDIVIDUAL_PLAN)) {
704 $perms = array_merge($perms, $permissions_for_edit_individual_plan);
705 }
706
707 if ($this->permissions->may(ilOrgUnitOperation::OP_MANAGE_MEMBERS)) {
708 $perms = array_merge($perms, $permissions_for_manage);
709 }
710
711 return $perms;
712 }

References ilOrgUnitOperation\OP_EDIT_INDIVIDUAL_PLAN, and ilOrgUnitOperation\OP_MANAGE_MEMBERS.

◆ getOrdering()

ilStudyProgrammeMembersTableGUI::getOrdering ( )
protected

Definition at line 218 of file class.ilStudyProgrammeMembersTableGUI.php.

219 {
220 $field = $this->getOrderField();
221 if (!$field) {
222 $field = $this->getDefaultOrderField();
223 }
224 $direction = $this->getOrderDirection();
225 if (!$direction) {
226 $direction = $this->getDefaultOrderDirection();
227 }
228
229 return $this->data_factory->order($field, strtoupper($direction));
230 }
Both the subject and the direction need to be specified when expressing an order.
Definition: Order.php:11
getDefaultOrderDirection()
Get Default order direction.
getDefaultOrderField()
Get Default order field.
getOrderDirection()
Get order direction.

References ilTable2GUI\getDefaultOrderDirection(), ilTable2GUI\getDefaultOrderField(), ilTableGUI\getOrderDirection(), and ilTable2GUI\getOrderField().

Referenced by __construct().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOrguValidUsersFilter()

ilStudyProgrammeMembersTableGUI::getOrguValidUsersFilter ( )
protected

Definition at line 870 of file class.ilStudyProgrammeMembersTableGUI.php.

870 : string
871 {
872 if ($this->permissions->may($this->permissions::ROLEPERM_MANAGE_MEMBERS)) {
873 return '';
874 }
875 $valid_user_ids = $this->permissions->getUserIdsSusceptibleTo(ilOrgUnitOperation::OP_VIEW_MEMBERS);
876
877 if (count($valid_user_ids) < 1) {
878 return ' AND false';
879 }
880
881 $valid_user_ids[] = $this->getParentObject()->user->getId();
882 return ' AND pcp.usr_id in ('
883 . implode(',', $valid_user_ids)
884 . ')';
885 }

References ilOrgUnitOperation\OP_VIEW_MEMBERS.

◆ getPossibleActions()

ilStudyProgrammeMembersTableGUI::getPossibleActions ( int  $node_id,
int  $root_prg_id,
int  $status 
)
protected

Get a list with possible actions on a progress record.

Returns
string[]

Definition at line 719 of file class.ilStudyProgrammeMembersTableGUI.php.

723 : array {
724 $actions = array();
725
726 if ($node_id == $root_prg_id) {
729 }
730
733 }
736 }
737
738 return $actions;
739 }

References ilObjStudyProgrammeMembersGUI\ACTION_REMOVE_USER, and ilObjStudyProgrammeMembersGUI\ACTION_SHOW_INDIVIDUAL_PLAN.

◆ getSelectableColumns()

ilStudyProgrammeMembersTableGUI::getSelectableColumns ( )

Get selectable columns.

Reimplemented from ilTable2GUI.

Definition at line 657 of file class.ilStudyProgrammeMembersTableGUI.php.

657 : array
658 {
659 $cols = [];
660 foreach (self::COLUMNS as $column) {
661 list($col, $lng_var, $optional, $lp, $no_lp) = $column;
662 if ($optional) {
663 $cols[$col] = ["txt" => $this->lng->txt($lng_var)];
664 }
665 }
666
667 return $cols;
668 }
$cols
Definition: xhr_table.php:11

References $cols.

◆ getStatusOptions()

ilStudyProgrammeMembersTableGUI::getStatusOptions ( )
protected

Get options of filter "status".

Definition at line 755 of file class.ilStudyProgrammeMembersTableGUI.php.

755 : array
756 {
757 return [
758 ilStudyProgrammeProgress::STATUS_IN_PROGRESS => $this->lng->txt("prg_status_in_progress"),
759 ilStudyProgrammeProgress::STATUS_COMPLETED => $this->lng->txt("prg_status_completed"),
760 ilStudyProgrammeProgress::STATUS_ACCREDITED => $this->lng->txt("prg_status_accredited"),
761 ilStudyProgrammeProgress::STATUS_NOT_RELEVANT => $this->lng->txt("prg_status_not_relevant"),
762 ilStudyProgrammeProgress::STATUS_FAILED => $this->lng->txt("prg_status_failed")
763 ];
764 }

References ilStudyProgrammeProgress\STATUS_ACCREDITED, ilStudyProgrammeProgress\STATUS_COMPLETED, ilStudyProgrammeProgress\STATUS_FAILED, ilStudyProgrammeProgress\STATUS_IN_PROGRESS, and ilStudyProgrammeProgress\STATUS_NOT_RELEVANT.

◆ getUserDateFormat()

ilStudyProgrammeMembersTableGUI::getUserDateFormat ( )
protected

Definition at line 232 of file class.ilStudyProgrammeMembersTableGUI.php.

232 : string
233 {
234 return ilCalendarUtil::getUserDateFormat(false, true);
235 }
static getUserDateFormat($a_add_time=false, $a_for_parsing=false)
Parse current user setting into date/time format.

References ilCalendarUtil\getUserDateFormat().

+ Here is the call graph for this function:

◆ getValidityOptions()

ilStudyProgrammeMembersTableGUI::getValidityOptions ( )
protected

Get options of filter "validity".

Definition at line 744 of file class.ilStudyProgrammeMembersTableGUI.php.

744 : array
745 {
746 return [
747 self::VALIDITY_OPTION_VALID => $this->lng->txt("prg_still_valid"),
748 self::VALIDITY_OPTION_INVALID => $this->lng->txt("prg_not_valid")
749 ];
750 }

◆ getValueOrEmptyString()

ilStudyProgrammeMembersTableGUI::getValueOrEmptyString ( string  $condition,
string  $value 
)
protected

Definition at line 371 of file class.ilStudyProgrammeMembersTableGUI.php.

371 : string
372 {
373 if ($condition) {
374 return $value;
375 }
376
377 return '';
378 }

Referenced by fillRow().

+ Here is the caller graph for this function:

◆ getWhere()

ilStudyProgrammeMembersTableGUI::getWhere ( int  $prg_id)
protected

Get the sql part WHERE.

Definition at line 633 of file class.ilStudyProgrammeMembersTableGUI.php.

633 : string
634 {
635 $q = "WHERE prgrs.prg_id = " . $this->db->quote($prg_id, "integer") . PHP_EOL;
636
637 //get all potentially visible users:
638 $visible = [];
639 foreach ($this->permissions::ORGU_OPERATIONS as $op) {
640 $visible = array_merge(
641 $visible,
642 $this->permissions->getUserIdsSusceptibleTo($op)
643 );
644 }
645
646 if (count($visible) > 0) {
647 $q .= " AND " . $this->db->in("prgrs.usr_id", $visible, false, "integer") . PHP_EOL;
648 } else {
649 $q .= " AND FALSE" . PHP_EOL;
650 }
651 return $q;
652 }

◆ initFilter()

ilStudyProgrammeMembersTableGUI::initFilter ( )

Init filter.Overwrite this to initialize all filter input property objects.

Reimplemented from ilTable2GUI.

Definition at line 769 of file class.ilStudyProgrammeMembersTableGUI.php.

769 : void
770 {
771 $item = $this->addFilterItemByMetaType('prg_validity', self::FILTER_SELECT);
772 $item->setOptions(
773 [self::OPTION_ALL => $this->lng->txt("all")] + $this->getValidityOptions()
774 );
775
776 $item = $this->addFilterItemByMetaType('prg_status', self::FILTER_SELECT);
777 $item->setOptions(
778 [self::OPTION_ALL => $this->lng->txt("all")] + $this->getStatusOptions()
779 );
780
781 $this->addFilterItemByMetaType('name', self::FILTER_TEXT);
782 $this->addFilterItemByMetaType('prg_expiry_date', self::FILTER_DATE_RANGE);
783 }
addFilterItemByMetaType($id, $type=self::FILTER_TEXT, $a_optional=false, $caption=null)
Add filter by standard type.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ isPermissionControlledByOrguPosition()

ilStudyProgrammeMembersTableGUI::isPermissionControlledByOrguPosition ( )
protected

Definition at line 865 of file class.ilStudyProgrammeMembersTableGUI.php.

866 {
867 return $this->prg->getPositionSettingsIsActiveForPrg();
868 }

◆ postOrder()

ilStudyProgrammeMembersTableGUI::postOrder ( array  $list,
\ILIAS\Data\Order  $order 
)
protected

Definition at line 195 of file class.ilStudyProgrammeMembersTableGUI.php.

195 : array
196 {
197 list($aspect, $direction) = $order->join('', function ($i, $k, $v) {
198 return [$k, $v];
199 });
200
201 if (array_key_exists($aspect, self::ORDER_MAPPING)) {
202 $aspect = self::ORDER_MAPPING[$aspect];
203 }
204
205 usort($list, function ($a, $b) use ($aspect) {
206 if (is_numeric($a[$aspect])) {
207 return $a[$aspect] > $b[$aspect];
208 }
209 return strcmp($a[$aspect], $b[$aspect]);
210 });
211
212 if ($direction === $order::DESC) {
213 $list = array_reverse($list);
214 }
215 return $list;
216 }
$i
Definition: metadata.php:24
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples

References Vendor\Package\$a, Vendor\Package\$b, and $i.

Referenced by __construct().

+ Here is the caller graph for this function:

Field Documentation

◆ $db

ilStudyProgrammeMembersTableGUI::$db
protected

Definition at line 53 of file class.ilStudyProgrammeMembersTableGUI.php.

◆ $may_edit_anything

ilStudyProgrammeMembersTableGUI::$may_edit_anything
protected

Definition at line 83 of file class.ilStudyProgrammeMembersTableGUI.php.

◆ $permissions

ilStudyProgrammeMembersTableGUI::$permissions
protected

Definition at line 78 of file class.ilStudyProgrammeMembersTableGUI.php.

Referenced by __construct().

◆ $prg

ilStudyProgrammeMembersTableGUI::$prg
protected

Definition at line 73 of file class.ilStudyProgrammeMembersTableGUI.php.

◆ $prg_has_lp_children

ilStudyProgrammeMembersTableGUI::$prg_has_lp_children
protected

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

◆ $prg_obj_id

ilStudyProgrammeMembersTableGUI::$prg_obj_id
protected

Definition at line 38 of file class.ilStudyProgrammeMembersTableGUI.php.

Referenced by __construct().

◆ $prg_ref_id

ilStudyProgrammeMembersTableGUI::$prg_ref_id
protected

Definition at line 43 of file class.ilStudyProgrammeMembersTableGUI.php.

Referenced by __construct().

◆ $sp_user_progress_db

ilStudyProgrammeMembersTableGUI::$sp_user_progress_db
protected

Definition at line 68 of file class.ilStudyProgrammeMembersTableGUI.php.

Referenced by __construct().

◆ $ui_factory

ilStudyProgrammeMembersTableGUI::$ui_factory
protected

Definition at line 58 of file class.ilStudyProgrammeMembersTableGUI.php.

◆ $ui_renderer

ilStudyProgrammeMembersTableGUI::$ui_renderer
protected

Definition at line 63 of file class.ilStudyProgrammeMembersTableGUI.php.

◆ $user_ids_viewer_may_read_learning_progress_of

ilStudyProgrammeMembersTableGUI::$user_ids_viewer_may_read_learning_progress_of
protected

Definition at line 88 of file class.ilStudyProgrammeMembersTableGUI.php.

◆ COLUMNS

const ilStudyProgrammeMembersTableGUI::COLUMNS
Initial value:
= [
['name', 'name', false, true, true],
['login', 'login', false, true, true],
['prg_orgus', 'prg_orgus', true, true, true],
['prg_status', 'prg_status', false, true, true],
['prg_completion_date', 'prg_completion_date', true, true, true],
['prg_completion_by', 'prg_completion_by', true, true, true],
['points', 'prg_points_reachable', false, true, false],
['points', 'prg_points_required', false, false, true],
['points_current', 'prg_points_current', false, false, true],
['prg_custom_plan', 'prg_custom_plan', true, true, true],
['prg_belongs_to', 'prg_belongs_to', true, true, true],
['prg_assign_date', 'prg_assign_date', false, true, true],
['prg_assigned_by', 'prg_assigned_by', true, true, true],
['prg_deadline', 'prg_deadline', true, true, true],
['prg_expiry_date', 'prg_expiry_date', true, true, true],
['prg_validity', 'prg_validity', true, true, true],
[null, 'action', false, true, true]
]

Definition at line 10 of file class.ilStudyProgrammeMembersTableGUI.php.

◆ OPTION_ALL

const ilStudyProgrammeMembersTableGUI::OPTION_ALL = -1

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

◆ ORDER_MAPPING

const ilStudyProgrammeMembersTableGUI::ORDER_MAPPING
Initial value:
= [
'prg_status' => 'status',
'prg_custom_plan' => 'custom_plan',
'prg_belongs_to' => 'belongs_to',
'prg_expiry_date' => 'vq_date',
'prg_orgus' => 'orgus',
'prg_completion_by' => 'completion_by',
'prg_completion_date' => 'completion_date',
]

Definition at line 185 of file class.ilStudyProgrammeMembersTableGUI.php.

◆ VALIDITY_OPTION_INVALID

const ilStudyProgrammeMembersTableGUI::VALIDITY_OPTION_INVALID = 3

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

◆ VALIDITY_OPTION_VALID

const ilStudyProgrammeMembersTableGUI::VALIDITY_OPTION_VALID = 1

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


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