ILIAS  release_7 Revision v7.30-3-g800a261c036
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 $DIC
Definition: goto.php:24

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

132 {
133 $ilCtrl = $this->ctrl;
136
137 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
138 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
139 $ilCtrl->redirect($this, "listSelfEvaluations");
140 } else {
141 $cgui = new ilConfirmationGUI();
142 $cgui->setFormAction($ilCtrl->getFormAction($this));
143 $cgui->setHeaderText($lng->txt("skmg_sure_delete_self_evaluation"));
144 $cgui->setCancel($lng->txt("cancel"), "listSelfEvaluations");
145 $cgui->setConfirm($lng->txt("delete"), "deleteSelfEvaluation");
146
147 foreach ($_POST["id"] as $i) {
148 $se = new ilSkillSelfEvaluation((int) $i);
149 $se_title =
150 ilSkillTreeNode::_lookupTitle($se->getTopSkillId());
151 $cgui->addItem("id[]", $i, $se_title . ", " . $lng->txt("created") . ": " .
152 $se->getCreated() . ", " . $lng->txt("last_update") . ": " . $se->getLastUpdate());
153 }
154
155 $tpl->setContent($cgui->getHTML());
156 }
157 }
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, $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 165 of file class.ilSkillSelfEvaluationGUI.php.

166 {
167 $ilCtrl = $this->ctrl;
169
170 if (is_array($_POST["id"])) {
171 foreach ($_POST["id"] as $i) {
172 $se = new ilSkillSelfEvaluation((int) $i);
173 if ($se->getUserId() == $ilUser->getId()) {
174 $se->delete();
175 }
176 }
177 }
178 ilUtil::sendSuccess("msg_obj_modified");
179 $ilCtrl->redirect($this, "listSelfEvaluations");
180 }
$ilUser
Definition: imgupload.php:18

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

◆ editSelfEvaluation()

ilSkillSelfEvaluationGUI::editSelfEvaluation ( )

Edit self evaluation.

Parameters

return

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

280 {
281 $this->startSelfEvaluation("edit");
282 }
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 {
74 $ilCtrl = $this->ctrl;
75
76 $cmd = $ilCtrl->getCmd("listSelfEvaluations");
77 $this->$cmd();
78 }

References $ctrl.

◆ getPresentationView()

ilSkillSelfEvaluationGUI::getPresentationView (   $a_user_id)

Get presentation view.

Parameters

return

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

347 {
349
350 $html = "";
351 foreach ($ses as $se) {
353 $html .= $this->form->getHTML() . "<br /><br />";
354 }
355
356 return $html;
357 }
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;
98 $ilCtrl = $this->ctrl;
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
111 foreach ($se_nodes as $n_id => $title) {
112 $options[$n_id] = $title;
113 }
114 $si = new ilSelectInputGUI($lng->txt("skmg_please_select_self_skill"), "sn_id");
115 $si->setOptions($options);
116
117 //$si->setInfo($lng->txt(""));
118 $ilToolbar->addInputItem($si, true);
119
120 $ilToolbar->addFormButton($lng->txt("skmg_execute_self_evaluation"), "startSelfEvaluation");
121
122 $table = new ilSelfEvaluationTableGUI($this, "listSelfEvaluations");
123
124 $tpl->setContent($table->getHTML());
125 }
This class represents a selection list property in a property form.
Self evaluation overview table.
static getAllSelfEvaluationNodes()
Get all self evaluation nodes.

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

247 {
250 $ilCtrl = $this->ctrl;
251
252 $se = new ilSkillSelfEvaluation();
253 $se->setUserId($ilUser->getId());
254 $se->setTopSkillId($_GET["sn_id"]);
255 if (is_array($_POST["se_sk"])) {
256 $se->setLevels($_POST["se_sk"]);
257 }
258 $se->create();
259
261 $cstep = (int) $_GET["step"];
262
263 if (count($steps)) {
264 $ilCtrl->setParameter($this, "step", 1);
265 $ilCtrl->setParameter($this, "se_id", $se->getId());
266 $ilCtrl->redirect($this, "editSelfEvaluation");
267 }
268
269 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
270 $ilCtrl->redirect($this, "");
271 }
static determineSteps($a_sn_id)
Determine steps.
$steps
Definition: latex.php:3

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

363 {
365
366 $this->form = new ilPropertyFormGUI();
367
369 $dates = ", " .
370 $lng->txt("created") . ": " .
372 new ilDateTime($se["created"], IL_CAL_DATETIME)
373 );
374 if ($se["created"] != $se["last_update"]) {
375 $dates .= ", " . $lng->txt("last_update") . ": " .
377 new ilDateTime($se["last_update"], IL_CAL_DATETIME)
378 );
379 }
381
382 $se = new ilSkillSelfEvaluation($se["id"]);
383 $levels = $se->getLevels();
384
385 $this->form->setTitle($lng->txt("skmg_self_evaluation") . $dates);
386
387 $stree = new ilSkillTree();
388
389 if ($stree->isInTree($se->getTopSkillId())) {
390 $cnode = $stree->getNodeData($se->getTopSkillId());
391 $childs = $stree->getSubTree($cnode);
392 foreach ($childs as $child) {
393 if ($child["type"] == "skll") {
394 // build title
395 $path = $stree->getPathFull($child["child"]);
396 $title = $sep = "";
397 foreach ($path as $p) {
398 if ($p["type"] != "skrt") {
399 $title .= $sep . $p["title"];
400 $sep = " > ";
401 }
402 }
403
404 $sk = new ilBasicSkill($child["child"]);
405 $ls = $sk->getLevelData();
406
407 $ne = new ilNonEditableValueGUI($title, "");
408 foreach ($ls as $ld) {
409 if ($ld["id"] == $levels[$child["child"]]) {
410 $ne->setValue($ld["title"]);
411 }
412 }
413 $this->form->addItem($ne);
414 }
415 }
416 }
417 }
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 $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 189 of file class.ilSkillSelfEvaluationGUI.php.

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

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

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

304 {
307 $ilCtrl = $this->ctrl;
308
309 $se = new ilSkillSelfEvaluation((int) $_GET["se_id"]);
310
311 if ($se->getUserId() == $ilUser->getId()) {
313 $cstep = (int) $_GET["step"];
314
315 if (is_array($_POST["se_sk"])) {
316 $se->setLevels($_POST["se_sk"], true);
317 }
318 $se->update();
319
320 if ($a_back) {
321 $ilCtrl->setParameter($this, "step", (int) $_GET["step"] - 1);
322 $ilCtrl->setParameter($this, "se_id", $se->getId());
323 $ilCtrl->redirect($this, "editSelfEvaluation");
324 } elseif (count($steps) - 1 > $cstep) {
325 $ilCtrl->setParameter($this, "step", (int) $_GET["step"] + 1);
326 $ilCtrl->setParameter($this, "se_id", $se->getId());
327 $ilCtrl->redirect($this, "editSelfEvaluation");
328 }
329
330 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
331 }
332
333 $ilCtrl->redirect($this, "");
334 }

References $_GET, $_POST, $ctrl, $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: