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');
116 $ilCtrl->setReturn($this,
'listUsers');
121 if (in_array($cmd, array(
"listProfiles",
"create",
"edit",
"save",
"update",
122 "confirmDeleteProfiles",
"deleteProfiles",
"showLevels",
"assignLevel",
123 "assignLevelSelectSkill",
"assignLevelToProfile",
124 "confirmLevelAssignmentRemoval",
"removeLevelAssignments",
125 "showUsers",
"assignUser",
126 "confirmUserRemoval",
"removeUsers",
"exportProfiles",
"showImportForm",
"importProfiles"))) {
147 $tpl->setTitle(
$lng->txt(
"skmg_profile") .
": " .
148 $this->profile->getTitle());
149 $tpl->setDescription(
"");
151 $ilTabs->clearTargets();
152 $ilHelp->setScreenIdComponent(
"skmg_prof");
154 $ilTabs->setBackTarget(
156 $ilCtrl->getLinkTarget($this,
"")
162 $lng->txt(
"skmg_assigned_users"),
163 $ilCtrl->getLinkTarget($this,
"showUsers")
169 $lng->txt(
"skmg_assigned_skill_levels"),
170 $ilCtrl->getLinkTarget($this,
"showLevels")
176 $lng->txt(
"settings"),
177 $ilCtrl->getLinkTarget($this,
"edit")
180 $ilTabs->activateTab($a_active);
195 $ilToolbar->addButton(
196 $lng->txt(
"skmg_add_profile"),
197 $ilCtrl->getLinkTarget($this,
"create")
200 $ilToolbar->addButton(
202 $ilCtrl->getLinkTarget($this,
"showImportForm")
206 include_once(
"./Services/Skill/classes/class.ilSkillProfileTableGUI.php");
246 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
251 $ti->setMaxLength(200);
253 $ti->setRequired(
true);
260 $form->addItem($desc);
264 if ($a_mode ==
"create") {
265 $form->addCommandButton(
"save",
$lng->txt(
"save"));
266 $form->addCommandButton(
"listProfiles",
$lng->txt(
"cancel"));
267 $form->setTitle(
$lng->txt(
"skmg_add_profile"));
270 $ti->setValue($this->profile->getTitle());
271 $desc->setValue($this->profile->getDescription());
273 $form->addCommandButton(
"update",
$lng->txt(
"save"));
274 $form->addCommandButton(
"listProfiles",
$lng->txt(
"cancel"));
275 $form->setTitle(
$lng->txt(
"skmg_edit_profile"));
298 if (
$form->checkInput()) {
300 $prof->setTitle(
$form->getInput(
"title"));
301 $prof->setDescription(
$form->getInput(
"description"));
303 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
304 $ilCtrl->redirect($this,
"listProfiles");
306 $form->setValuesByPost();
325 if (
$form->checkInput()) {
326 $this->profile->setTitle(
$form->getInput(
"title"));
327 $this->profile->setDescription(
$form->getInput(
"description"));
328 $this->profile->update();
331 $ilCtrl->redirect($this,
"listProfiles");
333 $form->setValuesByPost();
347 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
349 $ilCtrl->redirect($this,
"listProfiles");
351 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
353 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
354 $cgui->setHeaderText(
$lng->txt(
"skmg_delete_profiles"));
355 $cgui->setCancel(
$lng->txt(
"cancel"),
"listProfiles");
356 $cgui->setConfirm(
$lng->txt(
"delete"),
"deleteProfiles");
362 $tpl->setContent($cgui->getHTML());
379 if (is_array(
$_POST[
"id"])) {
387 $ilCtrl->redirect($this,
"listProfiles");
410 $ilToolbar->addButton(
411 $lng->txt(
"skmg_assign_level"),
412 $ilCtrl->getLinkTarget($this,
"assignLevel")
416 include_once(
"./Services/Skill/classes/class.ilSkillProfileLevelsTableGUI.php");
436 $tpl->setTitle(
$lng->txt(
"skmg_profile") .
": " .
437 $this->profile->getTitle());
438 $tpl->setDescription(
"");
444 $ilTabs->clearTargets();
445 $ilTabs->setBackTarget(
447 $ilCtrl->getLinkTarget($this,
"showLevels")
450 include_once(
"./Services/Skill/classes/class.ilSkillSelectorGUI.php");
451 $exp =
new ilSkillSelectorGUI($this,
"assignLevel", $this,
"assignLevelSelectSkill",
"cskill_id");
452 if (!$exp->handleCommand()) {
453 $tpl->setContent($exp->getHTML());
467 $ilCtrl->saveParameter($this,
"cskill_id");
469 $tpl->setTitle(
$lng->txt(
"skmg_profile") .
": " .
470 $this->profile->getTitle());
471 $tpl->setDescription(
"");
473 $ilTabs->clearTargets();
474 $ilTabs->setBackTarget(
476 $ilCtrl->getLinkTarget($this,
"showLevels")
479 include_once(
"./Services/Skill/classes/class.ilSkillLevelProfileAssignmentTableGUI.php");
482 "assignLevelSelectSkill",
501 $parts = explode(
":",
$_GET[
"cskill_id"]);
503 $this->profile->addSkillLevel(
506 (
int)
$_GET[
"level_id"]
508 $this->profile->update();
510 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
511 $ilCtrl->redirect($this,
"showLevels");
525 if (!is_array(
$_POST[
"ass_id"]) || count(
$_POST[
"ass_id"]) == 0) {
527 $ilCtrl->redirect($this,
"showLevels");
529 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
531 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
532 $cgui->setHeaderText(
$lng->txt(
"skmg_confirm_remove_level_ass"));
533 $cgui->setCancel(
$lng->txt(
"cancel"),
"showLevels");
534 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeLevelAssignments");
536 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
538 $id_arr = explode(
":",
$i);
547 $tpl->setContent($cgui->getHTML());
565 if (is_array(
$_POST[
"ass_id"])) {
567 $id_arr = explode(
":",
$i);
568 $this->profile->removeSkillLevel($id_arr[0], $id_arr[1], $id_arr[2]);
570 $this->profile->update();
573 $ilCtrl->redirect($this,
"showLevels");
587 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
592 'auto_complete_name' =>
$lng->txt(
'user'),
593 'submit_name' =>
$lng->txt(
'skmg_assign_user')
600 include_once(
"./Services/Skill/classes/class.ilSkillProfileUserTableGUI.php");
627 $this->profile->addUserToProfile($user_id);
628 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
631 $ilCtrl->redirect($this,
"showUsers");
649 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
651 $ilCtrl->redirect($this,
"showUsers");
653 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
655 $cgui->setFormAction(
$ilCtrl->getFormAction($this));
656 $cgui->setHeaderText(
$lng->txt(
"skmg_confirm_user_removal"));
657 $cgui->setCancel(
$lng->txt(
"cancel"),
"showUsers");
658 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeUsers");
665 $name[
"lastname"] .
", " .
$name[
"firstname"] .
666 " [" .
$name[
"login"] .
"]"
670 $tpl->setContent($cgui->getHTML());
686 if (is_array(
$_POST[
"id"])) {
688 $this->profile->removeUserFromProfile((
int)
$i);
690 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
692 $ilCtrl->redirect($this,
"showUsers");
705 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
709 include_once(
"./Services/Export/classes/class.ilExport.php");
711 $conf = $exp->getConfig(
"Services/Skill");
713 $conf->setSelectedProfiles(
$_POST[
"id"]);
720 $ilCtrl->redirectByClass(array(
"iladministrationgui",
"ilobjskillmanagementgui",
"ilexportgui"),
"");
742 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
745 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
747 $fi->setSuffixes(array(
"zip"));
748 $fi->setRequired(
true);
752 $form->addCommandButton(
"importProfiles",
$lng->txt(
"import"));
753 $form->addCommandButton(
"",
$lng->txt(
"cancel"));
772 if (
$form->checkInput()) {
773 include_once(
"./Services/Export/classes/class.ilImport.php");
775 $imp->importEntity($_FILES[
"import_file"][
"tmp_name"], $_FILES[
"import_file"][
"name"],
"skmg",
"Services/Skill");
777 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
780 $form->setValuesByPost();
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 _lookupName($a_user_id)
lookup user name
static _lookupObjId($a_id)
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.
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 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.
if(isset($_POST['submit'])) $form