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();
74 $ilCtrl->saveParameter($this, [
"sprof_id",
"local_context"]);
75 $this->access = $ilAccess;
76 $this->ref_id = (int)
$_GET[
"ref_id"];
78 if ((
int)
$_GET[
"sprof_id"] > 0) {
79 $this->
id = (int)
$_GET[
"sprof_id"];
84 if ($this->profile->getRefId() > 0 && (
bool)
$_GET[
"local_context"]) {
85 $this->local_context =
true;
98 return $this->access->checkAccess($a_perm,
"", $this->ref_id);
109 $cmd = $ilCtrl->getCmd(
"listProfiles");
110 $next_class = $ilCtrl->getNextClass();
111 switch ($next_class) {
112 case 'ilrepositorysearchgui':
114 $user_search->setTitle(
$lng->txt(
'skmg_add_user_to_profile'));
115 $user_search->setCallback($this,
'assignUser');
116 $user_search->setRoleCallback($this,
'assignRole');
120 $ilCtrl->setReturn($this,
'showUsers');
121 $ret = $ilCtrl->forwardCommand($user_search);
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"))) {
153 $tpl->setTitle(
$lng->txt(
"skmg_profile") .
": " .
154 $this->profile->getTitle());
155 $tpl->setDescription(
"");
157 $ilTabs->clearTargets();
158 $ilHelp->setScreenIdComponent(
"skmg_prof");
160 $ilTabs->setBackTarget(
162 $ilCtrl->getLinkTarget($this,
"")
168 $lng->txt(
"skmg_assigned_skill_levels"),
169 $ilCtrl->getLinkTarget($this,
"showLevels")
175 $lng->txt(
"skmg_assigned_users"),
176 $ilCtrl->getLinkTarget($this,
"showUsers")
182 $lng->txt(
"skmg_assigned_objects"),
183 $ilCtrl->getLinkTarget($this,
"showObjects")
189 $lng->txt(
"settings"),
190 $ilCtrl->getLinkTarget($this,
"edit")
193 $ilTabs->activateTab($a_active);
208 $ilToolbar->addButton(
209 $lng->txt(
"skmg_add_profile"),
210 $ilCtrl->getLinkTarget($this,
"create")
213 $ilToolbar->addButton(
215 $ilCtrl->getLinkTarget($this,
"showImportForm")
221 $tpl->setContent($tab->getHTML());
228 $ilCtrl->redirectByClass(
"ilcontskilladmingui",
"listProfiles");
239 $tpl->setContent($form->getHTML());
249 $tabs->clearTargets();
250 $tabs->setBackTarget(
251 $lng->txt(
"back_to_course"),
252 $ctrl->getLinkTargetByClass(
"ilcontskilladmingui",
"listProfiles")
256 $tpl->setContent($form->getHTML());
268 $tpl->setContent($form->getHTML());
286 $ti->setMaxLength(200);
288 $ti->setRequired(
true);
295 $form->addItem($desc);
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"));
309 $ti->setValue($this->profile->getTitle());
310 $desc->setValue($this->profile->getDescription());
312 $form->addCommandButton(
"update",
$lng->txt(
"save"));
313 $form->addCommandButton(
"listProfiles",
$lng->txt(
"cancel"));
314 $form->setTitle(
$lng->txt(
"skmg_edit_profile"));
318 $form->setFormAction($ilCtrl->getFormAction($this));
337 if ($form->checkInput()) {
339 $prof->setTitle($form->getInput(
"title"));
340 $prof->setDescription($form->getInput(
"description"));
342 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
343 $ilCtrl->redirect($this,
"listProfiles");
345 $form->setValuesByPost();
346 $tpl->setContent($form->getHtml());
361 if ($form->checkInput()) {
363 $prof->setTitle($form->getInput(
"title"));
364 $prof->setDescription($form->getInput(
"description"));
365 $prof->setRefId($this->ref_id);
368 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
369 $ilCtrl->redirectByClass(
"ilcontskilladmingui",
"listProfiles");
371 $form->setValuesByPost();
372 $tpl->setContent($form->getHtml());
390 if ($form->checkInput()) {
391 $this->profile->setTitle($form->getInput(
"title"));
392 $this->profile->setDescription($form->getInput(
"description"));
393 $this->profile->update();
396 $ilCtrl->redirect($this,
"listProfiles");
398 $form->setValuesByPost();
399 $tpl->setContent($form->getHtml());
412 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
414 $ilCtrl->redirect($this,
"listProfiles");
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");
426 $tpl->setContent($cgui->getHTML());
443 if (is_array(
$_POST[
"id"])) {
451 $ilCtrl->redirect($this,
"listProfiles");
474 $ilToolbar->addButton(
475 $lng->txt(
"skmg_assign_level"),
476 $ilCtrl->getLinkTarget($this,
"assignLevel")
486 $tpl->setContent($tab->getHTML());
497 $tabs->clearTargets();
498 $tabs->setBackTarget(
499 $lng->txt(
"back_to_course"),
500 $ctrl->getLinkTargetByClass(
"ilcontskilladmingui",
"listProfiles")
505 $lng->txt(
"skmg_assign_level"),
506 $ctrl->getLinkTarget($this,
"assignLevel")
512 "showLevelsWithLocalContext",
516 $tpl->setContent($tab->getHTML());
530 $tpl->setTitle(
$lng->txt(
"skmg_profile") .
": " .
531 $this->profile->getTitle());
532 $tpl->setDescription(
"");
538 $ilTabs->clearTargets();
540 $ilTabs->setBackTarget(
542 $ilCtrl->getLinkTarget($this,
"showLevelsWithLocalContext")
545 $ilTabs->setBackTarget(
547 $ilCtrl->getLinkTarget($this,
"showLevels")
552 $exp =
new ilSkillSelectorGUI($this,
"assignLevel", $this,
"assignLevelSelectSkill",
"cskill_id");
553 if (!$exp->handleCommand()) {
554 $tpl->setContent($exp->getHTML());
569 $ilCtrl->saveParameter($this,
"cskill_id");
571 $tpl->setTitle(
$lng->txt(
"skmg_profile") .
": " .
572 $this->profile->getTitle());
573 $tpl->setDescription(
"");
575 $ilTabs->clearTargets();
577 $ilTabs->setBackTarget(
579 $ilCtrl->getLinkTarget($this,
"showLevelsWithLocalContext")
582 $ilTabs->setBackTarget(
584 $ilCtrl->getLinkTarget($this,
"showLevels")
590 "assignLevelSelectSkill",
593 $tpl->setContent($tab->getHTML());
610 $parts = explode(
":",
$_GET[
"cskill_id"]);
612 $this->profile->addSkillLevel(
615 (
int)
$_GET[
"level_id"],
616 (
int) $this->profile->getMaxLevelOrderNr() + 10
618 $this->profile->update();
620 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
622 $ilCtrl->redirect($this,
"showLevelsWithLocalContext");
624 $ilCtrl->redirect($this,
"showLevels");
639 $tabs->clearTargets();
644 if (!is_array(
$_POST[
"ass_id"]) || count(
$_POST[
"ass_id"]) == 0) {
647 $ilCtrl->redirect($this,
"showLevelsWithLocalContext");
649 $ilCtrl->redirect($this,
"showLevels");
652 $cgui->setFormAction($ilCtrl->getFormAction($this));
653 $cgui->setHeaderText(
$lng->txt(
"skmg_confirm_remove_level_ass"));
655 $cgui->setCancel(
$lng->txt(
"cancel"),
"showLevelsWithLocalContext");
657 $cgui->setCancel(
$lng->txt(
"cancel"),
"showLevels");
659 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeLevelAssignments");
662 $id_arr = explode(
":",
$i);
671 $tpl->setContent($cgui->getHTML());
690 if (is_array(
$_POST[
"ass_id"])) {
692 $id_arr = explode(
":",
$i);
693 $this->profile->removeSkillLevel($id_arr[0], $id_arr[1], $id_arr[2], $id_arr[3]);
695 $this->profile->update();
696 $this->profile->fixSkillOrderNumbering();
700 $ilCtrl->redirect($this,
"showLevelsWithLocalContext");
702 $ilCtrl->redirect($this,
"showLevels");
719 $this->profile->updateSkillOrder($order);
721 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
723 $ilCtrl->redirect($this,
"showLevelsWithLocalContext");
725 $ilCtrl->redirect($this,
"showLevels");
743 'auto_complete_name' =>
$lng->txt(
'user'),
744 'submit_name' =>
$lng->txt(
'skmg_assign_user')
748 $ilToolbar->addSeparator();
751 $button->setCaption(
"skmg_add_assignment");
752 $button->setUrl($this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
753 $ilToolbar->addButtonInstance($button);
764 $tpl->setContent($tab->getHTML());
785 $this->profile->addUserToProfile($user_id);
786 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
791 if (is_array($users)) {
792 foreach ($users as $id) {
794 $this->profile->addUserToProfile($id);
797 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
800 $ilCtrl->redirect($this,
"showUsers");
816 foreach ($role_ids as $id) {
818 $this->profile->addRoleToProfile($id);
823 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
826 $ilCtrl->redirect($this,
"showUsers");
844 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
846 $ilCtrl->redirect($this,
"showUsers");
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");
881 $tpl->setContent($cgui->getHTML());
897 if (is_array(
$_POST[
"id"])) {
902 $this->profile->removeUserFromProfile((
int)
$i);
906 $this->profile->removeRoleFromProfile((
int)
$i);
913 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
915 $ilCtrl->redirect($this,
"showUsers");
928 $objects = $usage_info->getAssignedObjectsForSkillProfile($this->profile->getId());
935 $tpl->setContent($tab->getHTML());
953 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
955 $ilCtrl->redirect($this,
"");
959 $conf = $exp->getConfig(
"Services/Skill");
961 $conf->setSelectedProfiles(
$_POST[
"id"]);
968 $ilCtrl->redirectByClass(array(
"iladministrationgui",
"ilobjskillmanagementgui",
"ilexportgui"),
"");
993 $fi->setSuffixes(array(
"zip"));
994 $fi->setRequired(
true);
998 $form->addCommandButton(
"importProfiles",
$lng->txt(
"import"));
999 $form->addCommandButton(
"",
$lng->txt(
"cancel"));
1001 $form->setTitle(
$lng->txt(
"import"));
1002 $form->setFormAction($ilCtrl->getFormAction($this));
1017 if ($form->checkInput()) {
1019 $imp->importEntity($_FILES[
"import_file"][
"tmp_name"], $_FILES[
"import_file"][
"name"],
"skmg",
"Services/Skill");
1021 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
1022 $ilCtrl->redirect($this,
"");
1024 $form->setValuesByPost();
1025 $tpl->setContent($form->getHtml());
An exception for terminatinating execution or to throw for unit testing.
static lookupLevelTitle(int $a_id)
Confirmation screen class.
static _lookupId($a_user_str)
Lookup id by login.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static _lookupType($a_id, $a_reference=false)
lookup object type
static getDefaultMemberRole($a_ref_id)
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
TableGUI class for assigned objects of skills.
TableGUI class for skill profile skill level assignment.
confirmLevelAssignmentRemoval()
Confirm level assignment removal.
removeUsers()
Remove users.
importProfiles()
Import profiles.
assignLevel()
Assign Level.
deleteProfiles()
Delete profiles.
executeCommand()
Execute command.
showLevelsWithLocalContext()
showImportForm()
Show import form.
assignRole(array $role_ids)
Assign role.
initInputForm()
Init input form.
assignLevelToProfile()
Assign level to profile.
removeLevelAssignments()
Remove level assignment.
checkPermissionBool($a_perm)
Check permission pool.
listProfiles()
List profiles.
confirmDeleteProfiles()
Confirm profile deletion.
exportProfiles()
Export profiles.
assignLevelSelectSkill()
Output level table for profile assignment.
confirmUserRemoval()
Confirm user removal.
__construct()
Constructor.
saveLevelOrder()
Save level order.
showObjects()
Show assigned objects.
showLevels()
Show skill levels.
initProfileForm($a_mode="edit")
Init profile form.
setTabs($a_active)
Set tabs.
TableGUI class for skill profile levels.
TableGUI class for skill profiles.
TableGUI class for skill profile user assignment.
static lookupTitle($a_id)
Lookup title.
Explorer class that works on tree objects (Services/Tree)
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
This class represents a text area property in a property form.
This class represents a text property in a property form.
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 stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.