ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
ilSkillProfileGUI Class Reference

Skill profile GUI class. More...

+ Collaboration diagram for ilSkillProfileGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 setTabs ($a_active)
 Set tabs. More...
 
 listProfiles ()
 List profiles. More...
 
 create ()
 Create. More...
 
 edit ()
 Edit. More...
 
 initProfileForm ($a_mode="edit")
 Init profile form. More...
 
 save ()
 Save profile form. More...
 
 update ()
 Update. More...
 
 confirmDeleteProfiles ()
 Confirm profile deletion. More...
 
 deleteProfiles ()
 Delete profiles. More...
 
 showLevels ()
 Show skill levels. More...
 
 assignLevel ()
 Assign Level. More...
 
 assignLevelSelectSkill ()
 Output level table for profile assignment. More...
 
 assignLevelToProfile ()
 Assign level to profile. More...
 
 confirmLevelAssignmentRemoval ()
 Confirm level assignment removal. More...
 
 removeLevelAssignments ()
 Remove level assignment. More...
 
 showUsers ()
 Show users. More...
 
 assignUser ()
 Assign user. More...
 
 confirmUserRemoval ()
 Confirm user removal. More...
 
 removeUsers ()
 Remove users. More...
 

Protected Attributes

 $profile = null
 

Detailed Description

Skill profile GUI class.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$ @ilCtrl_Calls ilSkillProfileGUI: ilRepositorySearchGUI /

Definition at line 15 of file class.ilSkillProfileGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSkillProfileGUI::__construct ( )

Constructor.

Definition at line 22 of file class.ilSkillProfileGUI.php.

23 {
24 global $ilCtrl;
25
26 $ilCtrl->saveParameter($this, "sprof_id");
27
28 if ((int) $_GET["sprof_id"] > 0)
29 {
30 $this->id = (int) $_GET["sprof_id"];
31 }
32
33 if ($this->id > 0)
34 {
35 $this->profile = new ilSkillProfile($this->id);
36 }
37 }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

References $_GET, and $ilCtrl.

Member Function Documentation

◆ assignLevel()

ilSkillProfileGUI::assignLevel ( )

Assign Level.

Definition at line 329 of file class.ilSkillProfileGUI.php.

330 {
331 global $lng, $ilTabs, $ilCtrl, $tpl;
332
333 $tpl->setTitle($lng->txt("skmg_profile").": ".
334 $this->profile->getTitle());
335 $tpl->setDescription("");
336
337 //$this->setTabs("levels");
338
339 ilUtil::sendInfo($lng->txt("skmg_select_skill_level_assign"));
340
341 $ilTabs->clearTargets();
342 $ilTabs->setBackTarget($lng->txt("back"),
343 $ilCtrl->getLinkTarget($this, "showLevels"));
344
345 include_once("./Services/Skill/classes/class.ilSkillSelectorGUI.php");
346 $exp = new ilSkillSelectorGUI($this, "assignLevel", $this, "assignLevelSelectSkill", "cskill_id");
347 if (!$exp->handleCommand())
348 {
349 $tpl->setContent($exp->getHTML());
350 }
351 }
global $tpl
Definition: ilias.php:8
Explorer class that works on tree objects (Services/Tree)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $lng
Definition: privfeed.php:40

References $ilCtrl, $lng, $tpl, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ assignLevelSelectSkill()

ilSkillProfileGUI::assignLevelSelectSkill ( )

Output level table for profile assignment.

Definition at line 356 of file class.ilSkillProfileGUI.php.

357 {
358 global $tpl, $lng, $ilCtrl, $ilTabs;
359
360 $ilCtrl->saveParameter($this, "cskill_id");
361
362 $tpl->setTitle($lng->txt("skmg_profile").": ".
363 $this->profile->getTitle());
364 $tpl->setDescription("");
365
366 $ilTabs->clearTargets();
367 $ilTabs->setBackTarget($lng->txt("back"),
368 $ilCtrl->getLinkTarget($this, "showLevels"));
369
370 include_once("./Services/Skill/classes/class.ilSkillLevelProfileAssignmentTableGUI.php");
371 $tab = new ilSkillLevelProfileAssignmentTableGUI($this, "assignLevelSelectSkill",
372 $_GET["cskill_id"]);
373 $tpl->setContent($tab->getHTML());
374 }
TableGUI class for skill profile skill level assignment.

References $_GET, $ilCtrl, $lng, $tab, and $tpl.

◆ assignLevelToProfile()

ilSkillProfileGUI::assignLevelToProfile ( )

Assign level to profile.

Definition at line 379 of file class.ilSkillProfileGUI.php.

380 {
381 global $ilCtrl, $lng;
382
383 $parts = explode(":", $_GET["cskill_id"]);
384
385 $this->profile->addSkillLevel((int) $parts[0],
386 (int) $parts[1], (int) $_GET["level_id"]);
387 $this->profile->update();
388
389 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
390 $ilCtrl->redirect($this, "showLevels");
391 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

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

+ Here is the call graph for this function:

◆ assignUser()

ilSkillProfileGUI::assignUser ( )

Assign user.

Parameters

return

Definition at line 484 of file class.ilSkillProfileGUI.php.

485 {
486 global $ilCtrl, $lng;
487
488 $user_id = ilObjUser::_lookupId(ilUtil::stripSlashes($_POST["user_login"]));
489 if ($user_id > 0)
490 {
491 $this->profile->addUserToProfile($user_id);
492 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
493 }
494
495 $ilCtrl->redirect($this, "showUsers");
496 }
static _lookupId($a_user_str)
lookup id by login
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST['username']
Definition: cron.php:12

References $_POST, $ilCtrl, $lng, ilObjUser\_lookupId(), ilUtil\sendSuccess(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ confirmDeleteProfiles()

ilSkillProfileGUI::confirmDeleteProfiles ( )

Confirm profile deletion.

Definition at line 254 of file class.ilSkillProfileGUI.php.

255 {
256 global $ilCtrl, $tpl, $lng;
257
258 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
259 {
260 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
261 $ilCtrl->redirect($this, "listProfiles");
262 }
263 else
264 {
265 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
266 $cgui = new ilConfirmationGUI();
267 $cgui->setFormAction($ilCtrl->getFormAction($this));
268 $cgui->setHeaderText($lng->txt("skmg_delete_profiles"));
269 $cgui->setCancel($lng->txt("cancel"), "listProfiles");
270 $cgui->setConfirm($lng->txt("delete"), "deleteProfiles");
271
272 foreach ($_POST["id"] as $i)
273 {
274 $cgui->addItem("id[]", $i, ilSkillProfile::lookupTitle($i));
275 }
276
277 $tpl->setContent($cgui->getHTML());
278 }
279 }
Confirmation screen class.
static lookupTitle($a_id)
Lookup title.

References $_POST, $ilCtrl, $lng, $tpl, ilSkillProfile\lookupTitle(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ confirmLevelAssignmentRemoval()

ilSkillProfileGUI::confirmLevelAssignmentRemoval ( )

Confirm level assignment removal.

Definition at line 396 of file class.ilSkillProfileGUI.php.

397 {
398 global $ilCtrl, $tpl, $lng;
399
400 $this->setTabs("levels");
401
402 if (!is_array($_POST["ass_id"]) || count($_POST["ass_id"]) == 0)
403 {
404 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
405 $ilCtrl->redirect($this, "showLevels");
406 }
407 else
408 {
409 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
410 $cgui = new ilConfirmationGUI();
411 $cgui->setFormAction($ilCtrl->getFormAction($this));
412 $cgui->setHeaderText($lng->txt("skmg_confirm_remove_level_ass"));
413 $cgui->setCancel($lng->txt("cancel"), "showLevels");
414 $cgui->setConfirm($lng->txt("remove"), "removeLevelAssignments");
415
416 include_once("./Services/Skill/classes/class.ilBasicSkill.php");
417 foreach ($_POST["ass_id"] as $i)
418 {
419 $id_arr = explode(":", $i);
420 $cgui->addItem("ass_id[]", $i,
421 ilBasicSkill::_lookupTitle($id_arr[0]).": ".
423 }
424
425 $tpl->setContent($cgui->getHTML());
426 }
427 }
static lookupLevelTitle($a_id)
Lookup level title.
setTabs($a_active)
Set tabs.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.

References $_POST, $ilCtrl, $lng, $tpl, ilSkillTreeNode\_lookupTitle(), ilBasicSkill\lookupLevelTitle(), ilUtil\sendInfo(), and setTabs().

+ Here is the call graph for this function:

◆ confirmUserRemoval()

ilSkillProfileGUI::confirmUserRemoval ( )

Confirm user removal.

Definition at line 501 of file class.ilSkillProfileGUI.php.

502 {
503 global $ilCtrl, $tpl, $lng;
504
505 $this->setTabs("users");
506
507 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
508 {
509 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
510 $ilCtrl->redirect($this, "showUsers");
511 }
512 else
513 {
514 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
515 $cgui = new ilConfirmationGUI();
516 $cgui->setFormAction($ilCtrl->getFormAction($this));
517 $cgui->setHeaderText($lng->txt("skmg_confirm_user_removal"));
518 $cgui->setCancel($lng->txt("cancel"), "showUsers");
519 $cgui->setConfirm($lng->txt("remove"), "removeUsers");
520
521 foreach ($_POST["id"] as $i)
522 {
523 $name = ilObjUser::_lookupName($i);
524 $cgui->addItem("id[]", $i,
525 $name["lastname"].", ".$name["firstname"].
526 " [".$name["login"]."]");
527 }
528
529 $tpl->setContent($cgui->getHTML());
530 }
531 }
static _lookupName($a_user_id)
lookup user name

References $_POST, $ilCtrl, $lng, $tpl, ilObjUser\_lookupName(), ilUtil\sendInfo(), and setTabs().

+ Here is the call graph for this function:

◆ create()

ilSkillProfileGUI::create ( )

Create.

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

135 {
136 global $tpl;
137
138 $form = $this->initProfileForm("create");
139 $tpl->setContent($form->getHTML());
140 }
initProfileForm($a_mode="edit")
Init profile form.

References $tpl, and initProfileForm().

+ Here is the call graph for this function:

◆ deleteProfiles()

ilSkillProfileGUI::deleteProfiles ( )

Delete profiles.

Definition at line 284 of file class.ilSkillProfileGUI.php.

285 {
286 global $ilCtrl, $tpl, $lng;
287
288 if (is_array($_POST["id"]))
289 {
290 foreach ($_POST["id"] as $i)
291 {
292 $prof = new ilSkillProfile($i);
293 $prof->delete();
294 }
295 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
296 }
297
298 $ilCtrl->redirect($this, "listProfiles");
299 }

References $_POST, $ilCtrl, $lng, $tpl, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ edit()

ilSkillProfileGUI::edit ( )

Edit.

Definition at line 145 of file class.ilSkillProfileGUI.php.

146 {
147 global $tpl;
148
149 $this->setTabs("settings");
150 $form = $this->initProfileForm("edit");
151 $tpl->setContent($form->getHTML());
152 }

References $tpl, initProfileForm(), and setTabs().

+ Here is the call graph for this function:

◆ executeCommand()

ilSkillProfileGUI::executeCommand ( )

Execute command.

Definition at line 42 of file class.ilSkillProfileGUI.php.

43 {
44 global $ilCtrl, $lng;
45
46 $cmd = $ilCtrl->getCmd("listProfiles");
47 $next_class = $ilCtrl->getNextClass();
48 switch($next_class)
49 {
50 case 'ilrepositorysearchgui':
51 include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
52 $user_search = new ilRepositorySearchGUI();
53 $user_search->setTitle($lng->txt('skmg_add_user_to_profile'));
54 $user_search->setCallback($this, 'assignUser');
55
56 // Set tabs
57 //$this->tabs_gui->setTabActive('user_assignment');
58 $ilCtrl->setReturn($this, 'listUsers');
59 $ret = $ilCtrl->forwardCommand($user_search);
60 break;
61
62 default:
63 if (in_array($cmd, array("listProfiles", "create", "edit", "save", "update",
64 "confirmDeleteProfiles", "deleteProfiles", "showLevels", "assignLevel",
65 "assignLevelSelectSkill", "assignLevelToProfile",
66 "confirmLevelAssignmentRemoval", "removeLevelAssignments",
67 "showUsers", "assignUser",
68 "confirmUserRemoval", "removeUsers")))
69 {
70 $this->$cmd();
71 }
72 break;
73 }
74 }
$cmd
Definition: sahs_server.php:35

References $cmd, $ilCtrl, $lng, and $ret.

◆ initProfileForm()

ilSkillProfileGUI::initProfileForm (   $a_mode = "edit")

Init profile form.

Parameters
string$a_modeedit mode

Definition at line 160 of file class.ilSkillProfileGUI.php.

161 {
162 global $lng, $ilCtrl;
163
164 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
165 $form = new ilPropertyFormGUI();
166
167 // title
168 $ti = new ilTextInputGUI($lng->txt("title"), "title");
169 $ti->setMaxLength(200);
170 $ti->setSize(40);
171 $ti->setRequired(true);
172 $form->addItem($ti);
173
174 // description
175 $desc = new ilTextAreaInputGUI($lng->txt("description"), "description");
176 $desc->setCols(40);
177 $desc->setRows(4);
178 $form->addItem($desc);
179
180 // save and cancel commands
181 if ($a_mode == "create")
182 {
183 $form->addCommandButton("save", $lng->txt("save"));
184 $form->addCommandButton("listProfiles", $lng->txt("cancel"));
185 $form->setTitle($lng->txt("skmg_add_profile"));
186 }
187 else
188 {
189 // set values
190 $ti->setValue($this->profile->getTitle());
191 $desc->setValue($this->profile->getDescription());
192
193 $form->addCommandButton("update", $lng->txt("save"));
194 $form->addCommandButton("listProfiles", $lng->txt("cancel"));
195 $form->setTitle($lng->txt("skmg_edit_profile"));
196 }
197
198 $form->setFormAction($ilCtrl->getFormAction($this));
199
200 return $form;
201 }
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.

References $ilCtrl, and $lng.

Referenced by create(), edit(), save(), and update().

+ Here is the caller graph for this function:

◆ listProfiles()

ilSkillProfileGUI::listProfiles ( )

List profiles.

Definition at line 118 of file class.ilSkillProfileGUI.php.

119 {
120 global $tpl, $ilToolbar, $lng, $ilCtrl;
121
122 $ilToolbar->addButton($lng->txt("skmg_add_profile"),
123 $ilCtrl->getLinkTarget($this, "create"));
124
125 include_once("./Services/Skill/classes/class.ilSkillProfileTableGUI.php");
126 $tab = new ilSkillProfileTableGUI($this, "listProfiles");
127
128 $tpl->setContent($tab->getHTML());
129 }
TableGUI class for skill profiles.

References $ilCtrl, $lng, $tab, and $tpl.

◆ removeLevelAssignments()

ilSkillProfileGUI::removeLevelAssignments ( )

Remove level assignment.

Parameters

return

Definition at line 435 of file class.ilSkillProfileGUI.php.

436 {
437 global $ilCtrl;
438
439 if (is_array($_POST["ass_id"]))
440 {
441 foreach ($_POST["ass_id"] as $i)
442 {
443 $id_arr = explode(":", $i);
444 $this->profile->removeSkillLevel($id_arr[0], $id_arr[1], $id_arr[2]);
445 }
446 $this->profile->update();
447 }
448
449 $ilCtrl->redirect($this, "showLevels");
450 }

References $_POST, and $ilCtrl.

◆ removeUsers()

ilSkillProfileGUI::removeUsers ( )

Remove users.

Definition at line 536 of file class.ilSkillProfileGUI.php.

537 {
538 global $ilCtrl, $lng;
539
540 if (is_array($_POST["id"]))
541 {
542 foreach ($_POST["id"] as $i)
543 {
544 $this->profile->removeUserFromProfile((int) $i);
545 }
546 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
547 }
548 $ilCtrl->redirect($this, "showUsers");
549 }

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

+ Here is the call graph for this function:

◆ save()

ilSkillProfileGUI::save ( )

Save profile form.

Definition at line 206 of file class.ilSkillProfileGUI.php.

207 {
208 global $tpl, $lng, $ilCtrl;
209
210 $form = $this->initProfileForm("create");
211 if ($form->checkInput())
212 {
213 $prof = new ilSkillProfile();
214 $prof->setTitle($form->getInput("title"));
215 $prof->setDescription($form->getInput("description"));
216 $prof->create();
217 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
218 $ilCtrl->redirect($this, "listProfiles");
219 }
220 else
221 {
222 $form->setValuesByPost();
223 $tpl->setContent($form->getHtml());
224 }
225 }

References $ilCtrl, $lng, $tpl, initProfileForm(), and ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ setTabs()

ilSkillProfileGUI::setTabs (   $a_active)

Set tabs.

Parameters

return

Definition at line 82 of file class.ilSkillProfileGUI.php.

83 {
84 global $ilTabs, $lng, $ilCtrl, $tpl, $ilHelp;
85
86 $tpl->setTitle($lng->txt("skmg_profile").": ".
87 $this->profile->getTitle());
88 $tpl->setDescription("");
89
90 $ilTabs->clearTargets();
91 $ilHelp->setScreenIdComponent("skmg_prof");
92
93 $ilTabs->setBackTarget($lng->txt("back"),
94 $ilCtrl->getLinkTarget($this, ""));
95
96 // users
97 $ilTabs->addTab("users",
98 $lng->txt("skmg_assigned_users"),
99 $ilCtrl->getLinkTarget($this, "showUsers"));
100
101 // levels
102 $ilTabs->addTab("levels",
103 $lng->txt("skmg_assigned_skill_levels"),
104 $ilCtrl->getLinkTarget($this, "showLevels"));
105
106 // settings
107 $ilTabs->addTab("settings",
108 $lng->txt("settings"),
109 $ilCtrl->getLinkTarget($this, "edit"));
110
111 $ilTabs->activateTab($a_active);
112 }

References $ilCtrl, $lng, and $tpl.

Referenced by confirmLevelAssignmentRemoval(), confirmUserRemoval(), edit(), showLevels(), and showUsers().

+ Here is the caller graph for this function:

◆ showLevels()

ilSkillProfileGUI::showLevels ( )

Show skill levels.

Parameters

return

Definition at line 311 of file class.ilSkillProfileGUI.php.

312 {
313 global $tpl, $ilCtrl, $lng, $ilToolbar;
314
315 $this->setTabs("levels");
316
317 $ilToolbar->addButton($lng->txt("skmg_assign_level"),
318 $ilCtrl->getLinkTarget($this, "assignLevel")
319 );
320
321 include_once("./Services/Skill/classes/class.ilSkillProfileLevelsTableGUI.php");
322 $tab = new ilSkillProfileLevelsTableGUI($this, "showLevels", $this->profile);
323 $tpl->setContent($tab->getHTML());
324 }
TableGUI class for skill profile levels.

References $ilCtrl, $lng, $tab, $tpl, and setTabs().

+ Here is the call graph for this function:

◆ showUsers()

ilSkillProfileGUI::showUsers ( )

Show users.

Definition at line 455 of file class.ilSkillProfileGUI.php.

456 {
457 global $lng, $tpl, $ilToolbar;
458
459 // add member
460 include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
462 $this,
463 $ilToolbar,
464 array(
465 'auto_complete_name' => $lng->txt('user'),
466 'submit_name' => $lng->txt('skmg_assign_user')
467 )
468 );
469
470 $this->setTabs("users");
471
472 include_once("./Services/Skill/classes/class.ilSkillProfileUserTableGUI.php");
473 $tab = new ilSkillProfileUserTableGUI($this, "showUsers",
474 $this->profile);
475 $tpl->setContent($tab->getHTML());
476 }
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array())
fill toolbar with
TableGUI class for skill profile user assignment.

References $lng, $tab, $tpl, ilRepositorySearchGUI\fillAutoCompleteToolbar(), and setTabs().

+ Here is the call graph for this function:

◆ update()

ilSkillProfileGUI::update ( )

Update.

Definition at line 230 of file class.ilSkillProfileGUI.php.

231 {
232 global $lng, $ilCtrl, $tpl;
233
234 $form = $this->initProfileForm("edit");
235 if ($form->checkInput())
236 {
237 $this->profile->setTitle($form->getInput("title"));
238 $this->profile->setDescription($form->getInput("description"));
239 $this->profile->update();
240
241 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
242 $ilCtrl->redirect($this, "listProfiles");
243 }
244 else
245 {
246 $form->setValuesByPost();
247 $tpl->setContent($form->getHtml());
248 }
249 }

References $ilCtrl, $lng, $tpl, initProfileForm(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

Field Documentation

◆ $profile

ilSkillProfileGUI::$profile = null
protected

Definition at line 17 of file class.ilSkillProfileGUI.php.


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