19declare(strict_types=1);
35use Psr\Http\Message\ServerRequestInterface;
171 $this->
ctrl = $DIC->ctrl();
172 $this->
lng = $DIC->language();
173 $this->
help = $DIC[
"ilHelp"];
174 $this->setting =
$DIC[
"ilSetting"];
175 $this->
user = $DIC->user();
176 $this->tpl =
$DIC[
"tpl"];
177 $this->
tabs = $DIC->tabs();
178 $this->
toolbar = $DIC->toolbar();
179 $this->
access = $DIC->access();
180 $this->ui_fac =
$DIC->ui()->factory();
181 $this->ui_ren =
$DIC->ui()->renderer();
182 $this->request =
$DIC->http()->request();
183 $this->
ui = $DIC->ui();
184 $this->storage =
$DIC->resourceStorage();
185 $this->data_fac = new \ILIAS\Data\Factory();
186 $this->tree =
$DIC->repositoryTree();
187 $this->obj_definition =
$DIC[
"objDefinition"];
188 $this->personal_gui_request =
$DIC->skills()->internal()->gui()->personal_request();
189 $this->tree_repo =
$DIC->skills()->internal()->repo()->getTreeRepo();
190 $this->level_repo =
$DIC->skills()->internal()->repo()->getLevelRepo();
191 $this->tree_service =
$DIC->skills()->tree();
192 $this->internal_manager =
$DIC->skills()->internal()->manager();
193 $this->profile_manager = $this->internal_manager->getProfileManager();
194 $this->profile_completion_manager = $this->internal_manager->getProfileCompletionManager();
195 $this->personal_manager = $this->internal_manager->getPersonalSkillManager();
196 $this->assigned_material_manager = $this->internal_manager->getAssignedMaterialManager();
197 $this->self_evaluation_manager = $this->internal_manager->getSelfEvaluationManager();
198 $this->resource_manager = $this->internal_manager->getResourceManager();
199 $this->table_manager = $this->internal_manager->getTableManager();
200 $this->cont_factory_service =
$DIC->skills()->internalContainer()->factory();
209 $ilHelp->setScreenIdComponent(
"skill");
211 $ilCtrl->saveParameter($this,
"skill_id");
212 $ilCtrl->saveParameter($this,
"tref_id");
213 $ilCtrl->saveParameter($this,
"profile_id");
214 $ilCtrl->saveParameter($this,
"list_mode");
216 $this->requested_list_mode = $this->personal_gui_request->getListMode();
217 $this->requested_node_id = $this->personal_gui_request->getNodeId();
218 $this->requested_profile_id = $this->personal_gui_request->getProfileId();
219 $this->requested_skill_id = $this->personal_gui_request->getSkillId();
220 $this->requested_skill_ids = $this->personal_gui_request->getSkillIds();
221 $this->requested_basic_skill_id = $this->personal_gui_request->getBasicSkillId();
222 $this->requested_tref_id = $this->personal_gui_request->getTrefId();
223 $this->requested_level_id = $this->personal_gui_request->getLevelId();
224 $this->requested_wsp_ids = $this->personal_gui_request->getWorkspaceIds();
225 $this->requested_table_assign_materials_action = $this->personal_gui_request->getTableAssignMaterialsAction();
226 $this->requested_table_assign_materials_level_ids = $this->personal_gui_request->getTableAssignMaterialsLevelIds();
227 $this->requested_table_assign_materials_wsp_id = $this->personal_gui_request->getTableAssignMaterialsWorkspaceId();
229 $this->user_profiles = $this->profile_manager->getProfilesOfUser($this->
user->getId());
230 $this->cont_profiles = [];
232 $this->use_materials = !
$ilSetting->get(
"disable_personal_workspace");
246 $this->profile_id = $a_val;
259 $this->gap_self_eval_levels = $a_val;
272 $this->history_view = $a_val;
282 return ($this->mode ==
"gap" && !$this->history_view);
308 public function hideSkill(
int $a_skill_id,
int $a_tref_id = 0): void
310 $this->hidden_skills[] = $a_skill_id .
":" . $a_tref_id;
331 $this->obj_id = $a_obj_id;
332 $this->obj_skills = $a_skills;
336 int $cont_member_role_id
338 $this->cont_profiles = $this->profile_manager->getAllProfilesOfRole($cont_member_role_id);
343 $ilCtrl = $this->ctrl;
344 $ilUser = $this->user;
348 $next_class = $ilCtrl->getNextClass($this);
351 $cmd = $ilCtrl->getCmd(
"render");
356 switch ($next_class) {
363 public function setTabs(
string $a_activate): void
365 $ilCtrl = $this->ctrl;
367 $ilTabs = $this->tabs;
369 if (!empty($this->user_profiles)) {
370 $ilCtrl->setParameter($this,
"list_mode", self::LIST_PROFILES);
373 $lng->txt(
"skmg_assigned_profiles"),
374 $ilCtrl->getLinkTarget($this,
"render")
379 $ilCtrl->setParameter($this,
"list_mode", self::LIST_SELECTED);
382 $lng->txt(
"skmg_selected_skills"),
383 $ilCtrl->getLinkTarget($this,
"render")
386 $ilCtrl->clearParameterByClass(get_class($this),
"list_mode");
390 $ilTabs->activateTab($a_activate);
395 $this->offline_mode = $a_file_path;
400 return $this->offline_mode;
405 if ($this->requested_list_mode == self::LIST_SELECTED || empty($this->user_profiles)) {
408 $this->listAllAssignedProfiles();
414 $ilCtrl = $this->ctrl;
415 $ilUser = $this->user;
417 $main_tpl = $this->tpl;
418 $ilToolbar = $this->toolbar;
420 $tpl =
new ilTemplate(
"tpl.skill_filter.html",
true,
true,
"components/ILIAS/Skill");
422 $this->setTabs(
"list_skills");
425 $ilToolbar->addFormButton(
426 $lng->txt(
"skmg_add_skill"),
429 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
432 $filter_toolbar->setFormAction($ilCtrl->getFormAction($this));
433 $this->getFilter()->addToToolbar($filter_toolbar,
false);
435 $skills = $this->personal_manager->getSelectedUserSkills($ilUser->getId());
437 foreach ($skills as $s) {
438 $path = $this->tree_service->getSkillTreePath($s->getSkillNodeId());
441 foreach (
$path as $p) {
446 $html .= $this->getSkillHTML($s->getSkillNodeId(), 0,
true);
452 $filter_toolbar->addFormButton($this->
lng->txt(
"skmg_refresh_view"),
"applyFilter");
453 $tpl->
setVariable(
"FILTER", $filter_toolbar->getHTML());
454 $html = $tpl->
get() . $html;
456 $box = $this->ui_fac->messageBox()->info(
$lng->txt(
"skmg_no_skills_selected_info"));
457 $html = $this->ui_ren->render($box);
460 $main_tpl->setContent($html);
465 $this->getFilter()->save();
466 $this->
ctrl->setParameter($this,
"list_mode", self::LIST_SELECTED);
467 $this->
ctrl->redirect($this,
"listSkills");
475 $this->getFilter()->save();
476 $this->
ctrl->redirect($this,
"listAssignedProfile");
491 bool $a_edit =
false,
494 $main_tpl = $this->tpl;
498 "components/ILIAS/Skill",
499 "personal_skill_html",
500 array(
"personal_skills_gui" => $this,
"top_skill_id" => $a_top_skill_id,
"user_id" => $a_user_id,
501 "edit" => $a_edit,
"tref_id" => $a_tref_id)
504 if (!$uip->replaced()) {
505 $skill_html = $this->renderSkillHTML($a_top_skill_id, $a_user_id, $a_edit, $a_tref_id);
507 $skill_html = $uip->getHTML($skill_html);
508 $main_tpl->addJavaScript(
"assets/js/SkillEntries.js");
516 bool $a_edit =
false,
519 $ilCtrl = $this->
ctrl;
520 $ilUser = $this->user;
525 if ($a_user_id == 0) {
531 $tpl =
new ilTemplate(
"tpl.skill_pres.html",
true,
true,
"components/ILIAS/Skill");
533 $vtree = $this->tree_repo->getVirtualTreeForNodeId($a_top_skill_id);
534 $tref_id = $a_tref_id;
535 $skill_id = $a_top_skill_id;
537 $tref_id = $a_top_skill_id;
540 $b_skills = $vtree->getSubTreeForCSkillId($skill_id .
":" . $tref_id,
true);
542 foreach ($b_skills as $bs) {
543 $bs[
"id"] = (
int) $bs[
"skill_id"];
544 $bs[
"tref"] = (
int) $bs[
"tref_id"];
546 $path = $this->tree_service->getSkillTreePath($bs[
"id"], $bs[
"tref"]);
552 foreach (
$path as $p) {
560 $level_data = $skill->getLevelData();
566 foreach (
$path as $p) {
568 $title .= $sep . $p[
"title"];
570 $description = $p[
"description"];
572 if ($a_top_skill_id == $p[
"child"]) {
577 $title =
$lng->txt(
"skmg_skill_overview");
581 $panel_comps[] = $this->ui_fac->legacy()->content($this->getBasicSkillDescription((
string) $description));
585 $skl_lvl_desc = $this->getSkillLevelDescription($skill);
586 if (!empty($skl_lvl_desc)) {
589 $acc->addItem(
$lng->txt(
'skmg_skill_levels'), $skl_lvl_desc);
590 $panel_comps[] = $this->ui_fac->legacy()->content($acc->getHTML());
592 $prof_comp_head_rendered =
false;
593 $has_at_least_one_entry =
false;
594 if ($this->getProfileId() > 0) {
595 if ($this->getNonHistoricGapModeView()) {
596 if (!empty($self_eval_gap_item_prof = $this->getSelfEvalGapItem($level_data, $bs[
"tref"]))) {
598 $has_at_least_one_entry =
true;
600 $panel_comps[] = $this->ui_fac->legacy()->content($self_eval_gap_item_prof);
603 $self_eval_entries_latest = $this->getLatestEntriesForSkillHTML(
611 $self_eval_entries_non_latest = $this->getNonLatestEntriesForSkillHTML(
620 if (!empty($self_eval_entries_latest)) {
622 $has_at_least_one_entry =
true;
624 $panel_comps[] = $this->ui_fac->legacy()->content($self_eval_entries_latest);
625 $panel_comps[] = $this->ui_fac->legacy()->content($self_eval_entries_non_latest);
628 if (!$this->skmg_settings->getHideProfileBeforeSelfEval() ||
630 if ($this->getFilter()->showTargetLevel()) {
632 $prof_comp_head_rendered =
true;
633 $panel_comps[] = $this->ui_fac->legacy()->content($this->getProfileTargetItem($this->getProfileId(), $level_data, $bs[
"tref"]));
638 if ($this->getNonHistoricGapModeView()) {
639 if (!empty($actual_gap_item = $this->getActualGapItem($level_data, $bs[
"tref"]))) {
640 $panel_comps[] = $this->ui_fac->legacy()->content($actual_gap_item);
641 $has_at_least_one_entry =
true;
643 if ($this->getProfileId() == 0) {
644 if (!empty($self_eval_gap_item_non_prof = $this->getSelfEvalGapItem($level_data, $bs[
"tref"]))) {
645 $panel_comps[] = $this->ui_fac->legacy()->content($self_eval_gap_item_non_prof);
646 $has_at_least_one_entry =
true;
650 if ($this->getProfileId() > 0) {
652 $object_entries_latest = $this->getLatestEntriesForSkillHTML(
660 $object_entries_non_latest = $this->getNonLatestEntriesForSkillHTML(
669 if (!empty($object_entries_latest) && !$prof_comp_head_rendered) {
672 if (!empty($object_entries_latest)) {
673 $has_at_least_one_entry =
true;
675 $panel_comps[] = $this->ui_fac->legacy()->content($object_entries_latest);
676 $panel_comps[] = $this->ui_fac->legacy()->content($object_entries_non_latest);
679 $all_entries_latest = $this->getLatestEntriesForSkillHTML(
687 $all_entries_non_latest = $this->getNonLatestEntriesForSkillHTML(
696 if (!empty($all_entries_latest) && !$prof_comp_head_rendered) {
699 if (!empty($all_entries_latest)) {
700 $has_at_least_one_entry =
true;
702 $panel_comps[] = $this->ui_fac->legacy()->content($all_entries_latest);
703 $panel_comps[] = $this->ui_fac->legacy()->content($all_entries_non_latest);
707 if (!$has_at_least_one_entry) {
708 $panel_comps[] = $this->ui_fac->legacy()->content(
"<br/>" .
$lng->txt(
"skmg_no_skill_entries"));
713 $sub = $this->ui_fac->panel()->sub($title, $panel_comps);
714 if ($this->getFilter()->showMaterialsRessources() && $this->getProfileId() > 0
715 &&
$res = $this->getSuggestedResourcesForProfile($level_data, $bs[
"id"], $bs[
"tref"], $this->gap_mode_obj_id)) {
716 $sub = $sub->withFurtherInformation(
$res);
717 } elseif ($this->getFilter()->showMaterialsRessources() && $this->getProfileId() == 0 && !$this->gap_mode_obj_id) {
719 $sugg = $this->getAllSuggestedResources($bs[
"id"], $bs[
"tref"]);
721 $sub = $sub->withFurtherInformation($sugg);
726 $ilCtrl->setParameterByClass(
"ilpersonalskillsgui",
"skill_id", $a_top_skill_id);
727 $ilCtrl->setParameterByClass(
"ilpersonalskillsgui",
"tref_id", $bs[
"tref"]);
728 $ilCtrl->setParameterByClass(
"ilpersonalskillsgui",
"basic_skill_id", $bs[
"id"]);
729 $ilCtrl->setParameterByClass(
"ilpersonalskillsgui",
"list_mode", $this->requested_list_mode);
730 if ($this->use_materials) {
731 $actions[] = $this->ui_fac->button()->shy(
732 $lng->txt(
'skmg_assign_materials'),
733 $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui",
"assignMaterials")
736 $actions[] = $this->ui_fac->button()->shy(
737 $lng->txt(
'skmg_self_evaluation'),
738 $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui",
"selfEvaluation")
740 $sub = $sub->withActions($this->ui_fac->dropdown()->standard($actions)->withLabel(
$lng->txt(
"actions")));
743 $sub_panels[] = $sub;
746 if ($this->mode !=
"gap" && $this->getFilter()->showMaterialsRessources() && $this->use_materials) {
747 $mat = $this->getMaterials($level_data, $bs[
"tref"], $user->
getId());
749 $sub_panels[] = $mat;
756 $des = $this->getSkillCategoryDescription($skill_id, $tref_id);
759 $sub_panels = $this->ui_fac->legacy()->content($des . $this->ui_ren->render($sub_panels));
761 $panel = $this->ui_fac->panel()->standard(
766 if ($a_edit && $this->getProfileId() == 0) {
769 $ilCtrl->setParameterByClass(
"ilpersonalskillsgui",
"skill_id", $a_top_skill_id);
770 $actions[] = $this->ui_fac->button()->shy(
771 $lng->txt(
'skmg_remove_skill'),
772 $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui",
"confirmSkillRemove")
775 $panel = $panel->withActions($this->ui_fac->dropdown()->standard($actions)->withLabel(
$lng->txt(
"actions")));
778 return $this->ui_ren->render($panel);
790 $obj_id = $ws_tree->lookupObjectId($a_wsp_id);
793 if (!$this->getOfflineMode()) {
794 $url = $ws_access->getGotoLink($a_wsp_id, $obj_id);
796 $url = $this->getOfflineMode() .
"file_" . $obj_id .
"/";
802 $url .= $obj->getOfflineFilename();
807 $url .= $obj->getOfflineFilename();
812 $url .= $obj->getOfflineFilename();
817 $url .= $obj->getOfflineFilename();
822 $url .= $obj->getOfflineFilename();
827 $url .= $obj->getOfflineFilename();
832 $url .= $file->getFileName();
837 return array($caption,
$url, $obj_id);
842 $ilCtrl = $this->ctrl;
843 $ilUser = $this->user;
846 $this->personal_manager->addPersonalSkill($ilUser->getId(), $this->requested_node_id);
848 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_object_modified"));
849 $ilCtrl->setParameter($this,
"list_mode", self::LIST_SELECTED);
850 $ilCtrl->redirect($this,
"listSkills");
857 $ilCtrl = $this->ctrl;
859 if ($this->requested_skill_id > 0) {
860 $this->requested_skill_ids[] = $this->requested_skill_id;
862 if (empty($this->requested_skill_ids)) {
864 $ilCtrl->setParameter($this,
"list_mode", self::LIST_SELECTED);
865 $ilCtrl->redirect($this,
"listSkills");
868 $cgui->setFormAction($ilCtrl->getFormAction($this));
869 $cgui->setHeaderText(
$lng->txt(
"skmg_really_remove_skills"));
870 $cgui->setCancel(
$lng->txt(
"cancel"),
"listSkills");
871 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeSkills");
873 foreach ($this->requested_skill_ids as $i) {
883 $ilCtrl = $this->ctrl;
884 $ilUser = $this->user;
887 if (!empty($this->requested_skill_ids)) {
888 foreach ($this->requested_skill_ids as $n_id) {
889 $this->personal_manager->removePersonalSkill($ilUser->getId(), $n_id);
893 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_object_modified"));
894 $ilCtrl->setParameter($this,
"list_mode", self::LIST_SELECTED);
895 $ilCtrl->redirect($this,
"listSkills");
908 $ilCtrl = $this->ctrl;
911 $ilToolbar = $this->toolbar;
912 $ilTabs = $this->tabs;
914 $cmd = ($this->requested_list_mode == self::LIST_SELECTED || empty($this->user_profiles))
916 :
"listAssignedProfile";
917 $ilTabs->setBackTarget(
919 $ilCtrl->getLinkTarget($this, $cmd)
922 $ilCtrl->saveParameter($this,
"skill_id");
923 $ilCtrl->saveParameter($this,
"basic_skill_id");
924 $ilCtrl->saveParameter($this,
"tref_id");
932 $vtree = $this->tree_repo->getVirtualTreeForNodeId($this->requested_skill_id);
934 $skill_id = $this->requested_skill_id;
936 $tref_id = $this->requested_skill_id;
939 $bs = $vtree->getSubTreeForCSkillId($skill_id .
":" . $tref_id,
true);
942 foreach ($bs as
$b) {
946 $cur_basic_skill_id = ($this->requested_basic_skill_id > 0)
947 ? $this->requested_basic_skill_id
950 $ilCtrl->setParameter($this,
"basic_skill_id", $cur_basic_skill_id);
955 $si->setValue($cur_basic_skill_id);
956 $ilToolbar->addInputItem($si,
true);
957 $ilToolbar->addFormButton(
962 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
965 $table = $this->table_manager->getAssignMaterialsTable(
966 $this->requested_skill_id,
967 $this->requested_tref_id,
971 $tpl->
setContent($this->ui_ren->render($table));
980 $ilCtrl = $this->ctrl;
981 $ilUser = $this->user;
984 $ilTabs = $this->tabs;
989 if (!
$ilSetting->get(
"disable_personal_workspace")) {
990 $url =
'ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace';
991 $mbox = $ui->
factory()->messageBox()->info(
$lng->txt(
"skmg_ass_materials_from_workspace"))
992 ->withLinks([$ui->
factory()->link()->standard(
993 $lng->txt(
"personal_resources"),
996 $message = $ui->
renderer()->render($mbox);
999 if ($this->requested_table_assign_materials_action ===
"assignMaterials"
1000 && !empty($this->requested_table_assign_materials_level_ids)) {
1001 $ilCtrl->setParameter($this,
"level_id", $this->requested_table_assign_materials_level_ids[0]);
1003 $ilCtrl->saveParameter($this,
"skill_id");
1004 $ilCtrl->saveParameter($this,
"level_id");
1005 $ilCtrl->saveParameter($this,
"tref_id");
1006 $ilCtrl->saveParameter($this,
"basic_skill_id");
1008 $ilTabs->setBackTarget(
1010 $ilCtrl->getLinkTarget($this,
"assignMaterials")
1015 $exp->setTypeWhiteList(array(
"blog",
"wsrt",
"wfld",
"file",
"tstv",
"excv"));
1016 $exp->setSelectableTypes(array(
"file",
"tstv",
"excv"));
1017 $exp->setSelectMode(
"wsp_ids",
true);
1018 if ($exp->handleCommand()) {
1023 $mtpl =
new ilTemplate(
"tpl.materials_selection.html",
true,
true,
"components/ILIAS/Skill");
1024 $mtpl->setVariable(
"EXP", $exp->getHTML());
1029 $lng->txt(
"select"),
1032 $tb->setFormAction($ilCtrl->getFormAction($this));
1033 $tb->setOpenFormTag(
true);
1034 $tb->setCloseFormTag(
false);
1035 $mtpl->setVariable(
"TOOLBAR1", $tb->getHTML());
1036 $tb->setOpenFormTag(
false);
1037 $tb->setCloseFormTag(
true);
1038 $mtpl->setVariable(
"TOOLBAR2", $tb->getHTML());
1045 $ilCtrl = $this->ctrl;
1046 $ilUser = $this->user;
1050 if (!empty($this->requested_wsp_ids)) {
1051 foreach ($this->requested_wsp_ids as $w) {
1052 $this->assigned_material_manager->assignMaterial(
1054 $this->requested_skill_id,
1055 $this->requested_tref_id,
1056 $this->requested_basic_skill_id,
1057 $this->requested_level_id,
1061 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
1064 $ilCtrl->saveParameter($this,
"skill_id");
1065 $ilCtrl->saveParameter($this,
"level_id");
1066 $ilCtrl->saveParameter($this,
"tref_id");
1067 $ilCtrl->saveParameter($this,
"basic_skill_id");
1069 $ilCtrl->redirect($this,
"assignMaterials");
1074 $ilCtrl = $this->ctrl;
1075 $ilUser = $this->user;
1078 if ($this->requested_table_assign_materials_action ===
"removeMaterial"
1079 && !empty($this->requested_table_assign_materials_level_ids)
1080 && $this->requested_table_assign_materials_wsp_id !== 0) {
1081 $this->assigned_material_manager->removeAssignedMaterial(
1083 $this->requested_tref_id,
1084 (
int) $this->requested_table_assign_materials_level_ids[0],
1085 $this->requested_table_assign_materials_wsp_id
1087 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"msg_obj_modified"),
true);
1089 $ilCtrl->redirect($this,
"assignMaterials");
1099 $ilCtrl = $this->ctrl;
1102 $ilToolbar = $this->toolbar;
1103 $ilTabs = $this->tabs;
1105 $cmd = ($this->requested_list_mode == self::LIST_SELECTED || empty($this->user_profiles))
1107 :
"listAssignedProfile";
1109 if ($this->requested_list_mode === self::LIST_PROFILE_FOR_GAP) {
1110 $ilTabs->clearSubTabs();
1111 $ilTabs->clearTargets();
1112 $cmd =
"listProfileForGap";
1114 $ilTabs->setBackTarget(
1116 $ilCtrl->getLinkTarget($this, $cmd)
1119 $ilCtrl->saveParameter($this,
"skill_id");
1120 $ilCtrl->saveParameter($this,
"basic_skill_id");
1121 $ilCtrl->saveParameter($this,
"tref_id");
1129 $vtree = $this->tree_repo->getVirtualTreeForNodeId($this->requested_skill_id);
1131 $skill_id = $this->requested_skill_id;
1133 $tref_id = $this->requested_skill_id;
1136 $bs = $vtree->getSubTreeForCSkillId($skill_id .
":" . $tref_id,
true);
1140 foreach ($bs as
$b) {
1144 $cur_basic_skill_id = ($this->requested_basic_skill_id > 0)
1145 ? $this->requested_basic_skill_id
1148 $ilCtrl->setParameter($this,
"basic_skill_id", $cur_basic_skill_id);
1153 $si->setValue($cur_basic_skill_id);
1154 $ilToolbar->addInputItem($si,
true);
1155 $ilToolbar->addFormButton(
1156 $lng->txt(
"select"),
1160 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1163 $form = $this->getSelfEvaluationForm($cur_basic_skill_id);
1164 $tpl->
setContent($this->ui_ren->render($form));
1169 $top_skill_id = $this->requested_skill_id;
1170 $tref_id = $this->requested_tref_id;
1171 $basic_skill_id = $cur_basic_skill_id;
1173 $self_eval = $this->ui_fac->input()->field()->radio($this->
lng->txt(
"skmg_self_evaluation"))
1174 ->withRequired(
true);
1176 $current_level_id = $this->self_evaluation_manager->getSelfEvaluation(
1177 $this->
user->getId(),
1183 foreach ($skill->getLevelData() as $level) {
1184 $self_eval = $self_eval->withOption((
string) $level[
"id"], $level[
"title"], $level[
"description"]);
1185 if ($current_level_id == $level[
"id"]) {
1186 $self_eval = $self_eval->withValue($level[
"id"]);
1190 $tree_id = $this->tree_repo->getTreeIdForNodeId($basic_skill_id);
1191 $node_manager = $this->internal_manager->getTreeNodeManager($tree_id);
1192 $section_title = $node_manager->getWrittenPath($basic_skill_id);
1193 $section_inputs = [
"self_eval" => $self_eval];
1194 $section = $this->ui_fac->input()->field()->section(
1199 $form_action = $this->
ctrl->getFormAction($this,
"saveSelfEvaluation");
1200 return $this->ui_fac->input()->container()->form()->standard($form_action, [
"section" => $section]);
1205 $ilCtrl = $this->ctrl;
1206 $ilUser = $this->user;
1209 $ilCtrl->setParameter($this,
"basic_skill_id", $this->requested_basic_skill_id);
1210 $form = $this->getSelfEvaluationForm($this->requested_basic_skill_id);
1211 $ilCtrl->clearParameterByClass(
"ilpersonalskillsgui",
"basic_skill_id");
1212 $cmd = ($this->requested_list_mode == self::LIST_SELECTED || empty($this->user_profiles))
1213 ?
"render" :
"listAssignedProfile";
1215 if ($this->requested_list_mode === self::LIST_PROFILE_FOR_GAP) {
1216 $cmd =
"listProfileForGap";
1219 if ($this->request->getMethod() ===
"POST") {
1220 $form = $form->withRequest($this->request);
1221 $data = $form->getData();
1222 if (isset(
$data[
"section"]) && is_array(
$data[
"section"]) && !empty(
$data[
"section"][
"self_eval"])) {
1223 $this->self_evaluation_manager->saveSelfEvaluation(
1225 $this->requested_skill_id,
1226 $this->requested_tref_id,
1227 $this->requested_basic_skill_id,
1228 (
int)
$data[
"section"][
"self_eval"]
1230 $this->tpl->setOnScreenMessage(
"success",
$lng->txt(
"msg_obj_modified"),
true);
1232 $this->tpl->setContent($this->ui_ren->render($form));
1237 $this->
tabs->clearTargets();
1238 $this->
tabs->setBackTarget(
1240 $ilCtrl->getLinkTarget($this, $cmd)
1246 $ilCtrl->redirect($this, $cmd);
1251 $ilCtrl = $this->ctrl;
1254 $ilTabs = $this->tabs;
1257 $ilCtrl->setParameter($this,
"list_mode", self::LIST_SELECTED);
1258 $ilTabs->setBackTarget(
1260 $ilCtrl->getLinkTarget($this,
"render")
1262 $ilCtrl->clearParameterByClass(get_class($this),
"list_mode");
1265 if ($exp->getHasSelectableNodes()) {
1266 if (!$exp->handleCommand()) {
1269 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"skmg_select_skill"));
1271 $this->tpl->setOnScreenMessage(
'info',
$lng->txt(
"skmg_no_nodes_selectable"));
1277 $this->
ctrl->redirectByClass(
"ilContSkillPresentationGUI",
"showProfiles");
1282 if (empty($this->cont_profiles)) {
1283 $this->tpl->setContent($this->showInfoBoxForProfiles());
1287 $prof_list = $this->getProfilesListed($this->cont_profiles,
true);
1289 $html = $this->showInfoBoxForProfiles() . $this->ui_ren->render($prof_list);
1290 $this->tpl->setContent($html);
1296 $this->getFilter()->clear();
1297 $this->
tabs->clearTargets();
1298 $this->
tabs->setBackTarget(
1299 $this->
lng->txt(
"back"),
1300 $this->ctrl->getLinkTarget($this,
"showProfiles")
1302 $this->setProfileId($this->requested_profile_id);
1304 $this->tpl->setTitle($this->profile_manager->lookupTitle($this->getProfileId()));
1305 $this->
ctrl->setParameter($this,
"list_mode", self::LIST_PROFILE_FOR_GAP);
1306 $this->requested_list_mode = self::LIST_PROFILE_FOR_GAP;
1307 $this->tpl->setContent($this->getGapAnalysisHTML());
1312 if (empty($this->getObjectSkills())) {
1313 $this->tpl->setContent($this->showInfoBoxForRecords());
1317 $this->tpl->setContent($this->getGapAnalysisHTML());
1327 foreach ($profiles as $p) {
1328 $image_id = $p->getImageId();
1330 $identification = $this->storage->manage()->find($image_id);
1331 $src = $this->storage->consume()->src($identification);
1332 $image = $this->ui_fac->image()->responsive($src->getSrc(), $this->lng->txt(
"skmg_custom_image_alt"));
1334 $image = $this->ui_fac->image()->responsive(
1335 "./assets/images/logo/ilias_logo_72x72.png",
1340 $this->
ctrl->setParameter($this,
"profile_id", $p->getId());
1341 $link = $this->ui_fac->link()->standard(
1343 $this->ctrl->getLinkTarget($this, $gap_mode ?
"listProfileForGap" :
"listAssignedProfile")
1345 $this->
ctrl->setParameter($this,
"profile_id",
"");
1347 $chart_value = $this->profile_completion_manager->getProfileProgress($this->
user->getId(), $p->getId());
1348 $prof_item = $this->ui_fac->item()->standard($link)
1349 ->withDescription($p->getDescription())
1350 ->withLeadImage($image)
1351 ->withProgress($this->ui_fac->chart()->progressMeter()->standard(100, $chart_value));
1353 $prof_items[] = $prof_item;
1356 $prof_list = $this->ui_fac->panel()->listing()->standard(
"", array(
1357 $this->ui_fac->item()->group(
"", $prof_items)
1365 if (!empty($this->cont_profiles)) {
1366 $link = $this->ui_fac->link()->standard(
1367 $this->
lng->txt(
"skmg_open_all_assigned_profiles"),
1368 $this->ctrl->getLinkTargetByClass([
"ilDashboardGUI",
"ilAchievementsGUI",
"ilPersonalSkillsGUI"])
1370 $box = $this->ui_fac->messageBox()->info($this->
lng->txt(
"skmg_cont_profiles_info"))->withLinks([$link]);
1372 $box = $this->ui_fac->messageBox()->info($this->
lng->txt(
"skmg_cont_profiles_info_empty"));
1375 return $this->ui_ren->render($box);
1380 $box = $this->ui_fac->messageBox()->info($this->
lng->txt(
"skmg_cont_records_info_empty"));
1382 return $this->ui_ren->render($box);
1387 $this->gap_mode =
"max_per_type";
1388 $this->gap_mode_type = $a_type;
1389 $this->gap_cat_title = $a_cat_title;
1390 $this->mode =
"gap";
1395 $this->gap_mode =
"max_per_object";
1396 $this->gap_mode_obj_id = $a_obj_id;
1397 $this->gap_cat_title = $a_cat_title;
1398 $this->mode =
"gap";
1401 public function getGapAnalysisHTML(
int $a_user_id = 0, ?array $a_skills =
null): string
1403 $ilUser = $this->user;
1407 $this->getFilter()->clear();
1408 if ($a_skills ==
null) {
1409 foreach ($this->getObjectSkills() as $s) {
1410 $a_skills[] = array(
1411 "base_skill_id" => $s->getBaseSkillId(),
1412 "tref_id" => $s->getTrefId()
1419 if ($a_user_id == 0) {
1426 if ($this->getProfileId() > 0) {
1427 $this->profile_levels = $this->profile_manager->getSkillLevels($this->getProfileId());
1428 $skills = $this->profile_levels;
1431 $vtree = $this->tree_service->getGlobalVirtualSkillTree();
1432 $a_skills = $vtree->getOrderedNodeset($a_skills,
"base_skill_id",
"tref_id");
1434 foreach ($a_skills as $s) {
1436 $skills[] = $this->cont_factory_service->containerSkill()->skill(
1437 (
int) $s[
"base_skill_id"],
1444 if ($this->getTriggerUserFilter() !==
"") {
1445 $this->actual_levels = $this->profile_completion_manager->getLastLevelPerObjectAndTriggerUser(
1448 $this->gap_mode_obj_id,
1449 $this->getTriggerUserFilter()
1452 $this->actual_levels = $this->profile_completion_manager->getActualMaxLevels(
1456 $this->gap_mode_type,
1457 $this->gap_mode_obj_id
1459 $this->next_level_fuls = $this->profile_completion_manager->getActualNextLevelFulfilments(
1463 $this->gap_mode_type,
1464 $this->gap_mode_obj_id
1470 $not_all_self_evaluated =
false;
1472 foreach ($skills as $s) {
1473 if ($this->skmg_settings->getHideProfileBeforeSelfEval() &&
1475 $not_all_self_evaluated =
true;
1478 $path = $this->tree_service->getSkillTreePath($s->getBaseSkillId());
1481 foreach (
$path as $p) {
1488 $this->use_materials =
false;
1489 $html .= $this->getSkillHTML($s->getBaseSkillId(),
$user_id,
true, $s->getTrefId());
1492 if ($not_all_self_evaluated) {
1493 $box = $this->ui_fac->messageBox()->info(
$lng->txt(
"skmg_skill_needs_self_eval_box"));
1494 $html = $this->ui_ren->render($box) . $html;
1498 $all_chart_html = $this->getBarChartHTML($bc_skills);
1500 if (!empty($all_chart_html)) {
1501 $pan = $this->ui_fac->panel()->standard(
1502 $lng->txt(
"skmg_bar_charts"),
1503 $this->ui_fac->legacy()->content($all_chart_html)
1505 $all_chart_html = $this->ui_ren->render($pan);
1510 return $all_chart_html . $html;
1516 protected function getBarChartHTML(array $skills): string
1521 $target_dim =
$lng->txt(
"skmg_target_level");
1522 $eval_dim =
$lng->txt(
"skmg_eval_type_1");
1523 if ($this->gap_cat_title !=
"") {
1524 $eval_dim = $this->gap_cat_title;
1525 } elseif ($this->gap_mode ==
"max_per_type") {
1526 $eval_dim =
$lng->txt(
"objs_" . $this->gap_mode_type);
1527 } elseif ($this->gap_mode ==
"max_per_object") {
1530 $self_eval_dim =
$lng->txt(
"skmg_self_evaluation");
1532 $incl_self_eval =
false;
1534 if (!empty($this->getGapAnalysisSelfEvalLevels())) {
1535 $incl_self_eval =
true;
1536 $self_vals = $this->getGapAnalysisSelfEvalLevels();
1542 $all_chart_data = [];
1543 $render_eval_dim =
false;
1544 foreach ($skills as $l) {
1546 $levels = $bs->getLevelData();
1548 if (empty($levels)) {
1555 $labels = [0 =>
""];
1556 foreach ($levels as $lv) {
1559 $labels[] = $lv[
"title"];
1560 if ($this->getProfileId() > 0) {
1561 if ($l->getLevelId() == $lv[
"id"]) {
1562 $points[$target_dim] = [$cnt - 0.01, $cnt];
1563 $tooltips[$target_dim] = $lv[
"title"];
1565 $points[$target_dim] = $points[$target_dim] ??
null;
1566 $tooltips[$target_dim] = $tooltips[$target_dim] ??
null;
1569 if ($this->actual_levels[$l->getBaseSkillId()][$l->getTrefId()] == $lv[
"id"]) {
1570 $perc = $this->next_level_fuls[$l->getBaseSkillId()][$l->getTrefId()] ?? 0.0;
1571 $points[$eval_dim] = $cnt + $perc;
1572 $tooltips[$eval_dim] =
null;
1574 $tooltips[$eval_dim] = $lv[
"title"] .
" + " . $perc * 100 .
"%";
1576 $render_eval_dim =
true;
1578 $points[$eval_dim] = $points[$eval_dim] ??
null;
1579 $tooltips[$eval_dim] = $tooltips[$eval_dim] ??
null;
1580 if (!is_null($points[$eval_dim])) {
1581 $render_eval_dim =
true;
1584 if ($incl_self_eval) {
1585 if (($self_vals[$l->getBaseSkillId()][$l->getTrefId()] ?? 0) == $lv[
"id"]) {
1586 $points[$self_eval_dim] = $cnt;
1587 $tooltips[$self_eval_dim] =
null;
1589 $points[$self_eval_dim] = $points[$self_eval_dim] ??
null;
1590 $tooltips[$self_eval_dim] = $tooltips[$self_eval_dim] ??
null;
1596 if (!$render_eval_dim) {
1597 unset($points[$eval_dim]);
1598 unset($tooltips[$eval_dim]);
1605 if (!empty($tmp_labels) && $tmp_labels !== $labels) {
1609 $tmp_labels = $labels;
1612 $l->getBaseSkillId(),
1615 $all_chart_data[$chart_counter][$bar_counter][
"levels"] = $labels;
1616 $all_chart_data[$chart_counter][$bar_counter][
"points"] = $points;
1617 $all_chart_data[$chart_counter][$bar_counter][
"tooltips"] = $tooltips;
1622 $all_chart_html =
"";
1623 foreach ($all_chart_data as $chart_data) {
1624 $c_dimension = $this->data_fac->dimension()->cardinal($chart_data[0][
"levels"]);
1625 $r_dimension = $this->data_fac->dimension()->range($c_dimension);
1631 if ($this->getProfileId() > 0) {
1633 $target_bar = $target_bar->withRelativeWidth(1.1);
1634 $target_bar = $target_bar->withColor($this->data_fac->color(
"#333333"));
1635 $ds[$target_dim] = $r_dimension;
1636 $bars[$target_dim] = $target_bar;
1639 if ($render_eval_dim) {
1641 $eval_bar = $eval_bar->withRelativeWidth(0.5);
1642 $eval_bar = $eval_bar->withColor($this->data_fac->color(
"#307C88"));
1644 $eval_bar = $eval_bar->withColor($this->data_fac->color(
"#d38000"));
1646 $ds[$eval_dim] = $c_dimension;
1647 $bars[$eval_dim] = $eval_bar;
1650 if ($incl_self_eval) {
1652 $self_eval_bar = $self_eval_bar->withRelativeWidth(0.5);
1653 $self_eval_bar = $self_eval_bar->withColor($this->data_fac->color(
"#557b2e"));
1654 $ds[$self_eval_dim] = $c_dimension;
1655 $bars[$self_eval_dim] = $self_eval_bar;
1658 $dataset = $this->data_fac->dataset($ds);
1660 $render_chart =
false;
1661 foreach ($chart_data as
$a) {
1662 if ($render_eval_dim && !isset(
$a[
"points"][$eval_dim])) {
1663 $a[
"points"][$eval_dim] =
null;
1664 $a[
"tooltips"][$eval_dim] =
null;
1666 $dataset = $dataset->withPoint(
$a[
"item_title"],
$a[
"points"]);
1667 $dataset = $dataset->withAlternativeInformation(
$a[
"item_title"],
$a[
"tooltips"]);
1668 foreach (
$a[
"points"] as $dim => $p) {
1670 if (!is_null($p) && $dim != $target_dim) {
1671 $render_chart =
true;
1676 if ($render_chart) {
1677 $bar_chart = $this->ui_fac->chart()->bar()->horizontal(
1683 $x_axis =
new XAxis();
1684 $x_axis = $x_axis->withMaxValue(count($chart_data[0][
"levels"]) - 1);
1686 $bar_chart = $bar_chart->withCustomXAxis($x_axis);
1687 $bar_chart = $bar_chart->withTitleVisible(
false);
1689 $all_chart_html .= $this->ui_ren->render($bar_chart);
1693 return $all_chart_html;
1698 $ilUser = $this->user;
1701 if ($a_user_id == 0) {
1702 $a_user_id = $ilUser->getId();
1707 foreach ($a_levels as $v) {
1708 $mat_cnt = $this->assigned_material_manager->countAssignedMaterials(
1722 foreach ($a_levels as $k => $v) {
1725 foreach ($this->assigned_material_manager->getAssignedMaterials(
1730 $mat_data = $this->getMaterialInfo($item->getWorkspaceId(), $a_user_id);
1731 $title = $mat_data[0];
1732 $icon = $this->ui_fac->symbol()->icon()->standard(
1736 $link = $this->ui_fac->link()->standard($title, $mat_data[1]);
1737 $items[] = $this->ui_fac->item()->standard($link)->withLeadIcon($icon);
1741 $item_groups[] = $this->ui_fac->item()->group($v[
"title"], $items);
1744 $mat_panel = $this->ui_fac->panel()->sub(
1745 $lng->txt(
"skmg_materials"),
1756 $profile_levels = $this->profile_manager->getSkillLevels($a_profile_id);
1758 $a_activated_levels = [];
1760 foreach ($a_levels as $k => $v) {
1761 foreach ($profile_levels as $pl) {
1762 if ($pl->getLevelId() == $v[
"id"] &&
1763 $pl->getBaseSkillId() == $v[
"skill_id"] &&
1764 $a_tref_id == $pl->getTrefId()) {
1765 $a_activated_levels[] = $pl->getLevelId();
1770 $tpl =
new ilTemplate(
"tpl.skill_eval_item.html",
true,
true,
"components/ILIAS/Skill");
1771 $tpl->
setVariable(
"SCALE_BAR", $this->getScaleBar($a_levels, $a_activated_levels));
1783 $a_activated_levels = [];
1784 foreach ($a_levels as $k => $v) {
1785 if ($this->actual_levels[$v[
"skill_id"]][$a_tref_id] == $v[
"id"]) {
1786 $a_activated_levels[] = $v[
"id"];
1790 if (empty($a_activated_levels)) {
1795 if ($this->gap_cat_title !=
"") {
1796 $title = $this->gap_cat_title;
1797 } elseif ($this->gap_mode ==
"max_per_type") {
1798 $title =
$lng->txt(
"objs_" . $this->gap_mode_type);
1799 } elseif ($this->gap_mode ==
"max_per_object") {
1803 $tpl =
new ilTemplate(
"tpl.skill_eval_item.html",
true,
true,
"components/ILIAS/Skill");
1804 $tpl->
setVariable(
"SCALE_BAR", $this->getScaleBar($a_levels, $a_activated_levels));
1807 $tpl->
setVariable(
"TYPE",
$lng->txt(
"skmg_eval_type_latest_" . $type));
1813 if ($title !=
$lng->txt(
"skmg_eval_type_" . $type)) {
1824 $self_vals = $this->getGapAnalysisSelfEvalLevels();
1825 if (empty($self_vals)) {
1829 $a_activated_levels = [];
1830 foreach ($a_levels as $k => $v) {
1831 if (isset($self_vals[$v[
"skill_id"]][$a_tref_id]) &&
1832 $self_vals[$v[
"skill_id"]][$a_tref_id] == $v[
"id"]) {
1833 $a_activated_levels[] = $v[
"id"];
1837 if (empty($a_activated_levels)) {
1841 $tpl =
new ilTemplate(
"tpl.skill_eval_item.html",
true,
true,
"components/ILIAS/Skill");
1842 $tpl->
setVariable(
"SCALE_BAR", $this->getScaleBar($a_levels, $a_activated_levels));
1845 $tpl->
setVariable(
"TYPE",
$lng->txt(
"skmg_eval_type_latest_" . $type));
1859 public function getScaleBar(array $a_levels, $a_activated_levels): string
1863 if (!is_array($a_activated_levels)) {
1864 $a_activated_levels = array($a_activated_levels);
1867 foreach ($a_levels as $level) {
1868 $vals[$level[
"title"]] = (in_array($level[
"id"], $a_activated_levels));
1870 $scale_bar = $this->ui_fac->chart()->scaleBar($vals);
1872 return $this->ui_ren->render($scale_bar);
1875 public function getEvalItem(array $a_levels, array $a_level_entry,
bool $is_latest =
false): string
1878 $ilAccess = $this->access;
1880 $tpl =
new ilTemplate(
"tpl.skill_eval_item.html",
true,
true,
"components/ILIAS/Skill");
1881 $tpl->
setVariable(
"SCALE_BAR", $this->getScaleBar($a_levels, $a_level_entry[
"level_id"]));
1883 $type = Personal\SkillEval::TYPE_APPRAISAL;
1885 if ($a_level_entry[
"self_eval"] == 1) {
1886 $type = Personal\SkillEval::TYPE_SELF_EVAL;
1889 if ($a_level_entry[
"trigger_obj_type"] ==
"tst") {
1890 $type = Personal\SkillEval::TYPE_MEASUREMENT;
1895 if ($a_level_entry[
"trigger_obj_id"] > 0) {
1899 $title = $del_data[
"title"];
1901 $title = ($a_level_entry[
"trigger_title"]) ??
"";
1905 if ($a_level_entry[
"trigger_ref_id"] > 0
1906 && $ilAccess->checkAccess(
"read",
"", $a_level_entry[
"trigger_ref_id"])) {
1907 $title =
"<a href='" . ilLink::_getLink($a_level_entry[
"trigger_ref_id"]) .
"'>" . $title .
"</a>";
1911 $tpl->
setVariable(
"TYPE",
$lng->txt(
"skmg_eval_type_latest_" . $type));
1940 $tpl =
new ilTemplate(
"tpl.skill_entries_latest.html",
true,
true,
"components/ILIAS/Skill");
1942 $user_entries = $skill->getAllHistoricLevelEntriesOfUser($bs[
"tref"], $user->
getId(), $eval_type);
1943 $user_entries_filtered = $this->getFilteredEntriesForSkill(
1950 $latest_entries = $this->getSelfEvalEntriesLatestOnly($user_entries_filtered);
1952 $latest_entries = $this->getAllEntriesLatestOnly($user_entries_filtered);
1955 $latest_entries_html =
"";
1956 foreach ($latest_entries as $entry) {
1957 $latest_entries_html .= $this->ui_ren->render(
1958 $this->ui_fac->legacy()->content($this->getEvalItem($level_data, $entry,
true))
1962 if (!empty($latest_entries_html)) {
1963 $tpl->
setVariable(
"SKILL_ENTRIES", $latest_entries_html);
1965 if (count($user_entries_filtered) != count($latest_entries)) {
1967 $show_all_button = $this->ui_fac->button()->standard(
$lng->txt(
"skmg_show_all"),
"#")
1968 ->withOnLoadCode(
function (
$id) {
1969 return "$('#$id').on('click', function() {SkillEntries.showNonLatest($id); return false;})";
1971 $tpl->
setVariable(
"BUTTON", $this->ui_ren->render($show_all_button));
1990 $tpl =
new ilTemplate(
"tpl.skill_entries_non_latest.html",
true,
true,
"components/ILIAS/Skill");
1991 $user_entries = $skill->getAllHistoricLevelEntriesOfUser($bs[
"tref"], $user->
getId(), $eval_type);
1992 $user_entries_filtered = $this->getFilteredEntriesForSkill(
1999 $non_latest_entries = $this->getSelfEvalEntriesWithoutLatest($user_entries_filtered);
2001 $non_latest_entries = $this->getAllEntriesWithoutLatest($user_entries_filtered);
2004 $non_latest_entries_filtered_html =
"";
2005 foreach ($non_latest_entries as $entry) {
2006 $non_latest_entries_filtered_html .= $this->ui_ren->render(
2007 $this->ui_fac->legacy()->content($this->getEvalItem($level_data, $entry,
false))
2011 if (!empty($non_latest_entries_filtered_html)) {
2012 $tpl->
setVariable(
"SKILL_ENTRIES", $non_latest_entries_filtered_html);
2014 $show_latest_button = $this->ui_fac->button()->standard(
$lng->txt(
"skmg_show_latest_entries"),
"#")
2015 ->withOnLoadCode(
function (
$id) {
2016 return "$('#$id').on('click', function() {SkillEntries.hideNonLatest($id); return false;})";
2018 $tpl->
setVariable(
"BUTTON", $this->ui_ren->render($show_latest_button));
2033 $se_date = $this->self_evaluation_manager->getSelfEvaluationDate($user->
getId(), $top_skill_id, $bs[
"tref"], $bs[
"id"]);
2034 $se_rendered = $se_date ==
"";
2035 $filtered_entries = [];
2036 foreach ($entries as $level_entry) {
2037 if (count($this->getTriggerObjectsFilter()) && !in_array($level_entry[
'trigger_obj_id'], $this->getTriggerObjectsFilter())) {
2039 if ($this->requested_list_mode !== self::LIST_PROFILE_FOR_GAP || $level_entry[
"self_eval"] !== 1) {
2043 if ($this->getTriggerUserFilter() !==
"" && $level_entry[
'trigger_user_id'] != $this->getTriggerUserFilter()) {
2048 if ($se_date > $level_entry[
"status_date"] && !$se_rendered) {
2049 $se_rendered =
true;
2051 if ($this->getFilter()->isInRange($level_entry)) {
2052 $filtered_entries[] = $level_entry;
2055 return $filtered_entries;
2060 if (!empty($entries)) {
2061 $last_entry[] = $entries[0];
2070 if (count($entries) > 1) {
2071 array_shift($entries);
2080 $first_self_added =
false;
2081 $first_measurement_added =
false;
2082 $first_appraisal_added =
false;
2083 $latest_entries = [];
2084 foreach ($entries as $entry) {
2085 if (!$first_self_added && $entry[
"self_eval"] == 1) {
2086 $latest_entries[] = $entry;
2087 $first_self_added =
true;
2090 if (!$first_measurement_added && $entry[
"trigger_obj_type"] ==
"tst") {
2091 $latest_entries[] = $entry;
2092 $first_measurement_added =
true;
2095 if (!$first_appraisal_added && $entry[
"self_eval"] != 1 && $entry[
"trigger_obj_type"] !=
"tst") {
2096 $latest_entries[] = $entry;
2097 $first_appraisal_added =
true;
2101 return $latest_entries;
2106 $first_self_filtered =
false;
2107 $first_measurement_filtered =
false;
2108 $first_appraisal_filtered =
false;
2109 $non_latest_entries = [];
2110 foreach ($entries as $entry) {
2111 if (!$first_self_filtered && $entry[
"self_eval"] == 1) {
2112 $first_self_filtered =
true;
2115 if (!$first_measurement_filtered && $entry[
"trigger_obj_type"] ==
"tst") {
2116 $first_measurement_filtered =
true;
2119 if (!$first_appraisal_filtered && $entry[
"self_eval"] != 1 && $entry[
"trigger_obj_type"] !=
"tst") {
2120 $first_appraisal_filtered =
true;
2123 $non_latest_entries[] = $entry;
2126 return $non_latest_entries;
2131 $tpl =
new ilTemplate(
"tpl.skill_entries_header.html",
true,
true,
"components/ILIAS/Skill");
2134 $tpl->
setVariable(
"HEADING", $this->
lng->txt(
"skmg_self_evaluation"));
2136 $tpl->
setVariable(
"BYLINE", $this->
lng->txt(
"skmg_self_evaluation_byline"));
2139 if ($this->getProfileId() > 0) {
2140 $tpl->
setVariable(
"HEADING", $this->
lng->txt(
"skmg_skill_profile_records"));
2149 $tpl =
new ilTemplate(
"tpl.skill_description_category.html",
true,
true,
"components/ILIAS/Skill");
2165 $tpl =
new ilTemplate(
"tpl.skill_description_basic.html",
true,
true,
"components/ILIAS/Skill");
2167 if (!empty($description)) {
2169 $tpl->
setVariable(
"DESCRIPTION_BASIC", $description);
2178 $level_data = $skill->getLevelData();
2179 $tpl =
new ilTemplate(
"tpl.skill_desc.html",
true,
true,
"components/ILIAS/Skill");
2181 $desc_exists =
false;
2182 foreach ($level_data as $l) {
2183 if ($l[
"description"] !=
"") {
2184 $desc_exists =
true;
2189 foreach ($level_data as $l) {
2192 $tpl->
setVariable(
"LEVEL_DESC", nl2br($l[
"description"]));
2204 int $gap_mode_obj_id = 0
2209 if ($gap_mode_obj_id > 0 && !$this->obj_definition->isContainer($gap_mode_obj_type)) {
2214 if ($this->skmg_settings->getHideProfileBeforeSelfEval() &&
2216 $sec_panel_content = $this->ui_fac->legacy()->content(
$lng->txt(
"skmg_skill_needs_self_eval"));
2217 $sec_panel = $this->ui_fac->panel()->secondary()->legacy(
"", $sec_panel_content);
2222 if ($this->resource_manager->isLevelTooLow($a_tref_id, $a_levels, $this->profile_levels, $this->actual_levels)) {
2223 $imp_resources = $this->resource_manager->getSuggestedResources(
2227 $this->profile_levels
2229 $info = $this->ui_fac->item()->standard(
$lng->txt(
"skmg_recommended_learning_material_info"));
2230 $item_groups[] = $this->ui_fac->item()->group(
"", [
$info]);
2232 $at_least_one_item =
false;
2233 $highlighted_level =
false;
2236 $is_container =
false;
2237 if ($gap_mode_obj_id > 0 && $this->obj_definition->isContainer($gap_mode_obj_type)) {
2238 $is_container =
true;
2239 $sub_objects = $this->tree->getSubTree(
2245 foreach ($imp_resources as $order_level_id =>
$resources) {
2246 $level_id = (
int) substr(strrchr($order_level_id,
'_'), 1);
2248 if ($level_id <= $this->actual_levels[$a_base_skill][$a_tref_id]) {
2251 if ($level_id === $this->resource_manager->determineCurrentTargetLevel($a_levels, $this->profile_levels)) {
2252 $highlighted_level =
true;
2254 $level_title = $this->level_repo->lookupLevelTitle($level_id);
2259 if ($is_container && !in_array(
$ref_id, $sub_objects)) {
2264 $icon = $this->ui_fac->symbol()->icon()->standard(
2268 $link = $this->ui_fac->link()->standard($title, ilLink::_getLink(
$ref_id));
2269 $items[] = $this->ui_fac->item()->standard($link)->withLeadIcon($icon);
2270 $at_least_one_item =
true;
2272 $item_groups[] = $this->ui_fac->item()->group(
2274 ?
"<strong>" . $level_title .
" (" .
$lng->txt(
"skmg_target_level") .
")</strong>"
2279 if ($at_least_one_item) {
2280 switch ($gap_mode_obj_type) {
2282 $sec_panel_title =
$lng->txt(
"skmg_recommended_learning_material_crs");
2285 $sec_panel_title =
$lng->txt(
"skmg_recommended_learning_material_grp");
2288 $sec_panel_title =
$lng->txt(
"skmg_recommended_learning_material_global");
2291 $sec_panel = $this->ui_fac->panel()->secondary()->listing(
2296 $sec_panel_content = $this->ui_fac->legacy()->content(
$lng->txt(
"skmg_skill_needs_impr_no_res"));
2297 $sec_panel = $this->ui_fac->panel()->secondary()->legacy(
"", $sec_panel_content);
2300 $sec_panel_content = $this->ui_fac->legacy()->content(
$lng->txt(
"skmg_skill_no_needs_impr_info"));
2301 $sec_panel = $this->ui_fac->panel()->secondary()->legacy(
$lng->txt(
"skmg_skill_no_needs_impr"), $sec_panel_content);
2313 $res = $this->resource_manager->getResources($a_base_skill, $a_tref_id);
2316 foreach (
$res as $level) {
2320 foreach ($level as $r) {
2321 if ($r->getImparting()) {
2325 $icon = $this->ui_fac->symbol()->icon()->standard(
2329 $link = $this->ui_fac->link()->standard($title, ilLink::_getLink(
$ref_id));
2330 $items[] = $this->ui_fac->item()->standard($link)->withLeadIcon($icon);
2333 $cl = $r->getLevelId();
2341 $sec_panel = $this->ui_fac->panel()->secondary()->listing(
2342 $lng->txt(
"skmg_suggested_resources"),
2353 if (empty($this->user_profiles)) {
2354 $this->
ctrl->redirect($this,
"listSkills");
2357 $this->setTabs(
"profile");
2359 $prof_list = $this->getProfilesListed($this->user_profiles);
2361 $this->tpl->setContent($this->ui_ren->render($prof_list));
2366 $ilCtrl = $this->ctrl;
2369 $main_tpl = $this->tpl;
2371 $tpl =
new ilTemplate(
"tpl.skill_filter.html",
true,
true,
"components/ILIAS/Skill");
2373 $this->
tabs->clearTargets();
2374 $this->
tabs->setBackTarget(
2375 $this->
lng->txt(
"back"),
2376 $ilCtrl->getLinkTarget($this,
"listallassignedprofiles")
2378 $this->setProfileId($this->requested_profile_id);
2380 $main_tpl->setTitle($this->profile_manager->lookupTitle($this->getProfileId()));
2383 $filter_toolbar->setFormAction($ilCtrl->getFormAction($this));
2384 $this->getFilter()->addToToolbar($filter_toolbar,
true);
2387 if ($this->getProfileId() > 0) {
2388 $this->profile_levels = $this->profile_manager->getSkillLevels($this->getProfileId());
2389 $skills = $this->profile_levels;
2392 $this->actual_levels = $this->profile_completion_manager->getActualMaxLevels(
2393 $this->
user->getId(),
2396 $this->gap_mode_type,
2397 $this->gap_mode_obj_id
2402 $not_all_self_evaluated =
false;
2403 foreach ($skills as $s) {
2404 if ($this->skmg_settings->getHideProfileBeforeSelfEval() &&
2406 $not_all_self_evaluated =
true;
2410 $html .= $this->getSkillHTML($s->getBaseSkillId(), 0,
true, $s->getTrefId());
2414 $filter_toolbar->addFormButton($this->
lng->txt(
"skmg_refresh_view"),
"applyFilterAssignedProfiles");
2416 $tpl->
setVariable(
"FILTER", $filter_toolbar->getHTML());
2418 $html = $tpl->
get() . $html;
2421 if ($not_all_self_evaluated) {
2422 $box = $this->ui_fac->messageBox()->info(
$lng->txt(
"skmg_skill_needs_self_eval_box"));
2423 $html = $this->ui_ren->render($box) . $html;
2426 $main_tpl->setContent($html);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Provides fluid interface to RBAC services.
renderer()
Get a renderer for UI components.
factory()
Get the factory that crafts UI components.
Builds a Color from either hex- or rgb values.
Manages skill profile completion.
Manages resources for skills.
Skill internal manager service.
Request wrapper for personal skills guis.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupLevelTitle(int $a_id)
static hasSelfEvaluated(int $a_user_id, int $a_skill_id, int $a_tref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
loadLanguageModule(string $a_module)
Load language module.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static get(int $a_object_id)
parses the objects.xml it handles the xml-description of all ilias objects
static _lookupType(int $id, bool $reference=false)
static _getAllReferences(int $id)
get all reference ids for object ID
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
Explorer for selecting a personal skill.
Filter for personal skills.
Personal skills GUI class.
hideSkill(int $a_skill_id, int $a_tref_id=0)
getSkillEntriesHeader(int $eval_type)
assignMaterials()
Assign materials to skill levels.
getScaleBar(array $a_levels, $a_activated_levels)
getLatestEntriesForSkillHTML(int $top_skill_id, array $bs, ilSkillTreeNode $skill, ilObjUser $user, int $eval_type, array $level_data)
setObjectSkillProfiles(int $cont_member_role_id)
setGapAnalysisActualStatusModePerObject(int $a_obj_id, string $a_cat_title="")
ilSkillManagementSettings $skmg_settings
array $gap_self_eval_levels
getBasicSkillDescription(string $description)
setGapAnalysisActualStatusModePerType(string $a_type, string $a_cat_title="")
Table TableManager $table_manager
getSelfEvaluationForm(int $cur_basic_skill_id)
const LIST_PROFILE_FOR_GAP
getNonHistoricGapModeView()
getFilteredEntriesForSkill(array $entries, int $top_skill_id, array $bs, ilObjUser $user)
getSelfEvalGapItem(array $a_levels, int $a_tref_id=0)
int $requested_basic_skill_id
getNonLatestEntriesForSkillHTML(int $top_skill_id, array $bs, ilSkillTreeNode $skill, ilObjUser $user, int $eval_type, array $level_data)
setTabs(string $a_activate)
getSkillCategoryDescription(int $skill_id, int $tref_id)
ilSkillTreeRepository $tree_repo
getProfileTargetItem(int $a_profile_id, array $a_levels, int $a_tref_id=0)
getSelfEvalEntriesLatestOnly(array $entries)
string $trigger_user_filter
getMaterialInfo(int $a_wsp_id, int $a_user_id)
Get material file name and goto url.
string $requested_list_mode
setTriggerObjectsFilter(array $trigger_objects_filter)
listAllAssignedProfiles()
getTriggerObjectsFilter()
getGapAnalysisSelfEvalLevels()
Personal SelfEvaluationManager $self_evaluation_manager
array $requested_skill_ids
applyFilterAssignedProfiles()
Apply filter for profiles view.
getAllSuggestedResources(int $a_base_skill, int $a_tref_id)
array $requested_table_assign_materials_level_ids
assignMaterial()
Assign materials to skill level.
ilObjectDefinition $obj_definition
setGapAnalysisSelfEvalLevels(array $a_val)
Service SkillTreeService $tree_service
Service SkillPersonalGUIRequest $personal_gui_request
setOfflineMode(string $a_file_path)
getSkillHTML(int $a_top_skill_id, int $a_user_id=0, bool $a_edit=false, int $a_tref_id=0)
Get skill presentation HTML.
Service SkillInternalManagerService $internal_manager
getMaterials(array $a_levels, int $a_tref_id=0, int $a_user_id=0)
Profile SkillProfileManager $profile_manager
ilPersonalSkillsFilterGUI $filter
setObjectSkills(int $a_obj_id, array $a_skills)
ilGlobalTemplateInterface $tpl
ilSkillLevelRepository $level_repo
getSkillLevelDescription(ilSkillTreeNode $skill)
ContainerSkills SkillInternalFactoryService $cont_factory_service
renderSkillHTML(int $a_top_skill_id, int $a_user_id=0, bool $a_edit=false, int $a_tref_id=0)
Personal AssignedMaterialManager $assigned_material_manager
ServerRequestInterface $request
getEvalItem(array $a_levels, array $a_level_entry, bool $is_latest=false)
getAllEntriesLatestOnly(array $entries)
array $trigger_objects_filter
getAllEntriesWithoutLatest(array $entries)
getSelfEvalEntriesWithoutLatest(array $entries)
getProfilesListed(array $profiles, bool $gap_mode=false)
getSuggestedResourcesForProfile(array $a_levels, int $a_base_skill, int $a_tref_id, int $gap_mode_obj_id=0)
Profile SkillProfileCompletionManager $profile_completion_manager
string $requested_table_assign_materials_action
Resource SkillResourcesManager $resource_manager
Personal PersonalSkillManager $personal_manager
int $requested_profile_id
getActualGapItem(array $a_levels, int $a_tref_id=0)
setHistoryView(bool $a_val)
int $requested_table_assign_materials_wsp_id
setTriggerUserFilter(string $trigger_user_filter)
Skill management settings.
static _lookupTemplateId(int $a_obj_id)
static getInstance(int $a_id=0)
A node in the skill tree.
static _lookupDescription(int $a_obj_id)
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
static _lookupType(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Explorer for selecting a personal workspace item.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setVariable(string $variable, $value='')
Sets the given variable to the given value.
touchBlock(string $block)
overwrites ITX::touchBlock.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
setTitle(string $a_title, bool $hidden=false)
Sets title in standard template.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setTitleIcon(string $a_icon_path, string $a_icon_desc="")
set title icon
setContent(string $a_html)
Sets content for standard template.
An entity that renders components to a string output.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
Interface ilSkillLevelRepository.
Interface ilSkillTreeRepository.
filter(string $filter_id, array $class_path, string $cmd, bool $activated=true, bool $expanded=true)
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples