ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 listLocalProfiles ()
 
 create ()
 Create. More...
 
 createLocal ()
 
 edit ()
 Edit. More...
 
 initProfileForm ($a_mode="edit")
 Init profile form. More...
 
 save ()
 Save profile form. More...
 
 saveLocal ()
 
 update ()
 Update. More...
 
 confirmDeleteProfiles ()
 Confirm profile deletion. More...
 
 deleteProfiles ()
 Delete profiles. More...
 
 showLevels ()
 Show skill levels. More...
 
 showLevelsWithLocalContext ()
 
 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...
 
 saveLevelOrder ()
 Save level order. 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...
 
 showObjects ()
 Show assigned objects. More...
 
 exportProfiles ()
 Export profiles. More...
 
 showImportForm ()
 Show import form. More...
 
 initInputForm ()
 Init input form. More...
 
 importProfiles ()
 Import profiles. More...
 

Data Fields

 $access
 
 $ref_id
 
 $local_context = false
 

Protected Attributes

 $ctrl
 
 $lng
 
 $tabs
 
 $tpl
 
 $help
 
 $toolbar
 
 $profile = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSkillProfileGUI::__construct ( )

Constructor.

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

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

62  {
63  global $DIC;
64 
65  $this->ctrl = $DIC->ctrl();
66  $this->lng = $DIC->language();
67  $this->tabs = $DIC->tabs();
68  $this->tpl = $DIC["tpl"];
69  $this->help = $DIC["ilHelp"];
70  $this->toolbar = $DIC->toolbar();
71  $ilCtrl = $DIC->ctrl();
72  $ilAccess = $DIC->access();
73 
74  $ilCtrl->saveParameter($this, ["sprof_id", "local_context"]);
75  $this->access = $ilAccess;
76  $this->ref_id = (int) $_GET["ref_id"];
77 
78  if ((int) $_GET["sprof_id"] > 0) {
79  $this->id = (int) $_GET["sprof_id"];
80  }
81 
82  if ($this->id > 0) {
83  $this->profile = new ilSkillProfile($this->id);
84  if ($this->profile->getRefId() > 0 && (bool) $_GET["local_context"]) {
85  $this->local_context = true;
86  }
87  }
88  }
$_GET["client_id"]
help()
Definition: help.php:2
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

Member Function Documentation

◆ assignLevel()

ilSkillProfileGUI::assignLevel ( )

Assign Level.

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

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

523  {
524  $lng = $this->lng;
525  $ilTabs = $this->tabs;
526  $ilCtrl = $this->ctrl;
527  $tpl = $this->tpl;
528  $local = $this->local_context;
529 
530  $tpl->setTitle($lng->txt("skmg_profile") . ": " .
531  $this->profile->getTitle());
532  $tpl->setDescription("");
533 
534  //$this->setTabs("levels");
535 
536  ilUtil::sendInfo($lng->txt("skmg_select_skill_level_assign"));
537 
538  $ilTabs->clearTargets();
539  if ($local) {
540  $ilTabs->setBackTarget(
541  $lng->txt("back"),
542  $ilCtrl->getLinkTarget($this, "showLevelsWithLocalContext")
543  );
544  } else {
545  $ilTabs->setBackTarget(
546  $lng->txt("back"),
547  $ilCtrl->getLinkTarget($this, "showLevels")
548  );
549  }
550 
551 
552  $exp = new ilSkillSelectorGUI($this, "assignLevel", $this, "assignLevelSelectSkill", "cskill_id");
553  if (!$exp->handleCommand()) {
554  $tpl->setContent($exp->getHTML());
555  }
556  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Explorer class that works on tree objects (Services/Tree)
+ Here is the call graph for this function:

◆ assignLevelSelectSkill()

ilSkillProfileGUI::assignLevelSelectSkill ( )

Output level table for profile assignment.

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

References $_GET, $ctrl, $lng, $local_context, $tabs, and $tpl.

562  {
563  $tpl = $this->tpl;
564  $lng = $this->lng;
565  $ilCtrl = $this->ctrl;
566  $ilTabs = $this->tabs;
567  $local = $this->local_context;
568 
569  $ilCtrl->saveParameter($this, "cskill_id");
570 
571  $tpl->setTitle($lng->txt("skmg_profile") . ": " .
572  $this->profile->getTitle());
573  $tpl->setDescription("");
574 
575  $ilTabs->clearTargets();
576  if ($local) {
577  $ilTabs->setBackTarget(
578  $lng->txt("back"),
579  $ilCtrl->getLinkTarget($this, "showLevelsWithLocalContext")
580  );
581  } else {
582  $ilTabs->setBackTarget(
583  $lng->txt("back"),
584  $ilCtrl->getLinkTarget($this, "showLevels")
585  );
586  }
587 
589  $this,
590  "assignLevelSelectSkill",
591  $_GET["cskill_id"]
592  );
593  $tpl->setContent($tab->getHTML());
594  }
$_GET["client_id"]
TableGUI class for skill profile skill level assignment.

◆ assignLevelToProfile()

ilSkillProfileGUI::assignLevelToProfile ( )

Assign level to profile.

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

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

600  {
601  $ilCtrl = $this->ctrl;
602  $lng = $this->lng;
603  $local = $this->local_context;
604 
605  if (!$this->checkPermissionBool("write")) {
606  return;
607  }
608 
609 
610  $parts = explode(":", $_GET["cskill_id"]);
611 
612  $this->profile->addSkillLevel(
613  (int) $parts[0],
614  (int) $parts[1],
615  (int) $_GET["level_id"],
616  (int) $this->profile->getMaxLevelOrderNr() + 10
617  );
618  $this->profile->update();
619 
620  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
621  if ($local) {
622  $ilCtrl->redirect($this, "showLevelsWithLocalContext");
623  }
624  $ilCtrl->redirect($this, "showLevels");
625  }
checkPermissionBool($a_perm)
Check permission pool.
$_GET["client_id"]
+ Here is the call graph for this function:

◆ assignRole()

ilSkillProfileGUI::assignRole ( array  $role_ids)

Assign role.

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

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

807  {
808  $ilCtrl = $this->ctrl;
809  $lng = $this->lng;
810 
811  if (!$this->checkPermissionBool("write")) {
812  return;
813  }
814 
815  $success = false;
816  foreach ($role_ids as $id) {
817  if ($id > 0) {
818  $this->profile->addRoleToProfile($id);
819  $success = true;
820  }
821  }
822  if ($success) {
823  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
824  }
825 
826  $ilCtrl->redirect($this, "showUsers");
827  }
checkPermissionBool($a_perm)
Check permission pool.
$success
Definition: Utf8Test.php:86
+ Here is the call graph for this function:

◆ assignUser()

ilSkillProfileGUI::assignUser ( )

Assign user.

Parameters

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

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

774  {
775  $ilCtrl = $this->ctrl;
776  $lng = $this->lng;
777 
778  if (!$this->checkPermissionBool("write")) {
779  return;
780  }
781 
782  // user assignment with toolbar
783  $user_id = ilObjUser::_lookupId(ilUtil::stripSlashes($_POST["user_login"]));
784  if ($user_id > 0) {
785  $this->profile->addUserToProfile($user_id);
786  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
787  }
788 
789  // user assignment with ilRepositorySearchGUI
790  $users = $_POST['user'];
791  if (is_array($users)) {
792  foreach ($users as $id) {
793  if ($id > 0) {
794  $this->profile->addUserToProfile($id);
795  }
796  }
797  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
798  }
799 
800  $ilCtrl->redirect($this, "showUsers");
801  }
checkPermissionBool($a_perm)
Check permission pool.
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"]
+ 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 96 of file class.ilSkillProfileGUI.php.

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

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

◆ confirmDeleteProfiles()

ilSkillProfileGUI::confirmDeleteProfiles ( )

Confirm profile deletion.

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

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

407  {
408  $ilCtrl = $this->ctrl;
409  $tpl = $this->tpl;
410  $lng = $this->lng;
411 
412  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
413  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
414  $ilCtrl->redirect($this, "listProfiles");
415  } else {
416  $cgui = new ilConfirmationGUI();
417  $cgui->setFormAction($ilCtrl->getFormAction($this));
418  $cgui->setHeaderText($lng->txt("skmg_delete_profiles"));
419  $cgui->setCancel($lng->txt("cancel"), "listProfiles");
420  $cgui->setConfirm($lng->txt("delete"), "deleteProfiles");
421 
422  foreach ($_POST["id"] as $i) {
423  $cgui->addItem("id[]", $i, ilSkillProfile::lookupTitle($i));
424  }
425 
426  $tpl->setContent($cgui->getHTML());
427  }
428  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static lookupTitle($a_id)
Lookup title.
$_POST["username"]
$i
Definition: metadata.php:24
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmLevelAssignmentRemoval()

ilSkillProfileGUI::confirmLevelAssignmentRemoval ( )

Confirm level assignment removal.

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

References $_POST, $ctrl, $i, $lng, $local_context, $tabs, $tpl, ilSkillTreeNode\_lookupTitle(), ilBasicSkill\lookupLevelTitle(), ilUtil\sendInfo(), and setTabs().

631  {
632  $ilCtrl = $this->ctrl;
633  $tpl = $this->tpl;
634  $lng = $this->lng;
635  $tabs = $this->tabs;
636  $local = $this->local_context;
637 
638  if ($local) {
639  $tabs->clearTargets();
640  } else {
641  $this->setTabs("levels");
642  }
643 
644  if (!is_array($_POST["ass_id"]) || count($_POST["ass_id"]) == 0) {
645  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
646  if ($local) {
647  $ilCtrl->redirect($this, "showLevelsWithLocalContext");
648  }
649  $ilCtrl->redirect($this, "showLevels");
650  } else {
651  $cgui = new ilConfirmationGUI();
652  $cgui->setFormAction($ilCtrl->getFormAction($this));
653  $cgui->setHeaderText($lng->txt("skmg_confirm_remove_level_ass"));
654  if ($local) {
655  $cgui->setCancel($lng->txt("cancel"), "showLevelsWithLocalContext");
656  } else {
657  $cgui->setCancel($lng->txt("cancel"), "showLevels");
658  }
659  $cgui->setConfirm($lng->txt("remove"), "removeLevelAssignments");
660 
661  foreach ($_POST["ass_id"] as $i) {
662  $id_arr = explode(":", $i);
663  $cgui->addItem(
664  "ass_id[]",
665  $i,
666  ilBasicSkill::_lookupTitle($id_arr[0]) . ": " .
668  );
669  }
670 
671  $tpl->setContent($cgui->getHTML());
672  }
673  }
setTabs($a_active)
Set tabs.
static lookupLevelTitle(int $a_id)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
$_POST["username"]
$i
Definition: metadata.php:24
Confirmation screen class.
+ Here is the call graph for this function:

◆ confirmUserRemoval()

ilSkillProfileGUI::confirmUserRemoval ( )

Confirm user removal.

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

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

833  {
834  $ilCtrl = $this->ctrl;
835  $tpl = $this->tpl;
836  $lng = $this->lng;
837 
838  if (!$this->checkPermissionBool("write")) {
839  return;
840  }
841 
842  $this->setTabs("users");
843 
844  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
845  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
846  $ilCtrl->redirect($this, "showUsers");
847  } else {
848  $cgui = new ilConfirmationGUI();
849  $cgui->setFormAction($ilCtrl->getFormAction($this));
850  $cgui->setHeaderText($lng->txt("skmg_confirm_user_removal"));
851  $cgui->setCancel($lng->txt("cancel"), "showUsers");
852  $cgui->setConfirm($lng->txt("remove"), "removeUsers");
853 
854  foreach ($_POST["id"] as $i) {
856 
857  switch ($type) {
858  case 'usr':
859  $usr_name = ilUserUtil::getNamePresentation($i);
860  $cgui->addItem(
861  "id[]",
862  $i,
863  $usr_name
864  );
865  break;
866 
867  case 'role':
868  $role_name = ilObjRole::_lookupTitle($i);
869  $cgui->addItem(
870  "id[]",
871  $i,
872  $role_name
873  );
874  break;
875 
876  default:
877  echo 'not defined';
878  }
879  }
880 
881  $tpl->setContent($cgui->getHTML());
882  }
883  }
setTabs($a_active)
Set tabs.
checkPermissionBool($a_perm)
Check permission pool.
$type
static _lookupTitle($a_id)
lookup object title
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
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:
static _lookupType($a_id, $a_reference=false)
lookup object type
$_POST["username"]
$i
Definition: metadata.php:24
Confirmation screen class.
+ Here is the call graph for this function:

◆ create()

ilSkillProfileGUI::create ( )

Create.

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

References $tpl, and initProfileForm().

235  {
236  $tpl = $this->tpl;
237 
238  $form = $this->initProfileForm("create");
239  $tpl->setContent($form->getHTML());
240  }
initProfileForm($a_mode="edit")
Init profile form.
+ Here is the call graph for this function:

◆ createLocal()

ilSkillProfileGUI::createLocal ( )

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

References $ctrl, $lng, $tabs, $tpl, and initProfileForm().

243  {
244  $tpl = $this->tpl;
245  $lng = $this->lng;
246  $ctrl = $this->ctrl;
247  $tabs = $this->tabs;
248 
249  $tabs->clearTargets();
250  $tabs->setBackTarget(
251  $lng->txt("back_to_course"),
252  $ctrl->getLinkTargetByClass("ilcontskilladmingui", "listProfiles")
253  );
254 
255  $form = $this->initProfileForm("createLocal");
256  $tpl->setContent($form->getHTML());
257  }
initProfileForm($a_mode="edit")
Init profile form.
+ Here is the call graph for this function:

◆ deleteProfiles()

ilSkillProfileGUI::deleteProfiles ( )

Delete profiles.

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

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

434  {
435  $ilCtrl = $this->ctrl;
436  $tpl = $this->tpl;
437  $lng = $this->lng;
438 
439  if (!$this->checkPermissionBool("write")) {
440  return;
441  }
442 
443  if (is_array($_POST["id"])) {
444  foreach ($_POST["id"] as $i) {
445  $prof = new ilSkillProfile($i);
446  $prof->delete();
447  }
448  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
449  }
450 
451  $ilCtrl->redirect($this, "listProfiles");
452  }
checkPermissionBool($a_perm)
Check permission pool.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$_POST["username"]
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

◆ edit()

ilSkillProfileGUI::edit ( )

Edit.

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

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

263  {
264  $tpl = $this->tpl;
265 
266  $this->setTabs("settings");
267  $form = $this->initProfileForm("edit");
268  $tpl->setContent($form->getHTML());
269  }
setTabs($a_active)
Set tabs.
initProfileForm($a_mode="edit")
Init profile form.
+ Here is the call graph for this function:

◆ executeCommand()

ilSkillProfileGUI::executeCommand ( )

Execute command.

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

References $ctrl, $lng, and $ret.

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

◆ exportProfiles()

ilSkillProfileGUI::exportProfiles ( )

Export profiles.

Parameters

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

References $_GET, $_POST, $ctrl, $lng, ilObject\_lookupObjId(), checkPermissionBool(), ilSkillExportConfig\MODE_PROFILES, and ilUtil\sendInfo().

945  {
946  $ilCtrl = $this->ctrl;
947  $lng = $this->lng;
948 
949  if (!$this->checkPermissionBool("write")) {
950  return;
951  }
952 
953  if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
954  ilUtil::sendInfo($lng->txt("no_checkbox"), true);
955  $ilCtrl->redirect($this, "");
956  }
957 
958  $exp = new ilExport();
959  $conf = $exp->getConfig("Services/Skill");
960  $conf->setMode(ilSkillExportConfig::MODE_PROFILES);
961  $conf->setSelectedProfiles($_POST["id"]);
962  $exp->exportObject("skmg", ilObject::_lookupObjId((int) $_GET["ref_id"]));
963 
964  //ilExport::_createExportDirectory(0, "xml", "");
965  //$export_dir = ilExport::_getExportDirectory($a_id, "xml", $a_type);
966  //$exp->exportEntity("skprof", $_POST["id"], "", "Services/Skill", $a_title, $a_export_dir, "skprof");
967 
968  $ilCtrl->redirectByClass(array("iladministrationgui", "ilobjskillmanagementgui", "ilexportgui"), "");
969  }
checkPermissionBool($a_perm)
Check permission pool.
$_GET["client_id"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _lookupObjId($a_id)
$_POST["username"]
+ Here is the call graph for this function:

◆ importProfiles()

ilSkillProfileGUI::importProfiles ( )

Import profiles.

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

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

1011  {
1012  $tpl = $this->tpl;
1013  $lng = $this->lng;
1014  $ilCtrl = $this->ctrl;
1015 
1016  $form = $this->initInputForm();
1017  if ($form->checkInput()) {
1018  $imp = new ilImport();
1019  $imp->importEntity($_FILES["import_file"]["tmp_name"], $_FILES["import_file"]["name"], "skmg", "Services/Skill");
1020 
1021  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
1022  $ilCtrl->redirect($this, "");
1023  } else {
1024  $form->setValuesByPost();
1025  $tpl->setContent($form->getHtml());
1026  }
1027  }
Import class.
initInputForm()
Init input form.
+ Here is the call graph for this function:

◆ initInputForm()

ilSkillProfileGUI::initInputForm ( )

Init input form.

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

References $ctrl, $lng, and ilFileInputGUI\setSuffixes().

Referenced by importProfiles(), and showImportForm().

986  {
987  $lng = $this->lng;
988  $ilCtrl = $this->ctrl;
989 
990  $form = new ilPropertyFormGUI();
991 
992  $fi = new ilFileInputGUI($lng->txt("skmg_input_file"), "import_file");
993  $fi->setSuffixes(array("zip"));
994  $fi->setRequired(true);
995  $form->addItem($fi);
996 
997  // save and cancel commands
998  $form->addCommandButton("importProfiles", $lng->txt("import"));
999  $form->addCommandButton("", $lng->txt("cancel"));
1000 
1001  $form->setTitle($lng->txt("import"));
1002  $form->setFormAction($ilCtrl->getFormAction($this));
1003 
1004  return $form;
1005  }
This class represents a property form user interface.
This class represents a file property in a property form.
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 277 of file class.ilSkillProfileGUI.php.

References $ctrl, $lng, checkPermissionBool(), and ilTextAreaInputGUI\setCols().

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

278  {
279  $lng = $this->lng;
280  $ilCtrl = $this->ctrl;
281 
282  $form = new ilPropertyFormGUI();
283 
284  // title
285  $ti = new ilTextInputGUI($lng->txt("title"), "title");
286  $ti->setMaxLength(200);
287  $ti->setSize(40);
288  $ti->setRequired(true);
289  $form->addItem($ti);
290 
291  // description
292  $desc = new ilTextAreaInputGUI($lng->txt("description"), "description");
293  $desc->setCols(40);
294  $desc->setRows(4);
295  $form->addItem($desc);
296 
297  // save and cancel commands
298  if ($this->checkPermissionBool("write")) {
299  if ($a_mode == "create") {
300  $form->addCommandButton("save", $lng->txt("save"));
301  $form->addCommandButton("listProfiles", $lng->txt("cancel"));
302  $form->setTitle($lng->txt("skmg_add_profile"));
303  } elseif ($a_mode == "createLocal") {
304  $form->addCommandButton("saveLocal", $lng->txt("save"));
305  $form->addCommandButton("listLocalProfiles", $lng->txt("cancel"));
306  $form->setTitle($lng->txt("skmg_add_local_profile"));
307  } else {
308  // set values
309  $ti->setValue($this->profile->getTitle());
310  $desc->setValue($this->profile->getDescription());
311 
312  $form->addCommandButton("update", $lng->txt("save"));
313  $form->addCommandButton("listProfiles", $lng->txt("cancel"));
314  $form->setTitle($lng->txt("skmg_edit_profile"));
315  }
316  }
317 
318  $form->setFormAction($ilCtrl->getFormAction($this));
319 
320  return $form;
321  }
checkPermissionBool($a_perm)
Check permission pool.
This class represents a property form user interface.
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:

◆ listLocalProfiles()

ilSkillProfileGUI::listLocalProfiles ( )

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

References $ctrl.

225  {
226  $ilCtrl = $this->ctrl;
227 
228  $ilCtrl->redirectByClass("ilcontskilladmingui", "listProfiles");
229  }

◆ listProfiles()

ilSkillProfileGUI::listProfiles ( )

List profiles.

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

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

201  {
202  $tpl = $this->tpl;
203  $ilToolbar = $this->toolbar;
204  $lng = $this->lng;
205  $ilCtrl = $this->ctrl;
206 
207  if ($this->checkPermissionBool("write")) {
208  $ilToolbar->addButton(
209  $lng->txt("skmg_add_profile"),
210  $ilCtrl->getLinkTarget($this, "create")
211  );
212 
213  $ilToolbar->addButton(
214  $lng->txt("import"),
215  $ilCtrl->getLinkTarget($this, "showImportForm")
216  );
217  }
218 
219  $tab = new ilSkillProfileTableGUI($this, "listProfiles", $this->checkPermissionBool("write"));
220 
221  $tpl->setContent($tab->getHTML());
222  }
checkPermissionBool($a_perm)
Check permission pool.
TableGUI class for skill profiles.
+ Here is the call graph for this function:

◆ removeLevelAssignments()

ilSkillProfileGUI::removeLevelAssignments ( )

Remove level assignment.

Parameters

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

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

682  {
683  $ilCtrl = $this->ctrl;
684  $local = $this->local_context;
685 
686  if (!$this->checkPermissionBool("write")) {
687  return;
688  }
689 
690  if (is_array($_POST["ass_id"])) {
691  foreach ($_POST["ass_id"] as $i) {
692  $id_arr = explode(":", $i);
693  $this->profile->removeSkillLevel($id_arr[0], $id_arr[1], $id_arr[2], $id_arr[3]);
694  }
695  $this->profile->update();
696  $this->profile->fixSkillOrderNumbering();
697  }
698 
699  if ($local) {
700  $ilCtrl->redirect($this, "showLevelsWithLocalContext");
701  }
702  $ilCtrl->redirect($this, "showLevels");
703  }
checkPermissionBool($a_perm)
Check permission pool.
$_POST["username"]
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

◆ removeUsers()

ilSkillProfileGUI::removeUsers ( )

Remove users.

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

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

889  {
890  $ilCtrl = $this->ctrl;
891  $lng = $this->lng;
892 
893  if (!$this->checkPermissionBool("write")) {
894  return;
895  }
896 
897  if (is_array($_POST["id"])) {
898  foreach ($_POST["id"] as $i) {
900  switch ($type) {
901  case 'usr':
902  $this->profile->removeUserFromProfile((int) $i);
903  break;
904 
905  case 'role':
906  $this->profile->removeRoleFromProfile((int) $i);
907  break;
908 
909  default:
910  echo 'not deleted';
911  }
912  }
913  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
914  }
915  $ilCtrl->redirect($this, "showUsers");
916  }
checkPermissionBool($a_perm)
Check permission pool.
$type
static _lookupType($a_id, $a_reference=false)
lookup object type
$_POST["username"]
$i
Definition: metadata.php:24
+ Here is the call graph for this function:

◆ save()

ilSkillProfileGUI::save ( )

Save profile form.

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

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

327  {
328  $tpl = $this->tpl;
329  $lng = $this->lng;
330  $ilCtrl = $this->ctrl;
331 
332  if (!$this->checkPermissionBool("write")) {
333  return;
334  }
335 
336  $form = $this->initProfileForm("create");
337  if ($form->checkInput()) {
338  $prof = new ilSkillProfile();
339  $prof->setTitle($form->getInput("title"));
340  $prof->setDescription($form->getInput("description"));
341  $prof->create();
342  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
343  $ilCtrl->redirect($this, "listProfiles");
344  } else {
345  $form->setValuesByPost();
346  $tpl->setContent($form->getHtml());
347  }
348  }
checkPermissionBool($a_perm)
Check permission pool.
initProfileForm($a_mode="edit")
Init profile form.
+ Here is the call graph for this function:

◆ saveLevelOrder()

ilSkillProfileGUI::saveLevelOrder ( )

Save level order.

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

References $_POST, $ctrl, $lng, $local_context, checkPermissionBool(), and ilUtil\stripSlashesArray().

709  {
710  $lng = $this->lng;
711  $ilCtrl = $this->ctrl;
712  $local = $this->local_context;
713 
714  if (!$this->checkPermissionBool("write")) {
715  return;
716  }
717 
718  $order = ilUtil::stripSlashesArray($_POST["order"]);
719  $this->profile->updateSkillOrder($order);
720 
721  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
722  if ($local) {
723  $ilCtrl->redirect($this, "showLevelsWithLocalContext");
724  }
725  $ilCtrl->redirect($this, "showLevels");
726  }
checkPermissionBool($a_perm)
Check permission pool.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
$_POST["username"]
+ Here is the call graph for this function:

◆ saveLocal()

ilSkillProfileGUI::saveLocal ( )

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

References $ctrl, $lng, $tpl, checkPermissionBool(), ilParticipants\getDefaultMemberRole(), and initProfileForm().

351  {
352  $tpl = $this->tpl;
353  $lng = $this->lng;
354  $ilCtrl = $this->ctrl;
355 
356  if (!$this->checkPermissionBool("write")) {
357  return;
358  }
359 
360  $form = $this->initProfileForm("createLocal");
361  if ($form->checkInput()) {
362  $prof = new ilSkillProfile();
363  $prof->setTitle($form->getInput("title"));
364  $prof->setDescription($form->getInput("description"));
365  $prof->setRefId($this->ref_id);
366  $prof->create();
367  $prof->addRoleToProfile(ilParticipants::getDefaultMemberRole($this->ref_id));
368  ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
369  $ilCtrl->redirectByClass("ilcontskilladmingui", "listProfiles");
370  } else {
371  $form->setValuesByPost();
372  $tpl->setContent($form->getHtml());
373  }
374  }
checkPermissionBool($a_perm)
Check permission pool.
static getDefaultMemberRole($a_ref_id)
initProfileForm($a_mode="edit")
Init profile form.
+ Here is the call graph for this function:

◆ setTabs()

ilSkillProfileGUI::setTabs (   $a_active)

Set tabs.

Parameters

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

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

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

146  {
147  $ilTabs = $this->tabs;
148  $lng = $this->lng;
149  $ilCtrl = $this->ctrl;
150  $tpl = $this->tpl;
151  $ilHelp = $this->help;
152 
153  $tpl->setTitle($lng->txt("skmg_profile") . ": " .
154  $this->profile->getTitle());
155  $tpl->setDescription("");
156 
157  $ilTabs->clearTargets();
158  $ilHelp->setScreenIdComponent("skmg_prof");
159 
160  $ilTabs->setBackTarget(
161  $lng->txt("back"),
162  $ilCtrl->getLinkTarget($this, "")
163  );
164 
165  // levels
166  $ilTabs->addTab(
167  "levels",
168  $lng->txt("skmg_assigned_skill_levels"),
169  $ilCtrl->getLinkTarget($this, "showLevels")
170  );
171 
172  // users
173  $ilTabs->addTab(
174  "users",
175  $lng->txt("skmg_assigned_users"),
176  $ilCtrl->getLinkTarget($this, "showUsers")
177  );
178 
179  // objects
180  $ilTabs->addTab(
181  "objects",
182  $lng->txt("skmg_assigned_objects"),
183  $ilCtrl->getLinkTarget($this, "showObjects")
184  );
185 
186  // settings
187  $ilTabs->addTab(
188  "settings",
189  $lng->txt("settings"),
190  $ilCtrl->getLinkTarget($this, "edit")
191  );
192 
193  $ilTabs->activateTab($a_active);
194  }
+ Here is the caller graph for this function:

◆ showImportForm()

ilSkillProfileGUI::showImportForm ( )

Show import form.

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

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

975  {
976  $tpl = $this->tpl;
977  $ilTabs = $this->tabs;
978 
979  $tpl->setContent($this->initInputForm()->getHTML());
980  }
initInputForm()
Init input form.
+ Here is the call graph for this function:

◆ showLevels()

ilSkillProfileGUI::showLevels ( )

Show skill levels.

Parameters

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

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

465  {
466  $tpl = $this->tpl;
467  $ilCtrl = $this->ctrl;
468  $lng = $this->lng;
469  $ilToolbar = $this->toolbar;
470 
471  $this->setTabs("levels");
472 
473  if ($this->checkPermissionBool("write")) {
474  $ilToolbar->addButton(
475  $lng->txt("skmg_assign_level"),
476  $ilCtrl->getLinkTarget($this, "assignLevel")
477  );
478  }
479 
480  $tab = new ilSkillProfileLevelsTableGUI(
481  $this,
482  "showLevels",
483  $this->profile,
484  $this->checkPermissionBool("write")
485  );
486  $tpl->setContent($tab->getHTML());
487  }
TableGUI class for skill profile levels.
checkPermissionBool($a_perm)
Check permission pool.
setTabs($a_active)
Set tabs.
+ Here is the call graph for this function:

◆ showLevelsWithLocalContext()

ilSkillProfileGUI::showLevelsWithLocalContext ( )

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

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

490  {
491  $tpl = $this->tpl;
492  $lng = $this->lng;
493  $ctrl = $this->ctrl;
494  $tabs = $this->tabs;
496 
497  $tabs->clearTargets();
498  $tabs->setBackTarget(
499  $lng->txt("back_to_course"),
500  $ctrl->getLinkTargetByClass("ilcontskilladmingui", "listProfiles")
501  );
502 
503  if ($this->checkPermissionBool("write")) {
504  $toolbar->addButton(
505  $lng->txt("skmg_assign_level"),
506  $ctrl->getLinkTarget($this, "assignLevel")
507  );
508  }
509 
510  $tab = new ilSkillProfileLevelsTableGUI(
511  $this,
512  "showLevelsWithLocalContext",
513  $this->profile,
514  $this->checkPermissionBool("write")
515  );
516  $tpl->setContent($tab->getHTML());
517  }
TableGUI class for skill profile levels.
checkPermissionBool($a_perm)
Check permission pool.
+ Here is the call graph for this function:

◆ showObjects()

ilSkillProfileGUI::showObjects ( )

Show assigned objects.

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

References $tpl, and setTabs().

922  {
923  $tpl = $this->tpl;
924 
925  $this->setTabs("objects");
926 
927  $usage_info = new ilSkillUsage();
928  $objects = $usage_info->getAssignedObjectsForSkillProfile($this->profile->getId());
929 
931  $this,
932  "showObjects",
933  $objects
934  );
935  $tpl->setContent($tab->getHTML());
936  }
setTabs($a_active)
Set tabs.
TableGUI class for assigned objects of skills.
Skill usage.
+ Here is the call graph for this function:

◆ showUsers()

ilSkillProfileGUI::showUsers ( )

Show users.

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

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

732  {
733  $lng = $this->lng;
734  $tpl = $this->tpl;
735  $ilToolbar = $this->toolbar;
736 
737  // add member
738  if ($this->checkPermissionBool("write") && !$this->profile->getRefId() > 0) {
740  $this,
741  $ilToolbar,
742  array(
743  'auto_complete_name' => $lng->txt('user'),
744  'submit_name' => $lng->txt('skmg_assign_user')
745  )
746  );
747 
748  $ilToolbar->addSeparator();
749 
750  $button = ilLinkButton::getInstance();
751  $button->setCaption("skmg_add_assignment");
752  $button->setUrl($this->ctrl->getLinkTargetByClass('ilRepositorySearchGUI', 'start'));
753  $ilToolbar->addButtonInstance($button);
754  }
755 
756  $this->setTabs("users");
757 
758  $tab = new ilSkillProfileUserTableGUI(
759  $this,
760  "showUsers",
761  $this->profile,
762  $this->checkPermissionBool("write")
763  );
764  $tpl->setContent($tab->getHTML());
765  }
setTabs($a_active)
Set tabs.
checkPermissionBool($a_perm)
Check permission pool.
TableGUI class for skill profile user assignment.
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 379 of file class.ilSkillProfileGUI.php.

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

380  {
381  $lng = $this->lng;
382  $ilCtrl = $this->ctrl;
383  $tpl = $this->tpl;
384 
385  if (!$this->checkPermissionBool("write")) {
386  return;
387  }
388 
389  $form = $this->initProfileForm("edit");
390  if ($form->checkInput()) {
391  $this->profile->setTitle($form->getInput("title"));
392  $this->profile->setDescription($form->getInput("description"));
393  $this->profile->update();
394 
395  ilUtil::sendInfo($lng->txt("msg_obj_modified"), true);
396  $ilCtrl->redirect($this, "listProfiles");
397  } else {
398  $form->setValuesByPost();
399  $tpl->setContent($form->getHtml());
400  }
401  }
checkPermissionBool($a_perm)
Check permission pool.
initProfileForm($a_mode="edit")
Init profile form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
+ Here is the call graph for this function:

Field Documentation

◆ $access

ilSkillProfileGUI::$access

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

◆ $ctrl

◆ $help

ilSkillProfileGUI::$help
protected

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

Referenced by setTabs().

◆ $lng

◆ $local_context

◆ $profile

ilSkillProfileGUI::$profile = null
protected

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

◆ $ref_id

ilSkillProfileGUI::$ref_id

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

◆ $tabs

◆ $toolbar

ilSkillProfileGUI::$toolbar
protected

◆ $tpl


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