24 $ilCtrl->saveParameter($this, array(
"se_id",
"sn_id"));
25 $lng->loadLanguageModule(
"skmg");
29 $this->se_id = (int)
$_GET[
"se_id"];
30 $this->sn_id = ((int)
$_POST[
"sn_id"] > 0)
32 : (
int)
$_GET[
"sn_id"];
33 $ilCtrl->setParameter($this,
"sn_id", $this->sn_id);
43 $cmd = $ilCtrl->getCmd(
"listSelfEvaluations");
65 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
74 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
76 foreach ($se_nodes as $n_id => $title)
81 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
86 $ilToolbar->addInputItem(
$si,
true);
88 $ilToolbar->addFormButton($lng->txt(
"skmg_execute_self_evaluation"),
"startSelfEvaluation");
90 include_once(
"./Services/Skill/classes/class.ilSelfEvaluationTableGUI.php");
93 $tpl->setContent($table->getHTML());
104 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0)
107 $ilCtrl->redirect($this,
"listSelfEvaluations");
111 include_once(
"./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
112 include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
113 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
115 $cgui->setFormAction($ilCtrl->getFormAction($this));
116 $cgui->setHeaderText($lng->txt(
"skmg_sure_delete_self_evaluation"));
117 $cgui->setCancel($lng->txt(
"cancel"),
"listSelfEvaluations");
118 $cgui->setConfirm($lng->txt(
"delete"),
"deleteSelfEvaluation");
120 foreach (
$_POST[
"id"] as $i)
125 $cgui->addItem(
"id[]", $i, $se_title.
", ".$lng->txt(
"created").
": ".
126 $se->getCreated().
", ".$lng->txt(
"last_update").
": ".$se->getLastUpdate());
129 $tpl->setContent($cgui->getHTML());
143 include_once(
"./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
144 if (is_array(
$_POST[
"id"]))
146 foreach (
$_POST[
"id"] as $i)
149 if ($se->getUserId() == $ilUser->getId())
156 $ilCtrl->redirect($this,
"listSelfEvaluations");
171 if ($a_mode ==
"edit")
173 include_once(
"./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
175 $this->sn_id = $se->getTopSkillId();
179 $se_tpl =
new ilTemplate(
"tpl.self_evaluation.html",
true,
true,
"Services/Skill");
180 include_once(
"./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
183 $cstep = (int)
$_GET[
"step"];
184 $ilCtrl->setParameter($this,
"step", $cstep);
185 include_once(
"./Services/Skill/classes/class.ilSkillSelfEvalSkillTableGUI.php");
189 $se_tpl->setCurrentBlock(
"se_table");
190 $se_tpl->setVariable(
"SE_TABLE", $table->getHTML());
191 $se_tpl->parseCurrentBlock();
193 include_once(
"./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php");
195 if ($a_mode ==
"edit")
199 $tb->addFormButton(
"< ".$lng->txt(
"skmg_previous_step"),
"updateBackSelfEvaluation");
201 if ($cstep < count(
$steps) - 1)
203 $tb->addFormButton($lng->txt(
"skmg_next_step").
" >",
"updateSelfEvaluation");
205 else if ($cstep == count(
$steps) - 1)
207 $tb->addFormButton($lng->txt(
"skmg_save_self_evaluation"),
"updateSelfEvaluation");
212 if ($cstep < count(
$steps) - 1)
214 $tb->addFormButton($lng->txt(
"skmg_next_step").
" >",
"saveSelfEvaluation");
216 else if ($cstep == count(
$steps) - 1)
218 $tb->addFormButton($lng->txt(
"skmg_save_self_evaluation"),
"saveSelfEvaluation");
221 $se_tpl->setVariable(
"FORM_ACTION", $ilCtrl->getFormAction($this));
222 $se_tpl->setVariable(
"TOOLBAR", $tb->getHTML());
223 $tpl->setContent($se_tpl->get());
236 include_once(
"./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
239 $se->setUserId($ilUser->getId());
240 $se->setTopSkillId(
$_GET[
"sn_id"]);
241 if (is_array(
$_POST[
"se_sk"]))
243 $se->setLevels(
$_POST[
"se_sk"]);
248 $cstep = (int)
$_GET[
"step"];
252 $ilCtrl->setParameter($this,
"step", 1);
253 $ilCtrl->setParameter($this,
"se_id", $se->getId());
254 $ilCtrl->redirect($this,
"editSelfEvaluation");
258 $ilCtrl->redirect($this,
"");
295 include_once(
"./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
298 if ($se->getUserId() == $ilUser->getId())
301 $cstep = (int) $_GET[
"step"];
303 if (is_array(
$_POST[
"se_sk"]))
305 $se->setLevels(
$_POST[
"se_sk"],
true);
311 $ilCtrl->setParameter($this,
"step", (
int) $_GET[
"step"] - 1);
312 $ilCtrl->setParameter($this,
"se_id", $se->getId());
313 $ilCtrl->redirect($this,
"editSelfEvaluation");
315 else if (count(
$steps) - 1 > $cstep)
317 $ilCtrl->setParameter($this,
"step", (
int) $_GET[
"step"] + 1);
318 $ilCtrl->setParameter($this,
"se_id", $se->getId());
319 $ilCtrl->redirect($this,
"editSelfEvaluation");
325 $ilCtrl->redirect($this,
"");
340 include_once(
"./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
344 foreach ($ses as $se)
347 $html.= $this->form->getHTML().
"<br /><br />";
360 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
365 $lng->txt(
"created").
": ".
368 if ($se[
"created"] != $se[
"last_update"])
370 $dates.=
", ".$lng->txt(
"last_update").
": ".
377 $levels = $se->getLevels();
379 $this->form->setTitle($lng->txt(
"skmg_self_evaluation").$dates);
381 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
382 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
385 if ($stree->isInTree($se->getTopSkillId()))
387 $cnode = $stree->getNodeData($se->getTopSkillId());
388 $childs = $stree->getSubTree($cnode);
389 foreach ($childs as $child)
391 if ($child[
"type"] ==
"skll")
394 $path = $stree->getPathFull($child[
"child"]);
396 foreach (
$path as $p)
398 if ($p[
"type"] !=
"skrt")
400 $title.= $sep.$p[
"title"];
406 $ls = $sk->getLevelData();
411 if ($ld[
"id"] == $levels[$child[
"child"]])
413 $ne->setValue($ld[
"title"]);
416 $this->form->addItem($ne);