ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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...
 
 assignRole (array $role_ids)
 Assign role. 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

 $ctrl
 
 $lng
 
 $tabs
 
 $tpl
 
 $help
 
 $toolbar
 
 $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 60 of file class.ilSkillProfileGUI.php.

61 {
62 global $DIC;
63
64 $this->ctrl = $DIC->ctrl();
65 $this->lng = $DIC->language();
66 $this->tabs = $DIC->tabs();
67 $this->tpl = $DIC["tpl"];
68 $this->help = $DIC["ilHelp"];
69 $this->toolbar = $DIC->toolbar();
70 $ilCtrl = $DIC->ctrl();
71 $ilAccess = $DIC->access();
72
73 $ilCtrl->saveParameter($this, "sprof_id");
74 $this->access = $ilAccess;
75 $this->ref_id = (int) $_GET["ref_id"];
76
77 if ((int) $_GET["sprof_id"] > 0) {
78 $this->id = (int) $_GET["sprof_id"];
79 }
80
81 if ($this->id > 0) {
82 $this->profile = new ilSkillProfile($this->id);
83 }
84 }
$_GET["client_id"]
help()
Definition: help.php:2
global $ilCtrl
Definition: ilias.php:18
$DIC
Definition: xapitoken.php:46

References $_GET, $DIC, $ilCtrl, and help().

+ Here is the call graph for this function:

Member Function Documentation

◆ assignLevel()

ilSkillProfileGUI::assignLevel ( )

Assign Level.

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

431 {
433 $ilTabs = $this->tabs;
436
437 $tpl->setTitle($lng->txt("skmg_profile") . ": " .
438 $this->profile->getTitle());
439 $tpl->setDescription("");
440
441 //$this->setTabs("levels");
442
443 ilUtil::sendInfo($lng->txt("skmg_select_skill_level_assign"));
444
445 $ilTabs->clearTargets();
446 $ilTabs->setBackTarget(
447 $lng->txt("back"),
448 $ilCtrl->getLinkTarget($this, "showLevels")
449 );
450
451 include_once("./Services/Skill/classes/class.ilSkillSelectorGUI.php");
452 $exp = new ilSkillSelectorGUI($this, "assignLevel", $this, "assignLevelSelectSkill", "cskill_id");
453 if (!$exp->handleCommand()) {
454 $tpl->setContent($exp->getHTML());
455 }
456 }
Explorer class that works on tree objects (Services/Tree)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

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

+ Here is the call graph for this function:

◆ assignLevelSelectSkill()

ilSkillProfileGUI::assignLevelSelectSkill ( )

Output level table for profile assignment.

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

462 {
466 $ilTabs = $this->tabs;
467
468 $ilCtrl->saveParameter($this, "cskill_id");
469
470 $tpl->setTitle($lng->txt("skmg_profile") . ": " .
471 $this->profile->getTitle());
472 $tpl->setDescription("");
473
474 $ilTabs->clearTargets();
475 $ilTabs->setBackTarget(
476 $lng->txt("back"),
477 $ilCtrl->getLinkTarget($this, "showLevels")
478 );
479
480 include_once("./Services/Skill/classes/class.ilSkillLevelProfileAssignmentTableGUI.php");
482 $this,
483 "assignLevelSelectSkill",
484 $_GET["cskill_id"]
485 );
486 $tpl->setContent($tab->getHTML());
487 }
TableGUI class for skill profile skill level assignment.

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

◆ assignLevelToProfile()

ilSkillProfileGUI::assignLevelToProfile ( )

Assign level to profile.

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

493 {
496
497 if (!$this->checkPermissionBool("write")) {
498 return;
499 }
500
501
502 $parts = explode(":", $_GET["cskill_id"]);
503
504 $this->profile->addSkillLevel(
505 (int) $parts[0],
506 (int) $parts[1],
507 (int) $_GET["level_id"]
508 );
509 $this->profile->update();
510
511 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
512 $ilCtrl->redirect($this, "showLevels");
513 }
checkPermissionBool($a_perm)
Check permission pool.

References $_GET, $ctrl, $ilCtrl, $lng, and checkPermissionBool().

+ Here is the call graph for this function:

◆ assignRole()

ilSkillProfileGUI::assignRole ( array  $role_ids)

Assign role.

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

658 {
661
662 if (!$this->checkPermissionBool("write")) {
663 return;
664 }
665
666 $success = false;
667 foreach ($role_ids as $id) {
668 if ($id > 0) {
669 $this->profile->addRoleToProfile($id);
670 $success = true;
671 }
672 }
673 if ($success) {
674 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
675 }
676
677 $ilCtrl->redirect($this, "showUsers");
678 }
$success
Definition: Utf8Test.php:86

References $ctrl, $ilCtrl, $lng, $success, and checkPermissionBool().

+ Here is the call graph for this function:

◆ assignUser()

ilSkillProfileGUI::assignUser ( )

Assign user.

Parameters

return

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

625 {
628
629 if (!$this->checkPermissionBool("write")) {
630 return;
631 }
632
633 // user assignment with toolbar
634 $user_id = ilObjUser::_lookupId(ilUtil::stripSlashes($_POST["user_login"]));
635 if ($user_id > 0) {
636 $this->profile->addUserToProfile($user_id);
637 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
638 }
639
640 // user assignment with ilRepositorySearchGUI
641 $users = $_POST['user'];
642 if (is_array($users)) {
643 foreach ($users as $id) {
644 if ($id > 0) {
645 $this->profile->addUserToProfile($id);
646 }
647 }
648 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
649 }
650
651 $ilCtrl->redirect($this, "showUsers");
652 }
$_POST["username"]
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

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

+ 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 92 of file class.ilSkillProfileGUI.php.

93 {
94 return $this->access->checkAccess($a_perm, "", $this->ref_id);
95 }

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

+ Here is the caller graph for this function:

◆ confirmDeleteProfiles()

ilSkillProfileGUI::confirmDeleteProfiles ( )

Confirm profile deletion.

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

343 {
347
348 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
349 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
350 $ilCtrl->redirect($this, "listProfiles");
351 } else {
352 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
353 $cgui = new ilConfirmationGUI();
354 $cgui->setFormAction($ilCtrl->getFormAction($this));
355 $cgui->setHeaderText($lng->txt("skmg_delete_profiles"));
356 $cgui->setCancel($lng->txt("cancel"), "listProfiles");
357 $cgui->setConfirm($lng->txt("delete"), "deleteProfiles");
358
359 foreach ($_POST["id"] as $i) {
360 $cgui->addItem("id[]", $i, ilSkillProfile::lookupTitle($i));
361 }
362
363 $tpl->setContent($cgui->getHTML());
364 }
365 }
Confirmation screen class.
static lookupTitle($a_id)
Lookup title.
$i
Definition: metadata.php:24

References $_POST, $ctrl, $i, $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 518 of file class.ilSkillProfileGUI.php.

519 {
523
524 $this->setTabs("levels");
525
526 if (!is_array($_POST["ass_id"]) || count($_POST["ass_id"]) == 0) {
527 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
528 $ilCtrl->redirect($this, "showLevels");
529 } else {
530 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
531 $cgui = new ilConfirmationGUI();
532 $cgui->setFormAction($ilCtrl->getFormAction($this));
533 $cgui->setHeaderText($lng->txt("skmg_confirm_remove_level_ass"));
534 $cgui->setCancel($lng->txt("cancel"), "showLevels");
535 $cgui->setConfirm($lng->txt("remove"), "removeLevelAssignments");
536
537 include_once("./Services/Skill/classes/class.ilBasicSkill.php");
538 foreach ($_POST["ass_id"] as $i) {
539 $id_arr = explode(":", $i);
540 $cgui->addItem(
541 "ass_id[]",
542 $i,
543 ilBasicSkill::_lookupTitle($id_arr[0]) . ": " .
545 );
546 }
547
548 $tpl->setContent($cgui->getHTML());
549 }
550 }
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, $ctrl, $i, $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 683 of file class.ilSkillProfileGUI.php.

684 {
688
689 if (!$this->checkPermissionBool("write")) {
690 return;
691 }
692
693 $this->setTabs("users");
694
695 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
696 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
697 $ilCtrl->redirect($this, "showUsers");
698 } else {
699 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
700 $cgui = new ilConfirmationGUI();
701 $cgui->setFormAction($ilCtrl->getFormAction($this));
702 $cgui->setHeaderText($lng->txt("skmg_confirm_user_removal"));
703 $cgui->setCancel($lng->txt("cancel"), "showUsers");
704 $cgui->setConfirm($lng->txt("remove"), "removeUsers");
705
706 foreach ($_POST["id"] as $i) {
708
709 switch ($type) {
710 case 'usr':
712 $cgui->addItem(
713 "id[]",
714 $i,
715 $usr_name
716 );
717 break;
718
719 case 'role':
720 $role_name = ilObjRole::_lookupTitle($i);
721 $cgui->addItem(
722 "id[]",
723 $i,
724 $role_name
725 );
726 break;
727
728 default:
729 echo 'not defined';
730 }
731 }
732
733 $tpl->setContent($cgui->getHTML());
734 }
735 }
static _lookupTitle($a_id)
lookup object title
static _lookupType($a_id, $a_reference=false)
lookup object type
static getNamePresentation( $a_user_id, $a_user_image=false, $a_profile_link=false, $a_profile_back_link="", $a_force_first_lastname=false, $a_omit_login=false, $a_sortable=true, $a_return_data_array=false, $a_ctrl_path="ilpublicuserprofilegui")
Default behaviour is:
$type

References $_POST, $ctrl, $i, $ilCtrl, $lng, $tpl, $type, ilObject\_lookupTitle(), ilObject\_lookupType(), checkPermissionBool(), ilUserUtil\getNamePresentation(), ilUtil\sendInfo(), and setTabs().

+ Here is the call graph for this function:

◆ create()

ilSkillProfileGUI::create ( )

Create.

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

217 {
219
220 $form = $this->initProfileForm("create");
221 $tpl->setContent($form->getHTML());
222 }
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 370 of file class.ilSkillProfileGUI.php.

371 {
375
376 if (!$this->checkPermissionBool("write")) {
377 return;
378 }
379
380 if (is_array($_POST["id"])) {
381 foreach ($_POST["id"] as $i) {
382 $prof = new ilSkillProfile($i);
383 $prof->delete();
384 }
385 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
386 }
387
388 $ilCtrl->redirect($this, "listProfiles");
389 }

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

+ Here is the call graph for this function:

◆ edit()

ilSkillProfileGUI::edit ( )

Edit.

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

228 {
230
231 $this->setTabs("settings");
232 $form = $this->initProfileForm("edit");
233 $tpl->setContent($form->getHTML());
234 }

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

+ Here is the call graph for this function:

◆ executeCommand()

ilSkillProfileGUI::executeCommand ( )

Execute command.

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

101 {
104
105 $cmd = $ilCtrl->getCmd("listProfiles");
106 $next_class = $ilCtrl->getNextClass();
107 switch ($next_class) {
108 case 'ilrepositorysearchgui':
109 include_once('./Services/Search/classes/class.ilRepositorySearchGUI.php');
110 $user_search = new ilRepositorySearchGUI();
111 $user_search->setTitle($lng->txt('skmg_add_user_to_profile'));
112 $user_search->setCallback($this, 'assignUser');
113 $user_search->setRoleCallback($this, 'assignRole');
114
115 // Set tabs
116 //$this->tabs_gui->setTabActive('user_assignment');
117 $ilCtrl->setReturn($this, 'showUsers');
118 $ret = $ilCtrl->forwardCommand($user_search);
119 break;
120
121 default:
122 if (in_array($cmd, array("listProfiles", "create", "edit", "save", "update",
123 "confirmDeleteProfiles", "deleteProfiles", "showLevels", "assignLevel",
124 "assignLevelSelectSkill", "assignLevelToProfile",
125 "confirmLevelAssignmentRemoval", "removeLevelAssignments",
126 "showUsers", "assignUser", "assignRole",
127 "confirmUserRemoval", "removeUsers", "exportProfiles", "showImportForm", "importProfiles"))) {
128 $this->$cmd();
129 }
130 break;
131 }
132 }
$ret
Definition: parser.php:6

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

◆ exportProfiles()

ilSkillProfileGUI::exportProfiles ( )

Export profiles.

Parameters

return

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

777 {
779
780 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
781 $ilCtrl->redirect($this, "");
782 }
783
784 include_once("./Services/Export/classes/class.ilExport.php");
785 $exp = new ilExport();
786 $conf = $exp->getConfig("Services/Skill");
788 $conf->setSelectedProfiles($_POST["id"]);
789 $exp->exportObject("skmg", ilObject::_lookupObjId((int) $_GET["ref_id"]));
790
791 //ilExport::_createExportDirectory(0, "xml", "");
792 //$export_dir = ilExport::_getExportDirectory($a_id, "xml", $a_type);
793 //$exp->exportEntity("skprof", $_POST["id"], "", "Services/Skill", $a_title, $a_export_dir, "skprof");
794
795 $ilCtrl->redirectByClass(array("iladministrationgui", "ilobjskillmanagementgui", "ilexportgui"), "");
796 }
static _lookupObjId($a_id)

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

+ Here is the call graph for this function:

◆ importProfiles()

ilSkillProfileGUI::importProfiles ( )

Import profiles.

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

840 {
844 $ilTabs = $this->tabs;
845
846 $form = $this->initInputForm();
847 if ($form->checkInput()) {
848 include_once("./Services/Export/classes/class.ilImport.php");
849 $imp = new ilImport();
850 $imp->importEntity($_FILES["import_file"]["tmp_name"], $_FILES["import_file"]["name"], "skmg", "Services/Skill");
851
852 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
853 $ilCtrl->redirect($this, "");
854 } else {
855 $form->setValuesByPost();
856 $tpl->setContent($form->getHtml());
857 }
858 }
Import class.
initInputForm()
Init input form.

References $ctrl, $ilCtrl, $lng, $tabs, $tpl, and initInputForm().

+ Here is the call graph for this function:

◆ initInputForm()

ilSkillProfileGUI::initInputForm ( )

Init input form.

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

813 {
816
817 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
818 $form = new ilPropertyFormGUI();
819
820 include_once("./Services/Form/classes/class.ilFileInputGUI.php");
821 $fi = new ilFileInputGUI($lng->txt("skmg_input_file"), "import_file");
822 $fi->setSuffixes(array("zip"));
823 $fi->setRequired(true);
824 $form->addItem($fi);
825
826 // save and cancel commands
827 $form->addCommandButton("importProfiles", $lng->txt("import"));
828 $form->addCommandButton("", $lng->txt("cancel"));
829
830 $form->setTitle($lng->txt("import"));
831 $form->setFormAction($ilCtrl->getFormAction($this));
832
833 return $form;
834 }
This class represents a file property in a property form.
This class represents a property form user interface.

References $ctrl, $ilCtrl, and $lng.

Referenced by importProfiles(), and showImportForm().

+ 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 242 of file class.ilSkillProfileGUI.php.

243 {
246
247 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
248 $form = new ilPropertyFormGUI();
249
250 // title
251 $ti = new ilTextInputGUI($lng->txt("title"), "title");
252 $ti->setMaxLength(200);
253 $ti->setSize(40);
254 $ti->setRequired(true);
255 $form->addItem($ti);
256
257 // description
258 $desc = new ilTextAreaInputGUI($lng->txt("description"), "description");
259 $desc->setCols(40);
260 $desc->setRows(4);
261 $form->addItem($desc);
262
263 // save and cancel commands
264 if ($this->checkPermissionBool("write")) {
265 if ($a_mode == "create") {
266 $form->addCommandButton("save", $lng->txt("save"));
267 $form->addCommandButton("listProfiles", $lng->txt("cancel"));
268 $form->setTitle($lng->txt("skmg_add_profile"));
269 } else {
270 // set values
271 $ti->setValue($this->profile->getTitle());
272 $desc->setValue($this->profile->getDescription());
273
274 $form->addCommandButton("update", $lng->txt("save"));
275 $form->addCommandButton("listProfiles", $lng->txt("cancel"));
276 $form->setTitle($lng->txt("skmg_edit_profile"));
277 }
278 }
279
280 $form->setFormAction($ilCtrl->getFormAction($this));
281
282 return $form;
283 }
This class represents a text area property in a property form.
This class represents a text property in a property form.

References $ctrl, $ilCtrl, $lng, and checkPermissionBool().

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

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

◆ listProfiles()

ilSkillProfileGUI::listProfiles ( )

List profiles.

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

189 {
191 $ilToolbar = $this->toolbar;
194
195 if ($this->checkPermissionBool("write")) {
196 $ilToolbar->addButton(
197 $lng->txt("skmg_add_profile"),
198 $ilCtrl->getLinkTarget($this, "create")
199 );
200
201 $ilToolbar->addButton(
202 $lng->txt("import"),
203 $ilCtrl->getLinkTarget($this, "showImportForm")
204 );
205 }
206
207 include_once("./Services/Skill/classes/class.ilSkillProfileTableGUI.php");
208 $tab = new ilSkillProfileTableGUI($this, "listProfiles", $this->checkPermissionBool("write"));
209
210 $tpl->setContent($tab->getHTML());
211 }
TableGUI class for skill profiles.

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

+ Here is the call graph for this function:

◆ removeLevelAssignments()

ilSkillProfileGUI::removeLevelAssignments ( )

Remove level assignment.

Parameters

return

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

559 {
561
562 if (!$this->checkPermissionBool("write")) {
563 return;
564 }
565
566 if (is_array($_POST["ass_id"])) {
567 foreach ($_POST["ass_id"] as $i) {
568 $id_arr = explode(":", $i);
569 $this->profile->removeSkillLevel($id_arr[0], $id_arr[1], $id_arr[2]);
570 }
571 $this->profile->update();
572 }
573
574 $ilCtrl->redirect($this, "showLevels");
575 }

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

+ Here is the call graph for this function:

◆ removeUsers()

ilSkillProfileGUI::removeUsers ( )

Remove users.

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

741 {
744
745 if (!$this->checkPermissionBool("write")) {
746 return;
747 }
748
749 if (is_array($_POST["id"])) {
750 foreach ($_POST["id"] as $i) {
752 switch ($type) {
753 case 'usr':
754 $this->profile->removeUserFromProfile((int) $i);
755 break;
756
757 case 'role':
758 $this->profile->removeRoleFromProfile((int) $i);
759 break;
760
761 default:
762 echo 'not deleted';
763 }
764 }
765 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
766 }
767 $ilCtrl->redirect($this, "showUsers");
768 }

References $_POST, $ctrl, $i, $ilCtrl, $lng, $type, ilObject\_lookupType(), and checkPermissionBool().

+ Here is the call graph for this function:

◆ save()

ilSkillProfileGUI::save ( )

Save profile form.

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

289 {
293
294 if (!$this->checkPermissionBool("write")) {
295 return;
296 }
297
298 $form = $this->initProfileForm("create");
299 if ($form->checkInput()) {
300 $prof = new ilSkillProfile();
301 $prof->setTitle($form->getInput("title"));
302 $prof->setDescription($form->getInput("description"));
303 $prof->create();
304 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
305 $ilCtrl->redirect($this, "listProfiles");
306 } else {
307 $form->setValuesByPost();
308 $tpl->setContent($form->getHtml());
309 }
310 }

References $ctrl, $ilCtrl, $lng, $tpl, checkPermissionBool(), and initProfileForm().

+ Here is the call graph for this function:

◆ setTabs()

ilSkillProfileGUI::setTabs (   $a_active)

Set tabs.

Parameters

return

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

141 {
142 $ilTabs = $this->tabs;
146 $ilHelp = $this->help;
147
148 $tpl->setTitle($lng->txt("skmg_profile") . ": " .
149 $this->profile->getTitle());
150 $tpl->setDescription("");
151
152 $ilTabs->clearTargets();
153 $ilHelp->setScreenIdComponent("skmg_prof");
154
155 $ilTabs->setBackTarget(
156 $lng->txt("back"),
157 $ilCtrl->getLinkTarget($this, "")
158 );
159
160 // users
161 $ilTabs->addTab(
162 "users",
163 $lng->txt("skmg_assigned_users"),
164 $ilCtrl->getLinkTarget($this, "showUsers")
165 );
166
167 // levels
168 $ilTabs->addTab(
169 "levels",
170 $lng->txt("skmg_assigned_skill_levels"),
171 $ilCtrl->getLinkTarget($this, "showLevels")
172 );
173
174 // settings
175 $ilTabs->addTab(
176 "settings",
177 $lng->txt("settings"),
178 $ilCtrl->getLinkTarget($this, "edit")
179 );
180
181 $ilTabs->activateTab($a_active);
182 }

References $ctrl, $help, $ilCtrl, $lng, $tabs, and $tpl.

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

+ Here is the caller graph for this function:

◆ showImportForm()

ilSkillProfileGUI::showImportForm ( )

Show import form.

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

802 {
804 $ilTabs = $this->tabs;
805
806 $tpl->setContent($this->initInputForm()->getHTML());
807 }

References $tabs, $tpl, and initInputForm().

+ Here is the call graph for this function:

◆ showLevels()

ilSkillProfileGUI::showLevels ( )

Show skill levels.

Parameters

return

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

402 {
406 $ilToolbar = $this->toolbar;
407
408 $this->setTabs("levels");
409
410 if ($this->checkPermissionBool("write")) {
411 $ilToolbar->addButton(
412 $lng->txt("skmg_assign_level"),
413 $ilCtrl->getLinkTarget($this, "assignLevel")
414 );
415 }
416
417 include_once("./Services/Skill/classes/class.ilSkillProfileLevelsTableGUI.php");
419 $this,
420 "showLevels",
421 $this->profile,
422 $this->checkPermissionBool("write")
423 );
424 $tpl->setContent($tab->getHTML());
425 }
TableGUI class for skill profile levels.

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

+ Here is the call graph for this function:

◆ showUsers()

ilSkillProfileGUI::showUsers ( )

Show users.

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

581 {
584 $ilToolbar = $this->toolbar;
585
586 // add member
587 if ($this->checkPermissionBool("write")) {
588 include_once './Services/Search/classes/class.ilRepositorySearchGUI.php';
590 $this,
591 $ilToolbar,
592 array(
593 'auto_complete_name' => $lng->txt('user'),
594 'submit_name' => $lng->txt('skmg_assign_user')
595 )
596 );
597 }
598
599 $ilToolbar->addSeparator();
600
601 $button = ilLinkButton::getInstance();
602 $button->setCaption("skmg_add_assignment");
603 $button->setUrl($this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI', 'start'));
604 $ilToolbar->addButtonInstance($button);
605
606 $this->setTabs("users");
607
608 include_once("./Services/Skill/classes/class.ilSkillProfileUserTableGUI.php");
610 $this,
611 "showUsers",
612 $this->profile,
613 $this->checkPermissionBool("write")
614 );
615 $tpl->setContent($tab->getHTML());
616 }
static getInstance()
Factory.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
TableGUI class for skill profile user assignment.

References $lng, $tab, $toolbar, $tpl, checkPermissionBool(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ilLinkButton\getInstance(), and setTabs().

+ Here is the call graph for this function:

◆ update()

ilSkillProfileGUI::update ( )

Update.

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

316 {
320
321 if (!$this->checkPermissionBool("write")) {
322 return;
323 }
324
325 $form = $this->initProfileForm("edit");
326 if ($form->checkInput()) {
327 $this->profile->setTitle($form->getInput("title"));
328 $this->profile->setDescription($form->getInput("description"));
329 $this->profile->update();
330
331 ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
332 $ilCtrl->redirect($this, "listProfiles");
333 } else {
334 $form->setValuesByPost();
335 $tpl->setContent($form->getHtml());
336 }
337 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilSkillProfileGUI::$access

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

◆ $ctrl

◆ $help

ilSkillProfileGUI::$help
protected

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

Referenced by setTabs().

◆ $lng

◆ $profile

ilSkillProfileGUI::$profile = null
protected

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

◆ $ref_id

ilSkillProfileGUI::$ref_id

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

◆ $tabs

ilSkillProfileGUI::$tabs
protected

◆ $toolbar

ilSkillProfileGUI::$toolbar
protected

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

Referenced by listProfiles(), showLevels(), and showUsers().

◆ $tpl


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