5include_once(
"./Services/Skill/classes/class.ilPersonalSkill.php");
 
    6include_once(
"./Services/Skill/classes/class.ilSkillProfile.php");
 
  115        $this->ctrl = 
$DIC->ctrl();
 
  116        $this->lng = 
$DIC->language();
 
  117        $this->
help = $DIC[
"ilHelp"];
 
  118        $this->setting = 
$DIC[
"ilSetting"];
 
  119        $this->
user = $DIC->user();
 
  120        $this->tpl = 
$DIC[
"tpl"];
 
  121        $this->tabs = 
$DIC->tabs();
 
  122        $this->toolbar = 
$DIC->toolbar();
 
  123        $this->access = 
$DIC->access();
 
  124        $this->ui_fac = 
$DIC->ui()->factory();
 
  125        $this->ui_ren = 
$DIC->ui()->renderer();
 
  126        $this->
ui = $DIC->ui();
 
  134        $lng->loadLanguageModule(
'skmg');
 
  135        $ilHelp->setScreenIdComponent(
"skill");
 
  137        $ilCtrl->saveParameter($this, 
"skill_id");
 
  138        $ilCtrl->saveParameter($this, 
"tref_id");
 
  139        $ilCtrl->saveParameter($this, 
"profile_id");
 
  140        $ilCtrl->saveParameter($this, 
"list_mode");
 
  142        $this->list_mode = 
$_GET[
"list_mode"];
 
  146        include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
 
  149        $this->use_materials = !
$ilSetting->get(
"disable_personal_workspace");
 
  151        include_once(
"./Services/Skill/classes/class.ilSkillManagementSettings.php");
 
  175        $this->profile_id = $a_val;
 
  185        return $this->profile_id;
 
  195        $this->gap_self_eval_levels = $a_val;
 
  215        $this->history_view = $a_val;
 
  251        $this->intro_text = $a_val;
 
  272        $this->hidden_skills[] = $a_skill_id . 
":" . $a_tref_id;
 
  285        if (count($this->user_profiles) == 0) {
 
  288        $current_prof_id = 0;
 
  289        if ((
int) 
$_GET[
"profile_id"] > 0) {
 
  290            foreach ($this->user_profiles as $p) {
 
  291                if ($p[
"id"] == (
int) 
$_GET[
"profile_id"]) {
 
  292                    $current_prof_id = (int) 
$_GET[
"profile_id"];
 
  297        if ($current_prof_id == 0 && !(is_array($this->obj_skills) && $this->obj_id > 0)) {
 
  298            $current_prof_id = $this->user_profiles[0][
"id"];
 
  300        $ilCtrl->setParameter($this, 
"profile_id", $current_prof_id);
 
  312        $this->obj_id = $a_obj_id;
 
  313        $this->obj_skills = $a_skills;
 
  329        $next_class = 
$ilCtrl->getNextClass($this);
 
  333        $std_cmd = 
"listSkills";
 
  335        $cmd = 
$ilCtrl->getCmd($std_cmd);
 
  340        switch ($next_class) {
 
  358        $ilCtrl->setParameter($this, 
"list_mode", self::LIST_SELECTED);
 
  361            $lng->txt(
"skmg_selected_skills"),
 
  362            $ilCtrl->getLinkTarget($this, 
"render")
 
  365        if (count($this->user_profiles) > 0) {
 
  366            $ilCtrl->setParameter($this, 
"list_mode", self::LIST_PROFILES);
 
  369                $lng->txt(
"skmg_assigned_profiles"),
 
  370                $ilCtrl->getLinkTarget($this, 
"render")
 
  374        $ilCtrl->clearParameterByClass(get_class($this), 
"list_mode");
 
  378        $ilTabs->activateTab($a_activate);
 
  383        $this->offline_mode = $a_file_path;
 
  391        switch ($this->list_mode) {
 
  414        $tpl = 
new ilTemplate(
"tpl.skill_filter.html", 
true, 
true, 
"Services/Skill");
 
  418        include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
 
  422        $ilToolbar->addFormButton(
 
  423            $lng->txt(
"skmg_add_skill"),
 
  426        $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this));
 
  429        $filter_toolbar->setFormAction(
$ilCtrl->getFormAction($this));
 
  430        $this->
getFilter()->addToToolbar($filter_toolbar, 
false);
 
  434        foreach ($skills as $s) {
 
  435            $path = $stree->getSkillTreePath($s[
"skill_node_id"]);
 
  438            foreach ($path as $p) {
 
  443            $html .= $this->
getSkillHTML($s[
"skill_node_id"], 0, 
true);
 
  451            $filter_toolbar->addFormButton($this->lng->txt(
"skmg_refresh_view"), 
"applyFilter");
 
  452            $tpl->setVariable(
"FILTER", $filter_toolbar->getHTML());
 
  453            $html = 
$tpl->get() . $html;
 
  456        $main_tpl->setContent($html);
 
  465        $this->ctrl->redirect($this, 
"listSkills");
 
  474        $this->ctrl->redirect($this, 
"listAssignedProfile");
 
  486    public function getSkillHTML($a_top_skill_id, $a_user_id = 0, $a_edit = 
false, $a_tref_id = 0)
 
  489        include_once(
"./Services/UIComponent/classes/class.ilUIHookProcessor.php");
 
  492            "personal_skill_html",
 
  493            array(
"personal_skills_gui" => $this, 
"top_skill_id" => $a_top_skill_id, 
"user_id" => $a_user_id,
 
  494                "edit" => $a_edit, 
"tref_id" => $a_tref_id)
 
  496        if (!$uip->replaced()) {
 
  497            $skill_html = $this->
renderSkillHTML($a_top_skill_id, $a_user_id, $a_edit, $a_tref_id);
 
  499        $skill_html = $uip->getHTML($skill_html);
 
  510    public function renderSkillHTML($a_top_skill_id, $a_user_id = 0, $a_edit = 
false, $a_tref_id = 0)
 
  516        $sub_panels = array();
 
  518        if ($a_user_id == 0) {
 
  524        $tpl = 
new ilTemplate(
"tpl.skill_pres.html", 
true, 
true, 
"Services/Skill");
 
  526        include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
 
  529        include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
 
  531        $tref_id = $a_tref_id;
 
  532        $skill_id = $a_top_skill_id;
 
  534            include_once(
"./Services/Skill/classes/class.ilSkillTemplateReference.php");
 
  535            $tref_id = $a_top_skill_id;
 
  538        $b_skills = $vtree->getSubTreeForCSkillId($skill_id . 
":" . $tref_id, 
true);
 
  540        foreach ($b_skills as $bs) {
 
  541            $bs[
"id"] = $bs[
"skill_id"];
 
  542            $bs[
"tref"] = $bs[
"tref_id"];
 
  544            $path = $stree->getSkillTreePath($bs[
"id"], $bs[
"tref"]);
 
  546            $panel_comps = array();
 
  550            foreach ($path as $p) {
 
  558            $level_data = $skill->getLevelData();
 
  564            foreach ($path as $p) {
 
  566                    $title .= $sep . $p[
"title"];
 
  568                    $description = $p[
"description"];
 
  570                if ($a_top_skill_id == $p[
"child"]) {
 
  584                if (!$this->skmg_settings->getHideProfileBeforeSelfEval() ||
 
  586                    if ($this->
getFilter()->showTargetLevel()) {
 
  592            if ($this->mode == 
"gap" && !$this->history_view) {
 
  593                $panel_comps[] = $this->ui_fac->legacy($this->
getActualGapItem($level_data, $bs[
"tref"]) . 
"");
 
  594                $panel_comps[] = $this->ui_fac->legacy($this->
getSelfEvalGapItem($level_data, $bs[
"tref"]) . 
"");
 
  598                $se_rendered = ($se_date == 
"")
 
  609                    if ($se_date > $level_entry[
"status_date"] && !$se_rendered) {
 
  612                    if ($this->
getFilter()->isInRange($level_data, $level_entry)) {
 
  613                        $panel_comps[] = $this->ui_fac->legacy($this->
getEvalItem($level_data, $level_entry));
 
  619            if ($this->mode != 
"gap") {
 
  620                if ($this->
getFilter()->showMaterialsRessources() && $this->use_materials) {
 
  624                    $panel_comps[] = $this->ui_fac->legacy($mat);
 
  629            if ($this->
getFilter()->showMaterialsRessources()) {
 
  633                $panel_comps[] = $this->ui_fac->legacy($sugg);
 
  636            $sub = $this->ui_fac->panel()->sub((
string) $title, $panel_comps);
 
  639                $ilCtrl->setParameterByClass(
"ilpersonalskillsgui", 
"skill_id", $a_top_skill_id);
 
  640                $ilCtrl->setParameterByClass(
"ilpersonalskillsgui", 
"tref_id", $bs[
"tref"]);
 
  641                $ilCtrl->setParameterByClass(
"ilpersonalskillsgui", 
"basic_skill_id", $bs[
"id"]);
 
  642                if ($this->use_materials) {
 
  643                    $actions[] = $this->ui_fac->button()->shy(
 
  644                        $lng->txt(
'skmg_assign_materials'),
 
  645                        $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui", 
"assignMaterials")
 
  648                $actions[] = $this->ui_fac->button()->shy(
 
  649                    $lng->txt(
'skmg_self_evaluation'),
 
  650                    $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui", 
"selfEvaluation")
 
  652                $sub = $sub->withActions($this->ui_fac->dropdown()->standard($actions)->withLabel(
$lng->txt(
"actions")));
 
  655            $sub_panels[] = $sub;
 
  657            $tpl->parseCurrentBlock();
 
  663        $sub_panels = $this->ui_fac->legacy($des . $this->ui_ren->render($sub_panels));
 
  665        $panel = $this->ui_fac->panel()->standard(
 
  673            $ilCtrl->setParameterByClass(
"ilpersonalskillsgui", 
"skill_id", $a_top_skill_id);
 
  674            $actions[] = $this->ui_fac->button()->shy(
 
  675                $lng->txt(
'skmg_remove_skill'),
 
  676                $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui", 
"confirmSkillRemove")
 
  679            $panel = $panel->withActions($this->ui_fac->dropdown()->standard($actions)->withLabel(
$lng->txt(
"actions")));
 
  682        return $this->ui_ren->render($panel);
 
  694        if (!$this->ws_tree) {
 
  695            include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
 
  696            include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
 
  701        $obj_id = $this->ws_tree->lookupObjectId($a_wsp_id);
 
  704        if (!$this->offline_mode) {
 
  705            $url = $this->ws_access->getGotoLink($a_wsp_id, 
$obj_id);
 
  707            $url = $this->offline_mode . 
"file_" . 
$obj_id . 
"/";
 
  712                    include_once 
"Modules/Test/classes/class.ilObjTestVerification.php";
 
  714                    $url .= $obj->getOfflineFilename();
 
  718                    include_once 
"Modules/Exercise/classes/class.ilObjExerciseVerification.php";
 
  720                    $url .= $obj->getOfflineFilename();
 
  724                    include_once 
"Modules/Course/classes/Verification/class.ilObjCourseVerification.php";
 
  726                    $url .= $obj->getOfflineFilename();
 
  731                    $url .= $obj->getOfflineFilename();
 
  736                    $url .= $obj->getOfflineFilename();
 
  740                    include_once 
"Modules/ScormAicc/classes/Verification/class.ilObjSCORMVerification.php";
 
  742                    $url .= $obj->getOfflineFilename();
 
  747                    $url .= $file->getFilename();
 
  752        return array($caption, 
$url);
 
  766        ilUtil::sendSuccess(
$lng->txt(
"msg_object_modified"));
 
  767        $ilCtrl->redirect($this, 
"listSkills");
 
  781        include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
 
  782        if (
$_GET[
"skill_id"] > 0) {
 
  785        if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
 
  787            $ilCtrl->redirect($this, 
"listSkills");
 
  789            include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  791            $cgui->setFormAction(
$ilCtrl->getFormAction($this));
 
  792            $cgui->setHeaderText(
$lng->txt(
"skmg_really_remove_skills"));
 
  793            $cgui->setCancel(
$lng->txt(
"cancel"), 
"listSkills");
 
  794            $cgui->setConfirm(
$lng->txt(
"remove"), 
"removeSkills");
 
  800            $tpl->setContent($cgui->getHTML());
 
  813        if (is_array(
$_POST[
"id"])) {
 
  814            foreach (
$_POST[
"id"] as $n_id) {
 
  819        ilUtil::sendSuccess(
$lng->txt(
"msg_object_modified"));
 
  820        $ilCtrl->redirect($this, 
"listSkills");
 
  843        $ilTabs->setBackTarget(
 
  845            $ilCtrl->getLinkTarget($this, 
"render")
 
  848        $ilCtrl->saveParameter($this, 
"skill_id");
 
  849        $ilCtrl->saveParameter($this, 
"basic_skill_id");
 
  850        $ilCtrl->saveParameter($this, 
"tref_id");
 
  852        include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
 
  859        include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
 
  862        $skill_id = (int) 
$_GET[
"skill_id"];
 
  864            include_once(
"./Services/Skill/classes/class.ilSkillTemplateReference.php");
 
  865            $tref_id = 
$_GET[
"skill_id"];
 
  868        $bs = $vtree->getSubTreeForCSkillId($skill_id . 
":" . $tref_id, 
true);
 
  871        foreach ($bs as 
$b) {
 
  876        $cur_basic_skill_id = ((int) 
$_POST[
"basic_skill_id"] > 0)
 
  877            ? (int) 
$_POST[
"basic_skill_id"]
 
  878            : (((
int) 
$_GET[
"basic_skill_id"] > 0)
 
  879                ? (
int) 
$_GET[
"basic_skill_id"]
 
  882        $ilCtrl->setParameter($this, 
"basic_skill_id", $cur_basic_skill_id);
 
  884        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  886        $si->setOptions($options);
 
  887        $si->setValue($cur_basic_skill_id);
 
  888        $ilToolbar->addInputItem(
$si, 
true);
 
  889        $ilToolbar->addFormButton(
 
  894        $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this));
 
  897        include_once(
"./Services/Skill/classes/class.ilSkillAssignMaterialsTableGUI.php");
 
  901            (
int) 
$_GET[
"skill_id"],
 
  902            (
int) 
$_GET[
"tref_id"],
 
  926        if (!
$ilSetting->get(
"disable_personal_workspace")) {
 
  927            $url = 
'ilias.php?baseClass=ilDashboardGUI&cmd=jumpToWorkspace';
 
  928            $mbox = 
$ui->factory()->messageBox()->info(
$lng->txt(
"skmg_ass_materials_from_workspace"))
 
  929                ->withLinks([
$ui->factory()->link()->standard(
 
  930                    $lng->txt(
"personal_resources"),
 
  936        $ilCtrl->saveParameter($this, 
"skill_id");
 
  937        $ilCtrl->saveParameter($this, 
"level_id");
 
  938        $ilCtrl->saveParameter($this, 
"tref_id");
 
  939        $ilCtrl->saveParameter($this, 
"basic_skill_id");
 
  941        $ilTabs->setBackTarget(
 
  943            $ilCtrl->getLinkTarget($this, 
"assignMaterials")
 
  947        include_once(
"./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorerGUI.php");
 
  949        $exp->setTypeWhiteList(array(
"blog", 
"wsrt", 
"wfld", 
"file", 
"tstv", 
"excv"));
 
  950        $exp->setSelectableTypes(array(
"file", 
"tstv", 
"excv"));
 
  951        $exp->setSelectMode(
"wsp_id", 
true);
 
  952        if ($exp->handleCommand()) {
 
  957        $mtpl = 
new ilTemplate(
"tpl.materials_selection.html", 
true, 
true, 
"Services/Skill");
 
  958        $mtpl->setVariable(
"EXP", $exp->getHTML());
 
  966        $tb->setFormAction(
$ilCtrl->getFormAction($this));
 
  967        $tb->setOpenFormTag(
true);
 
  968        $tb->setCloseFormTag(
false);
 
  969        $mtpl->setVariable(
"TOOLBAR1", $tb->getHTML());
 
  970        $tb->setOpenFormTag(
false);
 
  971        $tb->setCloseFormTag(
true);
 
  972        $mtpl->setVariable(
"TOOLBAR2", $tb->getHTML());
 
  987        include_once(
"./Services/Skill/classes/class.ilPersonalSkill.php");
 
  988        if (is_array(
$_POST[
"wsp_id"])) {
 
  989            foreach (
$_POST[
"wsp_id"] as $w) {
 
  992                    (
int) 
$_GET[
"skill_id"],
 
  993                    (
int) 
$_GET[
"tref_id"],
 
  994                    (
int) 
$_GET[
"basic_skill_id"],
 
  995                    (
int) 
$_GET[
"level_id"],
 
  999            ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"), 
true);
 
 1002        $ilCtrl->saveParameter($this, 
"skill_id");
 
 1003        $ilCtrl->saveParameter($this, 
"level_id");
 
 1004        $ilCtrl->saveParameter($this, 
"tref_id");
 
 1005        $ilCtrl->saveParameter($this, 
"basic_skill_id");
 
 1007        $ilCtrl->redirect($this, 
"assignMaterials");
 
 1023            (
int) 
$_GET[
"tref_id"],
 
 1024            (
int) 
$_GET[
"level_id"],
 
 1025            (
int) 
$_GET[
"wsp_id"]
 
 1027        ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"), 
true);
 
 1028        $ilCtrl->redirect($this, 
"assignMaterials");
 
 1051        $ilTabs->setBackTarget(
 
 1053            $ilCtrl->getLinkTarget($this, 
"render")
 
 1056        $ilCtrl->saveParameter($this, 
"skill_id");
 
 1057        $ilCtrl->saveParameter($this, 
"basic_skill_id");
 
 1058        $ilCtrl->saveParameter($this, 
"tref_id");
 
 1060        include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
 
 1067        include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
 
 1070        $skill_id = (int) 
$_GET[
"skill_id"];
 
 1072            include_once(
"./Services/Skill/classes/class.ilSkillTemplateReference.php");
 
 1073            $tref_id = 
$_GET[
"skill_id"];
 
 1076        $bs = $vtree->getSubTreeForCSkillId($skill_id . 
":" . $tref_id, 
true);
 
 1080        foreach ($bs as 
$b) {
 
 1084        $cur_basic_skill_id = ((int) 
$_POST[
"basic_skill_id"] > 0)
 
 1085            ? (int) 
$_POST[
"basic_skill_id"]
 
 1086            : (((
int) 
$_GET[
"basic_skill_id"] > 0)
 
 1087                ? (
int) 
$_GET[
"basic_skill_id"]
 
 1090        $ilCtrl->setParameter($this, 
"basic_skill_id", $cur_basic_skill_id);
 
 1092        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
 1094        $si->setOptions($options);
 
 1095        $si->setValue($cur_basic_skill_id);
 
 1096        $ilToolbar->addInputItem(
$si, 
true);
 
 1097        $ilToolbar->addFormButton(
 
 1098            $lng->txt(
"select"),
 
 1102        $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this));
 
 1105        include_once(
"./Services/Skill/classes/class.ilSelfEvaluationSimpleTableGUI.php");
 
 1109            (
int) 
$_GET[
"skill_id"],
 
 1110            (
int) 
$_GET[
"tref_id"],
 
 1128            (
int) 
$_GET[
"skill_id"],
 
 1129            (
int) 
$_GET[
"tref_id"],
 
 1130            (
int) 
$_GET[
"basic_skill_id"],
 
 1133        ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"), 
true);
 
 1140        $ilCtrl->redirect($this, 
"render");
 
 1157        $ilTabs->setBackTarget(
 
 1159            $ilCtrl->getLinkTarget($this, 
"")
 
 1162        include_once(
"./Services/Skill/classes/class.ilPersonalSkillExplorerGUI.php");
 
 1164        if ($exp->getHasSelectableNodes()) {
 
 1165            if (!$exp->handleCommand()) {
 
 1166                $tpl->setContent($exp->getHTML());
 
 1187        if (count($this->user_profiles) == 0 && $this->obj_skills == 
null) {
 
 1209        if (is_array($this->obj_skills) && $this->obj_id > 0) {
 
 1213        foreach ($this->user_profiles as $p) {
 
 1214            $options[$p[
"id"]] = 
$lng->txt(
"skmg_profile") . 
": " . $p[
"title"];
 
 1217        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
 1219        $si->setOptions($options);
 
 1221        $ilToolbar->addInputItem(
$si, 
true);
 
 1222        $ilToolbar->addFormButton(
 
 1223            $lng->txt(
"select"),
 
 1226        $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this));
 
 1237        $this->gap_mode = 
"max_per_type";
 
 1238        $this->gap_mode_type = 
$a_type;
 
 1239        $this->gap_cat_title = $a_cat_title;
 
 1240        $this->mode = 
"gap";
 
 1250        $this->gap_mode = 
"max_per_object";
 
 1251        $this->gap_mode_obj_id = $a_obj_id;
 
 1252        $this->gap_cat_title = $a_cat_title;
 
 1253        $this->mode = 
"gap";
 
 1265        $this->actual_levels = array();
 
 1266        include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
 
 1267        foreach ($skills as $sk) {
 
 1269            if ($this->gap_mode == 
"max_per_type") {
 
 1270                $max = $bs->getMaxLevelPerType($sk[
"tref_id"], $this->gap_mode_type, $user_id);
 
 1271                $this->actual_levels[$sk[
"base_skill_id"]][$sk[
"tref_id"]] = $max;
 
 1272            } elseif ($this->gap_mode == 
"max_per_object") {
 
 1273                $max = $bs->getMaxLevelPerObject($sk[
"tref_id"], $this->gap_mode_obj_id, $user_id);
 
 1274                $this->actual_levels[$sk[
"base_skill_id"]][$sk[
"tref_id"]] = $max;
 
 1276                $max = $bs->getMaxLevel($sk[
"tref_id"], $user_id);
 
 1277                $this->actual_levels[$sk[
"base_skill_id"]][$sk[
"tref_id"]] = $max;
 
 1296        if ($a_skills == 
null) {
 
 1300        include_once(
"./Services/UIComponent/Panel/classes/class.ilPanelGUI.php");
 
 1306            $intro_html = $pan->getHTML();
 
 1311        if ($a_user_id == 0) {
 
 1314            $user_id = $a_user_id;
 
 1320            $this->profile_levels = $profile->getSkillLevels();
 
 1322            foreach ($this->profile_levels as $l) {
 
 1324                    "base_skill_id" => $l[
"base_skill_id"],
 
 1325                    "tref_id" => $l[
"tref_id"],
 
 1326                    "level_id" => $l[
"level_id"]
 
 1329        } elseif (is_array($a_skills)) {
 
 1330            $skills = $a_skills;
 
 1336        $incl_self_eval = 
false;
 
 1338            $incl_self_eval = 
true;
 
 1343        $all_chart_html = 
"";
 
 1346        $sw_skills = array();
 
 1347        foreach ($skills as $sk) {
 
 1348            if (!in_array($sk[
"base_skill_id"] . 
":" . $sk[
"tref_id"], $this->hidden_skills)) {
 
 1353        if (count($sw_skills) >= 3) {
 
 1354            $skill_packages = array();
 
 1356            if (count($sw_skills) < 8) {
 
 1357                $skill_packages[1] = $sw_skills;
 
 1359                $mod = count($sw_skills) % 7;
 
 1360                $pkg_num = floor((count($sw_skills) - 1) / 7) + 1;
 
 1362                foreach ($sw_skills as $k => $s) {
 
 1363                    $skill_packages[$cpkg][$k] = $s;
 
 1364                    if ($mod < 3 && count($skill_packages) == ($pkg_num - 1) && count($skill_packages[$cpkg]) == 3 + $mod) {
 
 1366                    } elseif (count($skill_packages[$cpkg]) == 7) {
 
 1373            foreach ($skill_packages as $pskills) {
 
 1376                $leg_labels = array();
 
 1381                foreach ($pskills as $k => $l) {
 
 1385                    $levels = $bs->getLevelData();
 
 1387                    foreach ($levels as $lv) {
 
 1389                        if ($l[
"level_id"] == $lv[
"id"]) {
 
 1390                            $pskills[$k][
"target_cnt"] = $cnt;
 
 1392                        if ($this->actual_levels[$l[
"base_skill_id"]][$l[
"tref_id"]] == $lv[
"id"]) {
 
 1393                            $pskills[$k][
"actual_cnt"] = $cnt;
 
 1395                        if ($incl_self_eval) {
 
 1396                            if ($self_vals[$l[
"base_skill_id"]][$l[
"tref_id"]] == $lv[
"id"]) {
 
 1397                                $pskills[$k][
"self_cnt"] = $cnt;
 
 1400                        $max_cnt = max($max_cnt, $cnt);
 
 1404                include_once(
"./Services/Chart/classes/class.ilChart.php");
 
 1406                $chart->setsize(800, 300);
 
 1407                $chart->setYAxisMax($max_cnt);
 
 1408                $chart->setLegLabels($leg_labels);
 
 1411                $cd = $chart->getDataInstance();
 
 1412                $cd->setLabel(
$lng->txt(
"skmg_target_level"));
 
 1413                $cd->setFill(
true, 
"#A0A0A0");
 
 1416                $cd2 = $chart->getDataInstance();
 
 1417                if ($this->gap_cat_title != 
"") {
 
 1418                    $cd2->setLabel($this->gap_cat_title);
 
 1419                } elseif ($this->gap_mode == 
"max_per_type") {
 
 1420                    $cd2->setLabel(
$lng->txt(
"objs_" . $this->gap_mode_type));
 
 1421                } elseif ($this->gap_mode == 
"max_per_object") {
 
 1425                $cd2->setFill(
true, 
"#FF8080");
 
 1426                $cd2->setFill(
true, 
"#cc8466");
 
 1429                if ($incl_self_eval) {
 
 1430                    $cd3 = $chart->getDataInstance();
 
 1431                    $cd3->setLabel(
$lng->txt(
"skmg_self_evaluation"));
 
 1432                    $cd3->setFill(
true, 
"#6ea03c");
 
 1437                foreach ($pskills as $pl) {
 
 1438                    $cd->addPoint($cnt, (
int) $pl[
"target_cnt"]);
 
 1439                    $cd2->addPoint($cnt, (
int) $pl[
"actual_cnt"]);
 
 1440                    if ($incl_self_eval) {
 
 1441                        $cd3->addPoint($cnt, (
int) $pl[
"self_cnt"]);
 
 1448                    $chart->addData($cd);
 
 1450                $chart->addData($cd2);
 
 1452                    $chart->addData($cd3);
 
 1455                if ($pkg_cnt == 1) {
 
 1457                    $chart->setLegend($lg);
 
 1460                $chart_html = $chart->getHTML();
 
 1461                $all_chart_html .= $chart_html;
 
 1466            $pan->setBody($all_chart_html);
 
 1467            $all_chart_html = $pan->getHTML();
 
 1474        include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
 
 1476        $skills = $vtree->getOrderedNodeset($skills, 
"base_skill_id", 
"tref_id");
 
 1477        foreach ($skills as $s) {
 
 1478            $path = $stree->getSkillTreePath($s[
"base_skill_id"]);
 
 1481            foreach ($path as $p) {
 
 1486            $html .= $this->
getSkillHTML($s[
"base_skill_id"], $user_id, 
false, $s[
"tref_id"]);
 
 1493        return $intro_html . $all_chart_html . $html;
 
 1505        $ilCtrl->setParameter($this, 
"profile_id", 
$_POST[
"profile_id"]);
 
 1506        if ($this->mode == 
"gap") {
 
 1507            $ilCtrl->redirect($this, 
"listProfilesForGap");
 
 1509            $ilCtrl->redirect($this, 
"listAssignedProfile");
 
 1524        if ($a_user_id == 0) {
 
 1525            $a_user_id = 
$ilUser->getId();
 
 1530        foreach ($a_levels as $v) {
 
 1544        $tpl = 
new ilTemplate(
"tpl.skill_materials.html", 
true, 
true, 
"Services/Skill");
 
 1545        foreach ($a_levels as $k => $v) {
 
 1552                $tpl->setCurrentBlock(
"material");
 
 1554                $tpl->setVariable(
"HREF_LINK", $mat_data[1]);
 
 1555                $tpl->setVariable(
"TXT_LINK", $mat_data[0]);
 
 1556                $tpl->parseCurrentBlock();
 
 1560                $tpl->setCurrentBlock(
"level");
 
 1561                $tpl->setVariable(
"LEVEL_VAL", $v[
"title"]);
 
 1562                $tpl->parseCurrentBlock();
 
 1565        $tpl->setVariable(
"TXT_MATERIAL", 
$lng->txt(
"skmg_materials"));
 
 1581        $profile_levels = $profile->getSkillLevels();
 
 1583        $a_activated_levels = array();
 
 1585        foreach ($a_levels as $k => $v) {
 
 1586            foreach ($profile_levels as $pl) {
 
 1587                if ($pl[
"level_id"] == $v[
"id"] &&
 
 1588                    $pl[
"base_skill_id"] == $v[
"skill_id"] &&
 
 1589                    $a_tref_id == $pl[
"tref_id"]) {
 
 1590                    $a_activated_levels[] = $pl[
"level_id"];
 
 1595        $tpl = 
new ilTemplate(
"tpl.skill_eval_item.html", 
true, 
true, 
"Services/Skill");
 
 1596        $tpl->setVariable(
"SCALE_BAR", $this->
getScaleBar($a_levels, $a_activated_levels));
 
 1598        $tpl->setVariable(
"TYPE", 
$lng->txt(
"skmg_target_level"));
 
 1599        $tpl->setVariable(
"TITLE", 
"");
 
 1614        $a_activated_levels = array();
 
 1615        foreach ($a_levels as $k => $v) {
 
 1616            if ($this->actual_levels[$v[
"skill_id"]][$a_tref_id] == $v[
"id"]) {
 
 1617                $a_activated_levels[] = $v[
"id"];
 
 1621        if ($this->gap_cat_title != 
"") {
 
 1622            $title = $this->gap_cat_title;
 
 1623        } elseif ($this->gap_mode == 
"max_per_type") {
 
 1624            $title = 
$lng->txt(
"objs_" . $this->gap_mode_type);
 
 1625        } elseif ($this->gap_mode == 
"max_per_object") {
 
 1629        $tpl = 
new ilTemplate(
"tpl.skill_eval_item.html", 
true, 
true, 
"Services/Skill");
 
 1630        $tpl->setVariable(
"SCALE_BAR", $this->
getScaleBar($a_levels, $a_activated_levels));
 
 1633        $tpl->setVariable(
"TYPE", 
$lng->txt(
"skmg_eval_type_" . 
$type));
 
 1639        if ($title != 
$lng->txt(
"skmg_eval_type_" . 
$type)) {
 
 1640            $tpl->setVariable(
"TITLE", $title);
 
 1657        if (count($self_vals) == 0) {
 
 1661        $a_activated_levels = array();
 
 1662        foreach ($a_levels as $k => $v) {
 
 1663            if ($self_vals[$v[
"skill_id"]][$a_tref_id] == $v[
"id"]) {
 
 1664                $a_activated_levels[] = $v[
"id"];
 
 1668        $tpl = 
new ilTemplate(
"tpl.skill_eval_item.html", 
true, 
true, 
"Services/Skill");
 
 1669        $tpl->setVariable(
"SCALE_BAR", $this->
getScaleBar($a_levels, $a_activated_levels));
 
 1672        $tpl->setVariable(
"TYPE", 
$lng->txt(
"skmg_eval_type_" . 
$type));
 
 1692        if (!is_array($a_activated_levels)) {
 
 1693            $a_activated_levels = array($a_activated_levels);
 
 1696        foreach ($a_levels as $level) {
 
 1697            $vals[$level[
"title"]] = (in_array($level[
"id"], $a_activated_levels));
 
 1699        $scale_bar = $this->ui_fac->chart()->scaleBar($vals);
 
 1701        return $this->ui_ren->render($scale_bar);
 
 1715        $tpl = 
new ilTemplate(
"tpl.skill_eval_item.html", 
true, 
true, 
"Services/Skill");
 
 1716        $tpl->setVariable(
"SCALE_BAR", $this->
getScaleBar($a_levels, $a_level_entry[
"level_id"]));
 
 1718        include_once(
"./Services/Skill/classes/class.ilSkillEval.php");
 
 1721        if ($a_level_entry[
"self_eval"] == 1) {
 
 1725        if ($a_level_entry[
"trigger_obj_type"] == 
"tst") {
 
 1730        $title = ($a_level_entry[
"trigger_obj_id"] > 0)
 
 1731                ? $a_level_entry[
"trigger_title"]
 
 1734        if ($a_level_entry[
"trigger_ref_id"] > 0
 
 1735            && $ilAccess->checkAccess(
"read", 
"", $a_level_entry[
"trigger_ref_id"])) {
 
 1736            include_once(
"./Services/Link/classes/class.ilLink.php");
 
 1737            $title = 
"<a href='" . 
ilLink::_getLink($a_level_entry[
"trigger_ref_id"]) . 
"'>" . $title . 
"</a>";
 
 1740        $tpl->setVariable(
"TYPE", 
$lng->txt(
"skmg_eval_type_" . 
$type));
 
 1745        $tpl->setVariable(
"TITLE", $title);
 
 1766        $tpl = 
new ilTemplate(
"tpl.skill_description_category.html", 
true, 
true, 
"Services/Skill");
 
 1770        if (!is_null($des) && !empty($des)) {
 
 1771            $tpl->setCurrentBlock(
"description_category");
 
 1772            $tpl->setVariable(
"DESCRIPTION_CATEGORY", $des);
 
 1773            $tpl->parseCurrentBlock();
 
 1789        $tpl = 
new ilTemplate(
"tpl.skill_description_basic.html", 
true, 
true, 
"Services/Skill");
 
 1791        if (!is_null($description) && !empty($description)) {
 
 1792            $tpl->setCurrentBlock(
"description_basic");
 
 1793            $tpl->setVariable(
"DESCRIPTION_BASIC", $description);
 
 1794            $tpl->parseCurrentBlock();
 
 1808        $level_data = $skill->getLevelData();
 
 1809        $tpl = 
new ilTemplate(
"tpl.skill_desc.html", 
true, 
true, 
"Services/Skill");
 
 1811        $desc_exists = 
false;
 
 1812        foreach ($level_data as $l) {
 
 1813            if ($l[
"description"] != 
"") {
 
 1814                $desc_exists = 
true;
 
 1819            foreach ($level_data as $l) {
 
 1820                $tpl->setCurrentBlock(
"level");
 
 1821                $tpl->setVariable(
"LEVEL_VAL", $l[
"title"]);
 
 1822                $tpl->setVariable(
"LEVEL_DESC", nl2br($l[
"description"]));
 
 1823                $tpl->parseCurrentBlock();
 
 1840        $tpl = 
new ilTemplate(
"tpl.suggested_resources.html", 
true, 
true, 
"Services/Skill");
 
 1843        if ($a_profile_id > 0) {
 
 1845            $current_target_level = 0;
 
 1847            foreach ($a_levels as $k => $v) {
 
 1848                foreach ($this->profile_levels as $pl) {
 
 1849                    if ($pl[
"level_id"] == $v[
"id"] &&
 
 1850                        $pl[
"base_skill_id"] == $v[
"skill_id"]) {
 
 1852                        $current_target_level = $v[
"id"];
 
 1856                if ($this->actual_levels[$v[
"skill_id"]][$a_tref_id] == $v[
"id"]) {
 
 1863                include_once(
"./Services/Skill/classes/class.ilSkillResources.php");
 
 1865                $res = $skill_res->getResources();
 
 1866                $imp_resources = array();
 
 1867                foreach (
$res as $level) {
 
 1868                    foreach ($level as $r) {
 
 1869                        if ($r[
"imparting"] == 
true &&
 
 1870                            $current_target_level == $r[
"level_id"]) {
 
 1871                            $imp_resources[] = $r;
 
 1875                foreach ($imp_resources as $r) {
 
 1876                    $ref_id = $r[
"rep_ref_id"];
 
 1879                    include_once(
"./Services/Link/classes/class.ilLink.php");
 
 1880                    $tpl->setCurrentBlock(
"resource_item");
 
 1881                    $tpl->setVariable(
"TXT_RES", $title);
 
 1883                    $tpl->parseCurrentBlock();
 
 1885                if (count($imp_resources) > 0) {
 
 1886                    $tpl->touchBlock(
"resources_list");
 
 1887                    $tpl->setVariable(
"SUGGESTED_MAT_MESS", 
$lng->txt(
"skmg_skill_needs_impr_res"));
 
 1890                    $tpl->setVariable(
"SUGGESTED_MAT_MESS", 
$lng->txt(
"skmg_skill_needs_impr_no_res"));
 
 1894                $tpl->setVariable(
"SUGGESTED_MAT_MESS", 
$lng->txt(
"skmg_skill_no_needs_impr"));
 
 1899            include_once(
"./Services/Skill/classes/class.ilSkillResources.php");
 
 1901            $res = $skill_res->getResources();
 
 1904            foreach (
$res as $level) {
 
 1907                foreach ($level as $r) {
 
 1908                    if ($r[
"imparting"]) {
 
 1909                        $ref_id = $r[
"rep_ref_id"];
 
 1912                        include_once(
"./Services/Link/classes/class.ilLink.php");
 
 1913                        $tpl->setCurrentBlock(
"resource_item");
 
 1914                        $tpl->setVariable(
"TXT_RES", $title);
 
 1916                        $tpl->parseCurrentBlock();
 
 1919                        $cl = $r[
"level_id"];
 
 1923                    $tpl->setCurrentBlock(
"resources_list_level");
 
 1924                    $tpl->setVariable(
"TXT_LEVEL", 
$lng->txt(
"skmg_level"));
 
 1926                    $tpl->parseCurrentBlock();
 
 1927                    $tpl->touchBlock(
"resources_list");
 
 1931                $tpl->setVariable(
"SUGGESTED_MAT_MESS", 
$lng->txt(
"skmg_suggested_resources"));
 
 1950        $tpl = 
new ilTemplate(
"tpl.skill_filter.html", 
true, 
true, 
"Services/Skill");
 
 1958        $filter_toolbar->setFormAction(
$ilCtrl->getFormAction($this));
 
 1959        $this->
getFilter()->addToToolbar($filter_toolbar, 
true);
 
 1964            $this->profile_levels = $profile->getSkillLevels();
 
 1966            foreach ($this->profile_levels as $l) {
 
 1968                    "base_skill_id" => $l[
"base_skill_id"],
 
 1969                    "tref_id" => $l[
"tref_id"],
 
 1970                    "level_id" => $l[
"level_id"]
 
 1979        foreach ($skills as $s) {
 
 1981            $html .= $this->
getSkillHTML($s[
"base_skill_id"], 0, 
true, $s[
"tref_id"]);
 
 1985            $filter_toolbar->addFormButton($this->lng->txt(
"skmg_refresh_view"), 
"applyFilterAssignedProfiles");
 
 1987            $tpl->setVariable(
"FILTER", $filter_toolbar->getHTML());
 
 1989            $html = 
$tpl->get() . $html;
 
 1992        $main_tpl->setContent($html);
 
An exception for terminatinating execution or to throw for unit testing.
static hasSelfEvaluated($a_user_id, $a_skill_id, $a_tref_id)
Has use self evaluated a skill?
static lookupLevelTitle($a_id)
Lookup level title.
static getInstanceByType($a_type, $a_id)
Get type instance.
Confirmation screen class.
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date @access public.
static setUseRelativeDates($a_status)
set use relative dates
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstance()
Get instance.
const PANEL_STYLE_PRIMARY
Explorer for selecting a personal skill.
static getAssignedMaterial($a_user_id, $a_tref_id, $a_level)
Get assigned material (for a skill level and user)
static removeMaterial($a_user_id, $a_tref_id, $a_level_id, $a_wsp_id)
Remove material.
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
static getSelfEvaluationDate($a_user_id, $a_top_skill, $a_tref_id, $a_basic_skill)
Get self evaluation.
static addPersonalSkill($a_user_id, $a_skill_node_id)
Add personal skill.
static assignMaterial($a_user_id, $a_top_skill, $a_tref_id, $a_basic_skill, $a_level, $a_wsp_id)
Assign material to skill level.
static removeSkill($a_user_id, $a_skill_node_id)
Remove personal skill.
static countAssignedMaterial($a_user_id, $a_tref_id, $a_level)
Get assigned material (for a skill level and user)
static saveSelfEvaluation($a_user_id, $a_top_skill, $a_tref_id, $a_basic_skill, $a_level)
Save self evaluation.
Filter for personal skills.
Personal skills GUI class.
assignMaterials()
Assign materials to skill levels.
setTriggerObjectsFilter($trigger_objects_filter)
getScaleBar($a_levels, $a_activated_levels)
Get scale bar.
setHistoryView($a_val)
Set history view.
getIntroText()
Get intro text.
hideSkill($a_skill_id, $a_tref_id=0)
Hide skill.
getBasicSkillDescription(string $description)
Get description for basic skill.
selfEvaluation()
Assign materials to skill levels.
setObjectSkills($a_obj_id, $a_skills=null)
Set object skills.
setIntroText($a_val)
Set intro text.
getSkillCategoryDescription(int $skill_id, int $tref_id)
Get description for skill category.
confirmSkillRemove()
Confirm skill remove.
removeSkills()
Remove skills.
getMaterialInfo($a_wsp_id, $a_user_id)
Get material file name and goto url.
getActualLevels($skills, $user_id)
Get actual levels.
getTriggerObjectsFilter()
getGapAnalysisSelfEvalLevels()
Get self evaluation levels for gap analysis.
getProfileId()
Get profile id.
applyFilterAssignedProfiles()
Apply filter for profiles view.
selectProfile()
Select profile.
getActualGapItem($a_levels, $a_tref_id=0)
assignMaterial()
Assign materials to skill level.
renderSkillHTML($a_top_skill_id, $a_user_id=0, $a_edit=false, $a_tref_id=0)
Render skill html.
setGapAnalysisSelfEvalLevels(array $a_val)
Set self evaluation levels for gap analysis.
listAssignedProfile()
List profile.
getSkillLevelDescription($skill)
Get level description.
setTabs($a_activate)
Set tabs.
getProfileTargetItem($a_profile_id, $a_levels, $a_tref_id=0)
Get profile target item.
applyFilter()
Apply filter.
showProfileSelectorToolbar()
Show profile selector toolbar.
listProfilesForGap()
List profiles.
getSelfEvalGapItem($a_levels, $a_tref_id=0)
getSkillHTML($a_top_skill_id, $a_user_id=0, $a_edit=false, $a_tref_id=0)
Get skill presentation HTML.
addSkill()
Add personal skill.
selectMaterial()
Select material.
determineCurrentProfile()
Determine current profile id.
removeMaterial()
Remove material.
setOfflineMode($a_file_path)
getGapAnalysisHTML($a_user_id=0, $a_skills=null)
Get gap analysis html.
getSuggestedResources($a_profile_id, $a_levels, $a_base_skill, $a_tref_id)
Render suggested resources.
setGapAnalysisActualStatusModePerObject($a_obj_id, $a_cat_title="")
Set gap analysis actual status mode "per object".
saveSelfEvaluation()
Save self evaluation.
getMaterials($a_levels, $a_tref_id=0, $a_user_id=0)
Get materials.
executeCommand()
Execute command.
setGapAnalysisActualStatusModePerType($a_type, $a_cat_title="")
Set gap analysis actual status mode "per type".
getHistoryView()
Get history view.
listSkillsForAdd()
LIst skills for adding.
setProfileId($a_val)
Set profile id.
getEvalItem($a_levels, $a_level_entry)
Get eval item.
Self evaluation, second simplier implementation.
Assign materials to skill levels table.
Skill management settings.
static getProfilesOfUser($a_user_id)
Get profiles of a user.
Manages resources for skills.
static _lookupTemplateId($a_obj_id)
Lookup template ID.
static getInstance($a_id=0)
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
static _lookupDescription($a_obj_id)
Lookup Description.
static _lookupType($a_obj_id)
Lookup Type.
special template class to simplify handling of ITX/PEAR
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Access handler for personal workspace.
Explorer for selecting a personal workspace item.
Tree handler for personal workspace.
foreach($_POST as $key=> $value) $res