ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSkillProfileGUI Class Reference

Skill profile GUI class. More...

+ Collaboration diagram for ilSkillProfileGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 checkPermissionBool ($a_perm)
 Check permission pool. 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...
 
 exportProfiles ()
 Export profiles. More...
 
 showImportForm ()
 Show import form. More...
 
 initInputForm ()
 Init input form. More...
 
 importProfiles ()
 Import profiles. More...
 

Data Fields

 $access
 
 $ref_id
 

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$ ilSkillProfileGUI: ilRepositorySearchGUI /

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

Constructor & Destructor Documentation

◆ __construct()

ilSkillProfileGUI::__construct ( )

Constructor.

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

References $_GET, and $ilCtrl.

31  {
32  global $ilCtrl, $ilAccess;
33 
34  $ilCtrl->saveParameter($this, "sprof_id");
35  $this->access = $ilAccess;
36  $this->ref_id = (int) $_GET["ref_id"];
37 
38  if ((int) $_GET["sprof_id"] > 0)
39  {
40  $this->id = (int) $_GET["sprof_id"];
41  }
42 
43  if ($this->id > 0)
44  {
45  $this->profile = new ilSkillProfile($this->id);
46  }
47  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

Member Function Documentation

◆ assignLevel()

ilSkillProfileGUI::assignLevel ( )

Assign Level.

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

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

377  {
378  global $lng, $ilTabs, $ilCtrl, $tpl;
379 
380  $tpl->setTitle($lng->txt("skmg_profile").": ".
381  $this->profile->getTitle());
382  $tpl->setDescription("");
383 
384  //$this->setTabs("levels");
385 
386  ilUtil::sendInfo($lng->txt("skmg_select_skill_level_assign"));
387 
388  $ilTabs->clearTargets();
389  $ilTabs->setBackTarget($lng->txt("back"),
390  $ilCtrl->getLinkTarget($this, "showLevels"));
391 
392  include_once("./Services/Skill/classes/class.ilSkillSelectorGUI.php");
393  $exp = new ilSkillSelectorGUI($this, "assignLevel", $this, "assignLevelSelectSkill", "cskill_id");
394  if (!$exp->handleCommand())
395  {
396  $tpl->setContent($exp->getHTML());
397  }
398  }
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Explorer class that works on tree objects (Services/Tree)
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ assignLevelSelectSkill()

ilSkillProfileGUI::assignLevelSelectSkill ( )

Output level table for profile assignment.

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

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

404  {
405  global $tpl, $lng, $ilCtrl, $ilTabs;
406 
407  $ilCtrl->saveParameter($this, "cskill_id");
408 
409  $tpl->setTitle($lng->txt("skmg_profile").": ".
410  $this->profile->getTitle());
411  $tpl->setDescription("");
412 
413  $ilTabs->clearTargets();
414  $ilTabs->setBackTarget($lng->txt("back"),
415  $ilCtrl->getLinkTarget($this, "showLevels"));
416 
417  include_once("./Services/Skill/classes/class.ilSkillLevelProfileAssignmentTableGUI.php");
418  $tab = new ilSkillLevelProfileAssignmentTableGUI($this, "assignLevelSelectSkill",
419  $_GET["cskill_id"]);
420  $tpl->setContent($tab->getHTML());
421  }
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
TableGUI class for skill profile skill level assignment.
global $lng
Definition: privfeed.php:17

◆ assignLevelToProfile()

ilSkillProfileGUI::assignLevelToProfile ( )

Assign level to profile.

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

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

427  {
428  global $ilCtrl, $lng;
429 
430  if (!$this->checkPermissionBool("write"))
431  {
432  return;
433  }
434 
435 
436  $parts = explode(":", $_GET["cskill_id"]);
437 
438  $this->profile->addSkillLevel((int) $parts[0],
439  (int) $parts[1], (int) $_GET["level_id"]);
440  $this->profile->update();
441 
442  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
443  $ilCtrl->redirect($this, "showLevels");
444  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermissionBool($a_perm)
Check permission pool.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ assignUser()

ilSkillProfileGUI::assignUser ( )

Assign user.

Parameters

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

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

543  {
544  global $ilCtrl, $lng;
545 
546  if (!$this->checkPermissionBool("write"))
547  {
548  return;
549  }
550 
551  $user_id = ilObjUser::_lookupId(ilUtil::stripSlashes($_POST["user_login"]));
552  if ($user_id > 0)
553  {
554  $this->profile->addUserToProfile($user_id);
555  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
556  }
557 
558  $ilCtrl->redirect($this, "showUsers");
559  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermissionBool($a_perm)
Check permission pool.
static _lookupId($a_user_str)
Lookup id by login.
global $ilCtrl
Definition: ilias.php:18
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
global $lng
Definition: privfeed.php:17
$_POST["username"]
+ Here is the call graph for this function:

◆ checkPermissionBool()

ilSkillProfileGUI::checkPermissionBool (   $a_perm)

Check permission pool.

Parameters
string$a_perm
Returns
bool

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

Referenced by assignLevelToProfile(), assignUser(), confirmUserRemoval(), deleteProfiles(), initProfileForm(), listProfiles(), removeLevelAssignments(), removeUsers(), save(), showLevels(), and update().

56  {
57  return $this->access->checkAccess($a_perm, "", $this->ref_id);
58  }
+ Here is the caller graph for this function:

◆ confirmDeleteProfiles()

ilSkillProfileGUI::confirmDeleteProfiles ( )

Confirm profile deletion.

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

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

294  {
295  global $ilCtrl, $tpl, $lng;
296 
297  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
298  {
299  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
300  $ilCtrl->redirect($this, "listProfiles");
301  }
302  else
303  {
304  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
305  $cgui = new ilConfirmationGUI();
306  $cgui->setFormAction($ilCtrl->getFormAction($this));
307  $cgui->setHeaderText($lng->txt("skmg_delete_profiles"));
308  $cgui->setCancel($lng->txt("cancel"), "listProfiles");
309  $cgui->setConfirm($lng->txt("delete"), "deleteProfiles");
310 
311  foreach ($_POST["id"] as $i)
312  {
313  $cgui->addItem("id[]", $i, ilSkillProfile::lookupTitle($i));
314  }
315 
316  $tpl->setContent($cgui->getHTML());
317  }
318  }
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $lng
Definition: privfeed.php:17
static lookupTitle($a_id)
Lookup title.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmLevelAssignmentRemoval()

ilSkillProfileGUI::confirmLevelAssignmentRemoval ( )

Confirm level assignment removal.

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

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

450  {
451  global $ilCtrl, $tpl, $lng;
452 
453  $this->setTabs("levels");
454 
455  if (!is_array($_POST["ass_id"]) || count($_POST["ass_id"]) == 0)
456  {
457  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
458  $ilCtrl->redirect($this, "showLevels");
459  }
460  else
461  {
462  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
463  $cgui = new ilConfirmationGUI();
464  $cgui->setFormAction($ilCtrl->getFormAction($this));
465  $cgui->setHeaderText($lng->txt("skmg_confirm_remove_level_ass"));
466  $cgui->setCancel($lng->txt("cancel"), "showLevels");
467  $cgui->setConfirm($lng->txt("remove"), "removeLevelAssignments");
468 
469  include_once("./Services/Skill/classes/class.ilBasicSkill.php");
470  foreach ($_POST["ass_id"] as $i)
471  {
472  $id_arr = explode(":", $i);
473  $cgui->addItem("ass_id[]", $i,
474  ilBasicSkill::_lookupTitle($id_arr[0]).": ".
475  ilBasicSkill::lookupLevelTitle($id_arr[2]));
476  }
477 
478  $tpl->setContent($cgui->getHTML());
479  }
480  }
setTabs($a_active)
Set tabs.
static lookupLevelTitle($a_id)
Lookup level title.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
global $lng
Definition: privfeed.php:17
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmUserRemoval()

ilSkillProfileGUI::confirmUserRemoval ( )

Confirm user removal.

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

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

565  {
566  global $ilCtrl, $tpl, $lng;
567 
568  if (!$this->checkPermissionBool("write"))
569  {
570  return;
571  }
572 
573  $this->setTabs("users");
574 
575  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
576  {
577  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
578  $ilCtrl->redirect($this, "showUsers");
579  }
580  else
581  {
582  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
583  $cgui = new ilConfirmationGUI();
584  $cgui->setFormAction($ilCtrl->getFormAction($this));
585  $cgui->setHeaderText($lng->txt("skmg_confirm_user_removal"));
586  $cgui->setCancel($lng->txt("cancel"), "showUsers");
587  $cgui->setConfirm($lng->txt("remove"), "removeUsers");
588 
589  foreach ($_POST["id"] as $i)
590  {
591  $name = ilObjUser::_lookupName($i);
592  $cgui->addItem("id[]", $i,
593  $name["lastname"].", ".$name["firstname"].
594  " [".$name["login"]."]");
595  }
596 
597  $tpl->setContent($cgui->getHTML());
598  }
599  }
static _lookupName($a_user_id)
lookup user name
setTabs($a_active)
Set tabs.
checkPermissionBool($a_perm)
Check permission pool.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $lng
Definition: privfeed.php:17
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ create()

ilSkillProfileGUI::create ( )

Create.

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

References $tpl, and initProfileForm().

162  {
163  global $tpl;
164 
165  $form = $this->initProfileForm("create");
166  $tpl->setContent($form->getHTML());
167  }
initProfileForm($a_mode="edit")
Init profile form.
global $tpl
Definition: ilias.php:8
+ Here is the call graph for this function:

◆ deleteProfiles()

ilSkillProfileGUI::deleteProfiles ( )

Delete profiles.

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

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

324  {
325  global $ilCtrl, $tpl, $lng;
326 
327  if (!$this->checkPermissionBool("write"))
328  {
329  return;
330  }
331 
332  if (is_array($_POST["id"]))
333  {
334  foreach ($_POST["id"] as $i)
335  {
336  $prof = new ilSkillProfile($i);
337  $prof->delete();
338  }
339  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
340  }
341 
342  $ilCtrl->redirect($this, "listProfiles");
343  }
checkPermissionBool($a_perm)
Check permission pool.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $lng
Definition: privfeed.php:17
$_POST["username"]
+ Here is the call graph for this function:

◆ edit()

ilSkillProfileGUI::edit ( )

Edit.

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

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

173  {
174  global $tpl;
175 
176  $this->setTabs("settings");
177  $form = $this->initProfileForm("edit");
178  $tpl->setContent($form->getHTML());
179  }
setTabs($a_active)
Set tabs.
initProfileForm($a_mode="edit")
Init profile form.
global $tpl
Definition: ilias.php:8
+ Here is the call graph for this function:

◆ executeCommand()

ilSkillProfileGUI::executeCommand ( )

Execute command.

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

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

64  {
65  global $ilCtrl, $lng;
66 
67  $cmd = $ilCtrl->getCmd("listProfiles");
68  $next_class = $ilCtrl->getNextClass();
69  switch($next_class)
70  {
71  case 'ilrepositorysearchgui':
72  include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
73  $user_search = new ilRepositorySearchGUI();
74  $user_search->setTitle($lng->txt('skmg_add_user_to_profile'));
75  $user_search->setCallback($this, 'assignUser');
76 
77  // Set tabs
78  //$this->tabs_gui->setTabActive('user_assignment');
79  $ilCtrl->setReturn($this, 'listUsers');
80  $ret = $ilCtrl->forwardCommand($user_search);
81  break;
82 
83  default:
84  if (in_array($cmd, array("listProfiles", "create", "edit", "save", "update",
85  "confirmDeleteProfiles", "deleteProfiles", "showLevels", "assignLevel",
86  "assignLevelSelectSkill", "assignLevelToProfile",
87  "confirmLevelAssignmentRemoval", "removeLevelAssignments",
88  "showUsers", "assignUser",
89  "confirmUserRemoval", "removeUsers", "exportProfiles", "showImportForm", "importProfiles")))
90  {
91  $this->$cmd();
92  }
93  break;
94  }
95  }
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
$ret
Definition: parser.php:6

◆ exportProfiles()

ilSkillProfileGUI::exportProfiles ( )

Export profiles.

Parameters

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

References $_GET, $_POST, $ilCtrl, ilObject\_lookupObjId(), array, and ilSkillExportConfig\MODE_PROFILES.

631  {
632  global $ilCtrl;
633 
634  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0)
635  {
636  $ilCtrl->redirect($this, "");
637  }
638 
639  include_once("./Services/Export/classes/class.ilExport.php");
640  $exp = new ilExport();
641  $conf = $exp->getConfig("Services/Skill");
642  $conf->setMode(ilSkillExportConfig::MODE_PROFILES);
643  $conf->setSelectedProfiles($_POST["id"]);
644  $exp->exportObject("skmg", ilObject::_lookupObjId((int) $_GET["ref_id"]));
645 
646  //ilExport::_createExportDirectory(0, "xml", "");
647  //$export_dir = ilExport::_getExportDirectory($a_id, "xml", $a_type);
648  //$exp->exportEntity("skprof", $_POST["id"], "", "Services/Skill", $a_title, $a_export_dir, "skprof");
649 
650  $ilCtrl->redirectByClass(array("iladministrationgui", "ilobjskillmanagementgui", "ilexportgui"), "");
651  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static _lookupObjId($a_id)
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:

◆ importProfiles()

ilSkillProfileGUI::importProfiles ( )

Import profiles.

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

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

693  {
694  global $tpl, $lng, $ilCtrl, $ilTabs;
695 
696  $form = $this->initInputForm();
697  if ($form->checkInput())
698  {
699  include_once("./Services/Export/classes/class.ilImport.php");
700  $imp = new ilImport();
701  $imp->importEntity($_FILES["import_file"]["tmp_name"], $_FILES["import_file"]["name"], "skmg", "Services/Skill");
702 
703  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
704  $ilCtrl->redirect($this, "");
705  }
706  else
707  {
708  $form->setValuesByPost();
709  $tpl->setContent($form->getHtml());
710  }
711  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Import class.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
initInputForm()
Init input form.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ initInputForm()

ilSkillProfileGUI::initInputForm ( )

Init input form.

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

References $ilCtrl, $lng, array, and ilFileInputGUI\setSuffixes().

Referenced by importProfiles(), and showImportForm().

667  {
668  global $lng, $ilCtrl;
669 
670  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
671  $form = new ilPropertyFormGUI();
672 
673  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
674  $fi = new ilFileInputGUI($lng->txt("skmg_input_file"), "import_file");
675  $fi->setSuffixes(array("zip"));
676  $fi->setRequired(true);
677  $form->addItem($fi);
678 
679  // save and cancel commands
680  $form->addCommandButton("importProfiles", $lng->txt("import"));
681  $form->addCommandButton("", $lng->txt("cancel"));
682 
683  $form->setTitle($lng->txt("import"));
684  $form->setFormAction($ilCtrl->getFormAction($this));
685 
686  return $form;
687  }
This class represents a property form user interface.
This class represents a file property in a property form.
global $ilCtrl
Definition: ilias.php:18
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initProfileForm()

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

Init profile form.

Parameters
string$a_modeedit mode

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

References $ilCtrl, $lng, checkPermissionBool(), ilTextAreaInputGUI\setCols(), and ilTextInputGUI\setMaxLength().

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

188  {
189  global $lng, $ilCtrl;
190 
191  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
192  $form = new ilPropertyFormGUI();
193 
194  // title
195  $ti = new ilTextInputGUI($lng->txt("title"), "title");
196  $ti->setMaxLength(200);
197  $ti->setSize(40);
198  $ti->setRequired(true);
199  $form->addItem($ti);
200 
201  // description
202  $desc = new ilTextAreaInputGUI($lng->txt("description"), "description");
203  $desc->setCols(40);
204  $desc->setRows(4);
205  $form->addItem($desc);
206 
207  // save and cancel commands
208  if ($this->checkPermissionBool("write"))
209  {
210  if ($a_mode == "create")
211  {
212  $form->addCommandButton("save", $lng->txt("save"));
213  $form->addCommandButton("listProfiles", $lng->txt("cancel"));
214  $form->setTitle($lng->txt("skmg_add_profile"));
215  } else
216  {
217  // set values
218  $ti->setValue($this->profile->getTitle());
219  $desc->setValue($this->profile->getDescription());
220 
221  $form->addCommandButton("update", $lng->txt("save"));
222  $form->addCommandButton("listProfiles", $lng->txt("cancel"));
223  $form->setTitle($lng->txt("skmg_edit_profile"));
224  }
225  }
226 
227  $form->setFormAction($ilCtrl->getFormAction($this));
228 
229  return $form;
230  }
checkPermissionBool($a_perm)
Check permission pool.
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
This class represents a text property in a property form.
setMaxLength($a_maxlength)
Set Max Length.
global $lng
Definition: privfeed.php:17
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listProfiles()

ilSkillProfileGUI::listProfiles ( )

List profiles.

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

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

140  {
141  global $tpl, $ilToolbar, $lng, $ilCtrl;
142 
143  if ($this->checkPermissionBool("write"))
144  {
145  $ilToolbar->addButton($lng->txt("skmg_add_profile"),
146  $ilCtrl->getLinkTarget($this, "create"));
147 
148  $ilToolbar->addButton($lng->txt("import"),
149  $ilCtrl->getLinkTarget($this, "showImportForm"));
150  }
151 
152  include_once("./Services/Skill/classes/class.ilSkillProfileTableGUI.php");
153  $tab = new ilSkillProfileTableGUI($this, "listProfiles");
154 
155  $tpl->setContent($tab->getHTML());
156  }
checkPermissionBool($a_perm)
Check permission pool.
TableGUI class for skill profiles.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ removeLevelAssignments()

ilSkillProfileGUI::removeLevelAssignments ( )

Remove level assignment.

Parameters

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

References $_POST, $ilCtrl, and checkPermissionBool().

489  {
490  global $ilCtrl;
491 
492  if (!$this->checkPermissionBool("write"))
493  {
494  return;
495  }
496 
497  if (is_array($_POST["ass_id"]))
498  {
499  foreach ($_POST["ass_id"] as $i)
500  {
501  $id_arr = explode(":", $i);
502  $this->profile->removeSkillLevel($id_arr[0], $id_arr[1], $id_arr[2]);
503  }
504  $this->profile->update();
505  }
506 
507  $ilCtrl->redirect($this, "showLevels");
508  }
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ removeUsers()

ilSkillProfileGUI::removeUsers ( )

Remove users.

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

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

605  {
606  global $ilCtrl, $lng;
607 
608  if (!$this->checkPermissionBool("write"))
609  {
610  return;
611  }
612 
613  if (is_array($_POST["id"]))
614  {
615  foreach ($_POST["id"] as $i)
616  {
617  $this->profile->removeUserFromProfile((int) $i);
618  }
619  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
620  }
621  $ilCtrl->redirect($this, "showUsers");
622  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermissionBool($a_perm)
Check permission pool.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
$_POST["username"]
+ Here is the call graph for this function:

◆ save()

ilSkillProfileGUI::save ( )

Save profile form.

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

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

236  {
237  global $tpl, $lng, $ilCtrl;
238 
239  if (!$this->checkPermissionBool("write"))
240  {
241  return;
242  }
243 
244  $form = $this->initProfileForm("create");
245  if ($form->checkInput())
246  {
247  $prof = new ilSkillProfile();
248  $prof->setTitle($form->getInput("title"));
249  $prof->setDescription($form->getInput("description"));
250  $prof->create();
251  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
252  $ilCtrl->redirect($this, "listProfiles");
253  }
254  else
255  {
256  $form->setValuesByPost();
257  $tpl->setContent($form->getHtml());
258  }
259  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
checkPermissionBool($a_perm)
Check permission pool.
initProfileForm($a_mode="edit")
Init profile form.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ setTabs()

ilSkillProfileGUI::setTabs (   $a_active)

Set tabs.

Parameters

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

References $ilCtrl, $lng, and $tpl.

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

104  {
105  global $ilTabs, $lng, $ilCtrl, $tpl, $ilHelp;
106 
107  $tpl->setTitle($lng->txt("skmg_profile").": ".
108  $this->profile->getTitle());
109  $tpl->setDescription("");
110 
111  $ilTabs->clearTargets();
112  $ilHelp->setScreenIdComponent("skmg_prof");
113 
114  $ilTabs->setBackTarget($lng->txt("back"),
115  $ilCtrl->getLinkTarget($this, ""));
116 
117  // users
118  $ilTabs->addTab("users",
119  $lng->txt("skmg_assigned_users"),
120  $ilCtrl->getLinkTarget($this, "showUsers"));
121 
122  // levels
123  $ilTabs->addTab("levels",
124  $lng->txt("skmg_assigned_skill_levels"),
125  $ilCtrl->getLinkTarget($this, "showLevels"));
126 
127  // settings
128  $ilTabs->addTab("settings",
129  $lng->txt("settings"),
130  $ilCtrl->getLinkTarget($this, "edit"));
131 
132  $ilTabs->activateTab($a_active);
133  }
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
+ Here is the caller graph for this function:

◆ showImportForm()

ilSkillProfileGUI::showImportForm ( )

Show import form.

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

References $tpl, and initInputForm().

657  {
658  global $tpl, $ilTabs;
659 
660  $tpl->setContent($this->initInputForm()->getHTML());
661  }
global $tpl
Definition: ilias.php:8
initInputForm()
Init input form.
+ Here is the call graph for this function:

◆ showLevels()

ilSkillProfileGUI::showLevels ( )

Show skill levels.

Parameters

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

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

356  {
357  global $tpl, $ilCtrl, $lng, $ilToolbar;
358 
359  $this->setTabs("levels");
360 
361  if ($this->checkPermissionBool("write"))
362  {
363  $ilToolbar->addButton($lng->txt("skmg_assign_level"),
364  $ilCtrl->getLinkTarget($this, "assignLevel")
365  );
366  }
367 
368  include_once("./Services/Skill/classes/class.ilSkillProfileLevelsTableGUI.php");
369  $tab = new ilSkillProfileLevelsTableGUI($this, "showLevels", $this->profile);
370  $tpl->setContent($tab->getHTML());
371  }
TableGUI class for skill profile levels.
checkPermissionBool($a_perm)
Check permission pool.
setTabs($a_active)
Set tabs.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ showUsers()

ilSkillProfileGUI::showUsers ( )

Show users.

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

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

514  {
515  global $lng, $tpl, $ilToolbar;
516 
517  // add member
518  include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
520  $this,
521  $ilToolbar,
522  array(
523  'auto_complete_name' => $lng->txt('user'),
524  'submit_name' => $lng->txt('skmg_assign_user')
525  )
526  );
527 
528  $this->setTabs("users");
529 
530  include_once("./Services/Skill/classes/class.ilSkillProfileUserTableGUI.php");
531  $tab = new ilSkillProfileUserTableGUI($this, "showUsers",
532  $this->profile);
533  $tpl->setContent($tab->getHTML());
534  }
setTabs($a_active)
Set tabs.
TableGUI class for skill profile user assignment.
global $tpl
Definition: ilias.php:8
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
+ Here is the call graph for this function:

◆ update()

ilSkillProfileGUI::update ( )

Update.

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

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

265  {
266  global $lng, $ilCtrl, $tpl;
267 
268  if (!$this->checkPermissionBool("write"))
269  {
270  return;
271  }
272 
273  $form = $this->initProfileForm("edit");
274  if ($form->checkInput())
275  {
276  $this->profile->setTitle($form->getInput("title"));
277  $this->profile->setDescription($form->getInput("description"));
278  $this->profile->update();
279 
280  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
281  $ilCtrl->redirect($this, "listProfiles");
282  }
283  else
284  {
285  $form->setValuesByPost();
286  $tpl->setContent($form->getHtml());
287  }
288  }
checkPermissionBool($a_perm)
Check permission pool.
initProfileForm($a_mode="edit")
Init profile form.
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilSkillProfileGUI::$access

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

◆ $profile

ilSkillProfileGUI::$profile = null
protected

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

◆ $ref_id

ilSkillProfileGUI::$ref_id

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


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