ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 
82  $apps = $this->survey->getAppraiseesData();
83  $ctpl = new ilTemplate("tpl.svy_skill_list_changes.html", true, true, "Modules/Survey");
84  foreach ($apps as $app) {
85  $changes_table = new ilSurveySkillChangesTableGUI(
86  $this,
87  "listSkillChanges",
88  $this->survey,
89  $app
90  );
91 
92  $ctpl->setCurrentBlock("appraisee");
93  $ctpl->setVariable("LASTNAME", $app["lastname"]);
94  $ctpl->setVariable("FIRSTNAME", $app["firstname"]);
95 
96  $ctpl->setVariable("CHANGES_TABLE", $changes_table->getHTML());
97 
98  $ctpl->parseCurrentBlock();
99  }
100 
101  $tpl->setContent($ctpl->get());
102  }
103 
110  public function writeSkills()
111  {
112  $lng = $this->lng;
114  return;
115  include_once("./Modules/Survey/classes/class.ilSurveySkill.php");
116  $sskill = new ilSurveySkill($this->survey);
117  $apps = $this->survey->getAppraiseesData();
118  $ctpl = new ilTemplate("tpl.svy_skill_list_changes.html", true, true, "Modules/Survey");
119  foreach ($apps as $app) {
120  $new_levels = $sskill->determineSkillLevelsForAppraisee($app["user_id"]);
121  foreach ($new_levels as $nl) {
122  if ($nl["new_level_id"] > 0) {
124  $nl["new_level_id"],
125  $app["user_id"],
126  $this->survey->getRefId(),
127  $nl["tref_id"],
129  );
130  }
131  }
132  }
133  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
134  $ilCtrl->redirect($this, "listSkillChanges");
135  }
136 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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
Create styles array
The data for the language used.
__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.