76 $this->ctrl = $ilCtrl;
80 $this->assignment_object = null;
87 $this->permissions = null;
91 $this->tpl->addCss(
"Modules/StudyProgramme/templates/css/ilStudyProgramme.css");
96 $this->parent_gui = $a_parent_gui;
101 $this->ref_id = $a_ref_id;
108 $cmd = $this->ctrl->getCmd();
117 case "updateFromCurrentPlan":
118 case "updateFromInput":
119 $cont = $this->$cmd();
122 throw new ilException(
"ilObjStudyProgrammeMembersGUI: " .
123 "Command not supported: $cmd");
126 $this->tpl->setContent($cont);
131 if (!is_numeric(
$_GET[
"ass_id"])) {
132 throw new ilException(
"Expected integer 'ass_id'");
134 return (
int)
$_GET[
"ass_id"];
139 if ($this->assignment_object === null) {
141 $this->assignment_object = $this->assignment_repository->getInstanceById((
int) $id);
143 return $this->assignment_object;
155 "may not access individual plan of user" 159 $progress = $prg->getProgressForAssignment($ass->getId());
162 $gui->setOnlyRelevant(
true);
164 $tpl =
new ilTemplate(
"tpl.individual_plan_tree_frame.html",
false,
false,
"Modules/StudyProgramme");
165 $tpl->setVariable(
"CONTENT", $gui->getHTML());
179 "may not access individual plan of user" 184 $this->ctrl->setParameter($this,
"ass_id", $ass->getId());
185 $this->ctrl->setParameter($this,
"cmd",
"manage");
187 $frame = $this->
buildFrame(
"manage", $table->getHTML());
188 $this->ctrl->setParameter($this,
"ass_id", null);
201 "may not access individual plan of user" 205 $prg = $this->parent_gui->getStudyProgramme();
206 $progress = $prg->getProgressForAssignment($ass->getId());
207 $msgs = $this->messages->getMessageCollection(
'msg_update_individual_plan');
208 $this->
object->updatePlanFromRepository(
210 $this->
user->getId(),
214 $this->ctrl->setParameter($this,
"ass_id", $ass->getId());
216 $this->ctrl->redirect($this,
"manage");
222 self::POST_VAR_STATUS,
223 self::POST_VAR_DEADLINE,
224 self::POST_VAR_REQUIRED_POINTS
228 foreach ($params as $postvar) {
230 if (array_key_exists($postvar, $post)) {
231 $ret[$postvar] = $post[$postvar];
232 krsort(
$ret[$postvar], SORT_NUMERIC);
241 $msgs = $this->messages->getMessageCollection(
'msg_update_individual_plan');
242 $this->
updateStatus($values[self::POST_VAR_STATUS], $msgs);
246 if ($msgs->hasAnyMessages()) {
247 $this->messages->showMessages($msgs);
251 $this->ctrl->redirect($this,
"manage");
256 $programme = $this->parent_gui->getStudyProgramme();
257 $acting_user_id = (int) $this->
user->getId();
259 foreach ($progress_updates as $progress_id => $target_status) {
260 switch ($target_status) {
263 $progress = $this->progress_repository->get($progress_id);
264 $cur_status = $progress->getStatus();
267 $programme->unmarkAccredited($progress_id, $acting_user_id, $msgs);
270 $programme->markRelevant($progress_id, $acting_user_id, $msgs);
275 $programme->markAccredited($progress_id, $acting_user_id, $msgs);
279 $programme->markNotRelevant($progress_id, $acting_user_id, $msgs);
282 case self::MANUAL_STATUS_NONE:
286 $msgs->
add(
false,
'msg_impossible_target_status', $progress_id);
293 $programme = $this->parent_gui->getStudyProgramme();
294 $acting_user_id = (int) $this->
user->getId();
296 foreach ($deadlines as $progress_id => $deadline) {
297 if (trim($deadline) ===
'') {
300 $deadline = DateTimeImmutable::createFromFormat(
'd.m.Y', $deadline);
303 $progress = $this->progress_repository->get($progress_id);
304 $cur_deadline = $progress->getDeadline();
306 if ($deadline != $cur_deadline) {
307 $programme->changeProgressDeadline($progress_id, $acting_user_id, $msgs, $deadline);
314 $programme = $this->parent_gui->getStudyProgramme();
315 $acting_user_id = (int) $this->
user->getId();
317 foreach ($required_points as $progress_id => $points) {
318 $points = (int) $points;
321 $msgs->
add(
false,
'msg_points_must_be_positive', $progress_id);
325 $progress = $this->progress_repository->get($progress_id);
326 $cur_points = $progress->getAmountOfPoints();
328 if ($points != $cur_points) {
329 $programme->changeAmountOfPoints($progress_id, $acting_user_id, $msgs, $points);
336 ilUtil::sendSuccess($this->lng->txt(
"prg_$a_lng_var"),
true);
349 $tpl =
new ilTemplate(
"tpl.indivdual_plan_frame.html",
true,
true,
"Modules/StudyProgramme");
351 $user_id = $ass->getUserId();
354 foreach ($tabs as $_tab) {
355 $tpl->setCurrentBlock(
"sub_tab");
356 $tpl->setVariable(
"CLASS", $_tab == $tab ?
"active" :
"");
358 $tpl->setVariable(
"TITLE", $this->lng->txt(
"prg_$_tab"));
359 $tpl->parseCurrentBlock();
361 $tpl->setVariable(
"CONTENT", $content);
368 $this->ctrl->setParameter($this,
"ass_id", $a_ass_id);
369 $lnk = $this->ctrl->getLinkTarget($this, $a_tab);
370 $this->ctrl->setParameter($this,
"ass_id", null);
377 $a_table->
addCommandButton(
"updateFromCurrentPlan", $this->lng->txt(
"prg_update_from_current_plan"));
383 $cl =
"ilObjStudyProgrammeIndividualPlanGUI";
384 $this->ctrl->setParameterByClass($cl,
"ass_id", $a_ass_id);
385 $link = $this->ctrl->getLinkTargetByClass($cl,
"view");
386 $this->ctrl->setParameterByClass($cl,
"ass_id", null);
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
const OP_VIEW_INDIVIDUAL_PLAN
This class provides processing control methods.
__construct(\ilGlobalTemplateInterface $tpl, \ilCtrl $ilCtrl, \ilLanguage $lng, \ilObjUser $ilUser, ilStudyProgrammeProgressRepository $progress_repository, ilStudyProgrammeAssignmentRepository $assignment_repository, ilPRGMessagePrinter $messages)
Util around ilPRGMessageCollection factors and output collections.
static _lookupFullname($a_user_id)
Lookup Full Name.
getLinkTargetForSubTab($a_tab, $a_ass_id)
updateDeadlines(array $deadlines, ilPRGMessageCollection $msgs)
add(bool $success, string $message, string $record_identitifer)
Class ilObjStudyProgrammeIndividualPlanGUI.
static getInstanceByRefId($a_ref_id)
const OP_EDIT_INDIVIDUAL_PLAN
static getInstanceByObjId($obj_id)
Class ilStudyProgrammeIndividualPlanTableGUI.
updateStatus(array $progress_updates, ilPRGMessageCollection $msgs)
const POST_VAR_REQUIRED_POINTS
setParentGUI($a_parent_gui)
updateRequiredPoints(array $required_points, ilPRGMessageCollection $msgs)
const STATUS_NOT_RELEVANT
static specificDicFor(\ilObjStudyProgramme $prg)
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
showSuccessMessage($a_lng_var)
appendIndividualPlanActions(ilTable2GUI $a_table)
getLinkTargetView($a_ass_id)
loadLanguageModule($a_module)
Covers the persistence of settings belonging to a study programme (SP).
Class ilStudyProgrammeExpandableProgressListGUI.
buildFrame($tab, $content)
Holds information about multi-actions, mainly in context of member-assignemnts and status changes...