ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilSurveySkillDeterminationGUI.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
14 {
18  protected $ctrl;
19 
23  protected $tpl;
24 
28  protected $toolbar;
29 
33  protected $lng;
34 
40  public function __construct(ilObjSurvey $a_survey)
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  }
50 
54  public function executeCommand()
55  {
57 
58  $cmd = $ilCtrl->getCmd("listSkillChanges");
59 
60  //$ilCtrl->saveParameter($this, array("sk_id", "tref_id"));
61 
62  if (in_array($cmd, array("listSkillChanges", "writeSkills"))) {
63  $this->$cmd();
64  }
65  }
66 
70  public function listSkillChanges()
71  {
72  $tpl = $this->tpl;
73  $ilToolbar = $this->toolbar;
74  $lng = $this->lng;
76 
77  include_once("./Modules/Survey/classes/class.ilSurveySkillChangesTableGUI.php");
78 
79  // $ilToolbar->addButton($lng->txt("survey_write_skills"),
80  // $ilCtrl->getLinkTarget($this, "writeSkills"));
81  if ($this->survey->get360Mode()) {
82  $apps = $this->survey->getAppraiseesData();
83  } else { // Mode self evaluation, No Appraisee and Rater involved.
84  $apps = $this->survey->getSurveyParticipants();
85  }
86  $ctpl = new ilTemplate("tpl.svy_skill_list_changes.html", true, true, "Modules/Survey");
87  foreach ($apps as $app) {
88  $changes_table = new ilSurveySkillChangesTableGUI(
89  $this,
90  "listSkillChanges",
91  $this->survey,
92  $app
93  );
94 
95  $ctpl->setCurrentBlock("appraisee");
96  $ctpl->setVariable("LASTNAME", $app["lastname"]);
97  $ctpl->setVariable("FIRSTNAME", $app["firstname"]);
98 
99  $ctpl->setVariable("CHANGES_TABLE", $changes_table->getHTML());
100 
101  $ctpl->parseCurrentBlock();
102  }
103 
104  $tpl->setContent($ctpl->get());
105  }
106 
113  public function writeSkills()
114  {
115  $lng = $this->lng;
117  return;
118  include_once("./Modules/Survey/classes/class.ilSurveySkill.php");
119  $sskill = new ilSurveySkill($this->survey);
120  $apps = $this->survey->getAppraiseesData();
121  $ctpl = new ilTemplate("tpl.svy_skill_list_changes.html", true, true, "Modules/Survey");
122  foreach ($apps as $app) {
123  $new_levels = $sskill->determineSkillLevelsForAppraisee($app["user_id"]);
124  foreach ($new_levels as $nl) {
125  if ($nl["new_level_id"] > 0) {
127  $nl["new_level_id"],
128  $app["user_id"],
129  $this->survey->getRefId(),
130  $nl["tref_id"],
132  );
133  }
134  }
135  }
136  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
137  $ilCtrl->redirect($this, "listSkillChanges");
138  }
139 }
global $DIC
Definition: saml.php:7
TableGUI class for survey skill changes.
global $ilCtrl
Definition: ilias.php:18
Skill/Competence handling in surveys.
special template class to simplify handling of ITX/PEAR
__construct(ilObjSurvey $a_survey)
Constructor.
static writeUserSkillLevelStatus( $a_level_id, $a_user_id, $a_trigger_ref_id, $a_tref_id=0, $a_status=ilBasicSkill::ACHIEVED, $a_force=false, $a_self_eval=false, $a_unique_identifier="")
Write skill level status.
Survey skill determination GUI class.