5 require_once(
"Services/Table/classes/class.ilTable2GUI.php");
6 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
7 require_once(
"Modules/StudyProgramme/classes/model/class.ilStudyProgrammeProgress.php");
8 require_once(
"Modules/StudyProgramme/classes/model/class.ilStudyProgrammeAssignment.php");
9 require_once(
"Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
10 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
11 require_once(
"Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
32 $this->
setId(
"sp_member_list");
33 parent::__construct($a_parent_obj, $a_parent_cmd, $a_template_context);
35 $this->prg_obj_id = $a_prg_obj_id;
36 $this->prg_ref_id = $a_prg_ref_id;
37 $this->prg_has_lp_children = $a_parent_obj->getStudyProgramme()->hasLPChildren();
53 $this->
setRowTemplate(
"tpl.members_table_row.html",
"Modules/StudyProgramme");
63 if ($this->prg_has_lp_children) {
93 $this->tpl->setCurrentBlock(
"checkb");
94 $this->tpl->setVariable(
"ID", $a_set[
"prgrs_id"]);
95 $this->tpl->parseCurrentBlock();
97 $this->tpl->setVariable(
"FIRSTNAME", $a_set[
"firstname"]);
98 $this->tpl->setVariable(
"LASTNAME", $a_set[
"lastname"]);
99 $this->tpl->setVariable(
"LOGIN", $a_set[
"login"]);
100 $this->tpl->setVariable(
"STATUS", $this->sp_user_progress_db->statusToRepr($a_set[
"status"]));
101 $this->tpl->setVariable(
"COMPLETION_BY", $a_set[
"completion_by"]);
102 $this->tpl->setVariable(
"POINTS_REQUIRED", $a_set[
"points"]);
104 if (!$this->prg_has_lp_children) {
105 $this->tpl->setCurrentBlock(
"points_current");
106 $this->tpl->setVariable(
"POINTS_CURRENT", $a_set[
"points_current"]);
107 $this->tpl->parseCurrentBlock();
110 $this->tpl->setVariable(
"CUSTOM_PLAN", $a_set[
"last_change_by"]
111 ? $this->lng->txt(
"yes")
112 : $this->lng->txt(
"no"));
113 $this->tpl->setVariable(
"BELONGS_TO", $a_set[
"belongs_to"]);
114 $this->tpl->setVariable(
"ACTIONS", $this->
buildActionDropDown($a_set[
"actions"], $a_set[
"prgrs_id"], $a_set[
"assignment_id"]));
118 case "prg_assign_date":
119 $this->tpl->setCurrentBlock(
"assign_date");
120 $this->tpl->setVariable(
"ASSIGN_DATE", $a_set[
"prg_assign_date"]);
121 $this->tpl->parseCurrentBlock(
"assign_date");
123 case "prg_assigned_by":
124 $this->tpl->setCurrentBlock(
"assigned_by");
125 $this->tpl->setVariable(
"ASSIGNED_BY", $a_set[
"prg_assigned_by"]);
126 $this->tpl->parseCurrentBlock(
"assigned_by");
144 foreach ($a_actions as
$action) {
148 return $l->getHTML();
162 return $this->
getParentObject()->getLinkTargetForAction($a_action, $a_prgrs_id, $a_ass_id);
180 $query =
"SELECT prgrs.id prgrs_id" 188 .
" , prgrs.points_cur*" 194 .
" , prgrs.last_change_by" 196 .
" , blngs.title belongs_to" 197 .
" , cmpl_usr.login accredited_by" 198 .
" , cmpl_obj.title completion_by" 199 .
" , cmpl_obj.type completion_by_type" 200 .
" , prgrs.completion_by completion_by_id" 201 .
" , prgrs.assignment_id assignment_id" 202 .
" , ass.root_prg_id root_prg_id" 203 .
" , ass.last_change prg_assign_date" 204 .
" , ass_usr.login prg_assigned_by" 206 .
" , CONCAT(pcp.firstname, pcp.lastname) name" 207 .
" , (prgrs.last_change_by IS NOT NULL) custom_plan" 213 if ($order_coloumn !== null) {
214 $query .=
" ORDER BY $order_coloumn";
217 $query .=
" $order_direction";
227 $members_list = array();
228 while ($rec = $this->db->fetchAssoc(
$res)) {
234 $rec[
'points_current'] = number_format($rec[
'points_current']);
238 if ($rec[
"completion_by_type"] ==
"crsr") {
245 if (!$rec[
"completion_by"]) {
246 $prgrs = $this->sp_user_progress_db->getInstanceForAssignment($this->prg_obj_id, $rec[
"assignment_id"]);
247 $rec[
"completion_by"] = implode(
", ", $prgrs->getNamesOfCompletedOrAccreditedChildren());
250 $rec[
"completion_by"] = $rec[
"accredited_by"];
253 $members_list[] = $rec;
255 return $members_list;
269 $query =
"SELECT count(prgrs.id) as cnt";
274 $rec = $this->db->fetchAssoc(
$res);
287 .
" JOIN usr_data pcp ON pcp.usr_id = prgrs.usr_id" 289 .
" ON ass.id = prgrs.assignment_id" 290 .
" JOIN object_data blngs ON blngs.obj_id = ass.root_prg_id" 291 .
" LEFT JOIN usr_data ass_usr ON ass_usr.usr_id = ass.last_change_by" 292 .
" LEFT JOIN usr_data cmpl_usr ON cmpl_usr.usr_id = prgrs.completion_by" 293 .
" LEFT JOIN object_data cmpl_obj ON cmpl_obj.obj_id = prgrs.completion_by";
305 return " WHERE prgrs.prg_id = " . $this->db->quote($a_prg_id,
"integer");
318 $cols[
"prg_assign_date"] = array(
319 "txt" => $this->lng->txt(
"prg_assign_date"));
321 $cols[
"prg_assigned_by"] = array(
322 "txt" => $this->lng->txt(
"prg_assigned_by"));
334 return array(
"name" => array(
"name")
335 ,
"login" => array(
"login")
336 ,
"prg_status" => array(
"status")
337 ,
"prg_completion_by" => array(null)
338 ,
"prg_points_required" => array(
"points")
339 ,
"prg_points_current" => array(
"points_current")
340 ,
"prg_custom_plan" => array(
"custom_plan")
341 ,
"prg_belongs_to" => array(
"belongs_to")
352 return array(
"name" => array(
"name")
353 ,
"login" => array(
"login")
354 ,
"prg_status" => array(
"status")
355 ,
"prg_completion_by" => array(null)
356 ,
"prg_points_reachable" => array(
"points")
357 ,
"prg_custom_plan" => array(
"custom_plan")
358 ,
"prg_belongs_to" => array(
"belongs_to")
382 'markAccreditedMulti' => $this->lng->txt(
'prg_multi_mark_accredited'),
383 'unmarkAccreditedMulti' => $this->lng->txt(
'prg_multi_unmark_accredited'),
384 'removeUserMulti' => $this->lng->txt(
'prg_multi_remove_user'),
385 'markRelevantMulti' => $this->lng->txt(
'prg_multi_mark_relevant'),
386 'markNotRelevantMulti' => $this->lng->txt(
'prg_multi_unmark_relevant'),
387 'updateFromCurrentPlanMulti' => $this->lng->txt(
'prg_multi_update_from_current_plan')
getLinkTargetForAction($a_action, $a_prgrs_id, $a_ass_id)
Get ilias link for action.
setExternalSorting($a_val)
Set external sorting.
static returnDbTableName()
getSelectableColumns()
Get selectable columns.
setExternalSegmentation($a_val)
Set external segmentation.
Storage implementation for ilStudyProgrammeUserProgress.
determineLimit()
Determine the limit.
getFrom()
Get the sql part FROM.
getOrderDirection()
Get order direction.
fetchData($a_prg_id, $limit=null, $offset=null, $order_coloumn=null, $order_direction=null)
Get data for table.
getWhere($a_prg_id)
Get the sql part WHERE.
getParentObject()
Get parent object.
countFetchData($a_prg_id)
Get maximum number of rows the table could have.
__construct($a_prg_obj_id, $a_prg_ref_id, $a_parent_obj, $a_parent_cmd="", $a_template_context="", \ilStudyProgrammeUserProgressDB $sp_user_progress_db)
Class ilObjStudyProgrammeMembersTableGUI.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
buildActionDropDown($a_actions, $a_prgrs_id, $a_ass_id)
Builds the action menu for each row of the table.
foreach($_POST as $key=> $value) $res
static _lookupTitle($a_obj_id)
Overwitten from base class.
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.
static getPossibleActions($a_node_id, $a_root_prg_id, $a_status)
Get a list with possible actions on a progress record.
addMultiCommand($a_cmd, $a_text)
Add Command button.
getColumnsChildren()
Get columns for children if it is a child.
addMultiCommands()
Add multicommands to table.
getSelectedColumns()
Get selected columns.
setEnableAllCommand($a_value)
Enable actions for all entries in current result.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static returnDbTableName()
getColumnsLPChildren()
Get columns for children if it is a lp child.
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setEnableHeader($a_enableheader)
Set Enable Header.
setMaxCount($a_max_count)
set max.
setEnableTitle($a_enabletitle)
Set Enable Title.
getMultiCommands()
Get possible multicommnds.