19 declare(strict_types=1);
37 $this->
setId(
"manage_indiv");
42 $this->
ctrl = $DIC[
'ilCtrl'];
43 $this->
lng = $DIC[
'lng'];
44 $this->db = $DIC[
'ilDB'];
46 $this->assignment = $ass;
54 $this->
setRowTemplate(
"tpl.individual_plan_table_row.html",
"components/ILIAS/StudyProgramme");
63 "prg_points_required",
74 foreach ($columns as $lng_var) {
86 $ui_factory = $DIC[
'ui.factory'];
87 $ui_renderer = $DIC[
'ui.renderer'];
88 $this->possible_image = $ui_renderer->render(
89 $ui_factory->symbol()->icon()->custom(
ilUtil::getImagePath(
"standard/icon_ok.svg"),
'ok')->withSize(
'small')
91 $this->not_possible_image = $ui_renderer->render(
92 $ui_factory->symbol()->icon()->custom(
ilUtil::getImagePath(
"standard/icon_not_ok.svg"),
'not ok')->withSize(
'small')
96 protected function fillRow(array $a_set): void
98 $this->tpl->setVariable(
"STATUS", $a_set[
'status_repr']);
102 $title .=
" (" . $this->
lng->txt(
"prg_status_draft") .
")";
104 $title .=
" (" . $this->
lng->txt(
"prg_status_outdated") .
")";
107 $this->tpl->setVariable(
"TITLE",
$title);
108 $this->tpl->setVariable(
"POINTS_CURRENT", $a_set[
"points_current"]);
109 $this->tpl->setVariable(
111 $this->
getRequiredPointsInput($a_set[
"progress_id"], $a_set[
"status"], (
string) $a_set[
"points_required"])
114 $a_set[
"progress_id"],
115 (
int) $a_set[
"status"],
116 (
int) $a_set[
"program_status"],
118 $this->tpl->setVariable(
"POSSIBLE", $a_set[
"possible"] ? $this->possible_image : $this->not_possible_image);
119 $this->tpl->setVariable(
"CHANGED_BY", $a_set[
"changed_by"]);
120 $this->tpl->setVariable(
"COMPLETION_BY", $a_set[
"completion_by"]);
124 case self::SEL_COLUMN_ASSIGNMENT_DATE:
125 $this->tpl->setCurrentBlock(
"assignment_date");
126 $this->tpl->setVariable(
"ASSIGNMENT_DATE", $a_set[
"assignment_date"]);
127 $this->tpl->parseCurrentBlock(
"assignment_date");
129 case self::SEL_COLUMN_DEADLINE:
130 $this->tpl->setCurrentBlock(
"deadline");
131 $this->tpl->setVariable(
"DEADLINE", $this->
getDeadlineInput($a_set[
"progress_id"], $a_set[
"deadline"]));
132 $this->tpl->parseCurrentBlock(
"deadline");
134 case self::SEL_COLUMN_COMPLETION_DATE:
135 $this->tpl->setCurrentBlock(
"completion_date");
136 $this->tpl->setVariable(
"COMPLETION_DATE", $a_set[
"completion_date"]);
137 $this->tpl->parseCurrentBlock(
"completion_date");
147 $cols[self::SEL_COLUMN_ASSIGNMENT_DATE] = array(
148 "txt" => $this->
lng->txt(
"assignment_date"));
149 $cols[self::SEL_COLUMN_DEADLINE] = array(
150 "txt" => $this->
lng->txt(
"prg_deadline"));
151 $cols[self::SEL_COLUMN_COMPLETION_DATE] = array(
152 "txt" => $this->
lng->txt(
"completion_date"));
158 $prg_id = $this->assignment->getRootId();
161 $ass_id = $this->assignment->getId();
162 $usr_id = $this->assignment->getUserId();
165 $prg->applyToSubTreeNodes(
166 function ($node) use ($prg_id,
$ass_id, $usr_id, &$plan, $prg) {
167 $progress = $this->assignment->getProgressForNode($node->getId());
168 $completion_by = $progress->getCompletionBy();
171 $successful_subnodes = array_filter(
172 $progress->getSubnodes(),
181 $successful_subnode_ids
183 $completion_by = implode(
', ', $out);
190 "status" => $progress->getStatus(),
191 "status_repr" => $programme->statusToRepr($progress->getStatus()),
192 "title" => $node->getTitle(),
193 "points_current" => $progress->getCurrentAmountOfPoints(),
194 "points_required" => $progress->getAmountOfPoints(),
195 "possible" => $progress->isSuccessful()
196 || $programme->canBeCompleted($progress)
199 "completion_by" => $completion_by,
200 "progress_id" => $progress->getId(),
202 "program_status" => $programme->getStatus(),
203 "assignment_date" => $progress->getAssignmentDate()->format(
'd.m.Y'),
204 "deadline" => $progress->isSuccessful() ?
null : $progress->getDeadline(),
205 "completion_date" => $progress->getCompletionDate() ? $progress->getCompletionDate()->format(
'd.m.Y') :
'' 217 $parent::MANUAL_STATUS_NONE =>
'-',
226 $options = array_filter(
228 static function ($o) use ($allowed, $parent, $node_lifecycle_status):
bool {
229 return (in_array($o, $allowed) || $o === $parent::MANUAL_STATUS_NONE)
235 $select =
new ilSelectInputGUI(
"", $parent::POST_VAR_STATUS .
"[$progress_id]");
236 $select->setOptions($options);
237 $select->setValue($parent::MANUAL_STATUS_NONE);
239 return $select->render();
245 return $points_required;
249 $input =
new ilNumberInputGUI(
"", $parent::POST_VAR_REQUIRED_POINTS .
"[$progress_id]");
250 $input->setValue($points_required);
252 return $input->render();
260 return $gui->render();
setTopCommands(bool $a_val)
getDeadlineInput(string $progress_id, $deadline)
getManualStatusSelect(string $progress_id, int $status, int $node_lifecycle_status)
setEnableTitle(bool $a_enabletitle)
const SEL_COLUMN_DEADLINE
__construct(ilObjStudyProgrammeIndividualPlanGUI $parent_obj, ilPRGAssignment $ass)
getRequiredPointsInput(string $progress_id, int $status, string $points_required)
static lookupTitle(int $obj_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
string $not_possible_image
A Progress is the status of a user on a single node of an assignment; it is unique by assignment_id:u...
setExternalSorting(bool $a_val)
const SEL_COLUMN_COMPLETION_DATE
static getAllowedTargetStatusFor(int $status_from)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setDefaultOrderDirection(string $a_defaultorderdirection)
const STATUS_NOT_RELEVANT
static getInstanceByObjId(int $obj_id)
const SEL_COLUMN_ASSIGNMENT_DATE
__construct(Container $dic, ilPlugin $plugin)
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)
const COMPLETED_BY_SUBNODES
Assignments are relations of users to a PRG; They hold progress-information for (sub-)nodes of the PR...
determineOffsetAndOrder(bool $a_omit_offset=false)
setEnableHeader(bool $a_enableheader)
setMaxCount(int $a_max_count)
set max.
ilPRGAssignment $assignment
setExternalSegmentation(bool $a_val)
static _lookupLogin(int $a_user_id)