5 include_once(
"./Services/Skill/classes/class.ilSkillProfile.php");
34 $ilCtrl->saveParameter($this,
"sprof_id");
35 $this->access = $ilAccess;
36 $this->ref_id = (int)
$_GET[
"ref_id"];
38 if ((
int)
$_GET[
"sprof_id"] > 0)
40 $this->
id = (int)
$_GET[
"sprof_id"];
57 return $this->access->checkAccess($a_perm,
"", $this->ref_id);
67 $cmd = $ilCtrl->getCmd(
"listProfiles");
68 $next_class = $ilCtrl->getNextClass();
71 case 'ilrepositorysearchgui':
72 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
74 $user_search->setTitle($lng->txt(
'skmg_add_user_to_profile'));
75 $user_search->setCallback($this,
'assignUser');
79 $ilCtrl->setReturn($this,
'listUsers');
80 $ret = $ilCtrl->forwardCommand($user_search);
84 if (in_array(
$cmd,
array(
"listProfiles",
"create",
"edit",
"save",
"update",
85 "confirmDeleteProfiles",
"deleteProfiles",
"showLevels",
"assignLevel",
86 "assignLevelSelectSkill",
"assignLevelToProfile",
87 "confirmLevelAssignmentRemoval",
"removeLevelAssignments",
88 "showUsers",
"assignUser",
89 "confirmUserRemoval",
"removeUsers",
"exportProfiles",
"showImportForm",
"importProfiles")))
107 $tpl->setTitle($lng->txt(
"skmg_profile").
": ".
108 $this->profile->getTitle());
109 $tpl->setDescription(
"");
111 $ilTabs->clearTargets();
112 $ilHelp->setScreenIdComponent(
"skmg_prof");
114 $ilTabs->setBackTarget($lng->txt(
"back"),
115 $ilCtrl->getLinkTarget($this,
""));
118 $ilTabs->addTab(
"users",
119 $lng->txt(
"skmg_assigned_users"),
120 $ilCtrl->getLinkTarget($this,
"showUsers"));
123 $ilTabs->addTab(
"levels",
124 $lng->txt(
"skmg_assigned_skill_levels"),
125 $ilCtrl->getLinkTarget($this,
"showLevels"));
128 $ilTabs->addTab(
"settings",
129 $lng->txt(
"settings"),
130 $ilCtrl->getLinkTarget($this,
"edit"));
132 $ilTabs->activateTab($a_active);
145 $ilToolbar->addButton($lng->txt(
"skmg_add_profile"),
146 $ilCtrl->getLinkTarget($this,
"create"));
148 $ilToolbar->addButton($lng->txt(
"import"),
149 $ilCtrl->getLinkTarget($this,
"showImportForm"));
152 include_once(
"./Services/Skill/classes/class.ilSkillProfileTableGUI.php");
155 $tpl->setContent(
$tab->getHTML());
166 $tpl->setContent($form->getHTML());
178 $tpl->setContent($form->getHTML());
191 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
198 $ti->setRequired(
true);
205 $form->addItem($desc);
210 if ($a_mode ==
"create")
212 $form->addCommandButton(
"save", $lng->txt(
"save"));
213 $form->addCommandButton(
"listProfiles", $lng->txt(
"cancel"));
214 $form->setTitle($lng->txt(
"skmg_add_profile"));
218 $ti->setValue($this->profile->getTitle());
219 $desc->setValue($this->profile->getDescription());
221 $form->addCommandButton(
"update", $lng->txt(
"save"));
222 $form->addCommandButton(
"listProfiles", $lng->txt(
"cancel"));
223 $form->setTitle($lng->txt(
"skmg_edit_profile"));
227 $form->setFormAction($ilCtrl->getFormAction($this));
245 if ($form->checkInput())
248 $prof->setTitle($form->getInput(
"title"));
249 $prof->setDescription($form->getInput(
"description"));
252 $ilCtrl->redirect($this,
"listProfiles");
256 $form->setValuesByPost();
257 $tpl->setContent($form->getHtml());
274 if ($form->checkInput())
276 $this->profile->setTitle($form->getInput(
"title"));
277 $this->profile->setDescription($form->getInput(
"description"));
278 $this->profile->update();
281 $ilCtrl->redirect($this,
"listProfiles");
285 $form->setValuesByPost();
286 $tpl->setContent($form->getHtml());
297 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0)
300 $ilCtrl->redirect($this,
"listProfiles");
304 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
306 $cgui->setFormAction($ilCtrl->getFormAction($this));
307 $cgui->setHeaderText($lng->txt(
"skmg_delete_profiles"));
308 $cgui->setCancel($lng->txt(
"cancel"),
"listProfiles");
309 $cgui->setConfirm($lng->txt(
"delete"),
"deleteProfiles");
311 foreach (
$_POST[
"id"] as $i)
316 $tpl->setContent($cgui->getHTML());
332 if (is_array(
$_POST[
"id"]))
334 foreach (
$_POST[
"id"] as $i)
342 $ilCtrl->redirect($this,
"listProfiles");
363 $ilToolbar->addButton($lng->txt(
"skmg_assign_level"),
364 $ilCtrl->getLinkTarget($this,
"assignLevel")
368 include_once(
"./Services/Skill/classes/class.ilSkillProfileLevelsTableGUI.php");
370 $tpl->setContent(
$tab->getHTML());
380 $tpl->setTitle($lng->txt(
"skmg_profile").
": ".
381 $this->profile->getTitle());
382 $tpl->setDescription(
"");
388 $ilTabs->clearTargets();
389 $ilTabs->setBackTarget($lng->txt(
"back"),
390 $ilCtrl->getLinkTarget($this,
"showLevels"));
392 include_once(
"./Services/Skill/classes/class.ilSkillSelectorGUI.php");
393 $exp =
new ilSkillSelectorGUI($this,
"assignLevel", $this,
"assignLevelSelectSkill",
"cskill_id");
394 if (!$exp->handleCommand())
396 $tpl->setContent($exp->getHTML());
407 $ilCtrl->saveParameter($this,
"cskill_id");
409 $tpl->setTitle($lng->txt(
"skmg_profile").
": ".
410 $this->profile->getTitle());
411 $tpl->setDescription(
"");
413 $ilTabs->clearTargets();
414 $ilTabs->setBackTarget($lng->txt(
"back"),
415 $ilCtrl->getLinkTarget($this,
"showLevels"));
417 include_once(
"./Services/Skill/classes/class.ilSkillLevelProfileAssignmentTableGUI.php");
420 $tpl->setContent(
$tab->getHTML());
436 $parts = explode(
":",
$_GET[
"cskill_id"]);
438 $this->profile->addSkillLevel((
int) $parts[0],
439 (
int) $parts[1], (
int)
$_GET[
"level_id"]);
440 $this->profile->update();
443 $ilCtrl->redirect($this,
"showLevels");
455 if (!is_array(
$_POST[
"ass_id"]) || count(
$_POST[
"ass_id"]) == 0)
458 $ilCtrl->redirect($this,
"showLevels");
462 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
464 $cgui->setFormAction($ilCtrl->getFormAction($this));
465 $cgui->setHeaderText($lng->txt(
"skmg_confirm_remove_level_ass"));
466 $cgui->setCancel($lng->txt(
"cancel"),
"showLevels");
467 $cgui->setConfirm($lng->txt(
"remove"),
"removeLevelAssignments");
469 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
470 foreach (
$_POST[
"ass_id"] as $i)
472 $id_arr = explode(
":", $i);
473 $cgui->addItem(
"ass_id[]", $i,
478 $tpl->setContent($cgui->getHTML());
497 if (is_array(
$_POST[
"ass_id"]))
499 foreach (
$_POST[
"ass_id"] as $i)
501 $id_arr = explode(
":", $i);
502 $this->profile->removeSkillLevel($id_arr[0], $id_arr[1], $id_arr[2]);
504 $this->profile->update();
507 $ilCtrl->redirect($this,
"showLevels");
518 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
523 'auto_complete_name' => $lng->txt(
'user'),
524 'submit_name' => $lng->txt(
'skmg_assign_user')
530 include_once(
"./Services/Skill/classes/class.ilSkillProfileUserTableGUI.php");
533 $tpl->setContent(
$tab->getHTML());
554 $this->profile->addUserToProfile($user_id);
558 $ilCtrl->redirect($this,
"showUsers");
575 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0)
578 $ilCtrl->redirect($this,
"showUsers");
582 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
584 $cgui->setFormAction($ilCtrl->getFormAction($this));
585 $cgui->setHeaderText($lng->txt(
"skmg_confirm_user_removal"));
586 $cgui->setCancel($lng->txt(
"cancel"),
"showUsers");
587 $cgui->setConfirm($lng->txt(
"remove"),
"removeUsers");
589 foreach (
$_POST[
"id"] as $i)
592 $cgui->addItem(
"id[]", $i,
593 $name[
"lastname"].
", ".$name[
"firstname"].
594 " [".$name[
"login"].
"]");
597 $tpl->setContent($cgui->getHTML());
613 if (is_array(
$_POST[
"id"]))
615 foreach (
$_POST[
"id"] as $i)
617 $this->profile->removeUserFromProfile((
int) $i);
621 $ilCtrl->redirect($this,
"showUsers");
634 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0)
636 $ilCtrl->redirect($this,
"");
639 include_once(
"./Services/Export/classes/class.ilExport.php");
641 $conf = $exp->getConfig(
"Services/Skill");
643 $conf->setSelectedProfiles(
$_POST[
"id"]);
650 $ilCtrl->redirectByClass(
array(
"iladministrationgui",
"ilobjskillmanagementgui",
"ilexportgui"),
"");
658 global
$tpl, $ilTabs;
670 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
673 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
674 $fi =
new ilFileInputGUI($lng->txt(
"skmg_input_file"),
"import_file");
676 $fi->setRequired(
true);
680 $form->addCommandButton(
"importProfiles", $lng->txt(
"import"));
681 $form->addCommandButton(
"", $lng->txt(
"cancel"));
683 $form->setTitle($lng->txt(
"import"));
684 $form->setFormAction($ilCtrl->getFormAction($this));
697 if ($form->checkInput())
699 include_once(
"./Services/Export/classes/class.ilImport.php");
701 $imp->importEntity($_FILES[
"import_file"][
"tmp_name"], $_FILES[
"import_file"][
"name"],
"skmg",
"Services/Skill");
704 $ilCtrl->redirect($this,
"");
708 $form->setValuesByPost();
709 $tpl->setContent($form->getHtml());
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
TableGUI class for skill profile levels.
static _lookupName($a_user_id)
lookup user name
deleteProfiles()
Delete profiles.
setTabs($a_active)
Set tabs.
checkPermissionBool($a_perm)
Check permission pool.
static lookupLevelTitle($a_id)
Lookup level title.
confirmDeleteProfiles()
Confirm profile deletion.
exportProfiles()
Export profiles.
assignLevelToProfile()
Assign level to profile.
confirmLevelAssignmentRemoval()
Confirm level assignment removal.
TableGUI class for skill profiles.
static _lookupId($a_user_str)
Lookup id by login.
removeLevelAssignments()
Remove level assignment.
TableGUI class for skill profile user assignment.
assignLevelSelectSkill()
Output level table for profile assignment.
executeCommand()
Execute command.
initProfileForm($a_mode="edit")
Init profile form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
assignLevel()
Assign Level.
static _lookupObjId($a_id)
removeUsers()
Remove users.
This class represents a text property in a property form.
setCols($a_cols)
Set Cols.
initInputForm()
Init input form.
setMaxLength($a_maxlength)
Set Max Length.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
importProfiles()
Import profiles.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
TableGUI class for skill profile skill level assignment.
confirmUserRemoval()
Confirm user removal.
Explorer class that works on tree objects (Services/Tree)
showLevels()
Show skill levels.
__construct()
Constructor.
This class represents a text area property in a property form.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
static lookupTitle($a_id)
Lookup title.
showImportForm()
Show import form.
listProfiles()
List profiles.
Confirmation screen class.