5include_once(
"./Services/Skill/classes/class.ilSkillProfile.php");
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();
71 $ilAccess =
$DIC->access();
73 $ilCtrl->saveParameter($this,
"sprof_id");
74 $this->access = $ilAccess;
75 $this->ref_id = (int)
$_GET[
"ref_id"];
77 if ((
int)
$_GET[
"sprof_id"] > 0) {
78 $this->
id = (int)
$_GET[
"sprof_id"];
94 return $this->access->checkAccess($a_perm,
"", $this->ref_id);
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');
111 $user_search->setTitle(
$lng->txt(
'skmg_add_user_to_profile'));
112 $user_search->setCallback($this,
'assignUser');
113 $user_search->setRoleCallback($this,
'assignRole');
117 $ilCtrl->setReturn($this,
'showUsers');
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"))) {
148 $tpl->setTitle(
$lng->txt(
"skmg_profile") .
": " .
149 $this->profile->getTitle());
150 $tpl->setDescription(
"");
152 $ilTabs->clearTargets();
153 $ilHelp->setScreenIdComponent(
"skmg_prof");
155 $ilTabs->setBackTarget(
157 $ilCtrl->getLinkTarget($this,
"")
163 $lng->txt(
"skmg_assigned_users"),
164 $ilCtrl->getLinkTarget($this,
"showUsers")
170 $lng->txt(
"skmg_assigned_skill_levels"),
171 $ilCtrl->getLinkTarget($this,
"showLevels")
177 $lng->txt(
"settings"),
178 $ilCtrl->getLinkTarget($this,
"edit")
181 $ilTabs->activateTab($a_active);
196 $ilToolbar->addButton(
197 $lng->txt(
"skmg_add_profile"),
198 $ilCtrl->getLinkTarget($this,
"create")
201 $ilToolbar->addButton(
203 $ilCtrl->getLinkTarget($this,
"showImportForm")
207 include_once(
"./Services/Skill/classes/class.ilSkillProfileTableGUI.php");
221 $tpl->setContent($form->getHTML());
233 $tpl->setContent($form->getHTML());
247 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
252 $ti->setMaxLength(200);
254 $ti->setRequired(
true);
261 $form->addItem($desc);
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"));
271 $ti->setValue($this->profile->getTitle());
272 $desc->setValue($this->profile->getDescription());
274 $form->addCommandButton(
"update",
$lng->txt(
"save"));
275 $form->addCommandButton(
"listProfiles",
$lng->txt(
"cancel"));
276 $form->setTitle(
$lng->txt(
"skmg_edit_profile"));
280 $form->setFormAction(
$ilCtrl->getFormAction($this));
299 if ($form->checkInput()) {
301 $prof->setTitle($form->getInput(
"title"));
302 $prof->setDescription($form->getInput(
"description"));
304 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
305 $ilCtrl->redirect($this,
"listProfiles");
307 $form->setValuesByPost();
308 $tpl->setContent($form->getHtml());
326 if ($form->checkInput()) {
327 $this->profile->setTitle($form->getInput(
"title"));
328 $this->profile->setDescription($form->getInput(
"description"));
329 $this->profile->update();
332 $ilCtrl->redirect($this,
"listProfiles");
334 $form->setValuesByPost();
335 $tpl->setContent($form->getHtml());
348 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
350 $ilCtrl->redirect($this,
"listProfiles");
352 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
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");
363 $tpl->setContent($cgui->getHTML());
380 if (is_array(
$_POST[
"id"])) {
388 $ilCtrl->redirect($this,
"listProfiles");
411 $ilToolbar->addButton(
412 $lng->txt(
"skmg_assign_level"),
413 $ilCtrl->getLinkTarget($this,
"assignLevel")
417 include_once(
"./Services/Skill/classes/class.ilSkillProfileLevelsTableGUI.php");
437 $tpl->setTitle(
$lng->txt(
"skmg_profile") .
": " .
438 $this->profile->getTitle());
439 $tpl->setDescription(
"");
445 $ilTabs->clearTargets();
446 $ilTabs->setBackTarget(
448 $ilCtrl->getLinkTarget($this,
"showLevels")
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());
468 $ilCtrl->saveParameter($this,
"cskill_id");
470 $tpl->setTitle(
$lng->txt(
"skmg_profile") .
": " .
471 $this->profile->getTitle());
472 $tpl->setDescription(
"");
474 $ilTabs->clearTargets();
475 $ilTabs->setBackTarget(
477 $ilCtrl->getLinkTarget($this,
"showLevels")
480 include_once(
"./Services/Skill/classes/class.ilSkillLevelProfileAssignmentTableGUI.php");
483 "assignLevelSelectSkill",
502 $parts = explode(
":",
$_GET[
"cskill_id"]);
504 $this->profile->addSkillLevel(
507 (
int)
$_GET[
"level_id"]
509 $this->profile->update();
511 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
512 $ilCtrl->redirect($this,
"showLevels");
526 if (!is_array(
$_POST[
"ass_id"]) || count(
$_POST[
"ass_id"]) == 0) {
528 $ilCtrl->redirect($this,
"showLevels");
530 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
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");
537 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
539 $id_arr = explode(
":",
$i);
548 $tpl->setContent($cgui->getHTML());
566 if (is_array(
$_POST[
"ass_id"])) {
568 $id_arr = explode(
":",
$i);
569 $this->profile->removeSkillLevel($id_arr[0], $id_arr[1], $id_arr[2]);
571 $this->profile->update();
574 $ilCtrl->redirect($this,
"showLevels");
588 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
593 'auto_complete_name' =>
$lng->txt(
'user'),
594 'submit_name' =>
$lng->txt(
'skmg_assign_user')
599 $ilToolbar->addSeparator();
602 $button->setCaption(
"skmg_add_assignment");
603 $button->setUrl($this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
604 $ilToolbar->addButtonInstance($button);
608 include_once(
"./Services/Skill/classes/class.ilSkillProfileUserTableGUI.php");
636 $this->profile->addUserToProfile($user_id);
637 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
642 if (is_array($users)) {
643 foreach ($users as $id) {
645 $this->profile->addUserToProfile($id);
648 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
651 $ilCtrl->redirect($this,
"showUsers");
667 foreach ($role_ids as $id) {
669 $this->profile->addRoleToProfile($id);
674 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
677 $ilCtrl->redirect($this,
"showUsers");
695 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
697 $ilCtrl->redirect($this,
"showUsers");
699 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
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");
733 $tpl->setContent($cgui->getHTML());
749 if (is_array(
$_POST[
"id"])) {
754 $this->profile->removeUserFromProfile((
int)
$i);
758 $this->profile->removeRoleFromProfile((
int)
$i);
765 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
767 $ilCtrl->redirect($this,
"showUsers");
780 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
784 include_once(
"./Services/Export/classes/class.ilExport.php");
786 $conf = $exp->getConfig(
"Services/Skill");
788 $conf->setSelectedProfiles(
$_POST[
"id"]);
795 $ilCtrl->redirectByClass(array(
"iladministrationgui",
"ilobjskillmanagementgui",
"ilexportgui"),
"");
817 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
820 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
822 $fi->setSuffixes(array(
"zip"));
823 $fi->setRequired(
true);
827 $form->addCommandButton(
"importProfiles",
$lng->txt(
"import"));
828 $form->addCommandButton(
"",
$lng->txt(
"cancel"));
830 $form->setTitle(
$lng->txt(
"import"));
831 $form->setFormAction(
$ilCtrl->getFormAction($this));
847 if ($form->checkInput()) {
848 include_once(
"./Services/Export/classes/class.ilImport.php");
850 $imp->importEntity($_FILES[
"import_file"][
"tmp_name"], $_FILES[
"import_file"][
"name"],
"skmg",
"Services/Skill");
852 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
855 $form->setValuesByPost();
856 $tpl->setContent($form->getHtml());
An exception for terminatinating execution or to throw for unit testing.
static lookupLevelTitle($a_id)
Lookup level title.
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 fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
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.
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.
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.