3 declare(strict_types=1);
36 protected \ILIAS\Container\InternalGUIService
$gui;
66 $this->
ctrl = $DIC->ctrl();
67 $this->
tabs = $DIC->tabs();
68 $this->
lng = $DIC->language();
69 $this->tpl = $DIC[
"tpl"];
70 $this->
toolbar = $DIC->toolbar();
71 $this->
access = $DIC->access();
73 $this->container_gui = $a_container_gui;
76 $this->container = $obj;
77 $this->ref_id = $this->container->getRefId();
80 $this->tree_service = $DIC->skills()->tree();
81 $this->tree_access_manager = $DIC->skills()->internal()->manager()->getTreeAccessManager($this->ref_id);
82 $this->profile_service = $DIC->skills()->profile();
83 $this->cont_skill_manager = $DIC->skills()->internalContainer()->manager()->getSkillManager(
84 $this->container->getId(),
85 $this->container->getRefId()
87 $this->usage_service = $DIC->skills()->usage();
90 $this->container_gui_request = $DIC->skills()->internalContainer()->gui()->request();
92 $this->
ctrl->saveParameter($this,
"profile_id");
93 $this->params = $this->
ctrl->getParameterArray($this);
95 $this->requested_usr_id = $this->container_gui_request->getUserId();
96 $this->requested_usr_ids = $this->container_gui_request->getUserIds();
97 $this->requested_selected_skill = $this->container_gui_request->getSelectedSkill();
98 $this->requested_combined_skill_ids = $this->container_gui_request->getCombinedSkillIds();
99 $this->requested_selected_profile_id = $this->container_gui_request->getSelectedProfileId();
100 $this->requested_profile_ids = $this->container_gui_request->getProfileIds();
102 $this->
lng->loadLanguageModule(
"skmg");
103 $this->
lng->loadLanguageModule(
"error");
104 $this->gui = $DIC->container()->internal()->gui();
109 $next_class = $this->
ctrl->getNextClass($this);
110 $cmd = $this->
ctrl->getCmd(
"listMembers");
112 switch ($next_class) {
113 case "ilskillprofilegui":
115 $this->
ctrl->setReturn($this,
"listProfiles");
116 $ret = $this->
ctrl->forwardCommand($profile_gui);
118 case "ilskillprofileuploadhandlergui":
120 $ret = $this->
ctrl->forwardCommand($skprof_upl_gui);
124 ($this->
access->checkAccess(
"write",
"", $this->ref_id) &&
126 "listCompetences",
"settings",
"saveSettings",
"selectSkill",
127 "saveSelectedSkill",
"confirmRemoveSelectedSkill",
"removeSelectedSkill",
128 "listProfiles",
"saveSelectedProfile",
"confirmRemoveSelectedGlobalProfiles",
129 "removeSelectedGlobalProfiles",
"confirmRemoveSingleGlobalProfile",
"removeSingleGlobalProfile",
130 "confirmDeleteSingleLocalProfile",
"deleteSingleLocalProfile",
131 "confirmDeleteSelectedLocalProfiles",
"deleteSelectedLocalProfiles" 134 ($this->
access->checkAccess(
"grade",
"", $this->ref_id) &&
136 "listMembers",
"assignCompetences",
137 "saveCompetenceAssignment",
"publishAssignments",
"deassignCompetencesConfirm",
"deassignCompetences" 184 $ne->setValue($name[
"lastname"] .
", " . $name[
"firstname"] .
" [" . $name[
"login"] .
"]");
187 if (empty($this->cont_skill_manager->getSkillsForContainerOrdered())) {
189 $ctrl->
redirect($this,
"listMembers");
192 foreach ($this->cont_skill_manager->getSkillsForContainerOrdered() as $sk) {
197 "-1" => $this->
lng->txt(
"cont_skill_do_not_set"),
199 foreach ($skill->getLevelData() as $l) {
200 $options[$l[
"id"]] = $l[
"title"];
204 "skill_" . $sk->getBaseSkillId() .
"_" . $sk->getTrefId()
207 $si->setInfo($this->
getPathString($sk->getBaseSkillId(), $sk->getTrefId()));
208 $mem_level = $this->cont_skill_manager->getMemberSkillLevel(
209 $this->requested_usr_id,
210 $sk->getBaseSkillId(),
214 $si->setValue($mem_level);
220 $form->addCommandButton(
"saveCompetenceAssignment", $this->
lng->txt(
"save"));
221 $form->addCommandButton(
"listMembers", $this->
lng->txt(
"cancel"));
223 $form->setTitle($this->
lng->txt(
"cont_assign_skills"));
224 $form->setFormAction($this->
ctrl->getFormAction($this));
231 $path = $this->tree_service->getSkillTreePath($a_skill_id, $a_tref_id);
233 foreach (
$path as $v) {
234 if ($v[
"type"] !==
"skrt" && !($v[
"skill_id"] == $a_skill_id && $v[
"tref_id"] == $a_tref_id)) {
235 $titles[] = $v[
"title"];
239 return implode(
" > ", $titles);
250 foreach ($this->cont_skill_manager->getSkillsForContainer() as $sk) {
251 $l = (
int) $form->getInput(
"skill_" . $sk->getBaseSkillId() .
"_" . $sk->getTrefId());
253 $this->cont_skill_manager->removeMemberSkillFromContainer(
254 $this->requested_usr_id,
255 $sk->getBaseSkillId(),
259 $this->cont_skill_manager->addMemberSkillForContainer(
260 $this->requested_usr_id,
261 $sk->getBaseSkillId(),
269 $this->cont_skill_manager->publishMemberSkills($this->requested_usr_id);
272 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
273 $ctrl->
redirect($this,
"listMembers");
282 if (empty($this->requested_usr_ids) && $this->requested_usr_id > 0) {
287 foreach ($user_ids as $user_id) {
288 if (!$this->cont_skill_manager->publishMemberSkills($user_id)) {
289 $not_changed[] = $user_id;
293 if (count($not_changed) === 0) {
294 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"cont_skll_published"),
true);
296 $names = array_map(
static function (
int $id) {
299 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"cont_skll_published_some_not") .
" (" . implode(
"; ", $names) .
")",
true);
302 $ctrl->
redirect($this,
"listMembers");
315 if (empty($this->requested_usr_ids) && $this->requested_usr_id > 0) {
319 if (!is_array($user_ids) || count($user_ids) === 0) {
320 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"no_checkbox"),
true);
321 $ctrl->
redirect($this,
"listMembers");
325 $cgui->setHeaderText($lng->
txt(
"cont_really_deassign_skills"));
326 $cgui->setCancel($lng->
txt(
"cancel"),
"listMembers");
327 $cgui->setConfirm($lng->
txt(
"cont_deassign_competence"),
"deassignCompetences");
329 foreach ($user_ids as $i) {
331 $cgui->addItem(
"usr_ids[]", (
string) $i, $name);
343 foreach ($this->requested_usr_ids as $user_id) {
344 $this->cont_skill_manager->removeAllMemberSkillsFromContainer($user_id);
347 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
348 $ctrl->
redirect($this,
"listMembers");
365 $lng->
txt(
"cont_add_skill"),
387 if (!$sel->handleCommand()) {
397 $s = explode(
":", ($this->requested_selected_skill));
399 $this->cont_skill_manager->addSkillForContainer((
int) $s[0], (
int) $s[1]);
400 $this->usage_service->addUsage($this->container->getId(), (
int) $s[0], (
int) $s[1]);
402 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
404 $ctrl->
redirect($this,
"listCompetences");
416 if (empty($this->requested_combined_skill_ids)) {
417 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"no_checkbox"),
true);
418 $ctrl->
redirect($this,
"listCompetences");
422 $cgui->setHeaderText($lng->
txt(
"cont_really_remove_skill_from_course"));
423 $cgui->setCancel($lng->
txt(
"cancel"),
"listCompetences");
424 $cgui->setConfirm($lng->
txt(
"remove"),
"removeSelectedSkill");
426 foreach ($this->requested_combined_skill_ids as $i) {
427 $s = explode(
":", $i);
440 if (!empty($this->requested_combined_skill_ids)) {
441 foreach ($this->requested_combined_skill_ids as
$id) {
442 $s = explode(
":", $id);
443 $this->cont_skill_manager->removeSkillFromContainer((
int) $s[0], (
int) $s[1]);
444 $this->usage_service->removeUsage($this->container->getId(), (
int) $s[0], (
int) $s[1]);
447 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
449 $ctrl->
redirect($this,
"listCompetences");
466 $options[0] = $lng->
txt(
"please_select");
468 $selectable_profiles = [];
469 $all_profiles = $this->profile_service->getAllGlobalProfiles();
470 $selected_profiles = $this->profile_service->getGlobalProfilesOfRole($this->cont_member_role_id);
471 foreach ($all_profiles as $profile) {
472 if (!array_key_exists($profile->getId(), $selected_profiles)) {
473 $selectable_profiles[$profile->getId()] = $profile;
477 foreach ($selectable_profiles as $profile) {
478 $tree = $this->tree_service->getObjSkillTreeById($profile->getSkillTreeId());
479 $options[$profile->getId()] = $tree->getTitle() .
": " . $profile->getTitle();
482 if ($this->skmg_settings->getLocalAssignmentOfProfiles()) {
485 $select->setValue(0);
489 $this->
lng->txt(
"cont_add_global_profile"),
490 "saveSelectedProfile" 491 )->submit()->toToolbar();
494 if ($this->skmg_settings->getLocalAssignmentOfProfiles()
495 && $this->skmg_settings->getAllowLocalProfiles()) {
499 if ($this->skmg_settings->getAllowLocalProfiles()) {
501 $this->
lng->txt(
"cont_add_local_profile"),
503 )->emphasised()->toToolbar();
512 $this->container->getRefId()
525 if (!($profile_id > 0)) {
526 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"cont_skill_no_profile_selected"),
true);
527 $ctrl->
redirect($this,
"listProfiles");
530 $this->profile_service->addRoleToProfile($profile_id, $this->cont_member_role_id);
532 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
534 $ctrl->
redirect($this,
"listProfiles");
546 if (empty($this->requested_profile_ids)) {
547 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"no_checkbox"),
true);
548 $ctrl->
redirect($this,
"listProfiles");
552 $cgui->setHeaderText($lng->
txt(
"cont_skill_really_remove_profiles_from_list"));
553 $cgui->setCancel($lng->
txt(
"cancel"),
"listProfiles");
554 $cgui->setConfirm($lng->
txt(
"remove"),
"removeSelectedGlobalProfiles");
556 foreach ($this->requested_profile_ids as $i) {
557 if ($this->profile_service->lookupProfileRefId($i) > 0) {
558 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"cont_skill_removal_not_possible"),
true);
559 $ctrl->
redirect($this,
"listProfiles");
561 $cgui->addItem(
"id[]", (
string) $i, $this->profile_service->lookupProfileTitle($i));
573 foreach ($this->requested_profile_ids as
$id) {
574 $this->profile_service->removeRoleFromProfile($id, $this->cont_member_role_id);
577 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
579 $ctrl->
redirect($this,
"listProfiles");
591 $profile_id = (
int) $this->params[
"profile_id"];
593 if (!($profile_id > 0)) {
594 $this->tpl->setOnScreenMessage(
'failure', $lng->
txt(
"error_sry_error"),
true);
595 $ctrl->
redirect($this,
"listProfiles");
599 $cgui->setHeaderText($lng->
txt(
"cont_skill_really_remove_profile_from_list"));
600 $cgui->setCancel($lng->
txt(
"cancel"),
"listProfiles");
601 $cgui->setConfirm($lng->
txt(
"remove"),
"removeSingleGlobalProfile");
602 $cgui->addItem(
"", (
string) $profile_id, $this->profile_service->lookupProfileTitle($profile_id));
613 $profile_id = (
int) $this->params[
"profile_id"];
615 if ($profile_id > 0) {
616 $this->profile_service->removeRoleFromProfile($profile_id, $this->cont_member_role_id);
618 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
620 $ctrl->
redirect($this,
"listProfiles");
632 if (empty($this->requested_profile_ids)) {
633 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"no_checkbox"),
true);
634 $ctrl->
redirect($this,
"listProfiles");
638 $cgui->setHeaderText($lng->
txt(
"cont_skill_really_delete_profiles_from_list"));
639 $cgui->setCancel($lng->
txt(
"cancel"),
"listProfiles");
640 $cgui->setConfirm($lng->
txt(
"delete"),
"deleteSelectedLocalProfiles");
642 foreach ($this->requested_profile_ids as $i) {
643 if (!($this->profile_service->lookupProfileRefId($i) > 0)) {
644 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"cont_skill_deletion_not_possible"),
true);
645 $ctrl->
redirect($this,
"listProfiles");
647 $cgui->addItem(
"id[]", (
string) $i, $this->profile_service->lookupProfileTitle($i));
659 if (!empty($this->requested_profile_ids)) {
660 foreach ($this->requested_profile_ids as
$id) {
661 if ($this->profile_service->lookupProfileRefId($id) > 0) {
662 $this->profile_service->deleteProfile($id);
666 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
668 $ctrl->
redirect($this,
"listProfiles");
680 $profile_id = (
int) $this->params[
"profile_id"];
682 if (!($profile_id > 0)) {
683 $this->tpl->setOnScreenMessage(
'failure', $lng->
txt(
"error_sry_error"),
true);
684 $ctrl->
redirect($this,
"listProfiles");
688 $cgui->setHeaderText($lng->
txt(
"cont_skill_really_delete_profile_from_list"));
689 $cgui->setCancel($lng->
txt(
"cancel"),
"listProfiles");
690 $cgui->setConfirm($lng->
txt(
"delete"),
"deleteSingleLocalProfile");
691 $cgui->addItem(
"", (
string) $profile_id, $this->profile_service->lookupProfileTitle($profile_id));
702 $profile_id = (
int) $this->params[
"profile_id"];
704 if ($profile_id > 0) {
705 $this->profile_service->deleteProfile($profile_id);
707 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
709 $ctrl->
redirect($this,
"listProfiles");
736 $op1 =
new ilRadioOption($lng->
txt(
"cont_skill_publish_auto"),
'0', $lng->
txt(
"cont_skill_publish_auto_info"));
737 $radg->addOption($op1);
738 $op2 =
new ilRadioOption($lng->
txt(
"cont_skill_publish_manual"),
'1', $lng->
txt(
"cont_skill_publish_manual_info"));
739 $radg->addOption($op2);
740 $form->addItem($radg);
743 $form->addCommandButton(
"saveSettings", $lng->
txt(
"save"));
745 $form->setTitle($lng->
txt(
"settings"));
760 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
array $requested_profile_ids
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilContainerGUI $container_gui
getLinkTargetByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
saveCompetenceAssignment()
Class ilSkillProfileUploadHandlerGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
redirect(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Container InternalGUIService $gui
activateSubTab(string $a_id)
deassignCompetencesConfirm()
TableGUI class for competences in containers.
static _lookupTitle(int $a_obj_id, int $a_tref_id=0)
confirmDeleteSelectedLocalProfiles()
static _lookupName(int $a_user_id)
lookup user name
confirmRemoveSingleGlobalProfile()
ilGlobalTemplateInterface $tpl
deleteSingleLocalProfile()
confirmRemoveSelectedSkill()
static getDefaultMemberRole(int $a_ref_id)
TableGUI class for container members / skill assignments.
ContainerSkills SkillContainerGUIRequest $container_gui_request
SkillTreeAccess $tree_access_manager
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
string $requested_selected_skill
TableGUI class for competence profiles in containers.
Request wrapper for skill guis in container classes.
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path='ilpublicuserprofilegui')
Default behaviour is:
setContent(string $a_html)
Sets content for standard template.
ContainerSkills ContainerSkillManager $cont_skill_manager
removeSingleGlobalProfile()
int $requested_selected_profile_id
array $requested_combined_skill_ids
deleteSelectedLocalProfiles()
confirmDeleteSingleLocalProfile()
__construct(ilContainerGUI $a_container_gui)
setValue(string $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _writeContainerSetting(int $a_id, string $a_keyword, string $a_value)
Explorer class that works on tree objects (Services/Tree)
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
confirmRemoveSelectedGlobalProfiles()
Container skills administration.
saveParameter(object $a_gui_obj, $a_parameter)
removeSelectedGlobalProfiles()
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
initCompetenceAssignmentForm()
SkillUsageService $usage_service
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder...
ilSkillManagementSettings $skmg_settings
SkillTreeService $tree_service
SkillProfileService $profile_service
getFormAction(object $a_gui_obj, string $a_fallback_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
getPathString(int $a_skill_id, int $a_tref_id=0)