ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilSkillSelfEvaluationGUI Class Reference

Self evaluation. More...

+ Collaboration diagram for ilSkillSelfEvaluationGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 readSelfEvaluation ()
 Read self_evaluation. More...
 
 listSelfEvaluations ()
 List all self evaluations. More...
 
 confirmSelfEvaluationDeletion ()
 Confirm self_evaluation deletion. More...
 
 deleteSelfEvaluation ()
 Delete self_evaluation. More...
 
 startSelfEvaluation ($a_mode="create")
 startSelfEvaluation More...
 
 saveSelfEvaluation ()
 Save self evaluation. More...
 
 editSelfEvaluation ()
 Edit self evaluation. More...
 
 updateBackSelfEvaluation ()
 Update self evaluation and go one step back. More...
 
 updateSelfEvaluation ($a_back=false)
 Update self evaluation. More...
 
 getPresentationView ($a_user_id)
 Get presentation view. More...
 
 setSelfEvaluationPresentationForm ($se)
 Set self evaluation presentation form. More...
 

Protected Attributes

 $ctrl
 
 $lng
 
 $tpl
 
 $toolbar
 
 $user
 

Detailed Description

Self evaluation.

Author
Alex Killing alex..nosp@m.kili.nosp@m.ng@gm.nosp@m.x.de
Version
$Id$ @ilCtrl_Calls ilSkillSelfEvaluationGUI:

Definition at line 12 of file class.ilSkillSelfEvaluationGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSkillSelfEvaluationGUI::__construct ( )

Constructor.

Parameters

return

Definition at line 45 of file class.ilSkillSelfEvaluationGUI.php.

46 {
47 global $DIC;
48
49 $this->ctrl = $DIC->ctrl();
50 $this->lng = $DIC->language();
51 $this->tpl = $DIC["tpl"];
52 $this->toolbar = $DIC->toolbar();
53 $this->user = $DIC->user();
54 $ilCtrl = $DIC->ctrl();
55 $lng = $DIC->language();
56
57 $ilCtrl->saveParameter($this, array("se_id", "sn_id"));
58 $lng->loadLanguageModule("skmg");
59
60 $this->readSelfEvaluation();
61
62 $this->se_id = (int) $_GET["se_id"];
63 $this->sn_id = ((int) $_POST["sn_id"] > 0)
64 ? (int) $_POST["sn_id"]
65 : (int) $_GET["sn_id"];
66 $ilCtrl->setParameter($this, "sn_id", $this->sn_id);
67 }
user()
Definition: user.php:4
$_GET["client_id"]
$_POST["username"]
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46

References $_GET, $_POST, $DIC, $ilCtrl, $lng, readSelfEvaluation(), and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ confirmSelfEvaluationDeletion()

ilSkillSelfEvaluationGUI::confirmSelfEvaluationDeletion ( )

Confirm self_evaluation deletion.

Definition at line 134 of file class.ilSkillSelfEvaluationGUI.php.

135 {
139
140 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
141 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
142 $ilCtrl->redirect($this, "listSelfEvaluations");
143 } else {
144 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
145 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
146 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
147 $cgui = new ilConfirmationGUI();
148 $cgui->setFormAction($ilCtrl->getFormAction($this));
149 $cgui->setHeaderText($lng->txt("skmg_sure_delete_self_evaluation"));
150 $cgui->setCancel($lng->txt("cancel"), "listSelfEvaluations");
151 $cgui->setConfirm($lng->txt("delete"), "deleteSelfEvaluation");
152
153 foreach ($_POST["id"] as $i) {
154 $se = new ilSkillSelfEvaluation((int) $i);
155 $se_title =
156 ilSkillTreeNode::_lookupTitle($se->getTopSkillId());
157 $cgui->addItem("id[]", $i, $se_title . ", " . $lng->txt("created") . ": " .
158 $se->getCreated() . ", " . $lng->txt("last_update") . ": " . $se->getLastUpdate());
159 }
160
161 $tpl->setContent($cgui->getHTML());
162 }
163 }
Confirmation screen class.
Self evaluation application class.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$i
Definition: metadata.php:24

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

+ Here is the call graph for this function:

◆ deleteSelfEvaluation()

ilSkillSelfEvaluationGUI::deleteSelfEvaluation ( )

Delete self_evaluation.

Parameters

return

Definition at line 171 of file class.ilSkillSelfEvaluationGUI.php.

172 {
176
177 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
178 if (is_array($_POST["id"])) {
179 foreach ($_POST["id"] as $i) {
180 $se = new ilSkillSelfEvaluation((int) $i);
181 if ($se->getUserId() == $ilUser->getId()) {
182 $se->delete();
183 }
184 }
185 }
186 ilUtil::sendSuccess("msg_obj_modified");
187 $ilCtrl->redirect($this, "listSelfEvaluations");
188 }
$ilUser
Definition: imgupload.php:18

References $_POST, $ctrl, $i, $ilCtrl, $ilUser, $lng, and $user.

◆ editSelfEvaluation()

ilSkillSelfEvaluationGUI::editSelfEvaluation ( )

Edit self evaluation.

Parameters

return

Definition at line 293 of file class.ilSkillSelfEvaluationGUI.php.

294 {
295 $this->startSelfEvaluation("edit");
296 }
startSelfEvaluation($a_mode="create")
startSelfEvaluation

References startSelfEvaluation().

+ Here is the call graph for this function:

◆ executeCommand()

ilSkillSelfEvaluationGUI::executeCommand ( )

Execute command.

Definition at line 72 of file class.ilSkillSelfEvaluationGUI.php.

73 {
75
76 $cmd = $ilCtrl->getCmd("listSelfEvaluations");
77 $this->$cmd();
78 }

References $ctrl, and $ilCtrl.

◆ getPresentationView()

ilSkillSelfEvaluationGUI::getPresentationView (   $a_user_id)

Get presentation view.

Parameters

return

Definition at line 361 of file class.ilSkillSelfEvaluationGUI.php.

362 {
363 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
365
366 $html = "";
367 foreach ($ses as $se) {
369 $html .= $this->form->getHTML() . "<br /><br />";
370 }
371
372 return $html;
373 }
setSelfEvaluationPresentationForm($se)
Set self evaluation presentation form.
static getAllSelfEvaluationsOfUser($a_user, $a_one_per_top_skill=false)
Get all self evaluations.

References ilSkillSelfEvaluation\getAllSelfEvaluationsOfUser(), and setSelfEvaluationPresentationForm().

+ Here is the call graph for this function:

◆ listSelfEvaluations()

ilSkillSelfEvaluationGUI::listSelfEvaluations ( )

List all self evaluations.

Definition at line 94 of file class.ilSkillSelfEvaluationGUI.php.

95 {
97 $ilToolbar = $this->toolbar;
100
101 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
102
103 // desc
104 /*$ne = new ilNonEditableValueGUI($lng->txt("lang"), var);
105 $ne->setValue();
106 $ne->setInfo();
107 $this->form->addItem($ne);*/
108
109 // select skill for self evaluation
110 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
112 foreach ($se_nodes as $n_id => $title) {
113 $options[$n_id] = $title;
114 }
115 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
116 $si = new ilSelectInputGUI($lng->txt("skmg_please_select_self_skill"), "sn_id");
117 $si->setOptions($options);
118
119 //$si->setInfo($lng->txt(""));
120 $ilToolbar->addInputItem($si, true);
121
122 $ilToolbar->addFormButton($lng->txt("skmg_execute_self_evaluation"), "startSelfEvaluation");
123
124 include_once("./Services/Skill/classes/class.ilSelfEvaluationTableGUI.php");
125 $table = new ilSelfEvaluationTableGUI($this, "listSelfEvaluations");
126
127 $tpl->setContent($table->getHTML());
128 }
This class represents a selection list property in a property form.
Self evaluation overview table.
static getAllSelfEvaluationNodes()
Get all self evaluation nodes.

References $ctrl, $ilCtrl, $lng, $si, $toolbar, $tpl, and ilSkillTreeNode\getAllSelfEvaluationNodes().

+ Here is the call graph for this function:

◆ readSelfEvaluation()

ilSkillSelfEvaluationGUI::readSelfEvaluation ( )

Read self_evaluation.

Parameters

return

Definition at line 86 of file class.ilSkillSelfEvaluationGUI.php.

87 {
88 // $this->self_evaluation = new ilSelfEvaluation((int) $_GET[save_param]);
89 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ saveSelfEvaluation()

ilSkillSelfEvaluationGUI::saveSelfEvaluation ( )

Save self evaluation.

Parameters

return

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

259 {
263
264 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
265
266 $se = new ilSkillSelfEvaluation();
267 $se->setUserId($ilUser->getId());
268 $se->setTopSkillId($_GET["sn_id"]);
269 if (is_array($_POST["se_sk"])) {
270 $se->setLevels($_POST["se_sk"]);
271 }
272 $se->create();
273
275 $cstep = (int) $_GET["step"];
276
277 if (count($steps)) {
278 $ilCtrl->setParameter($this, "step", 1);
279 $ilCtrl->setParameter($this, "se_id", $se->getId());
280 $ilCtrl->redirect($this, "editSelfEvaluation");
281 }
282
283 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
284 $ilCtrl->redirect($this, "");
285 }
static determineSteps($a_sn_id)
Determine steps.
$steps
Definition: latex.php:3

References $_GET, $_POST, $ctrl, $ilCtrl, $ilUser, $lng, $steps, $user, ilSkillSelfEvaluation\determineSteps(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ setSelfEvaluationPresentationForm()

ilSkillSelfEvaluationGUI::setSelfEvaluationPresentationForm (   $se)

Set self evaluation presentation form.

Definition at line 378 of file class.ilSkillSelfEvaluationGUI.php.

379 {
382
383 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
384 $this->form = new ilPropertyFormGUI();
385
387 $dates = ", " .
388 $lng->txt("created") . ": " .
390 new ilDateTime($se["created"], IL_CAL_DATETIME)
391 );
392 if ($se["created"] != $se["last_update"]) {
393 $dates .= ", " . $lng->txt("last_update") . ": " .
395 new ilDateTime($se["last_update"], IL_CAL_DATETIME)
396 );
397 }
399
400 $se = new ilSkillSelfEvaluation($se["id"]);
401 $levels = $se->getLevels();
402
403 $this->form->setTitle($lng->txt("skmg_self_evaluation") . $dates);
404
405 include_once("./Services/Skill/classes/class.ilBasicSkill.php");
406 include_once("./Services/Skill/classes/class.ilSkillTree.php");
407 $stree = new ilSkillTree();
408
409 if ($stree->isInTree($se->getTopSkillId())) {
410 $cnode = $stree->getNodeData($se->getTopSkillId());
411 $childs = $stree->getSubTree($cnode);
412 foreach ($childs as $child) {
413 if ($child["type"] == "skll") {
414 // build title
415 $path = $stree->getPathFull($child["child"]);
416 $title = $sep = "";
417 foreach ($path as $p) {
418 if ($p["type"] != "skrt") {
419 $title .= $sep . $p["title"];
420 $sep = " > ";
421 }
422 }
423
424 $sk = new ilBasicSkill($child["child"]);
425 $ls = $sk->getLevelData();
426
427 $ne = new ilNonEditableValueGUI($title, "");
428 foreach ($ls as $ld) {
429 if ($ld["id"] == $levels[$child["child"]]) {
430 $ne->setValue($ld["title"]);
431 }
432 }
433 $this->form->addItem($ne);
434 }
435 }
436 }
437 }
const IL_CAL_DATETIME
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
@classDescription Date and time handling
This class represents a non editable value in a property form.
This class represents a property form user interface.

References $ctrl, $ilCtrl, $lng, ilDatePresentation\formatDate(), IL_CAL_DATETIME, and ilDatePresentation\setUseRelativeDates().

Referenced by getPresentationView().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startSelfEvaluation()

ilSkillSelfEvaluationGUI::startSelfEvaluation (   $a_mode = "create")

startSelfEvaluation

Parameters

return

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

198 {
202
203 $se = null;
204 if ($a_mode == "edit") {
205 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
206 $se = new ilSkillSelfEvaluation((int) $_GET["se_id"]);
207 $this->sn_id = $se->getTopSkillId();
208 }
209 ilUtil::sendInfo($lng->txt("skmg_please_select_your_skill_levels"));
210
211 $se_tpl = new ilTemplate("tpl.self_evaluation.html", true, true, "Services/Skill");
212 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
213
215 $cstep = (int) $_GET["step"];
216 $ilCtrl->setParameter($this, "step", $cstep);
217 include_once("./Services/Skill/classes/class.ilSkillSelfEvalSkillTableGUI.php");
218 $table = new ilSkillSelfEvalSkillTableGUI(
219 $this,
220 "startSelfEvaluation",
221 $steps[$cstep],
222 $se
223 );
224
225 $se_tpl->setCurrentBlock("se_table");
226 $se_tpl->setVariable("SE_TABLE", $table->getHTML());
227 $se_tpl->parseCurrentBlock();
228
229 include_once("./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php");
230 $tb = new ilToolbarGUI();
231 if ($a_mode == "edit") {
232 if ($cstep > 0) {
233 $tb->addFormButton("< " . $lng->txt("skmg_previous_step"), "updateBackSelfEvaluation");
234 }
235 if ($cstep < count($steps) - 1) {
236 $tb->addFormButton($lng->txt("skmg_next_step") . " >", "updateSelfEvaluation");
237 } elseif ($cstep == count($steps) - 1) {
238 $tb->addFormButton($lng->txt("skmg_save_self_evaluation"), "updateSelfEvaluation");
239 }
240 } else {
241 if ($cstep < count($steps) - 1) {
242 $tb->addFormButton($lng->txt("skmg_next_step") . " >", "saveSelfEvaluation");
243 } elseif ($cstep == count($steps) - 1) {
244 $tb->addFormButton($lng->txt("skmg_save_self_evaluation"), "saveSelfEvaluation");
245 }
246 }
247 $se_tpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this));
248 $se_tpl->setVariable("TOOLBAR", $tb->getHTML());
249 $tpl->setContent($se_tpl->get());
250 }
Self evaluation table for single skill.
special template class to simplify handling of ITX/PEAR

References $_GET, $ctrl, $ilCtrl, $lng, $steps, $tpl, ilSkillSelfEvaluation\determineSteps(), and ilUtil\sendInfo().

Referenced by editSelfEvaluation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateBackSelfEvaluation()

ilSkillSelfEvaluationGUI::updateBackSelfEvaluation ( )

Update self evaluation and go one step back.

Parameters

return

Definition at line 304 of file class.ilSkillSelfEvaluationGUI.php.

305 {
306 $this->updateSelfEvaluation(true);
307 }
updateSelfEvaluation($a_back=false)
Update self evaluation.

References updateSelfEvaluation().

+ Here is the call graph for this function:

◆ updateSelfEvaluation()

ilSkillSelfEvaluationGUI::updateSelfEvaluation (   $a_back = false)

Update self evaluation.

Parameters

return

Definition at line 317 of file class.ilSkillSelfEvaluationGUI.php.

318 {
322
323 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
324 $se = new ilSkillSelfEvaluation((int) $_GET["se_id"]);
325
326 if ($se->getUserId() == $ilUser->getId()) {
328 $cstep = (int) $_GET["step"];
329
330 if (is_array($_POST["se_sk"])) {
331 $se->setLevels($_POST["se_sk"], true);
332 }
333 $se->update();
334
335 if ($a_back) {
336 $ilCtrl->setParameter($this, "step", (int) $_GET["step"] - 1);
337 $ilCtrl->setParameter($this, "se_id", $se->getId());
338 $ilCtrl->redirect($this, "editSelfEvaluation");
339 } elseif (count($steps) - 1 > $cstep) {
340 $ilCtrl->setParameter($this, "step", (int) $_GET["step"] + 1);
341 $ilCtrl->setParameter($this, "se_id", $se->getId());
342 $ilCtrl->redirect($this, "editSelfEvaluation");
343 }
344
345 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
346 }
347
348 $ilCtrl->redirect($this, "");
349 }

References $_GET, $_POST, $ctrl, $ilCtrl, $ilUser, $lng, $steps, $user, ilSkillSelfEvaluation\determineSteps(), and ilUtil\sendInfo().

Referenced by updateBackSelfEvaluation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

◆ $lng

◆ $toolbar

ilSkillSelfEvaluationGUI::$toolbar
protected

Definition at line 32 of file class.ilSkillSelfEvaluationGUI.php.

Referenced by listSelfEvaluations().

◆ $tpl

ilSkillSelfEvaluationGUI::$tpl
protected

◆ $user

ilSkillSelfEvaluationGUI::$user
protected

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