ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilPersonalSkillsGUI Class Reference

Personal skills GUI class. More...

+ Collaboration diagram for ilPersonalSkillsGUI:

Public Member Functions

 __construct ()
 Contructor. More...
 
 setProfileId ($a_val)
 Set profile id. More...
 
 getProfileId ()
 Get profile id. More...
 
 setGapAnalysisSelfEvalLevels (array $a_val)
 Set self evaluation levels for gap analysis. More...
 
 getGapAnalysisSelfEvalLevels ()
 Get self evaluation levels for gap analysis. More...
 
 setHistoryView ($a_val)
 Set history view. More...
 
 getHistoryView ()
 Get history view. More...
 
 setIntroText ($a_val)
 Set intro text. More...
 
 getIntroText ()
 Get intro text. More...
 
 hideSkill ($a_skill_id, $a_tref_id=0)
 Hide skill. More...
 
 determineCurrentProfile ()
 Determine current profile id. More...
 
 setObjectSkills ($a_obj_id, $a_skills=null)
 Set object skills. More...
 
 executeCommand ()
 Execute command. More...
 
 setTabs ($a_activate)
 Set tabs. More...
 
 setOfflineMode ($a_file_path)
 
 listSkills ()
 List skills. More...
 
 getSkillHTML ($a_top_skill_id, $a_user_id=0, $a_edit=false, $a_tref_id=0)
 Get skill presentation HTML. More...
 
 renderSkillHTML ($a_top_skill_id, $a_user_id=0, $a_edit=false, $a_tref_id=0)
 Render skill html. More...
 
 getMaterialInfo ($a_wsp_id, $a_user_id)
 Get material file name and goto url. More...
 
 addSkill ()
 Add personal skill. More...
 
 confirmSkillRemove ()
 Confirm skill remove. More...
 
 removeSkills ()
 Remove skills. More...
 
 assignMaterials ()
 Assign materials to skill levels. More...
 
 assignMaterial ()
 Assign materials to skill level. More...
 
 selectMaterial ()
 Select material. More...
 
 removeMaterial ()
 Remove material. More...
 
 selfEvaluation ()
 Assign materials to skill levels. More...
 
 saveSelfEvaluation ()
 Save self evaluation. More...
 
 listSkillsForAdd ()
 LIst skills for adding. More...
 
 listProfilesForGap ()
 List profiles. More...
 
 showProfileSelectorToolbar ()
 Show profile selector toolbar. More...
 
 setGapAnalysisActualStatusModePerType ($a_type, $a_cat_title="")
 Set gap analysis actual status mode "per type". More...
 
 setGapAnalysisActualStatusModePerObject ($a_obj_id, $a_cat_title="")
 Set gap analysis actual status mode "per object". More...
 
 getGapAnalysisHTML ($a_user_id=0, $a_skills=null)
 Get gap analysis html. More...
 
 selectProfile ()
 Select profile. More...
 
 getMaterials ($a_levels, $a_tref_id=0, $a_user_id=0)
 Get materials. More...
 
 getProfileTargetItem ($a_profile_id, $a_levels, $a_tref_id=0)
 Get profile target item. More...
 
 getActualGapItem ($a_levels, $a_tref_id=0)
 
 getSelfEvalGapItem ($a_levels, $a_tref_id=0)
 
 getScaleBar ($a_levels, $a_activated_levels)
 Get scale bar. More...
 
 getEvalItem ($a_levels, $a_level_entry)
 Get eval item. More...
 
 getSkillDescription ($skill)
 Get level description. More...
 
 getSuggestedResources ($a_profile_id, $a_levels, $a_base_skill, $a_tref_id)
 Render suggested resources. More...
 
 listAssignedProfile ()
 List profile. More...
 

Static Public Attributes

static $skill_tt_cnt = 1
 

Protected Member Functions

 getActualLevels ($skills, $user_id)
 Get actual levels. More...
 

Protected Attributes

 $offline_mode
 
 $skill_tree
 
 $actual_levels = array()
 
 $gap_self_eval_levels = array()
 
 $mode = ""
 
 $history_view = false
 
 $intro_text = ""
 
 $hidden_skills = array()
 
 $ctrl
 
 $lng
 
 $help
 
 $setting
 
 $user
 
 $tpl
 
 $tabs
 
 $toolbar
 
 $access
 
 $ui_fac
 
 $ui_ren
 
 $obj_id = 0
 
 $obj_skills = array()
 

Detailed Description

Personal skills GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

ilPersonalSkillsGUI:

Definition at line 18 of file class.ilPersonalSkillsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPersonalSkillsGUI::__construct ( )

Contructor.

public

Definition at line 92 of file class.ilPersonalSkillsGUI.php.

References $ctrl, $DIC, $help, $ilCtrl, $ilSetting, $lng, $setting, ilSkillProfile\getProfilesOfUser(), and user().

93  {
94  global $DIC;
95 
96  $this->ctrl = $DIC->ctrl();
97  $this->lng = $DIC->language();
98  $this->help = $DIC["ilHelp"];
99  $this->setting = $DIC["ilSetting"];
100  $this->user = $DIC->user();
101  $this->tpl = $DIC["tpl"];
102  $this->tabs = $DIC->tabs();
103  $this->toolbar = $DIC->toolbar();
104  $this->access = $DIC->access();
105  $this->ui_fac = $DIC->ui()->factory();
106  $this->ui_ren = $DIC->ui()->renderer();
107 
109  $ilHelp = $this->help;
110  $lng = $this->lng;
112 
113 
114  $lng->loadLanguageModule('skmg');
115  $ilHelp->setScreenIdComponent("skill");
116 
117  $ilCtrl->saveParameter($this, "skill_id");
118  $ilCtrl->saveParameter($this, "tref_id");
119  $ilCtrl->saveParameter($this, "profile_id");
120 
121  $this->user_profiles = ilSkillProfile::getProfilesOfUser($this->user->getId());
122 
123  include_once("./Services/Skill/classes/class.ilSkillTree.php");
124  $this->skill_tree = new ilSkillTree();
125 
126  $this->use_materials = !$ilSetting->get("disable_personal_workspace");
127 
128  include_once("./Services/Skill/classes/class.ilSkillManagementSettings.php");
129  $this->skmg_settings = new ilSkillManagementSettings();
130  }
global $DIC
Definition: saml.php:7
Skill tree.
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
static getProfilesOfUser($a_user_id)
Get profiles of a user.
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:

Member Function Documentation

◆ addSkill()

ilPersonalSkillsGUI::addSkill ( )

Add personal skill.

Definition at line 621 of file class.ilPersonalSkillsGUI.php.

References $_GET, $ctrl, $ilCtrl, $ilUser, $lng, $user, ilPersonalSkill\addPersonalSkill(), and ilUtil\sendSuccess().

622  {
625  $lng = $this->lng;
626 
627  ilPersonalSkill::addPersonalSkill($ilUser->getId(), (int) $_GET["obj_id"]);
628 
629  ilUtil::sendSuccess($lng->txt("msg_object_modified"));
630  $ilCtrl->redirect($this, "listSkills");
631  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static addPersonalSkill($a_user_id, $a_skill_node_id)
Add personal skill.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ assignMaterial()

ilPersonalSkillsGUI::assignMaterial ( )

Assign materials to skill level.

Parameters

Definition at line 779 of file class.ilPersonalSkillsGUI.php.

References $ctrl, $ilCtrl, $ilSetting, $ilUser, $lng, $setting, $tabs, $tpl, $user, array, ilUtil\sendInfo(), and ilTreeExplorerGUI\setTypeWhiteList().

780  {
783  $lng = $this->lng;
784  $tpl = $this->tpl;
785  $ilTabs = $this->tabs;
787 
788  if (!$ilSetting->get("disable_personal_workspace")) {
789  ilUtil::sendInfo($lng->txt("skmg_ass_materials_from_workspace") . " » <a href='ilias.php?baseClass=ilPersonalDesktopGUI&amp;cmd=jumpToWorkspace'>" . $lng->txt("personal_workspace") . "</a>");
790  }
791 
792  $ilCtrl->saveParameter($this, "skill_id");
793  $ilCtrl->saveParameter($this, "level_id");
794  $ilCtrl->saveParameter($this, "tref_id");
795  $ilCtrl->saveParameter($this, "basic_skill_id");
796 
797  $ilTabs->setBackTarget(
798  $lng->txt("back"),
799  $ilCtrl->getLinkTarget($this, "assignMaterials")
800  );
801 
802 
803  include_once("./Services/PersonalWorkspace/classes/class.ilWorkspaceExplorerGUI.php");
804  $exp = new ilWorkspaceExplorerGUI($ilUser->getId(), $this, "assignMaterial", $this, "selectMaterial");
805  $exp->setTypeWhiteList(array("blog", "wsrt", "wfld", "file", "tstv", "excv"));
806  $exp->setSelectableTypes(array("file", "tstv", "excv"));
807  $exp->setSelectMode("wsp_id", true);
808  if ($exp->handleCommand()) {
809  return;
810  }
811 
812  // fill template
813  $mtpl = new ilTemplate("tpl.materials_selection.html", true, true, "Services/Skill");
814  $mtpl->setVariable("EXP", $exp->getHTML());
815 
816  // toolbars
817  $tb = new ilToolbarGUI();
818  $tb->addFormButton(
819  $lng->txt("select"),
820  "selectMaterial"
821  );
822  $tb->setFormAction($ilCtrl->getFormAction($this));
823  $tb->setOpenFormTag(true);
824  $tb->setCloseFormTag(false);
825  $mtpl->setVariable("TOOLBAR1", $tb->getHTML());
826  $tb->setOpenFormTag(false);
827  $tb->setCloseFormTag(true);
828  $mtpl->setVariable("TOOLBAR2", $tb->getHTML());
829 
830  $tpl->setContent($mtpl->get());
831  }
setTypeWhiteList($a_val)
Set type white list.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
special template class to simplify handling of ITX/PEAR
Explorer for selecting a personal workspace item.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
global $ilSetting
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ assignMaterials()

ilPersonalSkillsGUI::assignMaterials ( )

Assign materials to skill levels.

Parameters

Definition at line 697 of file class.ilPersonalSkillsGUI.php.

References $_GET, $_POST, $ctrl, $ilCtrl, $lng, $options, $si, $tab, $tabs, $toolbar, $tpl, ilSkillTemplateReference\_lookupTemplateId(), ilSkillTreeNode\_lookupTitle(), ilSkillTreeNode\_lookupType(), array, and ilUtil\getImagePath().

698  {
700  $lng = $this->lng;
701  $tpl = $this->tpl;
702  $ilToolbar = $this->toolbar;
703  $ilTabs = $this->tabs;
704 
705 
706  $ilTabs->setBackTarget(
707  $lng->txt("back"),
708  $ilCtrl->getLinkTarget($this, "listSkills")
709  );
710 
711  $ilCtrl->saveParameter($this, "skill_id");
712  $ilCtrl->saveParameter($this, "basic_skill_id");
713  $ilCtrl->saveParameter($this, "tref_id");
714 
715  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
716  $tpl->setTitle(ilSkillTreeNode::_lookupTitle((int) $_GET["skill_id"]));
717  $tpl->setTitleIcon(ilUtil::getImagePath("icon_" .
718  ilSkillTreeNode::_lookupType((int) $_GET["skill_id"]) .
719  ".svg"));
720 
721  // basic skill selection
722  include_once("./Services/Skill/classes/class.ilVirtualSkillTree.php");
723  $vtree = new ilVirtualSkillTree();
724  $tref_id = 0;
725  $skill_id = (int) $_GET["skill_id"];
726  if (ilSkillTreeNode::_lookupType((int) $_GET["skill_id"]) == "sktr") {
727  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
728  $tref_id = $_GET["skill_id"];
729  $skill_id = ilSkillTemplateReference::_lookupTemplateId($_GET["skill_id"]);
730  }
731  $bs = $vtree->getSubTreeForCSkillId($skill_id . ":" . $tref_id, true);
732 
733  $options = array();
734  foreach ($bs as $b) {
735  //$options[$b["id"]] = ilSkillTreeNode::_lookupTitle($b["id"]);
736  $options[$b["skill_id"]] = ilSkillTreeNode::_lookupTitle($b["skill_id"]);
737  }
738 
739  $cur_basic_skill_id = ((int) $_POST["basic_skill_id"] > 0)
740  ? (int) $_POST["basic_skill_id"]
741  : (((int) $_GET["basic_skill_id"] > 0)
742  ? (int) $_GET["basic_skill_id"]
743  : key($options));
744 
745  $ilCtrl->setParameter($this, "basic_skill_id", $cur_basic_skill_id);
746 
747  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
748  $si = new ilSelectInputGUI($lng->txt("skmg_skill"), "basic_skill_id");
749  $si->setOptions($options);
750  $si->setValue($cur_basic_skill_id);
751  $ilToolbar->addInputItem($si, true);
752  $ilToolbar->addFormButton(
753  $lng->txt("select"),
754  "assignMaterials"
755  );
756 
757  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
758 
759  // table
760  include_once("./Services/Skill/classes/class.ilSkillAssignMaterialsTableGUI.php");
762  $this,
763  "assignMaterials",
764  (int) $_GET["skill_id"],
765  (int) $_GET["tref_id"],
766  $cur_basic_skill_id
767  );
768 
769  $tpl->setContent($tab->getHTML());
770  }
This class represents a selection list property in a property form.
$_GET["client_id"]
Assign materials to skill levels table.
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupTemplateId($a_obj_id)
Lookup template ID.
Create styles array
The data for the language used.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
$_POST["username"]
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:

◆ confirmSkillRemove()

ilPersonalSkillsGUI::confirmSkillRemove ( )

Confirm skill remove.

Definition at line 638 of file class.ilPersonalSkillsGUI.php.

References $_GET, $_POST, $ctrl, $i, $ilCtrl, $lng, $tpl, ilSkillTreeNode\_lookupTitle(), and ilUtil\sendInfo().

639  {
640  $lng = $this->lng;
641  $tpl = $this->tpl;
643 
644  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
645  if ($_GET["skill_id"] > 0) {
646  $_POST["id"][] = $_GET["skill_id"];
647  }
648  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
649  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
650  $ilCtrl->redirect($this, "listSkills");
651  } else {
652  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
653  $cgui = new ilConfirmationGUI();
654  $cgui->setFormAction($ilCtrl->getFormAction($this));
655  $cgui->setHeaderText($lng->txt("skmg_really_remove_skills"));
656  $cgui->setCancel($lng->txt("cancel"), "listSkills");
657  $cgui->setConfirm($lng->txt("remove"), "removeSkills");
658 
659  foreach ($_POST["id"] as $i) {
660  $cgui->addItem("id[]", $i, ilSkillTreeNode::_lookupTitle($i));
661  }
662 
663  $tpl->setContent($cgui->getHTML());
664  }
665  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
$i
Definition: disco.tpl.php:19
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ determineCurrentProfile()

ilPersonalSkillsGUI::determineCurrentProfile ( )

Determine current profile id.

Parameters

Definition at line 229 of file class.ilPersonalSkillsGUI.php.

References $_GET, $ctrl, $ilCtrl, and setProfileId().

Referenced by listAssignedProfile(), and listProfilesForGap().

230  {
232 
233  if (count($this->user_profiles) == 0) {
234  return;
235  }
236  $current_prof_id = 0;
237  if ((int) $_GET["profile_id"] > 0) {
238  foreach ($this->user_profiles as $p) {
239  if ($p["id"] == (int) $_GET["profile_id"]) {
240  $current_prof_id = (int) $_GET["profile_id"];
241  }
242  }
243  }
244 
245  if ($current_prof_id == 0 && !(is_array($this->obj_skills) && $this->obj_id > 0)) {
246  $current_prof_id = $this->user_profiles[0]["id"];
247  }
248  $ilCtrl->setParameter($this, "profile_id", $current_prof_id);
249  $this->setProfileId($current_prof_id);
250  }
setProfileId($a_val)
Set profile id.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilPersonalSkillsGUI::executeCommand ( )

Execute command.

public

Definition at line 270 of file class.ilPersonalSkillsGUI.php.

References $ctrl, $ilCtrl, $ilUser, $lng, $tpl, $user, and ilUtil\getImagePath().

271  {
274  $lng = $this->lng;
275  $tpl = $this->tpl;
276 
277  $next_class = $ilCtrl->getNextClass($this);
278 
279 
280  // determin standard command
281  $std_cmd = "listSkills";
282 
283  $cmd = $ilCtrl->getCmd($std_cmd);
284 
285  $tpl->setTitle($lng->txt("skills"));
286  $tpl->setTitleIcon(ilUtil::getImagePath("icon_skmg.svg"));
287 
288  switch ($next_class) {
289  default:
290  $this->$cmd();
291  break;
292  }
293  return true;
294  }
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ getActualGapItem()

ilPersonalSkillsGUI::getActualGapItem (   $a_levels,
  $a_tref_id = 0 
)
Parameters

Definition at line 1466 of file class.ilPersonalSkillsGUI.php.

References $lng, $title, $tpl, $type, ilObject\_lookupTitle(), array, and getScaleBar().

Referenced by renderSkillHTML().

1467  {
1468  $lng = $this->lng;
1469 
1470  $a_activated_levels = array();
1471  foreach ($a_levels as $k => $v) {
1472  if ($this->actual_levels[$v["skill_id"]][$a_tref_id] == $v["id"]) {
1473  $a_activated_levels[] = $v["id"];
1474  }
1475  }
1476 
1477  if ($this->gap_cat_title != "") {
1478  $title = $this->gap_cat_title;
1479  } elseif ($this->gap_mode == "max_per_type") {
1480  $title = $lng->txt("objs_" . $this->gap_mode_type);
1481  } elseif ($this->gap_mode == "max_per_object") {
1482  $title = ilObject::_lookupTitle($this->gap_mode_obj_id);
1483  }
1484 
1485  $tpl = new ilTemplate("tpl.skill_eval_item.html", true, true, "Services/Skill");
1486  $tpl->setVariable("SCALE_BAR", $this->getScaleBar($a_levels, $a_activated_levels));
1487 
1488  $type = 1;
1489  $tpl->setVariable("TYPE", $lng->txt("skmg_eval_type_" . $type));
1490  if ($type > 0) {
1491  $tpl->touchBlock("st" . $type);
1492  $tpl->touchBlock("stb" . $type);
1493  }
1494 
1495  if ($title != $lng->txt("skmg_eval_type_" . $type)) {
1496  $tpl->setVariable("TITLE", $title);
1497  }
1498 
1499  return $tpl->get();
1500  }
$type
static _lookupTitle($a_id)
lookup object title
getScaleBar($a_levels, $a_activated_levels)
Get scale bar.
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActualLevels()

ilPersonalSkillsGUI::getActualLevels (   $skills,
  $user_id 
)
protected

Get actual levels.

Parameters
array$skills
int$user_id

Definition at line 1118 of file class.ilPersonalSkillsGUI.php.

References array.

Referenced by getGapAnalysisHTML(), and listAssignedProfile().

1119  {
1120  // get actual levels for gap analysis
1121  $this->actual_levels = array();
1122  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
1123  foreach ($skills as $sk) {
1124  $bs = new ilBasicSkill($sk["base_skill_id"]);
1125  if ($this->gap_mode == "max_per_type") {
1126  $max = $bs->getMaxLevelPerType($sk["tref_id"], $this->gap_mode_type, $user_id);
1127  $this->actual_levels[$sk["base_skill_id"]][$sk["tref_id"]] = $max;
1128  } elseif ($this->gap_mode == "max_per_object") {
1129  $max = $bs->getMaxLevelPerObject($sk["tref_id"], $this->gap_mode_obj_id, $user_id);
1130  $this->actual_levels[$sk["base_skill_id"]][$sk["tref_id"]] = $max;
1131  } else {
1132  $max = $bs->getMaxLevel($sk["tref_id"], $user_id);
1133  $this->actual_levels[$sk["base_skill_id"]][$sk["tref_id"]] = $max;
1134  }
1135  }
1136  }
Create styles array
The data for the language used.
Basic Skill.
+ Here is the caller graph for this function:

◆ getEvalItem()

ilPersonalSkillsGUI::getEvalItem (   $a_levels,
  $a_level_entry 
)

Get eval item.

Parameters

Definition at line 1566 of file class.ilPersonalSkillsGUI.php.

References $access, $lng, $title, $tpl, $type, ilLink\_getLink(), ilDatePresentation\formatDate(), getScaleBar(), IL_CAL_DATETIME, ilDatePresentation\setUseRelativeDates(), ilSkillEval\TYPE_APPRAISAL, ilSkillEval\TYPE_MEASUREMENT, and ilSkillEval\TYPE_SELF_EVAL.

Referenced by renderSkillHTML().

1567  {
1568  $lng = $this->lng;
1569  $ilAccess = $this->access;
1570 
1571  $tpl = new ilTemplate("tpl.skill_eval_item.html", true, true, "Services/Skill");
1572  $tpl->setVariable("SCALE_BAR", $this->getScaleBar($a_levels, $a_level_entry["level_id"]));
1573 
1574  include_once("./Services/Skill/classes/class.ilSkillEval.php");
1576 
1577  if ($a_level_entry["self_eval"] == 1) {
1579  }
1580 
1581  if ($a_level_entry["trigger_obj_type"] == "tst") {
1583  }
1584 
1586  $title = ($a_level_entry["trigger_obj_id"] > 0)
1587  ? $a_level_entry["trigger_title"]
1588  : "";
1589 
1590  if ($a_level_entry["trigger_ref_id"] > 0
1591  && $ilAccess->checkAccess("read", "", $a_level_entry["trigger_ref_id"])) {
1592  include_once("./Services/Link/classes/class.ilLink.php");
1593  $title = "<a href='" . ilLink::_getLink($a_level_entry["trigger_ref_id"]) . "'>" . $title . "</a>";
1594  }
1595 
1596  $tpl->setVariable("TYPE", $lng->txt("skmg_eval_type_" . $type));
1597  if ($type > 0) {
1598  $tpl->touchBlock("st" . $type);
1599  $tpl->touchBlock("stb" . $type);
1600  }
1601  $tpl->setVariable("TITLE", $title);
1602  $tpl->setVariable(
1603  "DATE",
1604  ilDatePresentation::formatDate(new ilDate($a_level_entry["status_date"], IL_CAL_DATETIME))
1605  );
1606 
1608 
1609  return $tpl->get();
1610  }
const IL_CAL_DATETIME
$type
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
static setUseRelativeDates($a_status)
set use relative dates
getScaleBar($a_levels, $a_activated_levels)
Get scale bar.
Class for single dates.
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGapAnalysisHTML()

ilPersonalSkillsGUI::getGapAnalysisHTML (   $a_user_id = 0,
  $a_skills = null 
)

Get gap analysis html.

Parameters

Definition at line 1146 of file class.ilPersonalSkillsGUI.php.

References $chart, $html, $ilUser, $l, $lg, $lng, $obj_skills, $path, $s, $user, ilSkillTreeNode\_lookupTitle(), ilObject\_lookupTitle(), array, getActualLevels(), getGapAnalysisSelfEvalLevels(), ilPanelGUI\getInstance(), ilChart\getInstanceByType(), getIntroText(), getProfileId(), getSkillHTML(), ilPanelGUI\PANEL_STYLE_PRIMARY, ilSkillTreeNode\STATUS_DRAFT, and ilChart\TYPE_SPIDER.

Referenced by listProfilesForGap().

1147  {
1148  $ilUser = $this->user;
1149  $lng = $this->lng;
1150 
1151 
1152  if ($a_skills == null) {
1153  $a_skills = $this->obj_skills;
1154  }
1155 
1156  include_once("./Services/UIComponent/Panel/classes/class.ilPanelGUI.php");
1157 
1158  if ($this->getIntroText() != "") {
1159  $pan = ilPanelGUI::getInstance();
1160  $pan->setPanelStyle(ilPanelGUI::PANEL_STYLE_PRIMARY);
1161  $pan->setBody($this->getIntroText());
1162  $intro_html = $pan->getHTML();
1163  }
1164 
1165  // $this->setTabs("list_skills");
1166 
1167  if ($a_user_id == 0) {
1168  $user_id = $ilUser->getId();
1169  } else {
1170  $user_id = $a_user_id;
1171  }
1172 
1173  $skills = array();
1174  if ($this->getProfileId() > 0) {
1175  $profile = new ilSkillProfile($this->getProfileId());
1176  $this->profile_levels = $profile->getSkillLevels();
1177 
1178  foreach ($this->profile_levels as $l) {
1179  $skills[] = array(
1180  "base_skill_id" => $l["base_skill_id"],
1181  "tref_id" => $l["tref_id"],
1182  "level_id" => $l["level_id"]
1183  );
1184  }
1185  } elseif (is_array($a_skills)) {
1186  $skills = $a_skills;
1187  }
1188 
1189  // get actual levels for gap analysis
1190  $this->getActualLevels($skills, $user_id);
1191 
1192  $incl_self_eval = false;
1193  if (count($this->getGapAnalysisSelfEvalLevels()) > 0) {
1194  $incl_self_eval = true;
1195  $self_vals = $this->getGapAnalysisSelfEvalLevels();
1196  }
1197 
1198  // output spider stuff
1199  $all_chart_html = "";
1200 
1201  // determine skills that should be shown in the spider web
1202  $sw_skills = array();
1203  foreach ($skills as $sk) {
1204  if (!in_array($sk["base_skill_id"] . ":" . $sk["tref_id"], $this->hidden_skills)) {
1205  $sw_skills[] = $sk;
1206  }
1207  }
1208 
1209  if (count($sw_skills) >= 3) {
1210  $skill_packages = array();
1211 
1212  if (count($sw_skills) < 8) {
1213  $skill_packages[1] = $sw_skills;
1214  } else {
1215  $mod = count($sw_skills) % 7;
1216  $pkg_num = floor((count($sw_skills) - 1) / 7) + 1;
1217  $cpkg = 1;
1218  foreach ($sw_skills as $k => $s) {
1219  $skill_packages[$cpkg][$k] = $s;
1220  if ($mod < 3 && count($skill_packages) == ($pkg_num - 1) && count($skill_packages[$cpkg]) == 3+$mod) {
1221  $cpkg+=1;
1222  } elseif (count($skill_packages[$cpkg]) == 7) {
1223  $cpkg+=1;
1224  }
1225  }
1226  }
1227 
1228  $pkg_cnt = 0;
1229  foreach ($skill_packages as $pskills) {
1230  $pkg_cnt++;
1231  $max_cnt = 0;
1232  $leg_labels = array();
1233  //var_dump($this->profile_levels);
1234  //foreach ($this->profile_levels as $k => $l)
1235 
1236  // write target, actual and self counter to skill array
1237  foreach ($pskills as $k => $l) {
1238  //$bs = new ilBasicSkill($l["base_skill_id"]);
1239  $bs = new ilBasicSkill($l["base_skill_id"]);
1240  $leg_labels[] = ilBasicSkill::_lookupTitle($l["base_skill_id"], $l["tref_id"]);
1241  $levels = $bs->getLevelData();
1242  $cnt = 0;
1243  foreach ($levels as $lv) {
1244  $cnt++;
1245  if ($l["level_id"] == $lv["id"]) {
1246  $pskills[$k]["target_cnt"] = $cnt;
1247  }
1248  if ($this->actual_levels[$l["base_skill_id"]][$l["tref_id"]] == $lv["id"]) {
1249  $pskills[$k]["actual_cnt"] = $cnt;
1250  }
1251  if ($incl_self_eval) {
1252  if ($self_vals[$l["base_skill_id"]][$l["tref_id"]] == $lv["id"]) {
1253  $pskills[$k]["self_cnt"] = $cnt;
1254  }
1255  }
1256  $max_cnt = max($max_cnt, $cnt);
1257  }
1258  }
1259 
1260  include_once("./Services/Chart/classes/class.ilChart.php");
1261  $chart = ilChart::getInstanceByType(ilChart::TYPE_SPIDER, "gap_chart" . $pkg_cnt);
1262  $chart->setsize(800, 300);
1263  $chart->setYAxisMax($max_cnt);
1264  $chart->setLegLabels($leg_labels);
1265 
1266  // target level
1267  $cd = $chart->getDataInstance();
1268  $cd->setLabel($lng->txt("skmg_target_level"));
1269  $cd->setFill(true, "#A0A0A0");
1270 
1271  // other users
1272  $cd2 = $chart->getDataInstance();
1273  if ($this->gap_cat_title != "") {
1274  $cd2->setLabel($this->gap_cat_title);
1275  } elseif ($this->gap_mode == "max_per_type") {
1276  $cd2->setLabel($lng->txt("objs_" . $this->gap_mode_type));
1277  } elseif ($this->gap_mode == "max_per_object") {
1278  $cd2->setLabel(ilObject::_lookupTitle($this->gap_mode_obj_id));
1279  }
1280  //$cd2->setFill(true, "#dcb496");
1281  $cd2->setFill(true, "#FF8080");
1282  $cd2->setFill(true, "#cc8466");
1283 
1284  // self evaluation
1285  if ($incl_self_eval) {
1286  $cd3 = $chart->getDataInstance();
1287  $cd3->setLabel($lng->txt("skmg_self_evaluation"));
1288  $cd3->setFill(true, "#6ea03c");
1289  }
1290 
1291  // fill in data
1292  $cnt = 0;
1293  foreach ($pskills as $pl) {
1294  $cd->addPoint($cnt, (int) $pl["target_cnt"]);
1295  $cd2->addPoint($cnt, (int) $pl["actual_cnt"]);
1296  if ($incl_self_eval) {
1297  $cd3->addPoint($cnt, (int) $pl["self_cnt"]);
1298  }
1299  $cnt++;
1300  }
1301 
1302  // add data to chart
1303  if ($this->getProfileId() > 0) {
1304  $chart->addData($cd);
1305  }
1306  $chart->addData($cd2);
1307  if ($incl_self_eval && count($this->getGapAnalysisSelfEvalLevels()) > 0) {
1308  $chart->addData($cd3);
1309  }
1310 
1311  if ($pkg_cnt == 1) {
1312  $lg = new ilChartLegend();
1313  $chart->setLegend($lg);
1314  }
1315 
1316  $chart_html = $chart->getHTML();
1317  $all_chart_html.= $chart_html;
1318  }
1319 
1320  $pan = ilPanelGUI::getInstance();
1321  $pan->setPanelStyle(ilPanelGUI::PANEL_STYLE_PRIMARY);
1322  $pan->setBody($all_chart_html);
1323  $all_chart_html = $pan->getHTML();
1324  }
1325 
1326  $stree = new ilSkillTree();
1327  $html = "";
1328 
1329  // order skills per virtual skill tree
1330  include_once("./Services/Skill/classes/class.ilVirtualSkillTree.php");
1331  $vtree = new ilVirtualSkillTree();
1332  $skills = $vtree->getOrderedNodeset($skills, "base_skill_id", "tref_id");
1333  foreach ($skills as $s) {
1334  $path = $stree->getSkillTreePath($s["base_skill_id"]);
1335 
1336  // check draft
1337  foreach ($path as $p) {
1338  if ($p["status"] == ilSkillTreeNode::STATUS_DRAFT) {
1339  continue(2);
1340  }
1341  }
1342  $html.= $this->getSkillHTML($s["base_skill_id"], $user_id, false, $s["tref_id"]);
1343  }
1344 
1345  // list skills
1346  // include_once("./Services/Skill/classes/class.ilPersonalSkillTableGUI.php");
1347  // $sktab = new ilPersonalSkillTableGUI($this, "listSkills");
1348 
1349  return $intro_html . $all_chart_html . $html;
1350  }
$lg
Definition: example_018.php:62
const TYPE_SPIDER
Chart legend.
Skill tree.
const PANEL_STYLE_PRIMARY
static _lookupTitle($a_id)
lookup object title
$s
Definition: pwgen.php:45
getSkillHTML($a_top_skill_id, $a_user_id=0, $a_edit=false, $a_tref_id=0)
Get skill presentation HTML.
getGapAnalysisSelfEvalLevels()
Get self evaluation levels for gap analysis.
getActualLevels($skills, $user_id)
Get actual levels.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
static getInstance()
Get instance.
global $l
Definition: afr.php:30
Basic Skill.
$html
Definition: example_001.php:87
static getInstanceByType($a_type, $a_id)
Get type instance.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getGapAnalysisSelfEvalLevels()

ilPersonalSkillsGUI::getGapAnalysisSelfEvalLevels ( )

Get self evaluation levels for gap analysis.

Returns
array self evaluation values key1: base_skill_id, key2: tref_id: value: level id

Definition at line 167 of file class.ilPersonalSkillsGUI.php.

References $gap_self_eval_levels.

Referenced by getGapAnalysisHTML(), and getSelfEvalGapItem().

+ Here is the caller graph for this function:

◆ getHistoryView()

ilPersonalSkillsGUI::getHistoryView ( )

Get history view.

Returns
bool history view

Definition at line 187 of file class.ilPersonalSkillsGUI.php.

References $history_view.

188  {
189  return $this->history_view;
190  }

◆ getIntroText()

ilPersonalSkillsGUI::getIntroText ( )

Get intro text.

Returns
string intro text html

Definition at line 207 of file class.ilPersonalSkillsGUI.php.

References $intro_text.

Referenced by getGapAnalysisHTML().

208  {
209  return $this->intro_text;
210  }
+ Here is the caller graph for this function:

◆ getMaterialInfo()

ilPersonalSkillsGUI::getMaterialInfo (   $a_wsp_id,
  $a_user_id 
)

Get material file name and goto url.

Parameters
int$a_wsp_id
Returns
array caption, url

Definition at line 565 of file class.ilPersonalSkillsGUI.php.

References $file, $obj_id, $url, ilObject\_lookupTitle(), ilObject\_lookupType(), and array.

Referenced by getMaterials().

566  {
567  if (!$this->ws_tree) {
568  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
569  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
570  $this->ws_tree = new ilWorkspaceTree($a_user_id);
571  $this->ws_access = new ilWorkspaceAccessHandler($caption);
572  }
573 
574  $obj_id = $this->ws_tree->lookupObjectId($a_wsp_id);
575  $caption = ilObject::_lookupTitle($obj_id);
576 
577  if (!$this->offline_mode) {
578  $url = $this->ws_access->getGotoLink($a_wsp_id, $obj_id);
579  } else {
580  $url = $this->offline_mode . "file_" . $obj_id . "/";
581 
582  // all possible material types for now
583  switch (ilObject::_lookupType($obj_id)) {
584  case "tstv":
585  include_once "Modules/Test/classes/class.ilObjTestVerification.php";
586  $obj = new ilObjTestVerification($obj_id, false);
587  $url .= $obj->getOfflineFilename();
588  break;
589 
590  case "excv":
591  include_once "Modules/Exercise/classes/class.ilObjExerciseVerification.php";
592  $obj = new ilObjExerciseVerification($obj_id, false);
593  $url .= $obj->getOfflineFilename();
594  break;
595 
596  case "crsv":
597  include_once "Modules/Course/classes/Verification/class.ilObjCourseVerification.php";
598  $obj = new ilObjCourseVerification($obj_id, false);
599  $url .= $obj->getOfflineFilename();
600  break;
601 
602  case "scov":
603  include_once "Modules/ScormAicc/classes/Verification/class.ilObjSCORMVerification.php";
604  $obj = new ilObjSCORMVerification($obj_id, false);
605  $url .= $obj->getOfflineFilename();
606  break;
607 
608  case "file":
609  $file = new ilObjFile($obj_id, false);
610  $url .= $file->getFilename();
611  break;
612  }
613  }
614 
615  return array($caption, $url);
616  }
Access handler for personal workspace.
static _lookupTitle($a_id)
lookup object title
Tree handler for personal workspace.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
$url
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMaterials()

ilPersonalSkillsGUI::getMaterials (   $a_levels,
  $a_tref_id = 0,
  $a_user_id = 0 
)

Get materials.

Parameters

Definition at line 1375 of file class.ilPersonalSkillsGUI.php.

References $ilUser, $lng, $tpl, $user, ilPersonalSkill\countAssignedMaterial(), ilPersonalSkill\getAssignedMaterial(), and getMaterialInfo().

Referenced by renderSkillHTML().

1376  {
1377  $ilUser = $this->user;
1378  $lng = $this->lng;
1379 
1380  if ($a_user_id == 0) {
1381  $a_user_id = $ilUser->getId();
1382  }
1383 
1384  // only render, if materials given
1385  $got_mat = false;
1386  foreach ($a_levels as $v) {
1388  $a_user_id,
1389  $a_tref_id,
1390  $v["id"]
1391  );
1392  if ($mat_cnt > 0) {
1393  $got_mat = true;
1394  }
1395  }
1396  if (!$got_mat) {
1397  return "";
1398  }
1399 
1400  $tpl = new ilTemplate("tpl.skill_materials.html", true, true, "Services/Skill");
1401  foreach ($a_levels as $k => $v) {
1402  $got_mat = false;
1404  $a_user_id,
1405  $a_tref_id,
1406  $v["id"]
1407  ) as $item) {
1408  $tpl->setCurrentBlock("material");
1409  $mat_data = $this->getMaterialInfo($item["wsp_id"], $a_user_id);
1410  $tpl->setVariable("HREF_LINK", $mat_data[1]);
1411  $tpl->setVariable("TXT_LINK", $mat_data[0]);
1412  $tpl->parseCurrentBlock();
1413  $got_mat = true;
1414  }
1415  if ($got_mat) {
1416  $tpl->setCurrentBlock("level");
1417  $tpl->setVariable("LEVEL_VAL", $v["title"]);
1418  $tpl->parseCurrentBlock();
1419  }
1420  }
1421  $tpl->setVariable("TXT_MATERIAL", $lng->txt("skmg_materials"));
1422 
1423  return $tpl->get();
1424  }
getMaterialInfo($a_wsp_id, $a_user_id)
Get material file name and goto url.
special template class to simplify handling of ITX/PEAR
$ilUser
Definition: imgupload.php:18
static getAssignedMaterial($a_user_id, $a_tref_id, $a_level)
Get assigned material (for a skill level and user)
static countAssignedMaterial($a_user_id, $a_tref_id, $a_level)
Get assigned material (for a skill level and user)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getProfileId()

ilPersonalSkillsGUI::getProfileId ( )

Get profile id.

Returns

Definition at line 147 of file class.ilPersonalSkillsGUI.php.

Referenced by getGapAnalysisHTML(), listAssignedProfile(), renderSkillHTML(), and showProfileSelectorToolbar().

148  {
149  return $this->profile_id;
150  }
+ Here is the caller graph for this function:

◆ getProfileTargetItem()

ilPersonalSkillsGUI::getProfileTargetItem (   $a_profile_id,
  $a_levels,
  $a_tref_id = 0 
)

Get profile target item.

Parameters

Definition at line 1432 of file class.ilPersonalSkillsGUI.php.

References $lng, $tpl, array, and getScaleBar().

Referenced by renderSkillHTML().

1433  {
1434  $lng = $this->lng;
1435 
1436  $profile = new ilSkillProfile($a_profile_id);
1437  $profile_levels = $profile->getSkillLevels();
1438 
1439  $a_activated_levels = array();
1440 
1441  foreach ($a_levels as $k => $v) {
1442  foreach ($profile_levels as $pl) {
1443  if ($pl["level_id"] == $v["id"] &&
1444  $pl["base_skill_id"] == $v["skill_id"] &&
1445  $a_tref_id == $pl["tref_id"]) {
1446  $a_activated_levels[] = $pl["level_id"];
1447  }
1448  }
1449  }
1450 
1451  $tpl = new ilTemplate("tpl.skill_eval_item.html", true, true, "Services/Skill");
1452  $tpl->setVariable("SCALE_BAR", $this->getScaleBar($a_levels, $a_activated_levels));
1453 
1454  $tpl->setVariable("TYPE", $lng->txt("skmg_target_level"));
1455  $tpl->setVariable("TITLE", "");
1456 
1457  return $tpl->get();
1458  }
getScaleBar($a_levels, $a_activated_levels)
Get scale bar.
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScaleBar()

ilPersonalSkillsGUI::getScaleBar (   $a_levels,
  $a_activated_levels 
)

Get scale bar.

Parameters

Definition at line 1544 of file class.ilPersonalSkillsGUI.php.

References array.

Referenced by getActualGapItem(), getEvalItem(), getProfileTargetItem(), and getSelfEvalGapItem().

1545  {
1546  $vals = array();
1547 
1548  if (!is_array($a_activated_levels)) {
1549  $a_activated_levels = array($a_activated_levels);
1550  }
1551 
1552  foreach ($a_levels as $level) {
1553  $vals[$level["title"]] = (in_array($level["id"], $a_activated_levels));
1554  }
1555  $scale_bar = $this->ui_fac->chart()->scaleBar($vals);
1556 
1557  return $this->ui_ren->render($scale_bar);
1558  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ getSelfEvalGapItem()

ilPersonalSkillsGUI::getSelfEvalGapItem (   $a_levels,
  $a_tref_id = 0 
)
Parameters

Definition at line 1508 of file class.ilPersonalSkillsGUI.php.

References $lng, $tpl, $type, array, getGapAnalysisSelfEvalLevels(), and getScaleBar().

Referenced by renderSkillHTML().

1509  {
1510  $lng = $this->lng;
1511 
1512  $self_vals = $this->getGapAnalysisSelfEvalLevels();
1513  if (count($self_vals) == 0) {
1514  return;
1515  }
1516 
1517  $a_activated_levels = array();
1518  foreach ($a_levels as $k => $v) {
1519  if ($self_vals[$v["skill_id"]][$a_tref_id] == $v["id"]) {
1520  $a_activated_levels[] = $v["id"];
1521  }
1522  }
1523 
1524  $tpl = new ilTemplate("tpl.skill_eval_item.html", true, true, "Services/Skill");
1525  $tpl->setVariable("SCALE_BAR", $this->getScaleBar($a_levels, $a_activated_levels));
1526 
1527  $type = 3;
1528  $tpl->setVariable("TYPE", $lng->txt("skmg_eval_type_" . $type));
1529  if ($type > 0) {
1530  $tpl->touchBlock("st" . $type);
1531  $tpl->touchBlock("stb" . $type);
1532  }
1533 
1534  return $tpl->get();
1535  }
$type
getScaleBar($a_levels, $a_activated_levels)
Get scale bar.
getGapAnalysisSelfEvalLevels()
Get self evaluation levels for gap analysis.
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSkillDescription()

ilPersonalSkillsGUI::getSkillDescription (   $skill)

Get level description.

Parameters

Definition at line 1618 of file class.ilPersonalSkillsGUI.php.

References $l, and $tpl.

Referenced by renderSkillHTML().

1619  {
1620  $level_data = $skill->getLevelData();
1621  $tpl = new ilTemplate("tpl.skill_desc.html", true, true, "Services/Skill");
1622 
1623  $desc_exists = false;
1624  foreach ($level_data as $l) {
1625  if ($l["description"] != "") {
1626  $desc_exists = true;
1627  }
1628  }
1629  reset($level_data);
1630  if ($desc_exists) {
1631  foreach ($level_data as $l) {
1632  $tpl->setCurrentBlock("level");
1633  $tpl->setVariable("LEVEL_VAL", $l["title"]);
1634  $tpl->setVariable("LEVEL_DESC", nl2br($l["description"]));
1635  $tpl->parseCurrentBlock();
1636  }
1637  }
1638 
1639  return $tpl->get();
1640  }
special template class to simplify handling of ITX/PEAR
global $l
Definition: afr.php:30
+ Here is the caller graph for this function:

◆ getSkillHTML()

ilPersonalSkillsGUI::getSkillHTML (   $a_top_skill_id,
  $a_user_id = 0,
  $a_edit = false,
  $a_tref_id = 0 
)

Get skill presentation HTML.

$a_top_skill_id is a node of the skill "main tree", it can be a tref id!

  • called in listSkills (this class) -> $a_top_skill is the selected user skill (main tree node id), tref_id not set
  • called in ilPortfolioPage -> $a_top_skill is the selected user skill (main tree node id), tref_id not set
  • called in getGapAnalysis (this class) -> $a_top_skill id is the (basic) skill_id, tref_id may be set

Definition at line 382 of file class.ilPersonalSkillsGUI.php.

References array, and renderSkillHTML().

Referenced by getGapAnalysisHTML(), listAssignedProfile(), and listSkills().

383  {
384  // user interface plugin slot + default rendering
385  include_once("./Services/UIComponent/classes/class.ilUIHookProcessor.php");
386  $uip = new ilUIHookProcessor(
387  "Services/Skill",
388  "personal_skill_html",
389  array("personal_skills_gui" => $this, "top_skill_id" => $a_top_skill_id, "user_id" => $a_user_id,
390  "edit" => $a_edit, "tref_id" => $a_tref_id)
391  );
392  if (!$uip->replaced()) {
393  $skill_html = $this->renderSkillHTML($a_top_skill_id, $a_user_id, $a_edit, $a_tref_id);
394  }
395  $skill_html = $uip->getHTML($skill_html);
396 
397  return $skill_html;
398  }
renderSkillHTML($a_top_skill_id, $a_user_id=0, $a_edit=false, $a_tref_id=0)
Render skill html.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSuggestedResources()

ilPersonalSkillsGUI::getSuggestedResources (   $a_profile_id,
  $a_levels,
  $a_base_skill,
  $a_tref_id 
)

Render suggested resources.

Parameters

Definition at line 1648 of file class.ilPersonalSkillsGUI.php.

References $lng, $obj_id, $r, $res, $title, $tpl, ilLink\_getLink(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), array, and ilBasicSkill\lookupLevelTitle().

Referenced by renderSkillHTML().

1649  {
1650  $lng = $this->lng;
1651 
1652  $tpl = new ilTemplate("tpl.suggested_resources.html", true, true, "Services/Skill");
1653 
1654  // use a profile
1655  if ($a_profile_id > 0) {
1656  $too_low = true;
1657  $current_target_level = 0;
1658 
1659  foreach ($a_levels as $k => $v) {
1660  foreach ($this->profile_levels as $pl) {
1661  if ($pl["level_id"] == $v["id"] &&
1662  $pl["base_skill_id"] == $v["skill_id"]) {
1663  $too_low = true;
1664  $current_target_level = $v["id"];
1665  }
1666  }
1667 
1668  if ($this->actual_levels[$v["skill_id"]][$a_tref_id] == $v["id"]) {
1669  $too_low = false;
1670  }
1671  }
1672 
1673  // suggested resources
1674  if ($too_low) {
1675  include_once("./Services/Skill/classes/class.ilSkillResources.php");
1676  $skill_res = new ilSkillResources($a_base_skill, $a_tref_id);
1677  $res = $skill_res->getResources();
1678  $imp_resources = array();
1679  foreach ($res as $level) {
1680  foreach ($level as $r) {
1681  if ($r["imparting"] == true &&
1682  $current_target_level == $r["level_id"]) {
1683  $imp_resources[] = $r;
1684  }
1685  }
1686  }
1687  foreach ($imp_resources as $r) {
1688  $ref_id = $r["rep_ref_id"];
1689  $obj_id = ilObject::_lookupObjId($ref_id);
1691  include_once("./Services/Link/classes/class.ilLink.php");
1692  $tpl->setCurrentBlock("resource_item");
1693  $tpl->setVariable("TXT_RES", $title);
1694  $tpl->setVariable("HREF_RES", ilLink::_getLink($ref_id));
1695  $tpl->parseCurrentBlock();
1696  }
1697  if (count($imp_resources) > 0) {
1698  $tpl->touchBlock("resources_list");
1699  $tpl->setVariable("SUGGESTED_MAT_MESS", $lng->txt("skmg_skill_needs_impr_res"));
1700  return $tpl->get();
1701  } else {
1702  $tpl->setVariable("SUGGESTED_MAT_MESS", $lng->txt("skmg_skill_needs_impr_no_res"));
1703  return $tpl->get();
1704  }
1705  } else {
1706  $tpl->setVariable("SUGGESTED_MAT_MESS", $lng->txt("skmg_skill_no_needs_impr"));
1707  return $tpl->get();
1708  }
1709  } else {
1710  // no profile, just list all resources
1711  include_once("./Services/Skill/classes/class.ilSkillResources.php");
1712  $skill_res = new ilSkillResources($a_base_skill, $a_tref_id);
1713  $res = $skill_res->getResources();
1714  // add $r["level_id"] info
1715  $any = false;
1716  foreach ($res as $level) {
1717  $available = false;
1718  $cl = 0;
1719  foreach ($level as $r) {
1720  if ($r["imparting"]) {
1721  $ref_id = $r["rep_ref_id"];
1722  $obj_id = ilObject::_lookupObjId($ref_id);
1724  include_once("./Services/Link/classes/class.ilLink.php");
1725  $tpl->setCurrentBlock("resource_item");
1726  $tpl->setVariable("TXT_RES", $title);
1727  $tpl->setVariable("HREF_RES", ilLink::_getLink($ref_id));
1728  $tpl->parseCurrentBlock();
1729  $available = true;
1730  $any = true;
1731  $cl = $r["level_id"];
1732  }
1733  }
1734  if ($available) {
1735  $tpl->setCurrentBlock("resources_list_level");
1736  $tpl->setVariable("TXT_LEVEL", $lng->txt("skmg_level"));
1737  $tpl->setVariable("LEVEL_NAME", ilBasicSkill::lookupLevelTitle($cl));
1738  $tpl->parseCurrentBlock();
1739  $tpl->touchBlock("resources_list");
1740  }
1741  }
1742  if ($any) {
1743  $tpl->setVariable("SUGGESTED_MAT_MESS", $lng->txt("skmg_suggested_resources"));
1744  return $tpl->get();
1745  }
1746  }
1747  return "";
1748  }
static lookupLevelTitle($a_id)
Lookup level title.
static _lookupTitle($a_id)
lookup object title
$r
Definition: example_031.php:79
foreach($_POST as $key=> $value) $res
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
Manages resources for skills.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hideSkill()

ilPersonalSkillsGUI::hideSkill (   $a_skill_id,
  $a_tref_id = 0 
)

Hide skill.

Parameters

Definition at line 218 of file class.ilPersonalSkillsGUI.php.

219  {
220  $this->hidden_skills[] = $a_skill_id . ":" . $a_tref_id;
221  }

◆ listAssignedProfile()

ilPersonalSkillsGUI::listAssignedProfile ( )

List profile.

Parameters

Definition at line 1756 of file class.ilPersonalSkillsGUI.php.

References $html, $l, $s, $tpl, array, determineCurrentProfile(), getActualLevels(), getProfileId(), getSkillHTML(), setTabs(), showProfileSelectorToolbar(), and user().

1757  {
1758  $tpl = $this->tpl;
1759 
1760  $this->setTabs("profile");
1761 
1762  $this->determineCurrentProfile();
1763  $this->showProfileSelectorToolbar();
1764 
1765  $skills = array();
1766  if ($this->getProfileId() > 0) {
1767  $profile = new ilSkillProfile($this->getProfileId());
1768  $this->profile_levels = $profile->getSkillLevels();
1769 
1770  foreach ($this->profile_levels as $l) {
1771  $skills[] = array(
1772  "base_skill_id" => $l["base_skill_id"],
1773  "tref_id" => $l["tref_id"],
1774  "level_id" => $l["level_id"]
1775  );
1776  }
1777  }
1778 
1779  $this->getActualLevels($skills, $this->user->getId());
1780 
1781  // render
1782  $html = "";
1783  foreach ($skills as $s) {
1784  // todo draft check
1785  $html.= $this->getSkillHTML($s["base_skill_id"], 0, true, $s["tref_id"]);
1786  }
1787 
1788  $tpl->setContent($html);
1789  }
$s
Definition: pwgen.php:45
getSkillHTML($a_top_skill_id, $a_user_id=0, $a_edit=false, $a_tref_id=0)
Get skill presentation HTML.
setTabs($a_activate)
Set tabs.
user()
Definition: user.php:4
getActualLevels($skills, $user_id)
Get actual levels.
determineCurrentProfile()
Determine current profile id.
showProfileSelectorToolbar()
Show profile selector toolbar.
Create styles array
The data for the language used.
global $l
Definition: afr.php:30
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ listProfilesForGap()

ilPersonalSkillsGUI::listProfilesForGap ( )

List profiles.

Parameters

Definition at line 1035 of file class.ilPersonalSkillsGUI.php.

References $tpl, determineCurrentProfile(), getGapAnalysisHTML(), and showProfileSelectorToolbar().

1036  {
1037  $tpl = $this->tpl;
1038 
1039  //$a_user_id = $ilUser->getId();
1040 
1041  //$profiles = ilSkillProfile::getProfilesOfUser($a_user_id);
1042 
1043  if (count($this->user_profiles) == 0 && $this->obj_skills == null) {
1044  return;
1045  }
1046 
1047  $this->determineCurrentProfile();
1048  $this->showProfileSelectorToolbar();
1049 
1050  $tpl->setContent($this->getGapAnalysisHTML());
1051  }
getGapAnalysisHTML($a_user_id=0, $a_skills=null)
Get gap analysis html.
determineCurrentProfile()
Determine current profile id.
showProfileSelectorToolbar()
Show profile selector toolbar.
+ Here is the call graph for this function:

◆ listSkills()

ilPersonalSkillsGUI::listSkills ( )

List skills.

Definition at line 333 of file class.ilPersonalSkillsGUI.php.

References $ctrl, $html, $ilCtrl, $ilUser, $lng, $path, $s, $toolbar, $tpl, $user, ilPersonalSkill\getSelectedUserSkills(), getSkillHTML(), setTabs(), and ilSkillTreeNode\STATUS_DRAFT.

334  {
337  $lng = $this->lng;
338  $tpl = $this->tpl;
339  $ilToolbar = $this->toolbar;
340 
341  $this->setTabs("list_skills");
342 
343  include_once("./Services/Skill/classes/class.ilSkillTree.php");
344  $stree = new ilSkillTree();
345 
346  // skill selection / add new personal skill
347  $ilToolbar->addFormButton(
348  $lng->txt("skmg_add_skill"),
349  "listSkillsForAdd"
350  );
351  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
352 
354  $html = "";
355  foreach ($skills as $s) {
356  $path = $stree->getSkillTreePath($s["skill_node_id"]);
357 
358  // check draft
359  foreach ($path as $p) {
360  if ($p["status"] == ilSkillTreeNode::STATUS_DRAFT) {
361  continue(2);
362  }
363  }
364  $html.= $this->getSkillHTML($s["skill_node_id"], 0, true);
365  }
366 
367  // list skills
368  // include_once("./Services/Skill/classes/class.ilPersonalSkillTableGUI.php");
369  // $sktab = new ilPersonalSkillTableGUI($this, "listSkills");
370 
371  $tpl->setContent($html);
372  }
Skill tree.
$s
Definition: pwgen.php:45
getSkillHTML($a_top_skill_id, $a_user_id=0, $a_edit=false, $a_tref_id=0)
Get skill presentation HTML.
setTabs($a_activate)
Set tabs.
static getSelectedUserSkills($a_user_id)
Get personal selected user skills.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ listSkillsForAdd()

ilPersonalSkillsGUI::listSkillsForAdd ( )

LIst skills for adding.

Parameters

Definition at line 1005 of file class.ilPersonalSkillsGUI.php.

References $ctrl, $ilCtrl, $lng, $tabs, $tpl, and ilUtil\sendInfo().

1006  {
1007  $ilCtrl = $this->ctrl;
1008  $lng = $this->lng;
1009  $tpl = $this->tpl;
1010  $ilTabs = $this->tabs;
1011 
1012 
1013  $ilTabs->setBackTarget(
1014  $lng->txt("back"),
1015  $ilCtrl->getLinkTarget($this, "")
1016  );
1017 
1018  include_once("./Services/Skill/classes/class.ilPersonalSkillExplorerGUI.php");
1019  $exp = new ilPersonalSkillExplorerGUI($this, "listSkillsForAdd", $this, "addSkill");
1020  if ($exp->getHasSelectableNodes()) {
1021  if (!$exp->handleCommand()) {
1022  $tpl->setContent($exp->getHTML());
1023  }
1024  ilUtil::sendInfo($lng->txt("skmg_select_skill"));
1025  } else {
1026  ilUtil::sendInfo($lng->txt("skmg_no_nodes_selectable"));
1027  }
1028  }
Explorer for selecting a personal skill.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

◆ removeMaterial()

ilPersonalSkillsGUI::removeMaterial ( )

Remove material.

Definition at line 870 of file class.ilPersonalSkillsGUI.php.

References $_GET, $ctrl, $ilCtrl, $ilUser, $lng, $user, ilPersonalSkill\removeMaterial(), and ilUtil\sendSuccess().

871  {
874  $lng = $this->lng;
875 
876 
878  $ilUser->getId(),
879  (int) $_GET["tref_id"],
880  (int) $_GET["level_id"],
881  (int) $_GET["wsp_id"]
882  );
883  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
884  $ilCtrl->redirect($this, "assignMaterials");
885  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
static removeMaterial($a_user_id, $a_tref_id, $a_level_id, $a_wsp_id)
Remove material.
+ Here is the call graph for this function:

◆ removeSkills()

ilPersonalSkillsGUI::removeSkills ( )

Remove skills.

Definition at line 670 of file class.ilPersonalSkillsGUI.php.

References $_POST, $ctrl, $ilCtrl, $ilUser, $lng, $user, ilPersonalSkill\removeSkill(), and ilUtil\sendSuccess().

671  {
674  $lng = $this->lng;
675 
676  if (is_array($_POST["id"])) {
677  foreach ($_POST["id"] as $n_id) {
678  ilPersonalSkill::removeSkill($ilUser->getId(), $n_id);
679  }
680  }
681 
682  ilUtil::sendSuccess($lng->txt("msg_object_modified"));
683  $ilCtrl->redirect($this, "listSkills");
684  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilCtrl
Definition: ilias.php:18
static removeSkill($a_user_id, $a_skill_node_id)
Remove personal skill.
$ilUser
Definition: imgupload.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ renderSkillHTML()

ilPersonalSkillsGUI::renderSkillHTML (   $a_top_skill_id,
  $a_user_id = 0,
  $a_edit = false,
  $a_tref_id = 0 
)

Render skill html.

Parameters

Definition at line 406 of file class.ilPersonalSkillsGUI.php.

References $ctrl, $ilCtrl, $ilUser, $lng, $path, $title, $tpl, $user, ilSkillTemplateReference\_lookupTemplateId(), ilSkillTreeNode\_lookupTitle(), ilSkillTreeNode\_lookupType(), array, ilBasicSkill\EVAL_BY_ALL, getActualGapItem(), getEvalItem(), ilSkillTreeNodeFactory\getInstance(), getMaterials(), getProfileId(), getProfileTargetItem(), getSelfEvalGapItem(), ilPersonalSkill\getSelfEvaluationDate(), getSkillDescription(), getSuggestedResources(), ilBasicSkill\hasSelfEvaluated(), and ilSkillTreeNode\STATUS_DRAFT.

Referenced by getSkillHTML().

407  {
410  $lng = $this->lng;
411 
412  $sub_panels = array();
413 
414  if ($a_user_id == 0) {
415  $user = $ilUser;
416  } else {
417  $user = new ilObjUser($a_user_id);
418  }
419 
420  $tpl = new ilTemplate("tpl.skill_pres.html", true, true, "Services/Skill");
421 
422  include_once("./Services/Skill/classes/class.ilSkillTree.php");
423  $stree = new ilSkillTree();
424 
425  include_once("./Services/Skill/classes/class.ilVirtualSkillTree.php");
426  $vtree = new ilVirtualSkillTree();
427  $tref_id = $a_tref_id;
428  $skill_id = $a_top_skill_id;
429  if (ilSkillTreeNode::_lookupType($a_top_skill_id) == "sktr") {
430  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
431  $tref_id = $a_top_skill_id;
432  $skill_id = ilSkillTemplateReference::_lookupTemplateId($a_top_skill_id);
433  }
434  $b_skills = $vtree->getSubTreeForCSkillId($skill_id . ":" . $tref_id, true);
435 
436  foreach ($b_skills as $bs) {
437  $bs["id"] = $bs["skill_id"];
438  $bs["tref"] = $bs["tref_id"];
439 
440  $path = $stree->getSkillTreePath($bs["id"], $bs["tref"]);
441 
442  $panel_comps = array();
443 
444 
445  // check draft
446  foreach ($path as $p) {
447  if ($p["status"] == ilSkillTreeNode::STATUS_DRAFT) {
448  continue(2);
449  }
450  }
451  reset($path);
452 
453  $skill = ilSkillTreeNodeFactory::getInstance($bs["id"]);
454  $level_data = $skill->getLevelData();
455 
456 
457  // skill description
458  $panel_comps[] = $this->ui_fac->legacy($this->getSkillDescription($skill));
459 
460 
461  if ($this->getProfileId() > 0) {
462  if (!$this->skmg_settings->getHideProfileBeforeSelfEval() ||
463  ilBasicSkill::hasSelfEvaluated($user->getId(), $bs["id"], $bs["tref"])) {
464  $panel_comps[] = $this->ui_fac->legacy($this->getProfileTargetItem($this->getProfileId(), $level_data, $bs["tref"]));
465  }
466  }
467 
468  if ($this->mode == "gap" && !$this->history_view) {
469  $panel_comps[] = $this->ui_fac->legacy($this->getActualGapItem($level_data, $bs["tref"]) . "");
470  $panel_comps[] = $this->ui_fac->legacy($this->getSelfEvalGapItem($level_data, $bs["tref"]) . "");
471  } else {
472  // get date of self evaluation
473  $se_date = ilPersonalSkill::getSelfEvaluationDate($user->getId(), $a_top_skill_id, $bs["tref"], $bs["id"]);
474  $se_rendered = ($se_date == "")
475  ? true
476  : false;
477 
478  // get all object triggered entries and render them
479  foreach ($skill->getAllHistoricLevelEntriesOfUser($bs["tref"], $user->getId(), ilBasicSkill::EVAL_BY_ALL) as $level_entry) {
480  // render the self evaluation at the correct position within the list of object triggered entries
481  if ($se_date > $level_entry["status_date"] && !$se_rendered) {
482  $se_rendered = true;
483  }
484  $panel_comps[] = $this->ui_fac->legacy($this->getEvalItem($level_data, $level_entry));
485  }
486  }
487 
488  // materials (new)
489  if ($this->mode != "gap") {
490  $mat = $this->getMaterials($level_data, $bs["tref"], $user->getId());
491  if ($mat != "") {
492  $panel_comps[] = $this->ui_fac->legacy($mat);
493  }
494  }
495 
496  // suggested resources
497  $sugg = $this->getSuggestedResources($this->getProfileId(), $level_data, $bs["id"], $bs["tref"]);
498  if ($sugg != "") {
499  $panel_comps[] = $this->ui_fac->legacy($sugg);
500  }
501 
502  $title = $sep = "";
503  $found = false;
504  foreach ($path as $p) {
505  if ($found) {
506  $title.= $sep . $p["title"];
507  $sep = " > ";
508  }
509  if ($a_top_skill_id == $p["child"]) {
510  $found = true;
511  }
512  }
513 
514  $sub = $this->ui_fac->panel()->sub((string) $title, $panel_comps);
515  if ($a_edit) {
516  $actions = array();
517  $ilCtrl->setParameterByClass("ilpersonalskillsgui", "skill_id", $a_top_skill_id);
518  $ilCtrl->setParameterByClass("ilpersonalskillsgui", "tref_id", $bs["tref"]);
519  $ilCtrl->setParameterByClass("ilpersonalskillsgui", "basic_skill_id", $bs["id"]);
520  if ($this->use_materials) {
521  $actions[] = $this->ui_fac->button()->shy(
522  $lng->txt('skmg_assign_materials'),
523  $ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "assignMaterials")
524  );
525  }
526  $actions[] = $this->ui_fac->button()->shy(
527  $lng->txt('skmg_self_evaluation'),
528  $ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "selfEvaluation")
529  );
530  $sub = $sub->withActions($this->ui_fac->dropdown()->standard($actions)->withLabel($lng->txt("actions")));
531  }
532 
533  $sub_panels[] = $sub;
534 
535  $tpl->parseCurrentBlock();
536  }
537 
538  $panel = $this->ui_fac->panel()->standard(
539  (string) ilSkillTreeNode::_lookupTitle($skill_id, $tref_id),
540  $sub_panels
541  );
542 
543  if ($a_edit && $this->getProfileId() == 0) {
544  $actions = array();
545 
546  $ilCtrl->setParameterByClass("ilpersonalskillsgui", "skill_id", $a_top_skill_id);
547  $actions[] = $this->ui_fac->button()->shy(
548  $lng->txt('skmg_remove_skill'),
549  $ilCtrl->getLinkTargetByClass("ilpersonalskillsgui", "confirmSkillRemove")
550  );
551 
552  $panel = $panel->withActions($this->ui_fac->dropdown()->standard($actions)->withLabel($lng->txt("actions")));
553  }
554 
555  return $this->ui_ren->render($panel);
556  }
Skill tree.
getMaterials($a_levels, $a_tref_id=0, $a_user_id=0)
Get materials.
getEvalItem($a_levels, $a_level_entry)
Get eval item.
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
getActualGapItem($a_levels, $a_tref_id=0)
getSuggestedResources($a_profile_id, $a_levels, $a_base_skill, $a_tref_id)
Render suggested resources.
special template class to simplify handling of ITX/PEAR
getSelfEvalGapItem($a_levels, $a_tref_id=0)
$ilUser
Definition: imgupload.php:18
static _lookupTemplateId($a_obj_id)
Lookup template ID.
Create styles array
The data for the language used.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
getProfileTargetItem($a_profile_id, $a_levels, $a_tref_id=0)
Get profile target item.
getSkillDescription($skill)
Get level description.
static hasSelfEvaluated($a_user_id, $a_skill_id, $a_tref_id)
Has use self evaluated a skill?
static getSelfEvaluationDate($a_user_id, $a_top_skill, $a_tref_id, $a_basic_skill)
Get self evaluation.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveSelfEvaluation()

ilPersonalSkillsGUI::saveSelfEvaluation ( )

Save self evaluation.

Definition at line 976 of file class.ilPersonalSkillsGUI.php.

References $_GET, $_POST, $ctrl, $ilCtrl, $ilUser, $lng, $user, ilPersonalSkill\saveSelfEvaluation(), and ilUtil\sendSuccess().

977  {
980  $lng = $this->lng;
981 
983  $ilUser->getId(),
984  (int) $_GET["skill_id"],
985  (int) $_GET["tref_id"],
986  (int) $_GET["basic_skill_id"],
987  (int) $_POST["se"]
988  );
989  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
990 
991  /* $ilCtrl->saveParameter($this, "skill_id");
992  $ilCtrl->saveParameter($this, "level_id");
993  $ilCtrl->saveParameter($this, "tref_id");
994  $ilCtrl->saveParameter($this, "basic_skill_id");*/
995 
996  $ilCtrl->redirect($this, "listSkills");
997  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
static saveSelfEvaluation($a_user_id, $a_top_skill, $a_tref_id, $a_basic_skill, $a_level)
Save self evaluation.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ selectMaterial()

ilPersonalSkillsGUI::selectMaterial ( )

Select material.

Definition at line 836 of file class.ilPersonalSkillsGUI.php.

References $_GET, $_POST, $ctrl, $ilCtrl, $ilUser, $lng, $user, $w, ilPersonalSkill\assignMaterial(), and ilUtil\sendSuccess().

837  {
840  $lng = $this->lng;
841 
842 
843  include_once("./Services/Skill/classes/class.ilPersonalSkill.php");
844  if (is_array($_POST["wsp_id"])) {
845  foreach ($_POST["wsp_id"] as $w) {
847  $ilUser->getId(),
848  (int) $_GET["skill_id"],
849  (int) $_GET["tref_id"],
850  (int) $_GET["basic_skill_id"],
851  (int) $_GET["level_id"],
852  (int) $w
853  );
854  }
855  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
856  }
857 
858  $ilCtrl->saveParameter($this, "skill_id");
859  $ilCtrl->saveParameter($this, "level_id");
860  $ilCtrl->saveParameter($this, "tref_id");
861  $ilCtrl->saveParameter($this, "basic_skill_id");
862 
863  $ilCtrl->redirect($this, "assignMaterials");
864  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
$w
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
$_POST["username"]
static assignMaterial($a_user_id, $a_top_skill, $a_tref_id, $a_basic_skill, $a_level, $a_wsp_id)
Assign material to skill level.
+ Here is the call graph for this function:

◆ selectProfile()

ilPersonalSkillsGUI::selectProfile ( )

Select profile.

Parameters

Definition at line 1357 of file class.ilPersonalSkillsGUI.php.

References $_POST, $ctrl, and $ilCtrl.

1358  {
1359  $ilCtrl = $this->ctrl;
1360 
1361  $ilCtrl->setParameter($this, "profile_id", $_POST["profile_id"]);
1362  if ($this->mode == "gap") {
1363  $ilCtrl->redirect($this, "listProfilesForGap");
1364  } else {
1365  $ilCtrl->redirect($this, "listAssignedProfile");
1366  }
1367  }
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]

◆ selfEvaluation()

ilPersonalSkillsGUI::selfEvaluation ( )

Assign materials to skill levels.

Parameters

Definition at line 898 of file class.ilPersonalSkillsGUI.php.

References $_GET, $_POST, $ctrl, $ilCtrl, $lng, $options, $si, $tab, $tabs, $toolbar, $tpl, ilSkillTemplateReference\_lookupTemplateId(), ilSkillTreeNode\_lookupTitle(), ilSkillTreeNode\_lookupType(), array, and ilUtil\getImagePath().

899  {
901  $lng = $this->lng;
902  $tpl = $this->tpl;
903  $ilToolbar = $this->toolbar;
904  $ilTabs = $this->tabs;
905 
906 
907  $ilTabs->setBackTarget(
908  $lng->txt("back"),
909  $ilCtrl->getLinkTarget($this, "listSkills")
910  );
911 
912  $ilCtrl->saveParameter($this, "skill_id");
913  $ilCtrl->saveParameter($this, "basic_skill_id");
914  $ilCtrl->saveParameter($this, "tref_id");
915 
916  include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
917  $tpl->setTitle(ilSkillTreeNode::_lookupTitle((int) $_GET["skill_id"]));
918  $tpl->setTitleIcon(ilUtil::getImagePath("icon_" .
919  ilSkillTreeNode::_lookupType((int) $_GET["skill_id"]) .
920  ".svg"));
921 
922  // basic skill selection
923  include_once("./Services/Skill/classes/class.ilVirtualSkillTree.php");
924  $vtree = new ilVirtualSkillTree();
925  $tref_id = 0;
926  $skill_id = (int) $_GET["skill_id"];
927  if (ilSkillTreeNode::_lookupType((int) $_GET["skill_id"]) == "sktr") {
928  include_once("./Services/Skill/classes/class.ilSkillTemplateReference.php");
929  $tref_id = $_GET["skill_id"];
930  $skill_id = ilSkillTemplateReference::_lookupTemplateId($_GET["skill_id"]);
931  }
932  $bs = $vtree->getSubTreeForCSkillId($skill_id . ":" . $tref_id, true);
933 
934 
935  $options = array();
936  foreach ($bs as $b) {
937  $options[$b["skill_id"]] = ilSkillTreeNode::_lookupTitle($b["skill_id"]);
938  }
939 
940  $cur_basic_skill_id = ((int) $_POST["basic_skill_id"] > 0)
941  ? (int) $_POST["basic_skill_id"]
942  : (((int) $_GET["basic_skill_id"] > 0)
943  ? (int) $_GET["basic_skill_id"]
944  : key($options));
945 
946  $ilCtrl->setParameter($this, "basic_skill_id", $cur_basic_skill_id);
947 
948  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
949  $si = new ilSelectInputGUI($lng->txt("skmg_skill"), "basic_skill_id");
950  $si->setOptions($options);
951  $si->setValue($cur_basic_skill_id);
952  $ilToolbar->addInputItem($si, true);
953  $ilToolbar->addFormButton(
954  $lng->txt("select"),
955  "selfEvaluation"
956  );
957 
958  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
959 
960  // table
961  include_once("./Services/Skill/classes/class.ilSelfEvaluationSimpleTableGUI.php");
963  $this,
964  "selfEvaluation",
965  (int) $_GET["skill_id"],
966  (int) $_GET["tref_id"],
967  $cur_basic_skill_id
968  );
969 
970  $tpl->setContent($tab->getHTML());
971  }
This class represents a selection list property in a property form.
$_GET["client_id"]
static _lookupType($a_obj_id)
Lookup Type.
global $ilCtrl
Definition: ilias.php:18
Self evaluation, second simplier implementation.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static _lookupTemplateId($a_obj_id)
Lookup template ID.
Create styles array
The data for the language used.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
$_POST["username"]
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:

◆ setGapAnalysisActualStatusModePerObject()

ilPersonalSkillsGUI::setGapAnalysisActualStatusModePerObject (   $a_obj_id,
  $a_cat_title = "" 
)

Set gap analysis actual status mode "per object".

Parameters
integer$a_obj_idobject id

Definition at line 1104 of file class.ilPersonalSkillsGUI.php.

1105  {
1106  $this->gap_mode = "max_per_object";
1107  $this->gap_mode_obj_id = $a_obj_id;
1108  $this->gap_cat_title = $a_cat_title;
1109  $this->mode = "gap";
1110  }

◆ setGapAnalysisActualStatusModePerType()

ilPersonalSkillsGUI::setGapAnalysisActualStatusModePerType (   $a_type,
  $a_cat_title = "" 
)

Set gap analysis actual status mode "per type".

Parameters
string$a_typetype

Definition at line 1091 of file class.ilPersonalSkillsGUI.php.

References $a_type.

1092  {
1093  $this->gap_mode = "max_per_type";
1094  $this->gap_mode_type = $a_type;
1095  $this->gap_cat_title = $a_cat_title;
1096  $this->mode = "gap";
1097  }
$a_type
Definition: workflow.php:92

◆ setGapAnalysisSelfEvalLevels()

ilPersonalSkillsGUI::setGapAnalysisSelfEvalLevels ( array  $a_val)

Set self evaluation levels for gap analysis.

Parameters
array$a_valself evaluation values key1: base_skill_id, key2: tref_id: value: level id

Definition at line 157 of file class.ilPersonalSkillsGUI.php.

158  {
159  $this->gap_self_eval_levels = $a_val;
160  }

◆ setHistoryView()

ilPersonalSkillsGUI::setHistoryView (   $a_val)

Set history view.

Parameters
bool$a_valhistory view

Definition at line 177 of file class.ilPersonalSkillsGUI.php.

178  {
179  $this->history_view = $a_val;
180  }

◆ setIntroText()

ilPersonalSkillsGUI::setIntroText (   $a_val)

Set intro text.

Parameters
string$a_valintro text html

Definition at line 197 of file class.ilPersonalSkillsGUI.php.

198  {
199  $this->intro_text = $a_val;
200  }

◆ setObjectSkills()

ilPersonalSkillsGUI::setObjectSkills (   $a_obj_id,
  $a_skills = null 
)

Set object skills.

Parameters
int$a_obj_idobject id
array$a_skillsskills array

Definition at line 258 of file class.ilPersonalSkillsGUI.php.

259  {
260  $this->obj_id = $a_obj_id;
261  $this->obj_skills = $a_skills;
262  }

◆ setOfflineMode()

ilPersonalSkillsGUI::setOfflineMode (   $a_file_path)

Definition at line 325 of file class.ilPersonalSkillsGUI.php.

326  {
327  $this->offline_mode = $a_file_path;
328  }

◆ setProfileId()

ilPersonalSkillsGUI::setProfileId (   $a_val)

Set profile id.

Parameters
$a_val

Definition at line 137 of file class.ilPersonalSkillsGUI.php.

Referenced by determineCurrentProfile().

138  {
139  $this->profile_id = $a_val;
140  }
+ Here is the caller graph for this function:

◆ setTabs()

ilPersonalSkillsGUI::setTabs (   $a_activate)

Set tabs.

Definition at line 299 of file class.ilPersonalSkillsGUI.php.

References $ctrl, $ilCtrl, $lng, and $tabs.

Referenced by listAssignedProfile(), and listSkills().

300  {
302  $lng = $this->lng;
303  $ilTabs = $this->tabs;
304 
305  // list skills
306  $ilTabs->addTab(
307  "list_skills",
308  $lng->txt("skmg_selected_skills"),
309  $ilCtrl->getLinkTarget($this, "listSkills")
310  );
311 
312  if (count($this->user_profiles) > 0) {
313  $ilTabs->addTab(
314  "profile",
315  $lng->txt("skmg_assigned_profiles"),
316  $ilCtrl->getLinkTarget($this, "listAssignedProfile")
317  );
318  }
319 
320  // assign materials
321 
322  $ilTabs->activateTab($a_activate);
323  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ showProfileSelectorToolbar()

ilPersonalSkillsGUI::showProfileSelectorToolbar ( )

Show profile selector toolbar.

Definition at line 1058 of file class.ilPersonalSkillsGUI.php.

References $ctrl, $ilCtrl, $lng, $options, $si, $toolbar, ilObject\_lookupTitle(), ilObject\_lookupType(), array, and getProfileId().

Referenced by listAssignedProfile(), and listProfilesForGap().

1059  {
1060  $ilToolbar = $this->toolbar;
1061  $lng = $this->lng;
1062  $ilCtrl = $this->ctrl;
1063 
1064  $options = array();
1065  if (is_array($this->obj_skills) && $this->obj_id > 0) {
1066  $options[0] = $lng->txt("obj_" . ilObject::_lookupType($this->obj_id)) . ": " . ilObject::_lookupTitle($this->obj_id);
1067  }
1068 
1069  foreach ($this->user_profiles as $p) {
1070  $options[$p["id"]] = $lng->txt("skmg_profile") . ": " . $p["title"];
1071  }
1072 
1073  include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
1074  $si = new ilSelectInputGUI($lng->txt("skmg_profile"), "profile_id");
1075  $si->setOptions($options);
1076  $si->setValue($this->getProfileId());
1077  $ilToolbar->addInputItem($si, true);
1078  $ilToolbar->addFormButton(
1079  $lng->txt("select"),
1080  "selectProfile"
1081  );
1082  $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
1083  }
This class represents a selection list property in a property form.
static _lookupTitle($a_id)
lookup object title
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Definition: as_login.php:20
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilPersonalSkillsGUI::$access
protected

Definition at line 73 of file class.ilPersonalSkillsGUI.php.

Referenced by getEvalItem().

◆ $actual_levels

ilPersonalSkillsGUI::$actual_levels = array()
protected

Definition at line 23 of file class.ilPersonalSkillsGUI.php.

◆ $ctrl

◆ $gap_self_eval_levels

ilPersonalSkillsGUI::$gap_self_eval_levels = array()
protected

Definition at line 24 of file class.ilPersonalSkillsGUI.php.

Referenced by getGapAnalysisSelfEvalLevels().

◆ $help

ilPersonalSkillsGUI::$help
protected

Definition at line 43 of file class.ilPersonalSkillsGUI.php.

Referenced by __construct().

◆ $hidden_skills

ilPersonalSkillsGUI::$hidden_skills = array()
protected

Definition at line 28 of file class.ilPersonalSkillsGUI.php.

◆ $history_view

ilPersonalSkillsGUI::$history_view = false
protected

Definition at line 26 of file class.ilPersonalSkillsGUI.php.

Referenced by getHistoryView().

◆ $intro_text

ilPersonalSkillsGUI::$intro_text = ""
protected

Definition at line 27 of file class.ilPersonalSkillsGUI.php.

Referenced by getIntroText().

◆ $lng

◆ $mode

ilPersonalSkillsGUI::$mode = ""
protected

Definition at line 25 of file class.ilPersonalSkillsGUI.php.

◆ $obj_id

ilPersonalSkillsGUI::$obj_id = 0
protected

Definition at line 84 of file class.ilPersonalSkillsGUI.php.

Referenced by getMaterialInfo(), and getSuggestedResources().

◆ $obj_skills

ilPersonalSkillsGUI::$obj_skills = array()
protected

Definition at line 85 of file class.ilPersonalSkillsGUI.php.

Referenced by getGapAnalysisHTML().

◆ $offline_mode

ilPersonalSkillsGUI::$offline_mode
protected

Definition at line 20 of file class.ilPersonalSkillsGUI.php.

◆ $setting

ilPersonalSkillsGUI::$setting
protected

Definition at line 48 of file class.ilPersonalSkillsGUI.php.

Referenced by __construct(), and assignMaterial().

◆ $skill_tree

ilPersonalSkillsGUI::$skill_tree
protected

Definition at line 21 of file class.ilPersonalSkillsGUI.php.

◆ $skill_tt_cnt

ilPersonalSkillsGUI::$skill_tt_cnt = 1
static

Definition at line 22 of file class.ilPersonalSkillsGUI.php.

◆ $tabs

ilPersonalSkillsGUI::$tabs
protected

◆ $toolbar

ilPersonalSkillsGUI::$toolbar
protected

◆ $tpl

◆ $ui_fac

ilPersonalSkillsGUI::$ui_fac
protected

Definition at line 78 of file class.ilPersonalSkillsGUI.php.

◆ $ui_ren

ilPersonalSkillsGUI::$ui_ren
protected

Definition at line 83 of file class.ilPersonalSkillsGUI.php.

◆ $user


The documentation for this class was generated from the following file: