5 include_once(
"./Services/Skill/classes/class.ilSkillProfile.php");
26 $ilCtrl->saveParameter($this,
"sprof_id");
28 if ((
int)
$_GET[
"sprof_id"] > 0)
30 $this->
id = (int)
$_GET[
"sprof_id"];
46 $cmd = $ilCtrl->getCmd(
"listProfiles");
47 $next_class = $ilCtrl->getNextClass();
50 case 'ilrepositorysearchgui':
51 include_once(
'./Services/Search/classes/class.ilRepositorySearchGUI.php');
53 $user_search->setTitle($lng->txt(
'skmg_add_user_to_profile'));
54 $user_search->setCallback($this,
'assignUser');
58 $ilCtrl->setReturn($this,
'listUsers');
59 $ret = $ilCtrl->forwardCommand($user_search);
63 if (in_array(
$cmd, array(
"listProfiles",
"create",
"edit",
"save",
"update",
64 "confirmDeleteProfiles",
"deleteProfiles",
"showLevels",
"assignLevel",
65 "assignLevelSelectSkill",
"assignLevelToProfile",
66 "confirmLevelAssignmentRemoval",
"removeLevelAssignments",
67 "showUsers",
"assignUser",
68 "confirmUserRemoval",
"removeUsers")))
86 $tpl->setTitle($lng->txt(
"skmg_profile").
": ".
87 $this->profile->getTitle());
88 $tpl->setDescription(
"");
90 $ilTabs->clearTargets();
91 $ilHelp->setScreenIdComponent(
"skmg_prof");
93 $ilTabs->setBackTarget($lng->txt(
"back"),
94 $ilCtrl->getLinkTarget($this,
""));
97 $ilTabs->addTab(
"users",
98 $lng->txt(
"skmg_assigned_users"),
99 $ilCtrl->getLinkTarget($this,
"showUsers"));
102 $ilTabs->addTab(
"levels",
103 $lng->txt(
"skmg_assigned_skill_levels"),
104 $ilCtrl->getLinkTarget($this,
"showLevels"));
107 $ilTabs->addTab(
"settings",
108 $lng->txt(
"settings"),
109 $ilCtrl->getLinkTarget($this,
"edit"));
111 $ilTabs->activateTab($a_active);
122 $ilToolbar->addButton($lng->txt(
"skmg_add_profile"),
123 $ilCtrl->getLinkTarget($this,
"create"));
125 include_once(
"./Services/Skill/classes/class.ilSkillProfileTableGUI.php");
128 $tpl->setContent(
$tab->getHTML());
139 $tpl->setContent($form->getHTML());
151 $tpl->setContent($form->getHTML());
164 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
171 $ti->setRequired(
true);
178 $form->addItem($desc);
181 if ($a_mode ==
"create")
183 $form->addCommandButton(
"save", $lng->txt(
"save"));
184 $form->addCommandButton(
"listProfiles", $lng->txt(
"cancel"));
185 $form->setTitle($lng->txt(
"skmg_add_profile"));
190 $ti->setValue($this->profile->getTitle());
191 $desc->setValue($this->profile->getDescription());
193 $form->addCommandButton(
"update", $lng->txt(
"save"));
194 $form->addCommandButton(
"listProfiles", $lng->txt(
"cancel"));
195 $form->setTitle($lng->txt(
"skmg_edit_profile"));
198 $form->setFormAction($ilCtrl->getFormAction($this));
211 if ($form->checkInput())
214 $prof->setTitle($form->getInput(
"title"));
215 $prof->setDescription($form->getInput(
"description"));
218 $ilCtrl->redirect($this,
"listProfiles");
222 $form->setValuesByPost();
223 $tpl->setContent($form->getHtml());
235 if ($form->checkInput())
237 $this->profile->setTitle($form->getInput(
"title"));
238 $this->profile->setDescription($form->getInput(
"description"));
239 $this->profile->update();
242 $ilCtrl->redirect($this,
"listProfiles");
246 $form->setValuesByPost();
247 $tpl->setContent($form->getHtml());
258 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0)
261 $ilCtrl->redirect($this,
"listProfiles");
265 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
267 $cgui->setFormAction($ilCtrl->getFormAction($this));
268 $cgui->setHeaderText($lng->txt(
"skmg_delete_profiles"));
269 $cgui->setCancel($lng->txt(
"cancel"),
"listProfiles");
270 $cgui->setConfirm($lng->txt(
"delete"),
"deleteProfiles");
272 foreach (
$_POST[
"id"] as $i)
277 $tpl->setContent($cgui->getHTML());
288 if (is_array(
$_POST[
"id"]))
290 foreach (
$_POST[
"id"] as $i)
298 $ilCtrl->redirect($this,
"listProfiles");
317 $ilToolbar->addButton($lng->txt(
"skmg_assign_level"),
318 $ilCtrl->getLinkTarget($this,
"assignLevel")
321 include_once(
"./Services/Skill/classes/class.ilSkillProfileLevelsTableGUI.php");
323 $tpl->setContent(
$tab->getHTML());
333 $tpl->setTitle($lng->txt(
"skmg_profile").
": ".
334 $this->profile->getTitle());
335 $tpl->setDescription(
"");
341 $ilTabs->clearTargets();
342 $ilTabs->setBackTarget($lng->txt(
"back"),
343 $ilCtrl->getLinkTarget($this,
"showLevels"));
345 include_once(
"./Services/Skill/classes/class.ilSkillSelectorGUI.php");
346 $exp =
new ilSkillSelectorGUI($this,
"assignLevel", $this,
"assignLevelSelectSkill",
"cskill_id");
347 if (!$exp->handleCommand())
349 $tpl->setContent($exp->getHTML());
360 $ilCtrl->saveParameter($this,
"cskill_id");
362 $tpl->setTitle($lng->txt(
"skmg_profile").
": ".
363 $this->profile->getTitle());
364 $tpl->setDescription(
"");
366 $ilTabs->clearTargets();
367 $ilTabs->setBackTarget($lng->txt(
"back"),
368 $ilCtrl->getLinkTarget($this,
"showLevels"));
370 include_once(
"./Services/Skill/classes/class.ilSkillLevelProfileAssignmentTableGUI.php");
373 $tpl->setContent(
$tab->getHTML());
383 $parts = explode(
":",
$_GET[
"cskill_id"]);
385 $this->profile->addSkillLevel((
int) $parts[0],
386 (
int) $parts[1], (
int)
$_GET[
"level_id"]);
387 $this->profile->update();
390 $ilCtrl->redirect($this,
"showLevels");
402 if (!is_array(
$_POST[
"ass_id"]) || count(
$_POST[
"ass_id"]) == 0)
405 $ilCtrl->redirect($this,
"showLevels");
409 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
411 $cgui->setFormAction($ilCtrl->getFormAction($this));
412 $cgui->setHeaderText($lng->txt(
"skmg_confirm_remove_level_ass"));
413 $cgui->setCancel($lng->txt(
"cancel"),
"showLevels");
414 $cgui->setConfirm($lng->txt(
"remove"),
"removeLevelAssignments");
416 include_once(
"./Services/Skill/classes/class.ilBasicSkill.php");
417 foreach (
$_POST[
"ass_id"] as $i)
419 $id_arr = explode(
":", $i);
420 $cgui->addItem(
"ass_id[]", $i,
425 $tpl->setContent($cgui->getHTML());
439 if (is_array(
$_POST[
"ass_id"]))
441 foreach (
$_POST[
"ass_id"] as $i)
443 $id_arr = explode(
":", $i);
444 $this->profile->removeSkillLevel($id_arr[0], $id_arr[1], $id_arr[2]);
446 $this->profile->update();
449 $ilCtrl->redirect($this,
"showLevels");
460 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
465 'auto_complete_name' => $lng->txt(
'user'),
466 'submit_name' => $lng->txt(
'skmg_assign_user')
472 include_once(
"./Services/Skill/classes/class.ilSkillProfileUserTableGUI.php");
475 $tpl->setContent(
$tab->getHTML());
491 $this->profile->addUserToProfile($user_id);
495 $ilCtrl->redirect($this,
"showUsers");
507 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0)
510 $ilCtrl->redirect($this,
"showUsers");
514 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
516 $cgui->setFormAction($ilCtrl->getFormAction($this));
517 $cgui->setHeaderText($lng->txt(
"skmg_confirm_user_removal"));
518 $cgui->setCancel($lng->txt(
"cancel"),
"showUsers");
519 $cgui->setConfirm($lng->txt(
"remove"),
"removeUsers");
521 foreach (
$_POST[
"id"] as $i)
524 $cgui->addItem(
"id[]", $i,
525 $name[
"lastname"].
", ".$name[
"firstname"].
526 " [".$name[
"login"].
"]");
529 $tpl->setContent($cgui->getHTML());
540 if (is_array(
$_POST[
"id"]))
542 foreach (
$_POST[
"id"] as $i)
544 $this->profile->removeUserFromProfile((
int) $i);
548 $ilCtrl->redirect($this,
"showUsers");