5 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeGUI.php");
6 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
30 $ilCtrl->saveParameter($this, array(
"obj_id",
"level_id"));
31 $this->base_skill_id = $a_node_id;
51 $tpl->getStandardTemplate();
53 $next_class = $ilCtrl->getNextClass($this);
54 $cmd = $ilCtrl->getCmd();
57 case "ilcertificategui":
59 $ilTabs->activateTab(
"level_certificate");
60 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
61 include_once(
"./Services/Skill/classes/class.ilSkillCertificateAdapter.php");
64 $ret = $ilCtrl->forwardCommand($output_gui);
83 $tpl->setContent(
"Properties");
105 $it->setTitle($this->form->getInput(
"title"));
106 $it->setOrderNr($this->form->getInput(
"order_nr"));
107 $it->setStatus($this->form->getInput(
"status"));
108 $it->setSelfEvaluation(
$_POST[
"self_eval"]);
111 $this->node_object = $it;
121 $ilCtrl->setParameterByClass(
"ilbasicskillgui",
"obj_id",
122 $this->node_object->getId());
123 $ilCtrl->redirectByClass(
"ilbasicskillgui",
"edit");
131 $this->node_object->setTitle($this->form->getInput(
"title"));
132 $this->node_object->setOrderNr($this->form->getInput(
"order_nr"));
133 $this->node_object->setSelfEvaluation(
$_POST[
"self_eval"]);
134 $this->node_object->setStatus(
$_POST[
"status"]);
135 $this->node_object->update();
147 $ilToolbar->addButton($lng->txt(
"skmg_add_level"),
148 $ilCtrl->getLinkTarget($this,
"addLevel"));
150 include_once(
"./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
152 $tpl->setContent($table->getHTML());
164 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
171 $ti->setRequired(
true);
172 $this->form->addItem($ti);
178 $ni->setRequired(
true);
179 $this->form->addItem($ni);
186 $cb->
setInfo($lng->txt(
"skmg_selectable_info"));
187 $this->form->addItem($cb);
190 if ($a_mode ==
"create")
192 $this->form->addCommandButton(
"save", $lng->txt(
"save"));
193 $this->form->addCommandButton(
"cancelSave", $lng->txt(
"cancel"));
194 $this->form->setTitle($lng->txt(
"skmg_create_skll"));
198 $this->form->addCommandButton(
"update", $lng->txt(
"save"));
199 $this->form->setTitle($lng->txt(
"skmg_edit_skll"));
202 $ilCtrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
203 $this->form->setFormAction($ilCtrl->getFormAction($this));
230 $tpl->setContent($this->form->getHTML());
242 $tpl->setContent($this->form->getHTML());
253 if ($this->form->checkInput())
256 $this->node_object->addLevel(
257 $this->form->getInput(
"title"),
258 $this->form->getInput(
"description"));
261 $ilCtrl->redirect($this,
"edit");
264 $this->form->setValuesByPost();
265 $tpl->setContent($this->form->getHtml());
276 if ($this->form->checkInput())
278 $this->node_object->writeLevelTitle(
279 (
int)
$_GET[
"level_id"],
280 $this->form->getInput(
"title"));
281 $this->node_object->writeLevelDescription(
282 (
int) $_GET[
"level_id"],
283 $this->form->getInput(
"description"));
286 $ilCtrl->redirect($this,
"edit");
289 $this->form->setValuesByPost();
290 $tpl->setContent($this->form->getHtml());
302 $ilCtrl->saveParameter($this,
"level_id");
304 $ilTabs->activateTab(
"level_settings");
306 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
312 $ti->setRequired(
true);
313 $this->form->addItem($ti);
319 $this->form->addItem($ta);
322 if ($a_mode ==
"create")
324 $this->form->addCommandButton(
"saveLevel", $lng->txt(
"save"));
325 $this->form->addCommandButton(
"edit", $lng->txt(
"cancel"));
326 $this->form->setTitle($lng->txt(
"skmg_new_level"));
330 $this->form->addCommandButton(
"updateLevel", $lng->txt(
"save"));
331 $this->form->addCommandButton(
"edit", $lng->txt(
"cancel"));
332 $this->form->setTitle($lng->txt(
"skmg_edit_level"));
335 $this->form->setFormAction($ilCtrl->getFormAction($this));
345 $data = $this->node_object->getLevelData((
int)
$_GET[
"level_id"]);
346 $values[
"title"] = $data[
"title"];
347 $values[
"description"] = $data[
"description"];
348 $this->form->setValuesByArray($values);
359 $this->node_object->updateLevelOrder($order);
361 $ilCtrl->redirect($this,
"edit");
373 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0)
376 $ilCtrl->redirect($this,
"edit");
380 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
382 $cgui->setFormAction($ilCtrl->getFormAction($this));
383 $cgui->setHeaderText($lng->txt(
"skmg_really_delete_levels"));
384 $cgui->setCancel($lng->txt(
"cancel"),
"edit");
385 $cgui->setConfirm($lng->txt(
"delete"),
"deleteLevel");
387 foreach (
$_POST[
"id"] as $i)
392 $tpl->setContent($cgui->getHTML());
403 if (is_array(
$_POST[
"id"]))
405 foreach (
$_POST[
"id"] as $id)
407 $this->node_object->deleteLevel((
int) $id);
409 $this->node_object->fixLevelNumbering();
412 $ilCtrl->redirect($this,
"edit");
423 $ilTabs->clearTargets();
424 $ilHelp->setScreenIdComponent(
"skmg_lev");
426 $ilTabs->setBackTarget($lng->txt(
"back"),
427 $ilCtrl->getLinkTarget($this,
"edit"));
429 if (
$_GET[
"level_id"] > 0)
431 $ilTabs->addTab(
"level_settings",
432 $lng->txt(
"settings"),
433 $ilCtrl->getLinkTarget($this,
"editLevel"));
439 $ilTabs->addTab(
"level_resources",
440 $lng->txt(
"skmg_resources"),
441 $ilCtrl->getLinkTarget($this,
"showLevelResources"));
450 if (
$_GET[
"level_id"] > 0)
452 $tpl->setTitle($lng->txt(
"skmg_skill_level").
": ".
457 $tpl->setTitle($lng->txt(
"skmg_skill_level"));
460 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
462 $path = $tree->getPathFull($this->node_object->getId());
464 foreach (
$path as $p)
466 if (in_array($p[
"type"], array(
"scat",
"skll")))
468 $desc.= $sep.$p[
"title"];
472 $tpl->setDescription($desc);
484 $ilTabs->clearTargets();
485 $ilHelp->setScreenIdComponent(
"skmg_skll");
489 if (is_object($this->node_object))
493 $ilTabs->addTab(
"levels", $lng->txt(
"skmg_skill_levels"),
494 $ilCtrl->getLinkTarget($this,
'edit'));
497 $ilTabs->addTab(
"properties", $lng->txt(
"settings"),
498 $ilCtrl->getLinkTarget($this,
'editProperties'));
503 $ilCtrl->setParameterByClass(
"ilskillrootgui",
"obj_id",
504 $this->node_object->skill_tree->getRootId());
505 $ilTabs->setBackTarget($lng->txt(
"obj_skmg"),
506 $ilCtrl->getLinkTargetByClass(
"ilskillrootgui",
"listSkills"));
507 $ilCtrl->setParameterByClass(
"ilskillrootgui",
"obj_id",
510 $ilTabs->activateTab($a_tab);
512 $tpl->setTitle($lng->txt(
"skmg_skill").
": ".
513 $this->node_object->getTitle());
519 $tpl->setTitle($lng->txt(
"skmg_skill"));
520 $tpl->setDescription(
"");
533 $ilTabs->activateTab(
"level_trigger");
542 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
547 if ($trigger[
"obj_id"] > 0)
553 $ne->setValue($lng->txt(
"skmg_no_trigger"));
555 $this->form->addItem($ne);
557 if ($trigger[
"obj_id"] > 0)
559 $this->form->addCommandButton(
"removeLevelTrigger", $lng->txt(
"skmg_remove_trigger"));
561 $this->form->addCommandButton(
"selectLevelTrigger", $lng->txt(
"skmg_select_trigger"));
563 $this->form->setTitle($lng->txt(
"skmg_skill_level_trigger"));
564 $this->form->setFormAction($ilCtrl->getFormAction($this));
566 $tpl->setContent($this->form->getHTML());
577 $ilTabs->activateTab(
"level_trigger");
579 include_once
'Services/Search/classes/class.ilSearchRootSelector.php';
581 $ilCtrl->getLinkTarget($this,
'showRepositorySelection'));
582 $exp->
setExpand(
$_GET[
"search_root_expand"] ?
$_GET[
"search_root_expand"] : $tree->readRootId());
583 $exp->setExpandTarget($ilCtrl->getLinkTarget($this,
'selectLevelTrigger'));
584 $exp->setTargetClass(get_class($this));
585 $exp->setCmd(
'saveLevelTrigger');
586 $exp->setClickableTypes(array(
"crs"));
590 $tpl->setContent($exp->getOutput());
602 $ilCtrl->redirect($this,
"editLevelTrigger");
613 $ilCtrl->redirect($this,
"editLevelTrigger");
628 $ilCtrl->setParameterByClass(
"ilskillrootgui",
"obj_id", (
int) $_GET[
"obj_id"]);
629 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listSkills");
648 $ilToolbar->addButton(
649 $lng->txt(
"skmg_add_resource"),
650 $ilCtrl->getLinkTarget($this,
"addLevelResource"));
653 $ilTabs->activateTab(
"level_resources");
655 include_once(
"./Services/Skill/classes/class.ilSkillLevelResourcesTableGUI.php");
657 $this->base_skill_id, $this->tref_id, (
int)
$_GET[
"level_id"]);
659 $tpl->setContent(
$tab->getHTML());
670 $ilTabs->activateTab(
"level_resources");
672 include_once(
"./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
674 $this,
"saveLevelResource",
"root_id");
675 if (!$exp->handleCommand())
677 $tpl->setContent($exp->getHTML());
692 include_once(
"./Services/Skill/classes/class.ilSkillResources.php");
694 $sres->setResourceAsImparting((
int)
$_GET[
"level_id"],
$ref_id);
700 $ilCtrl->redirect($this,
"showLevelResources");
711 $ilTabs->activateTab(
"level_resources");
713 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0)
716 $ilCtrl->redirect($this,
"showLevelResources");
720 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
722 $cgui->setFormAction($ilCtrl->getFormAction($this));
723 $cgui->setHeaderText($lng->txt(
"skmg_confirm_level_resources_removal"));
724 $cgui->setCancel($lng->txt(
"cancel"),
"showLevelResources");
725 $cgui->setConfirm($lng->txt(
"remove"),
"removeLevelResources");
727 foreach (
$_POST[
"id"] as $i)
730 $cgui->addItem(
"id[]", $i, $title);
733 $tpl->setContent($cgui->getHTML());
744 if (is_array(
$_POST[
"id"]))
746 include_once(
"./Services/Skill/classes/class.ilSkillResources.php");
748 foreach (
$_POST[
"id"] as $i)
750 $sres->setResourceAsImparting((
int)
$_GET[
"level_id"], $i,
false);
756 $ilCtrl->redirect($this,
"showLevelResources");