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->activateSubTab($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) {
 
  451            $filter_toolbar->addFormButton($this->lng->txt(
"skmg_refresh_view"), 
"applyFilter");
 
  452            $tpl->setVariable(
"FILTER", $filter_toolbar->getHTML());
 
  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();
 
  566                if (!$this->skmg_settings->getHideProfileBeforeSelfEval() ||
 
  568                    if ($this->
getFilter()->showTargetLevel()) {
 
  574            if ($this->mode == 
"gap" && !$this->history_view) {
 
  575                $panel_comps[] = $this->ui_fac->legacy($this->
getActualGapItem($level_data, $bs[
"tref"]) . 
"");
 
  576                $panel_comps[] = $this->ui_fac->legacy($this->
getSelfEvalGapItem($level_data, $bs[
"tref"]) . 
"");
 
  580                $se_rendered = ($se_date == 
"")
 
  591                    if ($se_date > $level_entry[
"status_date"] && !$se_rendered) {
 
  594                    if ($this->
getFilter()->isInRange($level_data, $level_entry)) {
 
  595                        $panel_comps[] = $this->ui_fac->legacy($this->
getEvalItem($level_data, $level_entry));
 
  601            if ($this->mode != 
"gap") {
 
  602                if ($this->
getFilter()->showMaterialsRessources() && $this->use_materials) {
 
  606                    $panel_comps[] = $this->ui_fac->legacy($mat);
 
  611            if ($this->
getFilter()->showMaterialsRessources()) {
 
  615                $panel_comps[] = $this->ui_fac->legacy($sugg);
 
  620            foreach (
$path as $p) {
 
  622                    $title .= $sep . $p[
"title"];
 
  625                if ($a_top_skill_id == $p[
"child"]) {
 
  630            $sub = $this->ui_fac->panel()->sub((
string) 
$title, $panel_comps);
 
  633                $ilCtrl->setParameterByClass(
"ilpersonalskillsgui", 
"skill_id", $a_top_skill_id);
 
  634                $ilCtrl->setParameterByClass(
"ilpersonalskillsgui", 
"tref_id", $bs[
"tref"]);
 
  635                $ilCtrl->setParameterByClass(
"ilpersonalskillsgui", 
"basic_skill_id", $bs[
"id"]);
 
  636                if ($this->use_materials) {
 
  637                    $actions[] = $this->ui_fac->button()->shy(
 
  638                        $lng->txt(
'skmg_assign_materials'),
 
  639                        $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui", 
"assignMaterials")
 
  642                $actions[] = $this->ui_fac->button()->shy(
 
  643                    $lng->txt(
'skmg_self_evaluation'),
 
  644                    $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui", 
"selfEvaluation")
 
  646                $sub = $sub->withActions($this->ui_fac->dropdown()->standard($actions)->withLabel(
$lng->txt(
"actions")));
 
  649            $sub_panels[] = $sub;
 
  651            $tpl->parseCurrentBlock();
 
  654        $panel = $this->ui_fac->panel()->standard(
 
  662            $ilCtrl->setParameterByClass(
"ilpersonalskillsgui", 
"skill_id", $a_top_skill_id);
 
  663            $actions[] = $this->ui_fac->button()->shy(
 
  664                $lng->txt(
'skmg_remove_skill'),
 
  665                $ilCtrl->getLinkTargetByClass(
"ilpersonalskillsgui", 
"confirmSkillRemove")
 
  668            $panel = $panel->withActions($this->ui_fac->dropdown()->standard($actions)->withLabel(
$lng->txt(
"actions")));
 
  671        return $this->ui_ren->render($panel);
 
  683        if (!$this->ws_tree) {
 
  684            include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
 
  685            include_once 
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
 
  690        $obj_id = $this->ws_tree->lookupObjectId($a_wsp_id);
 
  693        if (!$this->offline_mode) {
 
  694            $url = $this->ws_access->getGotoLink($a_wsp_id, 
$obj_id);
 
  696            $url = $this->offline_mode . 
"file_" . 
$obj_id . 
"/";
 
  701                    include_once 
"Modules/Test/classes/class.ilObjTestVerification.php";
 
  703                    $url .= $obj->getOfflineFilename();
 
  707                    include_once 
"Modules/Exercise/classes/class.ilObjExerciseVerification.php";
 
  709                    $url .= $obj->getOfflineFilename();
 
  713                    include_once 
"Modules/Course/classes/Verification/class.ilObjCourseVerification.php";
 
  715                    $url .= $obj->getOfflineFilename();
 
  719                    include_once 
"Modules/ScormAicc/classes/Verification/class.ilObjSCORMVerification.php";
 
  721                    $url .= $obj->getOfflineFilename();
 
  726                    $url .= $file->getFilename();
 
  731        return array($caption, 
$url);
 
  745        ilUtil::sendSuccess(
$lng->txt(
"msg_object_modified"));
 
  746        $ilCtrl->redirect($this, 
"listSkills");
 
  760        include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
 
  761        if (
$_GET[
"skill_id"] > 0) {
 
  764        if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
 
  766            $ilCtrl->redirect($this, 
"listSkills");
 
  768            include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
  770            $cgui->setFormAction(
$ilCtrl->getFormAction($this));
 
  771            $cgui->setHeaderText(
$lng->txt(
"skmg_really_remove_skills"));
 
  772            $cgui->setCancel(
$lng->txt(
"cancel"), 
"listSkills");
 
  773            $cgui->setConfirm(
$lng->txt(
"remove"), 
"removeSkills");
 
  779            $tpl->setContent($cgui->getHTML());
 
  792        if (is_array(
$_POST[
"id"])) {
 
  793            foreach (
$_POST[
"id"] as $n_id) {
 
  798        ilUtil::sendSuccess(
$lng->txt(
"msg_object_modified"));
 
  799        $ilCtrl->redirect($this, 
"listSkills");
 
  822        $ilTabs->setBackTarget(
 
  824            $ilCtrl->getLinkTarget($this, 
"render")
 
  827        $ilCtrl->saveParameter($this, 
"skill_id");
 
  828        $ilCtrl->saveParameter($this, 
"basic_skill_id");
 
  829        $ilCtrl->saveParameter($this, 
"tref_id");
 
  831        include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
 
  838        include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
 
  841        $skill_id = (int) 
$_GET[
"skill_id"];
 
  843            include_once(
"./Services/Skill/classes/class.ilSkillTemplateReference.php");
 
  844            $tref_id = 
$_GET[
"skill_id"];
 
  847        $bs = $vtree->getSubTreeForCSkillId($skill_id . 
":" . $tref_id, 
true);
 
  850        foreach ($bs as $b) {
 
  855        $cur_basic_skill_id = ((int) 
$_POST[
"basic_skill_id"] > 0)
 
  856            ? (int) 
$_POST[
"basic_skill_id"]
 
  857            : (((
int) 
$_GET[
"basic_skill_id"] > 0)
 
  858                ? (
int) 
$_GET[
"basic_skill_id"]
 
  861        $ilCtrl->setParameter($this, 
"basic_skill_id", $cur_basic_skill_id);
 
  863        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
  866        $si->setValue($cur_basic_skill_id);
 
  867        $ilToolbar->addInputItem(
$si, 
true);
 
  868        $ilToolbar->addFormButton(
 
  873        $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this));
 
  876        include_once(
"./Services/Skill/classes/class.ilSkillAssignMaterialsTableGUI.php");
 
  880            (
int) 
$_GET[
"skill_id"],
 
  881            (
int) 
$_GET[
"tref_id"],
 
  905        if (!
$ilSetting->get(
"disable_personal_workspace")) {
 
  906            $url = 
'ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace';
 
  907            $mbox = 
$ui->factory()->messageBox()->info(
$lng->txt(
"skmg_ass_materials_from_workspace"))
 
  908                ->withLinks([
$ui->factory()->link()->standard(
 
  909                    $lng->txt(
"personal_workspace"),
 
  915        $ilCtrl->saveParameter($this, 
"skill_id");
 
  916        $ilCtrl->saveParameter($this, 
"level_id");
 
  917        $ilCtrl->saveParameter($this, 
"tref_id");
 
  918        $ilCtrl->saveParameter($this, 
"basic_skill_id");
 
  920        $ilTabs->setBackTarget(
 
  922            $ilCtrl->getLinkTarget($this, 
"assignMaterials")
 
  926        include_once(
"./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorerGUI.php");
 
  928        $exp->setTypeWhiteList(array(
"blog", 
"wsrt", 
"wfld", 
"file", 
"tstv", 
"excv"));
 
  929        $exp->setSelectableTypes(array(
"file", 
"tstv", 
"excv"));
 
  930        $exp->setSelectMode(
"wsp_id", 
true);
 
  931        if ($exp->handleCommand()) {
 
  936        $mtpl = 
new ilTemplate(
"tpl.materials_selection.html", 
true, 
true, 
"Services/Skill");
 
  937        $mtpl->setVariable(
"EXP", $exp->getHTML());
 
  945        $tb->setFormAction(
$ilCtrl->getFormAction($this));
 
  946        $tb->setOpenFormTag(
true);
 
  947        $tb->setCloseFormTag(
false);
 
  948        $mtpl->setVariable(
"TOOLBAR1", $tb->getHTML());
 
  949        $tb->setOpenFormTag(
false);
 
  950        $tb->setCloseFormTag(
true);
 
  951        $mtpl->setVariable(
"TOOLBAR2", $tb->getHTML());
 
  966        include_once(
"./Services/Skill/classes/class.ilPersonalSkill.php");
 
  967        if (is_array(
$_POST[
"wsp_id"])) {
 
  971                    (
int) 
$_GET[
"skill_id"],
 
  972                    (
int) 
$_GET[
"tref_id"],
 
  973                    (
int) 
$_GET[
"basic_skill_id"],
 
  974                    (
int) 
$_GET[
"level_id"],
 
  978            ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"), 
true);
 
  981        $ilCtrl->saveParameter($this, 
"skill_id");
 
  982        $ilCtrl->saveParameter($this, 
"level_id");
 
  983        $ilCtrl->saveParameter($this, 
"tref_id");
 
  984        $ilCtrl->saveParameter($this, 
"basic_skill_id");
 
  986        $ilCtrl->redirect($this, 
"assignMaterials");
 
 1002            (
int) 
$_GET[
"tref_id"],
 
 1003            (
int) 
$_GET[
"level_id"],
 
 1004            (
int) 
$_GET[
"wsp_id"]
 
 1006        ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"), 
true);
 
 1007        $ilCtrl->redirect($this, 
"assignMaterials");
 
 1030        $ilTabs->setBackTarget(
 
 1032            $ilCtrl->getLinkTarget($this, 
"render")
 
 1035        $ilCtrl->saveParameter($this, 
"skill_id");
 
 1036        $ilCtrl->saveParameter($this, 
"basic_skill_id");
 
 1037        $ilCtrl->saveParameter($this, 
"tref_id");
 
 1039        include_once(
"./Services/Skill/classes/class.ilSkillTreeNode.php");
 
 1046        include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
 
 1049        $skill_id = (int) 
$_GET[
"skill_id"];
 
 1051            include_once(
"./Services/Skill/classes/class.ilSkillTemplateReference.php");
 
 1052            $tref_id = 
$_GET[
"skill_id"];
 
 1055        $bs = $vtree->getSubTreeForCSkillId($skill_id . 
":" . $tref_id, 
true);
 
 1059        foreach ($bs as $b) {
 
 1063        $cur_basic_skill_id = ((int) 
$_POST[
"basic_skill_id"] > 0)
 
 1064            ? (int) 
$_POST[
"basic_skill_id"]
 
 1065            : (((
int) 
$_GET[
"basic_skill_id"] > 0)
 
 1066                ? (
int) 
$_GET[
"basic_skill_id"]
 
 1069        $ilCtrl->setParameter($this, 
"basic_skill_id", $cur_basic_skill_id);
 
 1071        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
 1074        $si->setValue($cur_basic_skill_id);
 
 1075        $ilToolbar->addInputItem(
$si, 
true);
 
 1076        $ilToolbar->addFormButton(
 
 1077            $lng->txt(
"select"),
 
 1081        $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this));
 
 1084        include_once(
"./Services/Skill/classes/class.ilSelfEvaluationSimpleTableGUI.php");
 
 1088            (
int) 
$_GET[
"skill_id"],
 
 1089            (
int) 
$_GET[
"tref_id"],
 
 1107            (
int) 
$_GET[
"skill_id"],
 
 1108            (
int) 
$_GET[
"tref_id"],
 
 1109            (
int) 
$_GET[
"basic_skill_id"],
 
 1112        ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"), 
true);
 
 1119        $ilCtrl->redirect($this, 
"render");
 
 1136        $ilTabs->setBackTarget(
 
 1138            $ilCtrl->getLinkTarget($this, 
"")
 
 1141        include_once(
"./Services/Skill/classes/class.ilPersonalSkillExplorerGUI.php");
 
 1143        if ($exp->getHasSelectableNodes()) {
 
 1144            if (!$exp->handleCommand()) {
 
 1145                $tpl->setContent($exp->getHTML());
 
 1166        if (count($this->user_profiles) == 0 && $this->obj_skills == 
null) {
 
 1188        if (is_array($this->obj_skills) && $this->obj_id > 0) {
 
 1192        foreach ($this->user_profiles as $p) {
 
 1193            $options[$p[
"id"]] = 
$lng->txt(
"skmg_profile") . 
": " . $p[
"title"];
 
 1196        include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
 1200        $ilToolbar->addInputItem(
$si, 
true);
 
 1201        $ilToolbar->addFormButton(
 
 1202            $lng->txt(
"select"),
 
 1205        $ilToolbar->setFormAction(
$ilCtrl->getFormAction($this));
 
 1216        $this->gap_mode = 
"max_per_type";
 
 1217        $this->gap_mode_type = 
$a_type;
 
 1218        $this->gap_cat_title = $a_cat_title;
 
 1219        $this->mode = 
"gap";
 
 1229        $this->gap_mode = 
"max_per_object";
 
 1230        $this->gap_mode_obj_id = $a_obj_id;
 
 1231        $this->gap_cat_title = $a_cat_title;
 
 1232        $this->mode = 
"gap";
 
 1244        $this->actual_levels = array();
 
 1245        include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
 
 1246        foreach ($skills as $sk) {
 
 1248            if ($this->gap_mode == 
"max_per_type") {
 
 1249                $max = $bs->getMaxLevelPerType($sk[
"tref_id"], $this->gap_mode_type, $user_id);
 
 1250                $this->actual_levels[$sk[
"base_skill_id"]][$sk[
"tref_id"]] = $max;
 
 1251            } elseif ($this->gap_mode == 
"max_per_object") {
 
 1252                $max = $bs->getMaxLevelPerObject($sk[
"tref_id"], $this->gap_mode_obj_id, $user_id);
 
 1253                $this->actual_levels[$sk[
"base_skill_id"]][$sk[
"tref_id"]] = $max;
 
 1255                $max = $bs->getMaxLevel($sk[
"tref_id"], $user_id);
 
 1256                $this->actual_levels[$sk[
"base_skill_id"]][$sk[
"tref_id"]] = $max;
 
 1275        if ($a_skills == 
null) {
 
 1279        include_once(
"./Services/UIComponent/Panel/classes/class.ilPanelGUI.php");
 
 1285            $intro_html = $pan->getHTML();
 
 1290        if ($a_user_id == 0) {
 
 1293            $user_id = $a_user_id;
 
 1299            $this->profile_levels = $profile->getSkillLevels();
 
 1301            foreach ($this->profile_levels as 
$l) {
 
 1303                    "base_skill_id" => 
$l[
"base_skill_id"],
 
 1304                    "tref_id" => 
$l[
"tref_id"],
 
 1305                    "level_id" => 
$l[
"level_id"]
 
 1308        } elseif (is_array($a_skills)) {
 
 1309            $skills = $a_skills;
 
 1315        $incl_self_eval = 
false;
 
 1317            $incl_self_eval = 
true;
 
 1322        $all_chart_html = 
"";
 
 1325        $sw_skills = array();
 
 1326        foreach ($skills as $sk) {
 
 1327            if (!in_array($sk[
"base_skill_id"] . 
":" . $sk[
"tref_id"], $this->hidden_skills)) {
 
 1332        if (count($sw_skills) >= 3) {
 
 1333            $skill_packages = array();
 
 1335            if (count($sw_skills) < 8) {
 
 1336                $skill_packages[1] = $sw_skills;
 
 1338                $mod = count($sw_skills) % 7;
 
 1339                $pkg_num = floor((count($sw_skills) - 1) / 7) + 1;
 
 1341                foreach ($sw_skills as $k => 
$s) {
 
 1342                    $skill_packages[$cpkg][$k] = 
$s;
 
 1343                    if ($mod < 3 && count($skill_packages) == ($pkg_num - 1) && count($skill_packages[$cpkg]) == 3 + $mod) {
 
 1345                    } elseif (count($skill_packages[$cpkg]) == 7) {
 
 1352            foreach ($skill_packages as $pskills) {
 
 1355                $leg_labels = array();
 
 1360                foreach ($pskills as $k => 
$l) {
 
 1364                    $levels = $bs->getLevelData();
 
 1366                    foreach ($levels as $lv) {
 
 1368                        if (
$l[
"level_id"] == $lv[
"id"]) {
 
 1369                            $pskills[$k][
"target_cnt"] = $cnt;
 
 1371                        if ($this->actual_levels[
$l[
"base_skill_id"]][
$l[
"tref_id"]] == $lv[
"id"]) {
 
 1372                            $pskills[$k][
"actual_cnt"] = $cnt;
 
 1374                        if ($incl_self_eval) {
 
 1375                            if ($self_vals[
$l[
"base_skill_id"]][
$l[
"tref_id"]] == $lv[
"id"]) {
 
 1376                                $pskills[$k][
"self_cnt"] = $cnt;
 
 1379                        $max_cnt = max($max_cnt, $cnt);
 
 1383                include_once(
"./Services/Chart/classes/class.ilChart.php");
 
 1385                $chart->setsize(800, 300);
 
 1386                $chart->setYAxisMax($max_cnt);
 
 1387                $chart->setLegLabels($leg_labels);
 
 1390                $cd = $chart->getDataInstance();
 
 1391                $cd->setLabel(
$lng->txt(
"skmg_target_level"));
 
 1392                $cd->setFill(
true, 
"#A0A0A0");
 
 1395                $cd2 = $chart->getDataInstance();
 
 1396                if ($this->gap_cat_title != 
"") {
 
 1397                    $cd2->setLabel($this->gap_cat_title);
 
 1398                } elseif ($this->gap_mode == 
"max_per_type") {
 
 1399                    $cd2->setLabel(
$lng->txt(
"objs_" . $this->gap_mode_type));
 
 1400                } elseif ($this->gap_mode == 
"max_per_object") {
 
 1404                $cd2->setFill(
true, 
"#FF8080");
 
 1405                $cd2->setFill(
true, 
"#cc8466");
 
 1408                if ($incl_self_eval) {
 
 1409                    $cd3 = $chart->getDataInstance();
 
 1410                    $cd3->setLabel(
$lng->txt(
"skmg_self_evaluation"));
 
 1411                    $cd3->setFill(
true, 
"#6ea03c");
 
 1416                foreach ($pskills as $pl) {
 
 1417                    $cd->addPoint($cnt, (
int) $pl[
"target_cnt"]);
 
 1418                    $cd2->addPoint($cnt, (
int) $pl[
"actual_cnt"]);
 
 1419                    if ($incl_self_eval) {
 
 1420                        $cd3->addPoint($cnt, (
int) $pl[
"self_cnt"]);
 
 1427                    $chart->addData($cd);
 
 1429                $chart->addData($cd2);
 
 1431                    $chart->addData($cd3);
 
 1434                if ($pkg_cnt == 1) {
 
 1436                    $chart->setLegend(
$lg);
 
 1439                $chart_html = $chart->getHTML();
 
 1440                $all_chart_html .= $chart_html;
 
 1445            $pan->setBody($all_chart_html);
 
 1446            $all_chart_html = $pan->getHTML();
 
 1453        include_once(
"./Services/Skill/classes/class.ilVirtualSkillTree.php");
 
 1455        $skills = $vtree->getOrderedNodeset($skills, 
"base_skill_id", 
"tref_id");
 
 1456        foreach ($skills as 
$s) {
 
 1457            $path = $stree->getSkillTreePath(
$s[
"base_skill_id"]);
 
 1460            foreach (
$path as $p) {
 
 1472        return $intro_html . $all_chart_html . 
$html;
 
 1484        $ilCtrl->setParameter($this, 
"profile_id", 
$_POST[
"profile_id"]);
 
 1485        if ($this->mode == 
"gap") {
 
 1486            $ilCtrl->redirect($this, 
"listProfilesForGap");
 
 1488            $ilCtrl->redirect($this, 
"listAssignedProfile");
 
 1503        if ($a_user_id == 0) {
 
 1504            $a_user_id = 
$ilUser->getId();
 
 1509        foreach ($a_levels as $v) {
 
 1523        $tpl = 
new ilTemplate(
"tpl.skill_materials.html", 
true, 
true, 
"Services/Skill");
 
 1524        foreach ($a_levels as $k => $v) {
 
 1531                $tpl->setCurrentBlock(
"material");
 
 1533                $tpl->setVariable(
"HREF_LINK", $mat_data[1]);
 
 1534                $tpl->setVariable(
"TXT_LINK", $mat_data[0]);
 
 1535                $tpl->parseCurrentBlock();
 
 1539                $tpl->setCurrentBlock(
"level");
 
 1540                $tpl->setVariable(
"LEVEL_VAL", $v[
"title"]);
 
 1541                $tpl->parseCurrentBlock();
 
 1544        $tpl->setVariable(
"TXT_MATERIAL", 
$lng->txt(
"skmg_materials"));
 
 1560        $profile_levels = $profile->getSkillLevels();
 
 1562        $a_activated_levels = array();
 
 1564        foreach ($a_levels as $k => $v) {
 
 1565            foreach ($profile_levels as $pl) {
 
 1566                if ($pl[
"level_id"] == $v[
"id"] &&
 
 1567                    $pl[
"base_skill_id"] == $v[
"skill_id"] &&
 
 1568                    $a_tref_id == $pl[
"tref_id"]) {
 
 1569                    $a_activated_levels[] = $pl[
"level_id"];
 
 1574        $tpl = 
new ilTemplate(
"tpl.skill_eval_item.html", 
true, 
true, 
"Services/Skill");
 
 1575        $tpl->setVariable(
"SCALE_BAR", $this->
getScaleBar($a_levels, $a_activated_levels));
 
 1577        $tpl->setVariable(
"TYPE", 
$lng->txt(
"skmg_target_level"));
 
 1578        $tpl->setVariable(
"TITLE", 
"");
 
 1593        $a_activated_levels = array();
 
 1594        foreach ($a_levels as $k => $v) {
 
 1595            if ($this->actual_levels[$v[
"skill_id"]][$a_tref_id] == $v[
"id"]) {
 
 1596                $a_activated_levels[] = $v[
"id"];
 
 1600        if ($this->gap_cat_title != 
"") {
 
 1601            $title = $this->gap_cat_title;
 
 1602        } elseif ($this->gap_mode == 
"max_per_type") {
 
 1603            $title = 
$lng->txt(
"objs_" . $this->gap_mode_type);
 
 1604        } elseif ($this->gap_mode == 
"max_per_object") {
 
 1608        $tpl = 
new ilTemplate(
"tpl.skill_eval_item.html", 
true, 
true, 
"Services/Skill");
 
 1609        $tpl->setVariable(
"SCALE_BAR", $this->
getScaleBar($a_levels, $a_activated_levels));
 
 1612        $tpl->setVariable(
"TYPE", 
$lng->txt(
"skmg_eval_type_" . 
$type));
 
 1636        if (count($self_vals) == 0) {
 
 1640        $a_activated_levels = array();
 
 1641        foreach ($a_levels as $k => $v) {
 
 1642            if ($self_vals[$v[
"skill_id"]][$a_tref_id] == $v[
"id"]) {
 
 1643                $a_activated_levels[] = $v[
"id"];
 
 1647        $tpl = 
new ilTemplate(
"tpl.skill_eval_item.html", 
true, 
true, 
"Services/Skill");
 
 1648        $tpl->setVariable(
"SCALE_BAR", $this->
getScaleBar($a_levels, $a_activated_levels));
 
 1651        $tpl->setVariable(
"TYPE", 
$lng->txt(
"skmg_eval_type_" . 
$type));
 
 1671        if (!is_array($a_activated_levels)) {
 
 1672            $a_activated_levels = array($a_activated_levels);
 
 1675        foreach ($a_levels as $level) {
 
 1676            $vals[$level[
"title"]] = (in_array($level[
"id"], $a_activated_levels));
 
 1678        $scale_bar = $this->ui_fac->chart()->scaleBar($vals);
 
 1680        return $this->ui_ren->render($scale_bar);
 
 1694        $tpl = 
new ilTemplate(
"tpl.skill_eval_item.html", 
true, 
true, 
"Services/Skill");
 
 1695        $tpl->setVariable(
"SCALE_BAR", $this->
getScaleBar($a_levels, $a_level_entry[
"level_id"]));
 
 1697        include_once(
"./Services/Skill/classes/class.ilSkillEval.php");
 
 1700        if ($a_level_entry[
"self_eval"] == 1) {
 
 1704        if ($a_level_entry[
"trigger_obj_type"] == 
"tst") {
 
 1709        $title = ($a_level_entry[
"trigger_obj_id"] > 0)
 
 1710                ? $a_level_entry[
"trigger_title"]
 
 1713        if ($a_level_entry[
"trigger_ref_id"] > 0
 
 1714            && $ilAccess->checkAccess(
"read", 
"", $a_level_entry[
"trigger_ref_id"])) {
 
 1715            include_once(
"./Services/Link/classes/class.ilLink.php");
 
 1719        $tpl->setVariable(
"TYPE", 
$lng->txt(
"skmg_eval_type_" . 
$type));
 
 1743        $level_data = $skill->getLevelData();
 
 1744        $tpl = 
new ilTemplate(
"tpl.skill_desc.html", 
true, 
true, 
"Services/Skill");
 
 1746        $desc_exists = 
false;
 
 1747        foreach ($level_data as 
$l) {
 
 1748            if (
$l[
"description"] != 
"") {
 
 1749                $desc_exists = 
true;
 
 1754            foreach ($level_data as 
$l) {
 
 1755                $tpl->setCurrentBlock(
"level");
 
 1756                $tpl->setVariable(
"LEVEL_VAL", 
$l[
"title"]);
 
 1757                $tpl->setVariable(
"LEVEL_DESC", nl2br(
$l[
"description"]));
 
 1758                $tpl->parseCurrentBlock();
 
 1775        $tpl = 
new ilTemplate(
"tpl.suggested_resources.html", 
true, 
true, 
"Services/Skill");
 
 1778        if ($a_profile_id > 0) {
 
 1780            $current_target_level = 0;
 
 1782            foreach ($a_levels as $k => $v) {
 
 1783                foreach ($this->profile_levels as $pl) {
 
 1784                    if ($pl[
"level_id"] == $v[
"id"] &&
 
 1785                        $pl[
"base_skill_id"] == $v[
"skill_id"]) {
 
 1787                        $current_target_level = $v[
"id"];
 
 1791                if ($this->actual_levels[$v[
"skill_id"]][$a_tref_id] == $v[
"id"]) {
 
 1798                include_once(
"./Services/Skill/classes/class.ilSkillResources.php");
 
 1800                $res = $skill_res->getResources();
 
 1801                $imp_resources = array();
 
 1802                foreach (
$res as $level) {
 
 1803                    foreach ($level as 
$r) {
 
 1804                        if (
$r[
"imparting"] == 
true &&
 
 1805                            $current_target_level == 
$r[
"level_id"]) {
 
 1806                            $imp_resources[] = 
$r;
 
 1810                foreach ($imp_resources as 
$r) {
 
 1811                    $ref_id = 
$r[
"rep_ref_id"];
 
 1814                    include_once(
"./Services/Link/classes/class.ilLink.php");
 
 1815                    $tpl->setCurrentBlock(
"resource_item");
 
 1818                    $tpl->parseCurrentBlock();
 
 1820                if (count($imp_resources) > 0) {
 
 1821                    $tpl->touchBlock(
"resources_list");
 
 1822                    $tpl->setVariable(
"SUGGESTED_MAT_MESS", 
$lng->txt(
"skmg_skill_needs_impr_res"));
 
 1825                    $tpl->setVariable(
"SUGGESTED_MAT_MESS", 
$lng->txt(
"skmg_skill_needs_impr_no_res"));
 
 1829                $tpl->setVariable(
"SUGGESTED_MAT_MESS", 
$lng->txt(
"skmg_skill_no_needs_impr"));
 
 1834            include_once(
"./Services/Skill/classes/class.ilSkillResources.php");
 
 1836            $res = $skill_res->getResources();
 
 1839            foreach (
$res as $level) {
 
 1842                foreach ($level as 
$r) {
 
 1843                    if (
$r[
"imparting"]) {
 
 1844                        $ref_id = 
$r[
"rep_ref_id"];
 
 1847                        include_once(
"./Services/Link/classes/class.ilLink.php");
 
 1848                        $tpl->setCurrentBlock(
"resource_item");
 
 1851                        $tpl->parseCurrentBlock();
 
 1854                        $cl = 
$r[
"level_id"];
 
 1858                    $tpl->setCurrentBlock(
"resources_list_level");
 
 1859                    $tpl->setVariable(
"TXT_LEVEL", 
$lng->txt(
"skmg_level"));
 
 1861                    $tpl->parseCurrentBlock();
 
 1862                    $tpl->touchBlock(
"resources_list");
 
 1866                $tpl->setVariable(
"SUGGESTED_MAT_MESS", 
$lng->txt(
"skmg_suggested_resources"));
 
 1885        $tpl = 
new ilTemplate(
"tpl.skill_filter.html", 
true, 
true, 
"Services/Skill");
 
 1893        $filter_toolbar->setFormAction(
$ilCtrl->getFormAction($this));
 
 1894        $this->
getFilter()->addToToolbar($filter_toolbar, 
true);
 
 1899            $this->profile_levels = $profile->getSkillLevels();
 
 1901            foreach ($this->profile_levels as 
$l) {
 
 1903                    "base_skill_id" => 
$l[
"base_skill_id"],
 
 1904                    "tref_id" => 
$l[
"tref_id"],
 
 1905                    "level_id" => 
$l[
"level_id"]
 
 1914        foreach ($skills as 
$s) {
 
 1920            $filter_toolbar->addFormButton($this->lng->txt(
"skmg_refresh_view"), 
"applyFilterAssignedProfiles");
 
 1922            $tpl->setVariable(
"FILTER", $filter_toolbar->getHTML());
 
 1927        $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.
getSkillDescription($skill)
Get level description.
selfEvaluation()
Assign materials to skill levels.
setObjectSkills($a_obj_id, $a_skills=null)
Set object skills.
setIntroText($a_val)
Set intro text.
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.
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 _lookupType($a_obj_id)
Lookup Type.
special template class to simplify handling of ITX/PEAR
UI interface hook processor.
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.
catch(Exception $e) $message
foreach($_POST as $key=> $value) $res