29 $this->
setId(
"manage_indiv");
36 $ilCtrl = $DIC[
'ilCtrl'];
39 $this->ctrl = $ilCtrl;
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 $this->tpl->setVariable(
"STATUS", $a_set[
'status_repr']);
92 $title .=
" (" . $this->lng->txt(
"prg_status_draft") .
")";
94 $title .=
" (" . $this->lng->txt(
"prg_status_outdated") .
")";
97 $this->tpl->setVariable(
"TITLE",
$title);
98 $this->tpl->setVariable(
"POINTS_CURRENT", $a_set[
"points_current"]);
99 $this->tpl->setVariable(
"POINTS_REQUIRED", $this->
getRequiredPointsInput($a_set[
"progress_id"], $a_set[
"status"], $a_set[
"points_required"]));
101 $a_set[
"progress_id"],
104 $this->tpl->setVariable(
"POSSIBLE", $a_set[
"possible"] ? $this->possible_image : $this->not_possible_image);
105 $this->tpl->setVariable(
"CHANGED_BY", $a_set[
"changed_by"]);
106 $this->tpl->setVariable(
"COMPLETION_BY", $a_set[
"completion_by"]);
110 case self::SEL_COLUMN_ASSIGNMENT_DATE:
111 $this->tpl->setCurrentBlock(
"assignment_date");
112 $this->tpl->setVariable(
"ASSIGNMENT_DATE", $a_set[
"assignment_date"]);
113 $this->tpl->parseCurrentBlock(
"assignment_date");
115 case self::SEL_COLUMN_DEADLINE:
116 $this->tpl->setCurrentBlock(
"deadline");
117 $this->tpl->setVariable(
"DEADLINE", $this->
getDeadlineInput($a_set[
"progress_id"], $a_set[
"deadline"]));
118 $this->tpl->parseCurrentBlock(
"deadline");
120 case self::SEL_COLUMN_COMPLETION_DATE:
121 $this->tpl->setCurrentBlock(
"completion_date");
122 $this->tpl->setVariable(
"COMPLETION_DATE", $a_set[
"completion_date"]);
123 $this->tpl->parseCurrentBlock(
"completion_date");
138 $cols[self::SEL_COLUMN_ASSIGNMENT_DATE] = array(
139 "txt" => $this->lng->txt(
"assignment_date"));
140 $cols[self::SEL_COLUMN_DEADLINE] = array(
141 "txt" => $this->lng->txt(
"prg_deadline"));
142 $cols[self::SEL_COLUMN_COMPLETION_DATE] = array(
143 "txt" => $this->lng->txt(
"completion_date"));
149 $prg_id = $this->assignment->getRootId();
152 $ass_id = $this->assignment->getId();
153 $usr_id = $this->assignment->getUserId();
156 $prg->applyToSubTreeNodes(
157 function ($node) use ($prg_id, $ass_id, $usr_id, &$plan, $prg) {
158 $progress = $this->sp_user_progress_db->getByIds($node->getId(), $ass_id);
159 $completion_by_id = $progress->getCompletionBy();
161 if ($completion_by_id) {
163 if (!$completion_by) {
165 if (
$type ==
"crsr") {
173 if ($progress->isSuccessful()) {
174 $names = $node->getNamesOfCompletedOrAccreditedChildren($ass_id);
175 $completion_by = implode(
", ", $names);
180 $plan[] = array(
"status" => $progress->getStatus()
181 ,
"status_repr" => $programme->statusToRepr($progress->getStatus())
182 ,
"title" => $node->getTitle()
183 ,
"points_current" => $progress->getCurrentAmountOfPoints()
184 ,
"points_required" => $progress->getAmountOfPoints()
185 ,
"possible" => $progress->isSuccessful()
186 || $programme->canBeCompleted($progress)
187 || !$progress->isRelevant()
189 ,
"completion_by" => $completion_by
190 ,
"progress_id" => $progress->getId()
192 ,
"program_status" => $programme->getStatus()
193 ,
"assignment_date" => $progress->getAssignmentDate()->format(
'd.m.Y')
194 ,
"deadline" => $progress->getDeadline()
195 ,
"completion_date" => $progress->getCompletionDate() ? $progress->getCompletionDate()->format(
'd.m.Y') :
'' 207 $parent::MANUAL_STATUS_NONE =>
'-',
216 $options = array_filter(
218 function ($o) use ($allowed, $parent) {
219 return in_array($o, $allowed) || $o === $parent::MANUAL_STATUS_NONE;
224 $select =
new ilSelectInputGUI(
"", $parent::POST_VAR_STATUS .
"[$a_progress_id]");
225 $select->setOptions($options);
226 $select->setValue($parent::MANUAL_STATUS_NONE);
228 return $select->render();
234 return $a_points_required;
238 $input =
new ilNumberInputGUI(
"", $parent::POST_VAR_REQUIRED_POINTS .
"[$a_progress_id]");
239 $input->setValue($a_points_required);
241 return $input->render();
249 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 getAllowedTargetStatusFor(int $status_from)
static _lookupTitle($a_id)
lookup object title
determineLimit()
Determine the limit.
__construct(ilObjStudyProgrammeIndividualPlanGUI $a_parent_obj, ilStudyProgrammeAssignment $a_ass, ilStudyProgrammeProgressRepository $sp_user_progress_db)
getParentObject()
Get parent object.
getDeadlineInput($a_progress_id, $deadline)
Class ilObjStudyProgrammeIndividualPlanGUI.
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
static getInstanceByObjId($obj_id)
Class ilStudyProgrammeIndividualPlanTableGUI.
const SEL_COLUMN_COMPLETION_DATE
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)
Represents one assignment of the user to a program tree.
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.
const SEL_COLUMN_ASSIGNMENT_DATE
__construct(Container $dic, ilPlugin $plugin)
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.
Covers the persistence of settings belonging to a study programme (SP).
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)