5include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeGUI.php");
6include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
65 $this->ctrl =
$DIC->ctrl();
66 $this->tpl =
$DIC[
"tpl"];
67 $this->tabs =
$DIC->tabs();
68 $this->
help = $DIC[
"ilHelp"];
69 $this->toolbar =
$DIC->toolbar();
70 $this->lng =
$DIC->language();
71 $this->tree =
$DIC->repositoryTree();
74 $ilCtrl->saveParameter($this, array(
"obj_id",
"level_id"));
75 $this->base_skill_id = $a_node_id;
98 $next_class =
$ilCtrl->getNextClass($this);
100 switch ($next_class) {
101 case "ilcertificategui":
103 $ilTabs->activateTab(
"level_certificate");
105 $skillLevelId = (int)
$_GET[
"level_id"];
108 new ilSkillCertificateAdapter($this->node_object, $skillLevelId),
111 $this->node_object->getId(),
112 ilCertificatePathConstants::SKILL_PATH . $this->node_object->getId() .
'/' . $skillLevelId
119 $ret = $this->$cmd();
134 $tpl->setContent(
"Properties");
149 $it->setTitle($this->form->getInput(
"title"));
150 $it->setDescription($this->form->getInput(
"description"));
151 $it->setOrderNr(
$tree->getMaxOrderNr((
int)
$_GET[
"obj_id"]) + 10);
152 $it->setStatus($this->form->getInput(
"status"));
153 $it->setSelfEvaluation(
$_POST[
"self_eval"]);
156 $this->node_object = $it;
169 $this->node_object->getId()
171 $ilCtrl->redirectByClass(
"ilbasicskillgui",
"edit");
183 $this->node_object->setTitle($this->form->getInput(
"title"));
184 $this->node_object->setDescription($this->form->getInput(
"description"));
185 $this->node_object->setSelfEvaluation(
$_POST[
"self_eval"]);
186 $this->node_object->setStatus(
$_POST[
"status"]);
187 $this->node_object->update();
206 $ilToolbar->addButton(
207 $lng->txt(
"skmg_add_level"),
208 $ilCtrl->getLinkTarget($this,
"addLevel")
213 include_once(
"./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
215 $tpl->setContent($table->getHTML());
228 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
233 $ti->setMaxLength(200);
235 $ti->setRequired(
true);
236 $this->form->addItem($ti);
241 $this->form->addItem($ta);
248 $cb->setInfo(
$lng->txt(
"skmg_selectable_info"));
249 $this->form->addItem($cb);
253 if ($a_mode ==
"create") {
254 $this->form->addCommandButton(
"save",
$lng->txt(
"save"));
255 $this->form->addCommandButton(
"cancelSave",
$lng->txt(
"cancel"));
256 $this->form->setTitle(
$lng->txt(
"skmg_create_skll"));
258 $this->form->addCommandButton(
"update",
$lng->txt(
"save"));
259 $this->form->setTitle(
$lng->txt(
"skmg_edit_skll"));
263 $ilCtrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
264 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
273 parent::editProperties();
291 $tpl->setContent($this->form->getHTML());
308 $tpl->setContent($this->form->getHTML());
325 if ($this->form->checkInput()) {
327 $this->node_object->addLevel(
328 $this->form->getInput(
"title"),
329 $this->form->getInput(
"description")
332 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
333 $ilCtrl->redirect($this,
"edit");
336 $this->form->setValuesByPost();
337 $tpl->setContent($this->form->getHtml());
354 if ($this->form->checkInput()) {
355 $this->node_object->writeLevelTitle(
356 (
int)
$_GET[
"level_id"],
357 $this->form->getInput(
"title")
359 $this->node_object->writeLevelDescription(
360 (
int)
$_GET[
"level_id"],
361 $this->form->getInput(
"description")
364 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
365 $ilCtrl->redirect($this,
"edit");
368 $this->form->setValuesByPost();
369 $tpl->setContent($this->form->getHtml());
383 $ilCtrl->saveParameter($this,
"level_id");
385 $ilTabs->activateTab(
"level_settings");
387 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
392 $ti->setMaxLength(200);
393 $ti->setRequired(
true);
394 $this->form->addItem($ti);
400 $this->form->addItem($ta);
404 if ($a_mode ==
"create") {
405 $this->form->addCommandButton(
"saveLevel",
$lng->txt(
"save"));
406 $this->form->addCommandButton(
"edit",
$lng->txt(
"cancel"));
407 $this->form->setTitle(
$lng->txt(
"skmg_new_level"));
409 $this->form->addCommandButton(
"updateLevel",
$lng->txt(
"save"));
410 $this->form->addCommandButton(
"edit",
$lng->txt(
"cancel"));
411 $this->form->setTitle(
$lng->txt(
"skmg_edit_level"));
415 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
425 $data = $this->node_object->getLevelData((
int)
$_GET[
"level_id"]);
426 $values[
"title"] =
$data[
"title"];
427 $values[
"description"] =
$data[
"description"];
428 $this->form->setValuesByArray($values);
444 $this->node_object->updateLevelOrder($order);
445 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
446 $ilCtrl->redirect($this,
"edit");
464 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
466 $ilCtrl->redirect($this,
"edit");
468 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
470 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
471 $cgui->setHeaderText(
$lng->txt(
"skmg_really_delete_levels"));
472 $cgui->setCancel(
$lng->txt(
"cancel"),
"edit");
473 $cgui->setConfirm(
$lng->txt(
"delete"),
"deleteLevel");
479 $tpl->setContent($cgui->getHTML());
495 if (is_array(
$_POST[
"id"])) {
496 foreach (
$_POST[
"id"] as $id) {
497 $this->node_object->deleteLevel((
int) $id);
499 $this->node_object->fixLevelNumbering();
501 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
502 $ilCtrl->redirect($this,
"edit");
517 $ilTabs->clearTargets();
518 $ilHelp->setScreenIdComponent(
"skmg_lev");
520 $ilTabs->setBackTarget(
522 $ilCtrl->getLinkTarget($this,
"edit")
525 if (
$_GET[
"level_id"] > 0) {
528 $lng->txt(
"settings"),
529 $ilCtrl->getLinkTarget($this,
"editLevel")
538 $lng->txt(
"skmg_resources"),
539 $ilCtrl->getLinkTarget($this,
"showLevelResources")
548 if (
$_GET[
"level_id"] > 0) {
549 $tpl->setTitle(
$lng->txt(
"skmg_skill_level") .
": " .
552 $tpl->setTitle(
$lng->txt(
"skmg_skill_level"));
555 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
557 $path =
$tree->getPathFull($this->node_object->getId());
559 foreach ($path as $p) {
560 if (in_array($p[
"type"], array(
"scat",
"skll"))) {
561 $desc .= $sep . $p[
"title"];
565 $tpl->setDescription($desc);
581 $ilTabs->clearTargets();
582 $ilHelp->setScreenIdComponent(
"skmg_skll");
586 if (is_object($this->node_object)) {
591 $lng->txt(
"skmg_skill_levels"),
592 $ilCtrl->getLinkTarget($this,
'edit')
598 $lng->txt(
"settings"),
599 $ilCtrl->getLinkTarget($this,
'editProperties')
608 $this->node_object->skill_tree->getRootId()
610 $ilTabs->setBackTarget(
611 $lng->txt(
"obj_skmg"),
612 $ilCtrl->getLinkTargetByClass(
"ilskillrootgui",
"listSkills")
620 $ilTabs->activateTab($a_tab);
622 $tpl->setTitle(
$lng->txt(
"skmg_skill") .
": " .
623 $this->node_object->getTitle());
627 $tpl->setTitle(
$lng->txt(
"skmg_skill"));
628 $tpl->setDescription(
"");
630 parent::setTitleIcon();
644 $ilTabs->activateTab(
"level_trigger");
646 $trigger = ilBasicSkill::lookupLevelTrigger((
int)
$_GET[
"level_id"]);
652 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
657 if ($trigger[
"obj_id"] > 0) {
660 $ne->setValue(
$lng->txt(
"skmg_no_trigger"));
662 $this->form->addItem($ne);
664 if ($trigger[
"obj_id"] > 0) {
665 $this->form->addCommandButton(
"removeLevelTrigger",
$lng->txt(
"skmg_remove_trigger"));
667 $this->form->addCommandButton(
"selectLevelTrigger",
$lng->txt(
"skmg_select_trigger"));
669 $this->form->setTitle(
$lng->txt(
"skmg_skill_level_trigger"));
670 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
672 $tpl->setContent($this->form->getHTML());
691 $ilTabs->activateTab(
"level_trigger");
693 include_once
'Services/Search/classes/class.ilSearchRootSelector.php';
695 $ilCtrl->getLinkTarget($this,
'showRepositorySelection')
697 $exp->setExpand(
$_GET[
"search_root_expand"] ?
$_GET[
"search_root_expand"] :
$tree->readRootId());
698 $exp->setExpandTarget(
$ilCtrl->getLinkTarget($this,
'selectLevelTrigger'));
699 $exp->setTargetClass(get_class($this));
700 $exp->setCmd(
'saveLevelTrigger');
701 $exp->setClickableTypes(array(
"crs"));
705 $tpl->setContent($exp->getOutput());
719 ilBasicSkill::writeLevelTrigger((
int)
$_GET[
"level_id"], (
int)
$_GET[
"root_id"]);
720 $ilCtrl->redirect($this,
"editLevelTrigger");
730 ilBasicSkill::writeLevelTrigger((
int)
$_GET[
"level_id"], 0);
731 $ilCtrl->redirect($this,
"editLevelTrigger");
745 $ilCtrl->setParameterByClass(
"ilskillrootgui",
"obj_id", (
int)
$_GET[
"obj_id"]);
746 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listSkills");
750 parent::redirectToParent();
770 $ilToolbar->addButton(
771 $lng->txt(
"skmg_add_resource"),
772 $ilCtrl->getLinkTarget($this,
"addLevelResource")
777 $ilTabs->activateTab(
"level_resources");
779 include_once(
"./Services/Skill/classes/class.ilSkillLevelResourcesTableGUI.php");
782 "showLevelResources",
783 $this->base_skill_id,
785 (
int)
$_GET[
"level_id"],
804 $ilTabs->activateTab(
"level_resources");
806 include_once(
"./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
814 if (!$exp->handleCommand()) {
815 $tpl->setContent($exp->getHTML());
834 include_once(
"./Services/Skill/classes/class.ilSkillResources.php");
836 $sres->setResourceAsImparting((
int)
$_GET[
"level_id"],
$ref_id);
839 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
842 $ilCtrl->redirect($this,
"showLevelResources");
860 $ilTabs->activateTab(
"level_resources");
862 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
864 $ilCtrl->redirect($this,
"showLevelResources");
866 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
868 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
869 $cgui->setHeaderText(
$lng->txt(
"skmg_confirm_level_resources_removal"));
870 $cgui->setCancel(
$lng->txt(
"cancel"),
"showLevelResources");
871 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeLevelResources");
875 $cgui->addItem(
"id[]",
$i, $title);
878 $tpl->setContent($cgui->getHTML());
894 if (is_array(
$_POST[
"id"])) {
895 include_once(
"./Services/Skill/classes/class.ilSkillResources.php");
898 $sres->setResourceAsImparting((
int)
$_GET[
"level_id"],
$i,
false);
899 $sres->setResourceAsTrigger((
int)
$_GET[
"level_id"],
$i,
false);
902 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
905 $ilCtrl->redirect($this,
"showLevelResources");
918 include_once(
"./Services/Skill/classes/class.ilSkillResources.php");
921 foreach ($resources->getResourcesOfLevel((
int)
$_GET[
"level_id"]) as $r) {
923 if (is_array(
$_POST[
"suggested"]) && isset(
$_POST[
"suggested"][$r[
"rep_ref_id"]]) &&
$_POST[
"suggested"][$r[
"rep_ref_id"]]) {
927 if (is_array(
$_POST[
"trigger"]) && isset(
$_POST[
"trigger"][$r[
"rep_ref_id"]]) &&
$_POST[
"trigger"][$r[
"rep_ref_id"]]) {
930 $resources->setResourceAsImparting((
int)
$_GET[
"level_id"], $r[
"rep_ref_id"], $imparting);
931 $resources->setResourceAsTrigger((
int)
$_GET[
"level_id"], $r[
"rep_ref_id"], $trigger);
935 $ilCtrl->redirect($this,
"showLevelResources");
An exception for terminatinating execution or to throw for unit testing.
removeLevelTrigger()
Remove trigger.
saveResourceSettings()
Save resource settings.
updateLevel()
Update level form.
confirmLevelDeletion()
Confirm level deletion.
selectLevelTrigger()
Select skill level trigger.
initLevelForm($a_mode="edit")
Init level form.
getLevelValues()
Get current values for level from.
initForm($a_mode="edit")
Init form.
removeLevelResources()
Remove level resource.
setLevelHead()
Set header for level.
setTabs($a_tab="levels")
Set header for skill.
confirmLevelResourcesRemoval()
Confirm level resources removal.
addLevelResource()
Add level resource.
executeCommand()
Execute command.
saveLevel()
Save level form.
saveLevelResource()
Save level resource.
deleteLevel()
Delete levels.
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
showProperties()
Show properties.
updateLevelOrder()
Update level order.
saveLevelTrigger()
Save level trigger.
editProperties()
Edit properties.
showLevelResources()
Show level resources.
editLevelTrigger()
Edit level trigger.
__construct($a_node_id=0)
Constructor.
static lookupLevelTitle($a_id)
Lookup level title.
GUI class to create PDF certificates.
Confirmation screen class.
Collection of basic placeholder values that can be used.
Collection of basic placeholder values that can be used.
This class represents a non editable value in a property form.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _isInTrash($a_ref_id)
checks wether object is in trash
static _lookupType($a_id, $a_reference=false)
lookup object type
Explorer for selecting repository items.
TableGUI class for skill level resources.
Manages resources for skills.
Basic GUI class for skill tree nodes.
setSkillNodeDescription()
Set skill node description.
addUsageTab($a_tabs)
Add usage tab.
addStatusInput(ilPropertyFormGUI $a_form)
Add status input.
checkPermissionBool($a_perm)
Check permission pool.
setLocator()
Set Locator Items.
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.
static _lookupType($a_obj_id)
Lookup Type.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc