88 $this->ctrl =
$DIC->ctrl();
89 $this->tabs =
$DIC->tabs();
90 $this->lng =
$DIC->language();
91 $this->tpl =
$DIC[
"tpl"];
92 $this->toolbar =
$DIC->toolbar();
93 $this->access =
$DIC->access();
95 $this->container_gui = $a_container_gui;
96 $this->container = $a_container_gui->object;
97 $this->ref_id = $this->container->getRefId();
101 include_once(
"./Services/Container/Skills/classes/class.ilContainerSkills.php");
107 $this->user_id = (int)
$_GET[
"usr_id"];
109 $this->ctrl->saveParameter($this,
"profile_id");
110 $this->params = $this->ctrl->getParameterArray($this);
112 $this->lng->loadLanguageModule(
"skmg");
113 $this->lng->loadLanguageModule(
"error");
121 $next_class = $this->ctrl->getNextClass($this);
122 $cmd = $this->ctrl->getCmd(
"listMembers");
124 switch ($next_class) {
125 case "ilskillprofilegui":
127 $this->ctrl->setReturn($this,
"listProfiles");
128 $ret = $this->ctrl->forwardCommand($profile_gui);
132 ($this->access->checkAccess(
"write",
"", $this->ref_id) &&
133 in_array($cmd, array(
"listCompetences",
"settings",
"saveSettings",
"selectSkill",
134 "saveSelectedSkill",
"confirmRemoveSelectedSkill",
"removeSelectedSkill",
135 "listProfiles",
"saveSelectedProfile",
"confirmRemoveSelectedGlobalProfiles",
136 "removeSelectedGlobalProfiles",
"confirmRemoveSingleGlobalProfile",
"removeSingleGlobalProfile",
137 "confirmDeleteSingleLocalProfile",
"deleteSingleLocalProfile",
138 "confirmDeleteSelectedLocalProfiles",
"deleteSelectedLocalProfiles")))
140 ($this->access->checkAccess(
"grade",
"", $this->ref_id) &&
141 in_array($cmd, array(
"listMembers",
"assignCompetences",
142 "saveCompetenceAssignment",
"publishAssignments",
"deassignCompetencesConfirm",
"deassignCompetences")))
159 $tabs->activateSubTab(
"members");
162 include_once(
"./Services/Container/Skills/classes/class.ilContSkillMemberTableGUI.php");
165 $tpl->setContent($tab->getHTML());
177 $ctrl->saveParameter($this,
"usr_id");
178 $tabs->activateSubTab(
"members");
181 $tpl->setContent($form->getHTML());
193 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
196 include_once(
"./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
198 $mem_levels = $mem_skills->getSkillLevels();
203 $ne->setValue(
$name[
"lastname"] .
", " .
$name[
"firstname"] .
" [" .
$name[
"login"] .
"]");
206 if (empty($this->container_skills->getOrderedSkills())) {
207 $tpl->setOnScreenMessage(
'info',
$lng->txt(
"cont_skill_no_skills_selected"),
true);
208 $ctrl->redirect($this,
"listMembers");
211 foreach ($this->container_skills->getOrderedSkills() as $sk) {
216 "-1" => $this->lng->txt(
"cont_skill_do_not_set"),
218 foreach ($skill->getLevelData() as $l) {
219 $options[$l[
"id"]] = $l[
"title"];
222 $si->setOptions($options);
224 if (isset($mem_levels[$sk[
"skill_id"] .
":" . $sk[
"tref_id"]])) {
225 $si->setValue($mem_levels[$sk[
"skill_id"] .
":" . $sk[
"tref_id"]]);
231 $form->addCommandButton(
"saveCompetenceAssignment", $this->lng->txt(
"save"));
232 $form->addCommandButton(
"listMembers", $this->lng->txt(
"cancel"));
234 $form->setTitle($this->lng->txt(
"cont_assign_skills"));
235 $form->setFormAction($this->ctrl->getFormAction($this));
247 $skill_tree = $this->skill_tree;
249 $path = $skill_tree->getSkillTreePath($a_skill_id, $a_tref_id);
251 foreach ($path as $v) {
252 if ($v[
"type"] !=
"skrt" && !($v[
"skill_id"] == $a_skill_id && $v[
"tref_id"] == $a_tref_id)) {
253 $titles[] = $v[
"title"];
257 return implode(
" > ", $titles);
274 foreach ($this->container_skills->getSkills() as $sk) {
275 $l = $form->getInput(
"skill_" . $sk[
"skill_id"] .
"_" . $sk[
"tref_id"]);
277 $levels[$sk[
"skill_id"] .
":" . $sk[
"tref_id"]] = $l;
281 include_once(
"./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
283 $mem_skills->saveLevelForSkills($levels);
286 $mem_skills->publish($this->container->getRefId());
289 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
290 $ctrl->redirect($this,
"listMembers");
301 $user_ids =
$_POST[
"usr_id"];
302 if (!is_array(
$_POST[
"usr_id"]) &&
$_GET[
"usr_id"] > 0) {
303 $user_ids[] =
$_GET[
"usr_id"];
306 include_once(
"./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
307 $not_changed = array();
308 foreach ($user_ids as $user_id) {
310 if (!$mem_skills->publish($this->container->getRefId())) {
311 $not_changed[] = $user_id;
315 if (count($not_changed) == 0) {
316 ilUtil::sendSuccess(
$lng->txt(
"cont_skll_published"),
true);
318 $names = array_map(
function ($id) {
321 ilUtil::sendInfo(
$lng->txt(
"cont_skll_published_some_not") .
" (" . implode(
"; ", $names) .
")",
true);
325 $ctrl->redirect($this,
"listMembers");
338 $tabs->activateSubTab(
"members");
340 $user_ids =
$_POST[
"usr_id"];
341 if (!is_array(
$_POST[
"usr_id"]) &&
$_GET[
"usr_id"] > 0) {
342 $user_ids[] =
$_GET[
"usr_id"];
345 if (!is_array($user_ids) || count($user_ids) == 0) {
347 $ctrl->redirect($this,
"listMembers");
349 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
351 $cgui->setFormAction(
$ctrl->getFormAction($this));
352 $cgui->setHeaderText(
$lng->txt(
"cont_really_deassign_skills"));
353 $cgui->setCancel(
$lng->txt(
"cancel"),
"listMembers");
354 $cgui->setConfirm(
$lng->txt(
"cont_deassign_competence"),
"deassignCompetences");
356 foreach ($user_ids as
$i) {
358 $cgui->addItem(
"usr_id[]",
$i,
$name);
361 $tpl->setContent($cgui->getHTML());
373 foreach (
$_POST[
"usr_id"] as $user_id) {
374 include_once(
"./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
376 $mem_skills->removeAllSkillLevels($this->container->getRefId());
379 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
380 $ctrl->redirect($this,
"listMembers");
397 $tabs->activateSubTab(
"competences");
400 $lng->txt(
"cont_add_skill"),
401 $ctrl->getLinkTarget($this,
"selectSkill")
405 include_once(
"./Services/Container/Skills/classes/class.ilContSkillTableGUI.php");
409 $this->container_skills,
410 $this->container_global_profiles,
411 $this->container_local_profiles
414 $tpl->setContent($tab->getHTML());
425 $tabs->activateSubTab(
"competences");
428 if (!$sel->handleCommand()) {
429 $tpl->setContent($sel->getHTML());
441 $s = explode(
":", (
$_GET[
"selected_skill"]));
443 $this->container_skills->addSkill((
int) $s[0], (
int) $s[1]);
444 $this->container_skills->save();
447 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
449 $ctrl->redirect($this,
"listCompetences");
462 $tabs->activateSubTab(
"competences");
464 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
466 $ctrl->redirect($this,
"listCompetences");
468 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
470 $cgui->setFormAction(
$ctrl->getFormAction($this));
471 $cgui->setHeaderText(
$lng->txt(
"cont_really_remove_skill_from_course"));
472 $cgui->setCancel(
$lng->txt(
"cancel"),
"listCompetences");
473 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeSelectedSkill");
476 $s = explode(
":",
$i);
480 $tpl->setContent($cgui->getHTML());
492 if (is_array(
$_POST[
"id"]) && count(
$_POST[
"id"]) > 0) {
493 foreach (
$_POST[
"id"] as $id) {
494 $s = explode(
":", $id);
495 $this->container_skills->removeSkill($s[0], $s[1]);
497 $this->container_skills->save();
500 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
502 $ctrl->redirect($this,
"listCompetences");
519 $tabs->activateSubTab(
"profiles");
522 $options[0] =
$lng->txt(
"please_select");
524 $selectable_profiles = array();
526 $selected_profiles = $this->container_global_profiles->getProfiles();
527 foreach ($all_profiles as $id => $profile) {
528 if (!array_key_exists($id, $selected_profiles)) {
529 $selectable_profiles[$id] = $profile;
533 foreach ($selectable_profiles as $profile) {
534 $options[$profile[
"id"]] = $profile[
"title"];
537 if ($this->skmg_settings->getLocalAssignmentOfProfiles()) {
539 $select->setOptions($options);
540 $select->setValue(0);
541 $toolbar->addInputItem($select,
true);
544 $button->setCaption(
"cont_add_global_profile");
545 $button->setCommand(
"saveSelectedProfile");
546 $toolbar->addButtonInstance($button);
549 if ($this->skmg_settings->getLocalAssignmentOfProfiles()
550 && $this->skmg_settings->getAllowLocalProfiles()) {
554 if ($this->skmg_settings->getAllowLocalProfiles()) {
556 $button->setCaption(
"cont_add_local_profile");
557 $button->setUrl(
$ctrl->getLinkTargetByClass(
"ilskillprofilegui",
"createLocal"));
558 $toolbar->addButtonInstance($button);
567 $this->container_global_profiles,
568 $this->container_local_profiles
571 $tpl->setContent($tab->getHTML());
582 $profile_id = (int)
$_POST[
"p_id"];
584 if (!$profile_id > 0) {
586 $ctrl->redirect($this,
"listProfiles");
589 $this->container_global_profiles->addProfile((
int) $profile_id);
590 $this->container_global_profiles->save();
592 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
594 $ctrl->redirect($this,
"listProfiles");
607 $tabs->activateSubTab(
"profiles");
609 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
611 $ctrl->redirect($this,
"listProfiles");
614 $cgui->setFormAction(
$ctrl->getFormAction($this));
615 $cgui->setHeaderText(
$lng->txt(
"cont_skill_really_remove_profiles_from_list"));
616 $cgui->setCancel(
$lng->txt(
"cancel"),
"listProfiles");
617 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeSelectedGlobalProfiles");
622 $ctrl->redirect($this,
"listProfiles");
627 $tpl->setContent($cgui->getHTML());
639 if (is_array(
$_POST[
"id"]) && count(
$_POST[
"id"]) > 0) {
640 foreach (
$_POST[
"id"] as $id) {
641 $this->container_global_profiles->removeProfile($id);
643 $this->container_global_profiles->save();
645 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
647 $ctrl->redirect($this,
"listProfiles");
660 $tabs->activateSubTab(
"profiles");
662 $profile_id = (int) $this->params[
"profile_id"];
664 if (!$profile_id > 0) {
666 $ctrl->redirect($this,
"listProfiles");
669 $cgui->setFormAction(
$ctrl->getFormAction($this));
670 $cgui->setHeaderText(
$lng->txt(
"cont_skill_really_remove_profile_from_list"));
671 $cgui->setCancel(
$lng->txt(
"cancel"),
"listProfiles");
672 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeSingleGlobalProfile");
675 $tpl->setContent($cgui->getHTML());
687 $profile_id = (int) $this->params[
"profile_id"];
689 if ($profile_id > 0) {
690 $this->container_global_profiles->removeProfile($profile_id);
691 $this->container_global_profiles->save();
693 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
695 $ctrl->redirect($this,
"listProfiles");
708 $tabs->activateSubTab(
"profiles");
710 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
712 $ctrl->redirect($this,
"listProfiles");
715 $cgui->setFormAction(
$ctrl->getFormAction($this));
716 $cgui->setHeaderText(
$lng->txt(
"cont_skill_really_delete_profiles_from_list"));
717 $cgui->setCancel(
$lng->txt(
"cancel"),
"listProfiles");
718 $cgui->setConfirm(
$lng->txt(
"delete"),
"deleteSelectedLocalProfiles");
723 $ctrl->redirect($this,
"listProfiles");
728 $tpl->setContent($cgui->getHTML());
740 if (is_array(
$_POST[
"id"]) && count(
$_POST[
"id"]) > 0) {
741 foreach (
$_POST[
"id"] as $id) {
748 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
750 $ctrl->redirect($this,
"listProfiles");
763 $tabs->activateSubTab(
"profiles");
765 $profile_id = (int) $this->params[
"profile_id"];
767 if (!$profile_id > 0) {
769 $ctrl->redirect($this,
"listProfiles");
772 $cgui->setFormAction(
$ctrl->getFormAction($this));
773 $cgui->setHeaderText(
$lng->txt(
"cont_skill_really_delete_profile_from_list"));
774 $cgui->setCancel(
$lng->txt(
"cancel"),
"listProfiles");
775 $cgui->setConfirm(
$lng->txt(
"delete"),
"deleteSingleLocalProfile");
778 $tpl->setContent($cgui->getHTML());
790 $profile_id = (int) $this->params[
"profile_id"];
792 if ($profile_id > 0) {
796 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
798 $ctrl->redirect($this,
"listProfiles");
812 $tabs->activateSubTab(
"settings");
816 $tpl->setContent($form->getHTML());
827 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
832 $op1 =
new ilRadioOption(
$lng->txt(
"cont_skill_publish_auto"), 0,
$lng->txt(
"cont_skill_publish_auto_info"));
833 $radg->addOption($op1);
834 $op2 =
new ilRadioOption(
$lng->txt(
"cont_skill_publish_manual"), 1,
$lng->txt(
"cont_skill_publish_manual_info"));
835 $radg->addOption($op2);
836 $form->addItem($radg);
839 $form->addCommandButton(
"saveSettings",
$lng->txt(
"save"));
841 $form->setTitle(
$lng->txt(
"settings"));
842 $form->setFormAction(
$ctrl->getFormAction($this));
859 ilUtil::sendSuccess(
$lng->txt(
"msg_obj_modified"),
true);
861 $ctrl->redirect($this,
"settings");
An exception for terminatinating execution or to throw for unit testing.
Confirmation screen class.
TableGUI class for competence profiles in containers.
Container skills administration.
confirmRemoveSelectedGlobalProfiles()
Confirm removal for selected global profiles.
removeSelectedGlobalProfiles()
Remove global profiles from course selection.
selectSkill()
Select skill for container.
initCompetenceAssignmentForm()
Init competence assignment form.
__construct($a_container_gui)
Constructor.
saveSettings()
Save settings.
deleteSelectedLocalProfiles()
Delete local profiles from course selection.
confirmDeleteSelectedLocalProfiles()
Confirm deletion for selected local profiles.
saveSelectedProfile()
Save selected profile.
deleteSingleLocalProfile()
Delete single local profile from course.
initSettingsForm()
Init settings form.
saveSelectedSkill()
Save selected skill.
publishAssignments()
Publish assignments.
executeCommand()
Execute command.
listProfiles()
Select competence profiles.
listCompetences()
Select competences.
deassignCompetences()
Deassign competences.
removeSelectedSkill()
Remove skill from course selection.
confirmDeleteSingleLocalProfile()
Confirm deletion for single local profile.
confirmRemoveSelectedSkill()
Confirm.
removeSingleGlobalProfile()
Remove single global profile from course.
$container_global_profiles
saveCompetenceAssignment()
Save competence assignment.
getPathString($a_skill_id, $a_tref_id=0)
Get path string.
deassignCompetencesConfirm()
Deassign competences confirmation.
listMembers()
List members.
assignCompetences()
Assign competences to a member.
confirmRemoveSingleGlobalProfile()
Confirm removal for single global profile.
$container_local_profiles
TableGUI class for container members / skill assignments.
TableGUI class for competences in containers.
Global competence profiles of a container.
Local competence profiles of a container.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
static _writeContainerSetting($a_id, $a_keyword, $a_value)
This class represents a non editable value in a property form.
static _lookupName($a_user_id)
lookup user name
This class represents an option in a radio group.
Skill management settings.
static lookupRefId($a_id)
static getGlobalProfiles()
Get global profiles.
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.
static setUsage($a_obj_id, $a_skill_id, $a_tref_id, $a_use=true)
Set usage.
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 sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.