609 $skill_tree = $this->skill_tree_factory->getTreeById($this->
getSkillTreeId());
611 $tree_node_manager = $this->skill_manager->getTreeNodeManager($this->
getSkillTreeId());
619 if ($a_rec[
"TopNode"] == 1) {
624 $parent = (
int) $a_mapping->
getMapping(
"Services/Skill",
"skl_tree", $a_rec[
"Parent"]);
625 $status = (
int) $a_rec[
"Status"];
626 $order = (
int) $a_rec[
"OrderNr"];
628 switch ($a_rec[
"Type"]) {
631 $scat->setTitle($a_rec[
"Title"]);
632 $scat->setDescription($a_rec[
"Description"] ??
"");
633 $scat->setImportId(
"il_" . $source_inst_id .
"_scat_" . $a_rec[
"Child"]);
634 $scat->setSelfEvaluation((
bool) $a_rec[
"SelfEval"]);
635 $scat->setOrderNr($order);
636 $scat->setStatus($status);
638 $tree_node_manager->putIntoTree($scat, $parent);
639 $a_mapping->
addMapping(
"Services/Skill",
"skl_tree", $a_rec[
"Child"], $scat->getId());
644 $skll->setTitle($a_rec[
"Title"]);
645 $skll->setDescription($a_rec[
"Description"] ??
"");
646 $skll->setImportId(
"il_" . $source_inst_id .
"_skll_" . $a_rec[
"Child"]);
647 $skll->setSelfEvaluation((
bool) $a_rec[
"SelfEval"]);
648 $skll->setOrderNr($order);
649 $skll->setStatus($status);
651 $tree_node_manager->putIntoTree($skll, $parent);
652 $a_mapping->
addMapping(
"Services/Skill",
"skl_tree", $a_rec[
"Child"], $skll->getId());
656 $template_id = (
int) $a_mapping->
getMapping(
"Services/Skill",
"skl_tree", $a_rec[
"TemplateId"]);
658 if ($template_id > 0) {
660 $sktr->setTitle($a_rec[
"Title"]);
661 $sktr->setDescription($a_rec[
"Description"] ??
"");
662 $sktr->setImportId(
"il_" . $source_inst_id .
"_sktr_" . $a_rec[
"Child"]);
663 $sktr->setSelfEvaluation((
bool) $a_rec[
"SelfEval"]);
664 $sktr->setOrderNr($order);
665 $sktr->setSkillTemplateId($template_id);
666 $sktr->setStatus($status);
668 $tree_node_manager->putIntoTree($sktr, $parent);
669 $a_mapping->
addMapping(
"Services/Skill",
"skl_tree", $a_rec[
"Child"], $sktr->getId());
676 case "skl_templ_subtree":
677 if ($a_rec[
"TopNode"] == 1) {
681 $parent = (
int) $a_mapping->
getMapping(
"Services/Skill",
"skl_tree", $a_rec[
"Parent"]);
682 $order = (
int) $a_rec[
"OrderNr"];
684 switch ($a_rec[
"Type"]) {
687 $sctp->setTitle($a_rec[
"Title"]);
688 $sctp->setDescription($a_rec[
"Description"] ??
"");
689 $sctp->setImportId(
"il_" . $source_inst_id .
"_sctp_" . $a_rec[
"Child"]);
690 $sctp->setOrderNr($order);
692 $tree_node_manager->putIntoTree($sctp, $parent);
693 $a_mapping->
addMapping(
"Services/Skill",
"skl_tree", $a_rec[
"Child"], $sctp->getId());
698 $sktp->setTitle($a_rec[
"Title"]);
699 $sktp->setDescription($a_rec[
"Description"] ??
"");
700 $sktp->setImportId(
"il_" . $source_inst_id .
"_sktp_" . $a_rec[
"Child"]);
701 $sktp->setOrderNr($order);
703 $tree_node_manager->putIntoTree($sktp, $parent);
704 $a_mapping->
addMapping(
"Services/Skill",
"skl_tree", $a_rec[
"Child"], $sktp->getId());
710 $skill_id = (
int) $a_mapping->
getMapping(
"Services/Skill",
"skl_tree", $a_rec[
"SkillId"]);
712 if (in_array(
$type, array(
"skll",
"sktp"))) {
713 if (
$type ==
"skll") {
718 $skill->addLevel($a_rec[
"Title"], $a_rec[
"Description"],
"il_" . $source_inst_id .
"_sklv_" . $a_rec[
"LevelId"]);
724 $profile = $this->skill_factory->profile(
727 $a_rec[
"Description"] ??
"",
730 $new_profile = $this->skill_manager->getProfileManager()->createProfile($profile);
732 $a_mapping->
addMapping(
"Services/Skill",
"skl_prof", $a_rec[
"Id"], $new_profile->getId());
735 case "skl_local_prof":
736 $profile = $this->skill_factory->profile(
739 $a_rec[
"Description"] ??
"",
744 $new_profile = $this->skill_manager->getProfileManager()->createProfile($profile);
746 $a_mapping->
addMapping(
"Services/Skill",
"skl_local_prof", $a_rec[
"Id"], $new_profile->getId());
749 case "skl_prof_level":
750 $profile_id = (
int) $a_mapping->
getMapping(
"Services/Skill",
"skl_prof", $a_rec[
"ProfileId"])
751 ? (
int) $a_mapping->
getMapping(
"Services/Skill",
"skl_prof", $a_rec[
"ProfileId"])
752 : (
int) $a_mapping->
getMapping(
"Services/Skill",
"skl_local_prof", $a_rec[
"ProfileId"]);
753 if ($profile_id > 0) {
754 $prof = $this->skill_manager->getProfileManager()->getById($profile_id);
757 $level_id = $tref_id = $base_skill = 0;
758 foreach ($level_id_data as $l) {
760 foreach ($skill_data as $s) {
764 $level_id = $l[
"level_id"];
765 $base_skill = $s[
"skill_id"];
766 $tref_id = $s[
"tref_id"];
771 $prof->addSkillLevel($base_skill, $tref_id, $level_id, $a_rec[
"OrderNr"]);
773 $this->skill_manager->getProfileManager()->updateProfile($prof);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupLevelSkillId(int $a_id)
static getCommonSkillIdForImportId(int $a_source_inst_id, int $a_skill_import_id, int $a_tref_import_id=0)
addMapping(string $a_comp, string $a_entity, string $a_old_id, string $a_new_id)
static _lookupType(int $a_obj_id)
int $init_templ_top_order_nr
getMapping(string $a_comp, string $a_entity, string $a_old_id)
getCurrentInstallationId()
static getLevelIdForImportId(int $a_source_inst_id, int $a_level_import_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...