5 include_once(
"./Services/Skill/classes/class.ilSkillTreeNodeGUI.php");
6 include_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;
77 parent::__construct($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"];
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->setOrderNr(
$tree->getMaxOrderNr((
int)
$_GET[
"obj_id"]) + 10);
151 $it->setStatus($this->form->getInput(
"status"));
152 $it->setSelfEvaluation(
$_POST[
"self_eval"]);
155 $this->node_object = $it;
168 $this->node_object->getId()
170 $ilCtrl->redirectByClass(
"ilbasicskillgui",
"edit");
182 $this->node_object->setTitle($this->form->getInput(
"title"));
183 $this->node_object->setSelfEvaluation(
$_POST[
"self_eval"]);
184 $this->node_object->setStatus(
$_POST[
"status"]);
185 $this->node_object->update();
204 $ilToolbar->addButton(
205 $lng->txt(
"skmg_add_level"),
206 $ilCtrl->getLinkTarget($this,
"addLevel")
211 include_once(
"./Services/Skill/classes/class.ilSkillLevelTableGUI.php");
226 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
233 $ti->setRequired(
true);
234 $this->form->addItem($ti);
243 $this->form->addItem($cb);
247 if ($a_mode ==
"create") {
248 $this->form->addCommandButton(
"save",
$lng->txt(
"save"));
249 $this->form->addCommandButton(
"cancelSave",
$lng->txt(
"cancel"));
250 $this->form->setTitle(
$lng->txt(
"skmg_create_skll"));
252 $this->form->addCommandButton(
"update",
$lng->txt(
"save"));
253 $this->form->setTitle(
$lng->txt(
"skmg_edit_skll"));
257 $ilCtrl->setParameter($this,
"obj_id",
$_GET[
"obj_id"]);
258 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
267 parent::editProperties();
285 $tpl->setContent($this->form->getHTML());
302 $tpl->setContent($this->form->getHTML());
319 if ($this->form->checkInput()) {
321 $this->node_object->addLevel(
322 $this->form->getInput(
"title"),
323 $this->form->getInput(
"description")
326 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
327 $ilCtrl->redirect($this,
"edit");
330 $this->form->setValuesByPost();
331 $tpl->setContent($this->form->getHtml());
348 if ($this->form->checkInput()) {
349 $this->node_object->writeLevelTitle(
350 (
int)
$_GET[
"level_id"],
351 $this->form->getInput(
"title")
353 $this->node_object->writeLevelDescription(
354 (
int) $_GET[
"level_id"],
355 $this->form->getInput(
"description")
358 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
359 $ilCtrl->redirect($this,
"edit");
362 $this->form->setValuesByPost();
363 $tpl->setContent($this->form->getHtml());
377 $ilCtrl->saveParameter($this,
"level_id");
379 $ilTabs->activateTab(
"level_settings");
381 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
387 $ti->setRequired(
true);
388 $this->form->addItem($ti);
394 $this->form->addItem($ta);
398 if ($a_mode ==
"create") {
399 $this->form->addCommandButton(
"saveLevel",
$lng->txt(
"save"));
400 $this->form->addCommandButton(
"edit",
$lng->txt(
"cancel"));
401 $this->form->setTitle(
$lng->txt(
"skmg_new_level"));
403 $this->form->addCommandButton(
"updateLevel",
$lng->txt(
"save"));
404 $this->form->addCommandButton(
"edit",
$lng->txt(
"cancel"));
405 $this->form->setTitle(
$lng->txt(
"skmg_edit_level"));
409 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
419 $data = $this->node_object->getLevelData((
int)
$_GET[
"level_id"]);
422 $this->form->setValuesByArray(
$values);
438 $this->node_object->updateLevelOrder($order);
439 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
440 $ilCtrl->redirect($this,
"edit");
458 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
460 $ilCtrl->redirect($this,
"edit");
462 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
464 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
465 $cgui->setHeaderText(
$lng->txt(
"skmg_really_delete_levels"));
466 $cgui->setCancel(
$lng->txt(
"cancel"),
"edit");
467 $cgui->setConfirm(
$lng->txt(
"delete"),
"deleteLevel");
473 $tpl->setContent($cgui->getHTML());
489 if (is_array(
$_POST[
"id"])) {
491 $this->node_object->deleteLevel((
int) $id);
493 $this->node_object->fixLevelNumbering();
495 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
496 $ilCtrl->redirect($this,
"edit");
511 $ilTabs->clearTargets();
512 $ilHelp->setScreenIdComponent(
"skmg_lev");
514 $ilTabs->setBackTarget(
516 $ilCtrl->getLinkTarget($this,
"edit")
519 if (
$_GET[
"level_id"] > 0) {
522 $lng->txt(
"settings"),
523 $ilCtrl->getLinkTarget($this,
"editLevel")
532 $lng->txt(
"skmg_resources"),
533 $ilCtrl->getLinkTarget($this,
"showLevelResources")
542 if (
$_GET[
"level_id"] > 0) {
543 $tpl->setTitle(
$lng->txt(
"skmg_skill_level") .
": " .
546 $tpl->setTitle(
$lng->txt(
"skmg_skill_level"));
549 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
551 $path =
$tree->getPathFull($this->node_object->getId());
553 foreach (
$path as $p) {
554 if (in_array($p[
"type"], array(
"scat",
"skll"))) {
555 $desc .= $sep . $p[
"title"];
559 $tpl->setDescription($desc);
575 $ilTabs->clearTargets();
576 $ilHelp->setScreenIdComponent(
"skmg_skll");
580 if (is_object($this->node_object)) {
585 $lng->txt(
"skmg_skill_levels"),
586 $ilCtrl->getLinkTarget($this,
'edit')
592 $lng->txt(
"settings"),
593 $ilCtrl->getLinkTarget($this,
'editProperties')
602 $this->node_object->skill_tree->getRootId()
604 $ilTabs->setBackTarget(
605 $lng->txt(
"obj_skmg"),
606 $ilCtrl->getLinkTargetByClass(
"ilskillrootgui",
"listSkills")
614 $ilTabs->activateTab($a_tab);
616 $tpl->setTitle(
$lng->txt(
"skmg_skill") .
": " .
617 $this->node_object->getTitle());
621 $tpl->setTitle(
$lng->txt(
"skmg_skill"));
622 $tpl->setDescription(
"");
624 parent::setTitleIcon();
638 $ilTabs->activateTab(
"level_trigger");
640 $trigger = ilBasicSkill::lookupLevelTrigger((
int)
$_GET[
"level_id"]);
646 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
651 if ($trigger[
"obj_id"] > 0) {
654 $ne->setValue(
$lng->txt(
"skmg_no_trigger"));
656 $this->form->addItem($ne);
658 if ($trigger[
"obj_id"] > 0) {
659 $this->form->addCommandButton(
"removeLevelTrigger",
$lng->txt(
"skmg_remove_trigger"));
661 $this->form->addCommandButton(
"selectLevelTrigger",
$lng->txt(
"skmg_select_trigger"));
663 $this->form->setTitle(
$lng->txt(
"skmg_skill_level_trigger"));
664 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
666 $tpl->setContent($this->form->getHTML());
685 $ilTabs->activateTab(
"level_trigger");
687 include_once
'Services/Search/classes/class.ilSearchRootSelector.php';
689 $ilCtrl->getLinkTarget($this,
'showRepositorySelection')
692 $exp->setExpandTarget(
$ilCtrl->getLinkTarget($this,
'selectLevelTrigger'));
693 $exp->setTargetClass(get_class($this));
694 $exp->setCmd(
'saveLevelTrigger');
695 $exp->setClickableTypes(array(
"crs"));
699 $tpl->setContent($exp->getOutput());
713 ilBasicSkill::writeLevelTrigger((
int)
$_GET[
"level_id"], (
int) $_GET[
"root_id"]);
714 $ilCtrl->redirect($this,
"editLevelTrigger");
724 ilBasicSkill::writeLevelTrigger((
int)
$_GET[
"level_id"], 0);
725 $ilCtrl->redirect($this,
"editLevelTrigger");
739 $ilCtrl->setParameterByClass(
"ilskillrootgui",
"obj_id", (
int) $_GET[
"obj_id"]);
740 $ilCtrl->redirectByClass(
"ilskillrootgui",
"listSkills");
744 parent::redirectToParent();
764 $ilToolbar->addButton(
765 $lng->txt(
"skmg_add_resource"),
766 $ilCtrl->getLinkTarget($this,
"addLevelResource")
771 $ilTabs->activateTab(
"level_resources");
773 include_once(
"./Services/Skill/classes/class.ilSkillLevelResourcesTableGUI.php");
776 "showLevelResources",
777 $this->base_skill_id,
779 (
int)
$_GET[
"level_id"],
798 $ilTabs->activateTab(
"level_resources");
800 include_once(
"./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
808 if (!$exp->handleCommand()) {
809 $tpl->setContent($exp->getHTML());
828 include_once(
"./Services/Skill/classes/class.ilSkillResources.php");
830 $sres->setResourceAsImparting((
int)
$_GET[
"level_id"],
$ref_id);
833 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
836 $ilCtrl->redirect($this,
"showLevelResources");
854 $ilTabs->activateTab(
"level_resources");
856 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
858 $ilCtrl->redirect($this,
"showLevelResources");
860 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
862 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
863 $cgui->setHeaderText(
$lng->txt(
"skmg_confirm_level_resources_removal"));
864 $cgui->setCancel(
$lng->txt(
"cancel"),
"showLevelResources");
865 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeLevelResources");
869 $cgui->addItem(
"id[]", $i,
$title);
872 $tpl->setContent($cgui->getHTML());
888 if (is_array(
$_POST[
"id"])) {
889 include_once(
"./Services/Skill/classes/class.ilSkillResources.php");
892 $sres->setResourceAsImparting((
int)
$_GET[
"level_id"], $i,
false);
893 $sres->setResourceAsTrigger((
int) $_GET[
"level_id"], $i,
false);
896 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
899 $ilCtrl->redirect($this,
"showLevelResources");
912 include_once(
"./Services/Skill/classes/class.ilSkillResources.php");
915 foreach ($resources->getResourcesOfLevel((
int)
$_GET[
"level_id"]) as
$r) {
917 if (is_array(
$_POST[
"suggested"]) && isset(
$_POST[
"suggested"][
$r[
"rep_ref_id"]]) &&
$_POST[
"suggested"][$r[
"rep_ref_id"]]) {
921 if (is_array(
$_POST[
"trigger"]) && isset(
$_POST[
"trigger"][$r[
"rep_ref_id"]]) &&
$_POST[
"trigger"][$r[
"rep_ref_id"]]) {
924 $resources->setResourceAsImparting((
int) $_GET[
"level_id"], $r[
"rep_ref_id"], $imparting);
925 $resources->setResourceAsTrigger((
int) $_GET[
"level_id"], $r[
"rep_ref_id"], $trigger);
929 $ilCtrl->redirect($this,
"showLevelResources");
saveLevelTrigger()
Save level trigger.
redirectToParent($a_tmp_mode=false)
Redirect to parent (identified by current obj_id)
addUsageTab($a_tabs)
Add usage tab.
Collection of basic placeholder values that can be used.
setValue($a_value)
Set Value.
Explorer for selecting repository items.
setSkillNodeDescription()
Set skill node description.
static lookupLevelTitle($a_id)
Lookup level title.
setLocator()
Set Locator Items.
editProperties()
Edit properties.
static putInTree($a_obj, $a_parent_id="", $a_target_node_id="")
Put this object into the skill tree.
if(!array_key_exists('StateId', $_REQUEST)) $id
static _isInTrash($a_ref_id)
checks wether object is in trash
setTabs($a_tab="levels")
Set header for skill.
saveResourceSettings()
Save resource settings.
removeLevelTrigger()
Remove trigger.
static _lookupTitle($a_id)
lookup object title
saveLevelResource()
Save level resource.
static _lookupType($a_obj_id)
Lookup Type.
checkPermissionBool($a_perm)
Check permission pool.
removeLevelResources()
Remove level resource.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
__construct($a_node_id=0)
Constructor.
executeCommand()
Execute command.
Basic GUI class for skill tree nodes.
confirmLevelDeletion()
Confirm level deletion.
static _lookupObjId($a_id)
Manages resources for skills.
confirmLevelResourcesRemoval()
Confirm level resources removal.
This class represents a text property in a property form.
setCols($a_cols)
Set Cols.
GUI class to create PDF certificates.
editLevelTrigger()
Edit level trigger.
TableGUI class for skill level resources.
setMaxLength($a_maxlength)
Set Max Length.
static _lookupType($a_id, $a_reference=false)
lookup object type
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
showProperties()
Show properties.
saveLevel()
Save level form.
updateLevel()
Update level form.
setLevelHead()
Set header for level.
This class represents a non editable value in a property form.
Skill certificate adapter.
initForm($a_mode="edit")
Init form.
This class represents a text area property in a property form.
updateLevelOrder()
Update level order.
Collection of basic placeholder values that can be used.
getLevelValues()
Get current values for level from.
initLevelForm($a_mode="edit")
Init level form.
if(empty($password)) $table
showLevelResources()
Show level resources.
selectLevelTrigger()
Select skill level trigger.
addLevelResource()
Add level resource.
addStatusInput(ilPropertyFormGUI $a_form)
Add status input.
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
deleteLevel()
Delete levels.
Confirmation screen class.