ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSurveySkillDeterminationGUI Class Reference

Survey skill determination GUI class. More...

+ Collaboration diagram for ilSurveySkillDeterminationGUI:

Public Member Functions

 __construct (ilObjSurvey $a_survey)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 listSkillChanges ()
 List skill changes. More...
 
 writeAndAddSkills ()
 Write skills and add them to user's competence records. More...
 

Protected Attributes

 $ctrl
 
 $tpl
 
 $toolbar
 
 $lng
 

Detailed Description

Survey skill determination GUI class.

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

Definition at line 13 of file class.ilSurveySkillDeterminationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSurveySkillDeterminationGUI::__construct ( ilObjSurvey  $a_survey)

Constructor.

Parameters
object$a_survey

Definition at line 40 of file class.ilSurveySkillDeterminationGUI.php.

References $DIC.

41  {
42  global $DIC;
43 
44  $this->ctrl = $DIC->ctrl();
45  $this->tpl = $DIC["tpl"];
46  $this->toolbar = $DIC->toolbar();
47  $this->lng = $DIC->language();
48  $this->survey = $a_survey;
49  }
global $DIC
Definition: goto.php:24

Member Function Documentation

◆ executeCommand()

ilSurveySkillDeterminationGUI::executeCommand ( )

Execute command.

Definition at line 54 of file class.ilSurveySkillDeterminationGUI.php.

References $ctrl.

55  {
56  $ilCtrl = $this->ctrl;
57 
58  $cmd = $ilCtrl->getCmd("listSkillChanges");
59 
60  //$ilCtrl->saveParameter($this, array("sk_id", "tref_id"));
61 
62  if (in_array($cmd, array("listSkillChanges", "writeAndAddSkills"))) {
63  $this->$cmd();
64  }
65  }

◆ listSkillChanges()

ilSurveySkillDeterminationGUI::listSkillChanges ( )

List skill changes.

Definition at line 70 of file class.ilSurveySkillDeterminationGUI.php.

References $app, $ctrl, $lng, $toolbar, and $tpl.

71  {
72  $tpl = $this->tpl;
73  $ilToolbar = $this->toolbar;
74  $lng = $this->lng;
75  $ilCtrl = $this->ctrl;
76 
77  if ($this->survey->get360Mode()) {
78  $apps = $this->survey->getAppraiseesData();
79  } else { // Mode self evaluation, No Appraisee and Rater involved.
80  $apps = $this->survey->getSurveyParticipants();
81  }
82  $ctpl = new ilTemplate("tpl.svy_skill_list_changes.html", true, true, "Modules/Survey");
83  foreach ($apps as $app) {
84  $changes_table = new ilSurveySkillChangesTableGUI(
85  $this,
86  "listSkillChanges",
87  $this->survey,
88  $app
89  );
90 
91  $ctpl->setCurrentBlock("appraisee");
92  $ctpl->setVariable("LASTNAME", $app["lastname"]);
93  $ctpl->setVariable("FIRSTNAME", $app["firstname"]);
94 
95  $ctpl->setVariable("CHANGES_TABLE", $changes_table->getHTML());
96 
97  $ctpl->parseCurrentBlock();
98  }
99 
100  $tpl->setContent($ctpl->get());
101  }
$app
Definition: cli.php:38
TableGUI class for survey skill changes.

◆ writeAndAddSkills()

ilSurveySkillDeterminationGUI::writeAndAddSkills ( )

Write skills and add them to user's competence records.

Parameters

Definition at line 109 of file class.ilSurveySkillDeterminationGUI.php.

References $app, $ctrl, $lng, ilBasicSkill\ACHIEVED, ilPersonalSkill\addPersonalSkill(), and ilBasicSkill\writeUserSkillLevelStatus().

110  {
111  $lng = $this->lng;
112  $ilCtrl = $this->ctrl;
113  return;
114  $sskill = new ilSurveySkill($this->survey);
115  $apps = $this->survey->getAppraiseesData();
116  $ctpl = new ilTemplate("tpl.svy_skill_list_changes.html", true, true, "Modules/Survey");
117  foreach ($apps as $app) {
118  $new_levels = $sskill->determineSkillLevelsForAppraisee($app["user_id"]);
119  foreach ($new_levels as $nl) {
120  if ($nl["new_level_id"] > 0) {
122  $nl["new_level_id"],
123  $app["user_id"],
124  $this->survey->getRefId(),
125  $nl["tref_id"],
127  false,
128  false,
129  "",
130  $nl["next_level_perc"]
131  );
132 
133  if ($nl["tref_id"] > 0) {
134  ilPersonalSkill::addPersonalSkill($app["user_id"], $nl["tref_id"]);
135  } else {
136  ilPersonalSkill::addPersonalSkill($app["user_id"], $nl["base_skill_id"]);
137  }
138  }
139  }
140  }
141  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
142  $ilCtrl->redirect($this, "listSkillChanges");
143  }
$app
Definition: cli.php:38
static writeUserSkillLevelStatus(int $a_level_id, int $a_user_id, int $a_trigger_ref_id, int $a_tref_id=0, int $a_status=ilBasicSkill::ACHIEVED, bool $a_force=false, bool $a_self_eval=false, string $a_unique_identifier="", float $a_next_level_fulfilment=0.0)
Skill/Competence handling in surveys.
static addPersonalSkill($a_user_id, $a_skill_node_id)
Add personal skill.
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilSurveySkillDeterminationGUI::$ctrl
protected

◆ $lng

ilSurveySkillDeterminationGUI::$lng
protected

Definition at line 33 of file class.ilSurveySkillDeterminationGUI.php.

Referenced by listSkillChanges(), and writeAndAddSkills().

◆ $toolbar

ilSurveySkillDeterminationGUI::$toolbar
protected

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

Referenced by listSkillChanges().

◆ $tpl

ilSurveySkillDeterminationGUI::$tpl
protected

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

Referenced by listSkillChanges().


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