603 $skill_tree = $this->skill_tree_factory->getTreeById($this->
getSkillTreeId());
605 $tree_node_manager = $this->skill_manager->getTreeNodeManager($this->
getSkillTreeId());
613 if ((
int) $a_rec[
"TopNode"] === 1) {
618 $parent = (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Parent"]);
619 $status = (
int) $a_rec[
"Status"];
620 $order = (
int) $a_rec[
"OrderNr"];
622 switch ($a_rec[
"Type"]) {
625 $scat->setTitle($a_rec[
"Title"]);
626 $scat->setDescription($a_rec[
"Description"] ??
"");
627 $scat->setImportId(
"il_" . $source_inst_id .
"_scat_" . $a_rec[
"Child"]);
628 $scat->setSelfEvaluation((
bool) $a_rec[
"SelfEval"]);
629 $scat->setOrderNr($order);
630 $scat->setStatus($status);
632 $tree_node_manager->putIntoTree($scat, $parent);
633 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Child"], (
string) $scat->getId());
638 $skll->setTitle($a_rec[
"Title"]);
639 $skll->setDescription($a_rec[
"Description"] ??
"");
640 $skll->setImportId(
"il_" . $source_inst_id .
"_skll_" . $a_rec[
"Child"]);
641 $skll->setSelfEvaluation((
bool) $a_rec[
"SelfEval"]);
642 $skll->setOrderNr($order);
643 $skll->setStatus($status);
645 $tree_node_manager->putIntoTree($skll, $parent);
646 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Child"], (
string) $skll->getId());
650 $template_id = (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"TemplateId"]);
652 if ($template_id > 0) {
654 $sktr->setTitle($a_rec[
"Title"]);
655 $sktr->setDescription($a_rec[
"Description"] ??
"");
656 $sktr->setImportId(
"il_" . $source_inst_id .
"_sktr_" . $a_rec[
"Child"]);
657 $sktr->setSelfEvaluation((
bool) $a_rec[
"SelfEval"]);
658 $sktr->setOrderNr($order);
659 $sktr->setSkillTemplateId($template_id);
660 $sktr->setStatus($status);
662 $tree_node_manager->putIntoTree($sktr, $parent);
663 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Child"], (
string) $sktr->getId());
669 case "skl_templ_subtree":
670 if ((
int) $a_rec[
"TopNode"] === 1) {
674 $parent = (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Parent"]);
675 $order = (
int) $a_rec[
"OrderNr"];
677 switch ($a_rec[
"Type"]) {
680 $sctp->setTitle($a_rec[
"Title"]);
681 $sctp->setDescription($a_rec[
"Description"] ??
"");
682 $sctp->setImportId(
"il_" . $source_inst_id .
"_sctp_" . $a_rec[
"Child"]);
683 $sctp->setOrderNr($order);
685 $tree_node_manager->putIntoTree($sctp, $parent);
686 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Child"], (
string) $sctp->getId());
691 $sktp->setTitle($a_rec[
"Title"]);
692 $sktp->setDescription($a_rec[
"Description"] ??
"");
693 $sktp->setImportId(
"il_" . $source_inst_id .
"_sktp_" . $a_rec[
"Child"]);
694 $sktp->setOrderNr($order);
696 $tree_node_manager->putIntoTree($sktp, $parent);
697 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"Child"], (
string) $sktp->getId());
703 $skill_id = (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_tree", $a_rec[
"SkillId"]);
705 if (in_array($type, array(
"skll",
"sktp"))) {
706 if ($type ==
"skll") {
711 $skill->addLevel($a_rec[
"Title"], $a_rec[
"Description"],
"il_" . $source_inst_id .
"_sklv_" . $a_rec[
"LevelId"]);
717 $profile = $this->skill_factory->profile()->profile(
720 $a_rec[
"Description"] ??
"",
723 $new_profile = $this->skill_manager->getProfileManager()->createProfile($profile);
725 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_prof", $a_rec[
"Id"], (
string) $new_profile->getId());
728 case "skl_local_prof":
729 $profile = $this->skill_factory->profile()->profile(
732 $a_rec[
"Description"] ??
"",
735 (
int) $a_rec[
"RefId"]
737 $new_profile = $this->skill_manager->getProfileManager()->createProfile($profile);
739 $a_mapping->
addMapping(
"components/ILIAS/Skill",
"skl_local_prof", $a_rec[
"Id"], (
string) $new_profile->getId());
742 case "skl_prof_level":
743 $profile_id = (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_prof", $a_rec[
"ProfileId"])
744 ? (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_prof", $a_rec[
"ProfileId"])
745 : (
int) $a_mapping->
getMapping(
"components/ILIAS/Skill",
"skl_local_prof", $a_rec[
"ProfileId"]);
746 if ($profile_id > 0) {
749 $level_id = $tref_id = $base_skill = 0;
750 foreach ($level_id_data as $l) {
752 foreach ($skill_data as $s) {
756 $level_id = $l[
"level_id"];
757 $base_skill = $s[
"skill_id"];
758 $tref_id = $s[
"tref_id"];
763 $level = $this->skill_factory->profile()->profileLevel(
768 (
int) $a_rec[
"OrderNr"]
770 $this->skill_manager->getProfileManager()->addSkillLevel($level);
Skill Template Reference.
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)