ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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...
 

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 20 of file class.ilSkillSelfEvaluationGUI.php.

21 {
22 global $ilCtrl, $lng;
23
24 $ilCtrl->saveParameter($this, array("se_id", "sn_id"));
25 $lng->loadLanguageModule("skmg");
26
27 $this->readSelfEvaluation();
28
29 $this->se_id = (int) $_GET["se_id"];
30 $this->sn_id = ((int) $_POST["sn_id"] > 0)
31 ? (int) $_POST["sn_id"]
32 : (int) $_GET["sn_id"];
33 $ilCtrl->setParameter($this, "sn_id", $this->sn_id);
34 }
$_GET["client_id"]
$_POST['username']
Definition: cron.php:12
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:40

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

+ Here is the call graph for this function:

Member Function Documentation

◆ confirmSelfEvaluationDeletion()

ilSkillSelfEvaluationGUI::confirmSelfEvaluationDeletion ( )

Confirm self_evaluation deletion.

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

101 {
102 global $ilCtrl, $tpl, $lng;
103
104 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
105 {
106 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
107 $ilCtrl->redirect($this, "listSelfEvaluations");
108 }
109 else
110 {
111 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
112 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
113 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
114 $cgui = new ilConfirmationGUI();
115 $cgui->setFormAction($ilCtrl->getFormAction($this));
116 $cgui->setHeaderText($lng->txt("skmg_sure_delete_self_evaluation"));
117 $cgui->setCancel($lng->txt("cancel"), "listSelfEvaluations");
118 $cgui->setConfirm($lng->txt("delete"), "deleteSelfEvaluation");
119
120 foreach ($_POST["id"] as $i)
121 {
122 $se = new ilSkillSelfEvaluation((int) $i);
123 $se_title =
124 ilSkillTreeNode::_lookupTitle($se->getTopSkillId());
125 $cgui->addItem("id[]", $i, $se_title.", ".$lng->txt("created").": ".
126 $se->getCreated().", ".$lng->txt("last_update").": ".$se->getLastUpdate());
127 }
128
129 $tpl->setContent($cgui->getHTML());
130 }
131 }
global $tpl
Definition: ilias.php:8
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.

References $_POST, $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 139 of file class.ilSkillSelfEvaluationGUI.php.

140 {
141 global $ilCtrl, $lng, $ilUser;
142
143 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
144 if (is_array($_POST["id"]))
145 {
146 foreach ($_POST["id"] as $i)
147 {
148 $se = new ilSkillSelfEvaluation((int) $i);
149 if ($se->getUserId() == $ilUser->getId())
150 {
151 $se->delete();
152 }
153 }
154 }
155 ilUtil::sendSuccess("msg_obj_modified");
156 $ilCtrl->redirect($this, "listSelfEvaluations");
157 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
global $ilUser
Definition: imgupload.php:15

References $_POST, $ilCtrl, $ilUser, $lng, and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ editSelfEvaluation()

ilSkillSelfEvaluationGUI::editSelfEvaluation ( )

Edit self evaluation.

Parameters

return

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

268 {
269 $this->startSelfEvaluation("edit");
270 }
startSelfEvaluation($a_mode="create")
startSelfEvaluation

References startSelfEvaluation().

+ Here is the call graph for this function:

◆ executeCommand()

ilSkillSelfEvaluationGUI::executeCommand ( )

Execute command.

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

40 {
41 global $ilCtrl;
42
43 $cmd = $ilCtrl->getCmd("listSelfEvaluations");
44 $this->$cmd();
45 }
$cmd
Definition: sahs_server.php:35

References $cmd, and $ilCtrl.

◆ getPresentationView()

ilSkillSelfEvaluationGUI::getPresentationView (   $a_user_id)

Get presentation view.

Parameters

return

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

339 {
340 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
342
343 $html = "";
344 foreach ($ses as $se)
345 {
347 $html.= $this->form->getHTML()."<br /><br />";
348 }
349
350 return $html;
351 }
setSelfEvaluationPresentationForm($se)
Set self evaluation presentation form.
static getAllSelfEvaluationsOfUser($a_user, $a_one_per_top_skill=false)
Get all self evaluations.
$html
Definition: example_001.php:87

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

+ Here is the call graph for this function:

◆ listSelfEvaluations()

ilSkillSelfEvaluationGUI::listSelfEvaluations ( )

List all self evaluations.

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

62 {
63 global $tpl, $ilToolbar, $ilCtrl, $lng;
64
65 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
66
67 // desc
68 /*$ne = new ilNonEditableValueGUI($lng->txt("lang"), var);
69 $ne->setValue();
70 $ne->setInfo();
71 $this->form->addItem($ne);*/
72
73 // select skill for self evaluation
74 include_once("./Services/Skill/classes/class.ilSkillTreeNode.php");
76 foreach ($se_nodes as $n_id => $title)
77 {
78
79 $options[$n_id] = $title;
80 }
81 include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
82 $si = new ilSelectInputGUI($lng->txt("skmg_please_select_self_skill"), "sn_id");
83 $si->setOptions($options);
84
85 //$si->setInfo($lng->txt(""));
86 $ilToolbar->addInputItem($si, true);
87
88 $ilToolbar->addFormButton($lng->txt("skmg_execute_self_evaluation"), "startSelfEvaluation");
89
90 include_once("./Services/Skill/classes/class.ilSelfEvaluationTableGUI.php");
91 $table = new ilSelfEvaluationTableGUI($this, "listSelfEvaluations");
92
93 $tpl->setContent($table->getHTML());
94 }
This class represents a selection list property in a property form.
Self evaluation overview table.
static getAllSelfEvaluationNodes()
Get all self evaluation nodes.
if(!is_array($argv)) $options

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

+ Here is the call graph for this function:

◆ readSelfEvaluation()

ilSkillSelfEvaluationGUI::readSelfEvaluation ( )

Read self_evaluation.

Parameters

return

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

54 {
55// $this->self_evaluation = new ilSelfEvaluation((int) $_GET[save_param]);
56 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ saveSelfEvaluation()

ilSkillSelfEvaluationGUI::saveSelfEvaluation ( )

Save self evaluation.

Parameters

return

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

233 {
234 global $ilUser, $lng, $ilCtrl;
235
236 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
237
238 $se = new ilSkillSelfEvaluation();
239 $se->setUserId($ilUser->getId());
240 $se->setTopSkillId($_GET["sn_id"]);
241 if (is_array($_POST["se_sk"]))
242 {
243 $se->setLevels($_POST["se_sk"]);
244 }
245 $se->create();
246
248 $cstep = (int) $_GET["step"];
249
250 if (count($steps))
251 {
252 $ilCtrl->setParameter($this, "step", 1);
253 $ilCtrl->setParameter($this, "se_id", $se->getId());
254 $ilCtrl->redirect($this, "editSelfEvaluation");
255 }
256
257 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
258 $ilCtrl->redirect($this, "");
259 }
static determineSteps($a_sn_id)
Determine steps.
$steps
Definition: latex.php:3

References $_GET, $_POST, $ilCtrl, $ilUser, $lng, $steps, 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 356 of file class.ilSkillSelfEvaluationGUI.php.

357 {
358 global $lng, $ilCtrl;
359
360 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
361 $this->form = new ilPropertyFormGUI();
362
364 $dates = ", ".
365 $lng->txt("created").": ".
367 new ilDateTime($se["created"], IL_CAL_DATETIME));
368 if ($se["created"] != $se["last_update"])
369 {
370 $dates.= ", ".$lng->txt("last_update").": ".
372 new ilDateTime($se["last_update"], IL_CAL_DATETIME));
373 }
375
376 $se = new ilSkillSelfEvaluation($se["id"]);
377 $levels = $se->getLevels();
378
379 $this->form->setTitle($lng->txt("skmg_self_evaluation").$dates);
380
381 include_once("./Services/Skill/classes/class.ilBasicSkill.php");
382 include_once("./Services/Skill/classes/class.ilSkillTree.php");
383 $stree = new ilSkillTree();
384
385 if ($stree->isInTree($se->getTopSkillId()))
386 {
387 $cnode = $stree->getNodeData($se->getTopSkillId());
388 $childs = $stree->getSubTree($cnode);
389 foreach ($childs as $child)
390 {
391 if ($child["type"] == "skll")
392 {
393 // build title
394 $path = $stree->getPathFull($child["child"]);
395 $title = $sep = "";
396 foreach ($path as $p)
397 {
398 if ($p["type"] != "skrt")
399 {
400 $title.= $sep.$p["title"];
401 $sep = " > ";
402 }
403 }
404
405 $sk = new ilBasicSkill($child["child"]);
406 $ls = $sk->getLevelData();
407
408 $ne = new ilNonEditableValueGUI($title, "");
409 foreach ($ls as $ld)
410 {
411 if ($ld["id"] == $levels[$child["child"]])
412 {
413 $ne->setValue($ld["title"]);
414 }
415 }
416 $this->form->addItem($ne);
417 }
418 }
419 }
420
421 }
const IL_CAL_DATETIME
static setUseRelativeDates($a_status)
set use relative dates
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
This class represents a non editable value in a property form.
This class represents a property form user interface.
$path
Definition: index.php:22

References $ilCtrl, $lng, $path, 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 166 of file class.ilSkillSelfEvaluationGUI.php.

167 {
168 global $tpl, $ilCtrl, $lng;
169
170 $se = null;
171 if ($a_mode == "edit")
172 {
173 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
174 $se = new ilSkillSelfEvaluation((int) $_GET["se_id"]);
175 $this->sn_id = $se->getTopSkillId();
176 }
177 ilUtil::sendInfo($lng->txt("skmg_please_select_your_skill_levels"));
178
179 $se_tpl = new ilTemplate("tpl.self_evaluation.html", true, true, "Services/Skill");
180 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
181
183 $cstep = (int) $_GET["step"];
184 $ilCtrl->setParameter($this, "step", $cstep);
185 include_once("./Services/Skill/classes/class.ilSkillSelfEvalSkillTableGUI.php");
186 $table = new ilSkillSelfEvalSkillTableGUI($this, "startSelfEvaluation",
187 $steps[$cstep], $se);
188
189 $se_tpl->setCurrentBlock("se_table");
190 $se_tpl->setVariable("SE_TABLE", $table->getHTML());
191 $se_tpl->parseCurrentBlock();
192
193 include_once("./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php");
194 $tb = new ilToolbarGUI();
195 if ($a_mode == "edit")
196 {
197 if ($cstep > 0)
198 {
199 $tb->addFormButton("< ".$lng->txt("skmg_previous_step"), "updateBackSelfEvaluation");
200 }
201 if ($cstep < count($steps) - 1)
202 {
203 $tb->addFormButton($lng->txt("skmg_next_step")." >", "updateSelfEvaluation");
204 }
205 else if ($cstep == count($steps) - 1)
206 {
207 $tb->addFormButton($lng->txt("skmg_save_self_evaluation"), "updateSelfEvaluation");
208 }
209 }
210 else
211 {
212 if ($cstep < count($steps) - 1)
213 {
214 $tb->addFormButton($lng->txt("skmg_next_step")." >", "saveSelfEvaluation");
215 }
216 else if ($cstep == count($steps) - 1)
217 {
218 $tb->addFormButton($lng->txt("skmg_save_self_evaluation"), "saveSelfEvaluation");
219 }
220 }
221 $se_tpl->setVariable("FORM_ACTION", $ilCtrl->getFormAction($this));
222 $se_tpl->setVariable("TOOLBAR", $tb->getHTML());
223 $tpl->setContent($se_tpl->get());
224 }
Self evaluation table for single skill.
special template class to simplify handling of ITX/PEAR

References $_GET, $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 278 of file class.ilSkillSelfEvaluationGUI.php.

279 {
280 $this->updateSelfEvaluation(true);
281 }
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 291 of file class.ilSkillSelfEvaluationGUI.php.

292 {
293 global $ilUser, $lng, $ilCtrl;
294
295 include_once("./Services/Skill/classes/class.ilSkillSelfEvaluation.php");
296 $se = new ilSkillSelfEvaluation((int) $_GET["se_id"]);
297
298 if ($se->getUserId() == $ilUser->getId())
299 {
301 $cstep = (int) $_GET["step"];
302
303 if (is_array($_POST["se_sk"]))
304 {
305 $se->setLevels($_POST["se_sk"], true);
306 }
307 $se->update();
308
309 if ($a_back)
310 {
311 $ilCtrl->setParameter($this, "step", (int) $_GET["step"] - 1);
312 $ilCtrl->setParameter($this, "se_id", $se->getId());
313 $ilCtrl->redirect($this, "editSelfEvaluation");
314 }
315 else if (count($steps) - 1 > $cstep)
316 {
317 $ilCtrl->setParameter($this, "step", (int) $_GET["step"] + 1);
318 $ilCtrl->setParameter($this, "se_id", $se->getId());
319 $ilCtrl->redirect($this, "editSelfEvaluation");
320 }
321
322 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
323 }
324
325 $ilCtrl->redirect($this, "");
326 }

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

Referenced by updateBackSelfEvaluation().

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

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