72 $ilToolbar = $DIC[
'ilToolbar'];
73 $ilLocator = $DIC[
'ilLocator'];
80 $this->ref_id = $a_ref_id;
81 $this->parent_gui = $a_parent_gui;
85 $this->ilLocator = $ilLocator;
87 $this->toolbar = $ilToolbar;
92 $this->assignment_object = null;
97 $lng->loadLanguageModule(
"prg");
99 $this->tpl->addCss(
"Modules/StudyProgramme/templates/css/ilStudyProgramme.css");
104 $cmd = $this->ctrl->getCmd();
113 case "updateFromCurrentPlan":
114 case "updateFromInput":
115 $cont = $this->$cmd();
118 throw new ilException(
"ilObjStudyProgrammeMembersGUI: " .
119 "Command not supported: $cmd");
122 $this->tpl->setContent($cont);
127 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserAssignment.php");
128 if (!is_numeric(
$_GET[
"ass_id"])) {
129 throw new ilException(
"Expected integer 'ass_id'");
131 return (
int)
$_GET[
"ass_id"];
136 if ($this->assignment_object === null) {
140 return $this->assignment_object;
145 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeIndividualPlanProgressListGUI.php");
147 $gui->setOnlyRelevant(
true);
149 $tpl =
new ilTemplate(
"tpl.individual_plan_tree_frame.html",
false,
false,
"Modules/StudyProgramme");
150 $tpl->setVariable(
"CONTENT", $gui->getHTML());
156 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeIndividualPlanTableGUI.php");
158 $this->ctrl->setParameter($this,
"ass_id", $ass->getId());
159 $this->ctrl->setParameter($this,
"cmd",
"manage");
162 $this->ctrl->setParameter($this,
"ass_id", null);
169 $ass->updateFromProgram();
170 $this->ctrl->setParameter($this,
"ass_id", $ass->getId());
172 $this->ctrl->redirect($this,
"manage");
177 require_once(
"Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
187 $this->ctrl->redirect($this,
"manage");
194 foreach ($status_updates as $prgrs_id => $status) {
195 $prgrs = $this->sp_user_progress_db->getInstanceById($prgrs_id);
196 $cur_status = $prgrs->getStatus();
199 $prgrs->unmarkAccredited($this->
user->getId());
202 $prgrs->markRelevant($this->
user->getId());
205 $prgrs->markNotRelevant($this->
user->getId());
208 $prgrs->markAccredited($this->
user->getId());
220 if ($deadline !== null && $deadline->get(
IL_CAL_DATE) <
date(
"Y-m-d")) {
221 $prgrs->markFailed($this->
user->getId());
224 if ($deadline === null || $deadline->get(
IL_CAL_DATE) >
date(
"Y-m-d")) {
225 $prgrs->markNotFailed($this->
user->getId());
253 $prgrs = $this->sp_user_progress_db->getInstanceById($prgrs_id);
254 $cur_status = $prgrs->getStatus();
259 if ($required_points < 0) {
260 $required_points = 0;
263 if ($required_points == $prgrs->getAmountOfPoints()) {
267 $prgrs->setRequiredAmountOfPoints($required_points, $this->
user->getId());
282 throw new ilException(
"Expected array $post_var in POST");
285 $post_value =
$_POST[$post_var];
286 $deadline = $post_value[$prgrs_id];
288 if ($deadline ==
"") {
303 if (array_key_exists($post_var,
$_POST)) {
311 require_once(
"Services/Utilities/classes/class.ilUtil.php");
318 if (!array_key_exists($post_var,
$_POST)) {
319 throw new ilException(
"Expected array $post_var in POST");
327 if (!array_key_exists($post_var,
$_POST)) {
328 throw new ilException(
"Expected array $post_var in POST");
331 $post_value =
$_POST[$post_var];
332 return (
int) $post_value[$prgrs_id];
338 $tpl =
new ilTemplate(
"tpl.indivdual_plan_frame.html",
true,
true,
"Modules/StudyProgramme");
342 foreach (
array(
"view",
"manage") as $_tab) {
343 $tpl->setCurrentBlock(
"sub_tab");
344 $tpl->setVariable(
"CLASS", $_tab ==
$tab ?
"active" :
"");
346 $tpl->setVariable(
"TITLE", $this->lng->txt(
"prg_$_tab"));
347 $tpl->parseCurrentBlock();
349 $tpl->setVariable(
"CONTENT", $content);
356 $this->ctrl->setParameter($this,
"ass_id", $a_ass_id);
357 $lnk = $this->ctrl->getLinkTarget($this, $a_tab);
358 $this->ctrl->setParameter($this,
"ass_id", null);
365 $a_table->
addCommandButton(
"updateFromCurrentPlan", $this->lng->txt(
"prg_update_from_current_plan"));
378 return self::POST_VAR_STATUS;
383 return self::POST_VAR_REQUIRED_POINTS;
388 return self::POST_VAR_DEADLINE;
393 return self::MANUAL_STATUS_NONE;
398 return self::MANUAL_STATUS_NOT_RELEVANT;
403 return self::MANUAL_STATUS_ACCREDITED;
408 $cl =
"ilObjStudyProgrammeIndividualPlanGUI";
409 $ctrl->setParameterByClass($cl,
"ass_id", $a_ass_id);
410 $link =
$ctrl->getLinkTargetByClass($cl,
"view");
411 $ctrl->setParameterByClass($cl,
"ass_id", null);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
__construct($a_parent_gui, $a_ref_id, ilStudyProgrammeUserProgressDB $sp_user_progress_db)
updateDeadline(ilStudyProgrammeUserProgress $prgrs)
Updates current deadline.
static _lookupFullname($a_user_id)
Lookup Full Name.
getLinkTargetForSubTab($a_tab, $a_ass_id)
if(!array_key_exists('StateId', $_REQUEST)) $id
Storage implementation for ilStudyProgrammeUserProgress.
const MANUAL_STATUS_NOT_RELEVANT
getRequiredPointsPostVarTitle()
getId()
Get the id of the progress.
Class ilObjStudyProgrammeIndividualPlanGUI.
Class ilStudyProgrammeIndividualPlanTableGUI.
getDeadlineFromForm($prgrs_id)
Get the deadline from form.
getRequiredPointsUpdates($prgrs_id)
getManualStatusNotRelevant()
const POST_VAR_REQUIRED_POINTS
static getLinkTargetView($ctrl, $a_ass_id)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
special template class to simplify handling of ITX/PEAR
redirection script todo: (a better solution should control the processing via a xml file) ...
const STATUS_NOT_RELEVANT
Create styles array
The data for the language used.
postContainDeadline()
Checks whether $_POST contains deadline.
getManualStatusAccredited()
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
showSuccessMessage($a_lng_var)
appendIndividualPlanActions(ilTable2GUI $a_table)
const MANUAL_STATUS_ACCREDITED
updateProgress($user_id)
Updates current progress.
Class ilStudyProgrammeExpandableProgressListGUI.
static getInstance($a_id)
Get an instance.
buildFrame($tab, $content)
if(empty($password)) $table
getDeadlinePostVarTitle()
setDeadline($deadline)
Set the deadline of this node.
getManualStatusPostVarTitle()
updateRequiredPoints($prgrs_id)
Represents the progress of a user at one node of a study programme.