5 require_once(
"Services/Table/classes/class.ilTable2GUI.php");
6 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
7 require_once(
"Modules/StudyProgramme/classes/class.ilObjStudyProgramme.php");
8 require_once(
"Services/Utilities/classes/class.ilUtil.php");
29 $this->
setId(
"manage_indiv");
33 parent::__construct($a_parent_obj,
'manage');
43 $this->assignment = $a_ass;
51 $this->
setRowTemplate(
"tpl.individual_plan_table_row.html",
"Modules/StudyProgramme");
58 ,
"prg_points_current" 59 ,
"prg_points_required" 83 $this->not_possible_image =
"<img src='" .
ilUtil::getImagePath(
"icon_not_ok.svg") .
"' alt='not ok'>";
88 $status = $this->sp_user_progress_db->statusToRepr($a_set[
"status"]);
89 $this->tpl->setVariable(
"STATUS", $status);
93 $title .=
" (" . $this->lng->txt(
"prg_status_draft") .
")";
95 $title .=
" (" . $this->lng->txt(
"prg_status_outdated") .
")";
98 $this->tpl->setVariable(
"TITLE",
$title);
99 $this->tpl->setVariable(
"POINTS_CURRENT", $a_set[
"points_current"]);
100 $this->tpl->setVariable(
"POINTS_REQUIRED", $this->
getRequiredPointsInput($a_set[
"progress_id"], $a_set[
"status"], $a_set[
"points_required"]));
101 $this->tpl->setVariable(
"MANUAL_STATUS", $this->
getManualStatusSelect($a_set[
"progress_id"], $a_set[
"status"]));
102 $this->tpl->setVariable(
"POSSIBLE", $a_set[
"possible"] ? $this->possible_image : $this->not_possible_image);
103 $this->tpl->setVariable(
"CHANGED_BY", $a_set[
"changed_by"]);
104 $this->tpl->setVariable(
"COMPLETION_BY", $a_set[
"completion_by"]);
108 case self::SEL_COLUMN_DEADLINE:
109 $this->tpl->setCurrentBlock(
"deadline");
110 $this->tpl->setVariable(
"DEADLINE", $this->
getDeadlineInput($a_set[
"progress_id"], $a_set[
"deadline"]));
111 $this->tpl->parseCurrentBlock(
"deadline");
126 $cols[self::SEL_COLUMN_DEADLINE] = array(
127 "txt" => $this->lng->txt(
"prg_deadline"));
134 $prg = $this->assignment->getStudyProgramme();
135 $prg_id = $prg->getId();
136 $ass_id = $this->assignment->getId();
137 $usr_id = $this->assignment->getUserId();
140 $prg->applyToSubTreeNodes(
function ($node) use ($prg_id, $ass_id, $usr_id, &$plan) {
141 $progress = $this->sp_user_progress_db->getInstance($ass_id, $node->getId(), $usr_id);
142 $completion_by_id = $progress->getCompletionBy();
143 if ($completion_by_id) {
145 if (!$completion_by) {
147 if (
$type ==
"crsr") {
154 $completion_by = implode(
", ", $progress->getNamesOfCompletedOrAccreditedChildren());
156 $plan[] = array(
"status" => $progress->getStatus()
157 ,
"title" => $node->getTitle()
158 ,
"points_current" => $progress->getCurrentAmountOfPoints()
159 ,
"points_required" => $progress->getAmountOfPoints()
160 ,
"possible" => $progress->isSuccessful() || $progress->canBeCompleted() || !$progress->isRelevant()
162 ,
"completion_by" => $completion_by
163 ,
"progress_id" => $progress->getId()
164 ,
"program_status" => $progress->getStudyProgramme()->getStatus()
165 ,
"deadline" => $progress->getDeadline()
178 $status_title = $parent->getManualStatusPostVarTitle();
179 $manual_status_none = $parent->getManualStatusNone();
180 $manual_status_not_relevant = $parent->getManualStatusNotRelevant();
181 $manual_status_accredited = $parent->getManualStatusAccredited();
183 require_once(
"Services/Form/classes/class.ilSelectInputGUI.php");
185 $select->setOptions(array( $manual_status_none =>
"-" 186 , $manual_status_accredited => $this->lng->txt(
"prg_status_accredited")
187 , $manual_status_not_relevant => $this->lng->txt(
"prg_status_not_relevant")
190 $select->setValue($manual_status_not_relevant);
192 $select->setValue($manual_status_accredited);
195 return $select->render();
201 return $a_points_required;
204 $required_points_title = $this->
getParentObject()->getRequiredPointsPostVarTitle();
206 require_once(
"Services/Form/classes/class.ilNumberInputGUI.php");
208 $input->setValue($a_points_required);
215 require_once(
"Services/Form/classes/class.ilDateTimeInputGUI.php");
219 $gui->setDate($deadline);
221 return $gui->render();
static _lookupLogin($a_user_id)
lookup login
setExternalSorting($a_val)
Set external sorting.
getSelectableColumns()
Get selectable columns.
const SEL_COLUMN_DEADLINE
setExternalSegmentation($a_val)
Set external segmentation.
static _lookupTitle($a_id)
lookup object title
Storage implementation for ilStudyProgrammeUserProgress.
determineLimit()
Determine the limit.
getParentObject()
Get parent object.
__construct(ilObjStudyProgrammeIndividualPlanGUI $a_parent_obj, ilStudyProgrammeUserAssignment $a_ass, \ilStudyProgrammeUserProgressDB $sp_user_progress_db)
getDeadlineInput($a_progress_id, $deadline)
Class ilObjStudyProgrammeIndividualPlanGUI.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
Class ilStudyProgrammeIndividualPlanTableGUI.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
static _lookupTitle($a_obj_id)
Overwitten from base class.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getSelectedColumns()
Get selected columns.
const STATUS_NOT_RELEVANT
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static _lookupType($a_id, $a_reference=false)
lookup object type
determineOffsetAndOrder($a_omit_offset=false)
Determine offset and order.
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.
setEnableHeader($a_enableheader)
Set Enable Header.
getManualStatusSelect($a_progress_id, $a_status)
setMaxCount($a_max_count)
set max.
setEnableTitle($a_enabletitle)
Set Enable Title.
getRequiredPointsInput($a_progress_id, $a_status, $a_points_required)
Represents one assignment of a user to a study programme.