ILIAS  release_7 Revision v7.30-3-g800a261c036
ilContSkillAdminGUI Class Reference

Container skills administration. More...

+ Collaboration diagram for ilContSkillAdminGUI:

Public Member Functions

 __construct ($a_container_gui)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 listMembers ()
 List members. More...
 
 assignCompetences ()
 Assign competences to a member. More...
 
 initCompetenceAssignmentForm ()
 Init competence assignment form. More...
 
 getPathString ($a_skill_id, $a_tref_id=0)
 Get path string. More...
 
 saveCompetenceAssignment ()
 Save competence assignment. More...
 
 publishAssignments ()
 Publish assignments. More...
 
 deassignCompetencesConfirm ()
 Deassign competences confirmation. More...
 
 deassignCompetences ()
 Deassign competences. More...
 
 listCompetences ()
 Select competences. More...
 
 selectSkill ()
 Select skill for container. More...
 
 saveSelectedSkill ()
 Save selected skill. More...
 
 confirmRemoveSelectedSkill ()
 Confirm. More...
 
 removeSelectedSkill ()
 Remove skill from course selection. More...
 
 listProfiles ()
 Select competence profiles. More...
 
 saveSelectedProfile ()
 Save selected profile. More...
 
 confirmRemoveSelectedGlobalProfiles ()
 Confirm removal for selected global profiles. More...
 
 removeSelectedGlobalProfiles ()
 Remove global profiles from course selection. More...
 
 confirmRemoveSingleGlobalProfile ()
 Confirm removal for single global profile. More...
 
 removeSingleGlobalProfile ()
 Remove single global profile from course. More...
 
 confirmDeleteSelectedLocalProfiles ()
 Confirm deletion for selected local profiles. More...
 
 deleteSelectedLocalProfiles ()
 Delete local profiles from course selection. More...
 
 confirmDeleteSingleLocalProfile ()
 Confirm deletion for single local profile. More...
 
 deleteSingleLocalProfile ()
 Delete single local profile from course. More...
 
 settings ()
 Settings. More...
 
 initSettingsForm ()
 Init settings form. More...
 
 saveSettings ()
 Save settings. More...
 

Protected Attributes

 $ctrl
 
 $tabs
 
 $lng
 
 $tpl
 
 $container_gui
 
 $container
 
 $container_skills
 
 $container_global_profiles
 
 $container_local_profiles
 
 $skmg_settings
 
 $toolbar
 
 $access
 
 $params
 

Detailed Description

Container skills administration.

Author
Alex Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

@ilCtrl_Calls ilContSkillAdminGUI: ilSkillProfileGUI

Definition at line 12 of file class.ilContSkillAdminGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilContSkillAdminGUI::__construct (   $a_container_gui)

Constructor.

Parameters

Definition at line 84 of file class.ilContSkillAdminGUI.php.

85 {
86 global $DIC;
87
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();
94
95 $this->container_gui = $a_container_gui;
96 $this->container = $a_container_gui->object;
97 $this->ref_id = $this->container->getRefId();
98
99 $this->skill_tree = new ilSkillTree();
100
101 include_once("./Services/Container/Skills/classes/class.ilContainerSkills.php");
102 $this->container_skills = new ilContainerSkills($this->container->getId());
103 $this->container_global_profiles = new ilContainerGlobalProfiles($this->container->getId());
104 $this->container_local_profiles = new ilContainerLocalProfiles($this->container->getId());
105 $this->skmg_settings = new ilSkillManagementSettings();
106
107 $this->user_id = (int) $_GET["usr_id"];
108
109 $this->ctrl->saveParameter($this, "profile_id");
110 $this->params = $this->ctrl->getParameterArray($this);
111
112 $this->lng->loadLanguageModule("skmg");
113 $this->lng->loadLanguageModule("error");
114 }
$_GET["client_id"]
Global competence profiles of a container.
Local competence profiles of a container.
Skills of a container.
global $DIC
Definition: goto.php:24

References $_GET, and $DIC.

Member Function Documentation

◆ assignCompetences()

ilContSkillAdminGUI::assignCompetences ( )

Assign competences to a member.

Definition at line 171 of file class.ilContSkillAdminGUI.php.

172 {
176
177 $ctrl->saveParameter($this, "usr_id");
178 $tabs->activateSubTab("members");
179
180 $form = $this->initCompetenceAssignmentForm();
181 $tpl->setContent($form->getHTML());
182 }
initCompetenceAssignmentForm()
Init competence assignment form.

References $ctrl, $tabs, $tpl, and initCompetenceAssignmentForm().

+ Here is the call graph for this function:

◆ confirmDeleteSelectedLocalProfiles()

ilContSkillAdminGUI::confirmDeleteSelectedLocalProfiles ( )

Confirm deletion for selected local profiles.

Definition at line 701 of file class.ilContSkillAdminGUI.php.

702 {
707
708 $tabs->activateSubTab("profiles");
709
710 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
711 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
712 $ctrl->redirect($this, "listProfiles");
713 } else {
714 $cgui = new ilConfirmationGUI();
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");
719
720 foreach ($_POST["id"] as $i) {
722 ilUtil::sendInfo($lng->txt("cont_skill_deletion_not_possible"), true);
723 $ctrl->redirect($this, "listProfiles");
724 }
725 $cgui->addItem("id[]", $i, ilSkillProfile::lookupTitle($i));
726 }
727
728 $tpl->setContent($cgui->getHTML());
729 }
730 }
$_POST["username"]
Confirmation screen class.
static lookupRefId($a_id)
static lookupTitle($a_id)
Lookup title.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
$i
Definition: metadata.php:24

References $_POST, $ctrl, $i, $lng, $tabs, $tpl, ilSkillProfile\lookupRefId(), ilSkillProfile\lookupTitle(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ confirmDeleteSingleLocalProfile()

ilContSkillAdminGUI::confirmDeleteSingleLocalProfile ( )

Confirm deletion for single local profile.

Definition at line 756 of file class.ilContSkillAdminGUI.php.

757 {
762
763 $tabs->activateSubTab("profiles");
764
765 $profile_id = (int) $this->params["profile_id"];
766
767 if (!$profile_id > 0) {
768 ilUtil::sendFailure($lng->txt("error_sry_error"), true);
769 $ctrl->redirect($this, "listProfiles");
770 } else {
771 $cgui = new ilConfirmationGUI();
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");
776 $cgui->addItem("", $profile_id, ilSkillProfile::lookupTitle($profile_id));
777
778 $tpl->setContent($cgui->getHTML());
779 }
780 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $ctrl, $lng, $tabs, $tpl, ilSkillProfile\lookupTitle(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ confirmRemoveSelectedGlobalProfiles()

ilContSkillAdminGUI::confirmRemoveSelectedGlobalProfiles ( )

Confirm removal for selected global profiles.

Definition at line 600 of file class.ilContSkillAdminGUI.php.

601 {
606
607 $tabs->activateSubTab("profiles");
608
609 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
610 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
611 $ctrl->redirect($this, "listProfiles");
612 } else {
613 $cgui = new ilConfirmationGUI();
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");
618
619 foreach ($_POST["id"] as $i) {
621 ilUtil::sendInfo($lng->txt("cont_skill_removal_not_possible"), true);
622 $ctrl->redirect($this, "listProfiles");
623 }
624 $cgui->addItem("id[]", $i, ilSkillProfile::lookupTitle($i));
625 }
626
627 $tpl->setContent($cgui->getHTML());
628 }
629 }

References $_POST, $ctrl, $i, $lng, $tabs, $tpl, ilSkillProfile\lookupRefId(), ilSkillProfile\lookupTitle(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ confirmRemoveSelectedSkill()

ilContSkillAdminGUI::confirmRemoveSelectedSkill ( )

Confirm.

Definition at line 455 of file class.ilContSkillAdminGUI.php.

456 {
461
462 $tabs->activateSubTab("competences");
463
464 if (!is_array($_POST["id"]) || count($_POST["id"]) == 0) {
465 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
466 $ctrl->redirect($this, "listCompetences");
467 } else {
468 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
469 $cgui = new ilConfirmationGUI();
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");
474
475 foreach ($_POST["id"] as $i) {
476 $s = explode(":", $i);
477 $cgui->addItem("id[]", $i, ilBasicSkill::_lookupTitle((int) $s[0], (int) $s[1]));
478 }
479
480 $tpl->setContent($cgui->getHTML());
481 }
482 }
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.

References $_POST, $ctrl, $i, $lng, $tabs, $tpl, ilSkillTreeNode\_lookupTitle(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ confirmRemoveSingleGlobalProfile()

ilContSkillAdminGUI::confirmRemoveSingleGlobalProfile ( )

Confirm removal for single global profile.

Definition at line 653 of file class.ilContSkillAdminGUI.php.

654 {
659
660 $tabs->activateSubTab("profiles");
661
662 $profile_id = (int) $this->params["profile_id"];
663
664 if (!$profile_id > 0) {
665 ilUtil::sendFailure($lng->txt("error_sry_error"), true);
666 $ctrl->redirect($this, "listProfiles");
667 } else {
668 $cgui = new ilConfirmationGUI();
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");
673 $cgui->addItem("", $profile_id, ilSkillProfile::lookupTitle($profile_id));
674
675 $tpl->setContent($cgui->getHTML());
676 }
677 }

References $ctrl, $lng, $tabs, $tpl, ilSkillProfile\lookupTitle(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ deassignCompetences()

ilContSkillAdminGUI::deassignCompetences ( )

Deassign competences.

Definition at line 368 of file class.ilContSkillAdminGUI.php.

369 {
372
373 foreach ($_POST["usr_id"] as $user_id) {
374 include_once("./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
375 $mem_skills = new ilContainerMemberSkills($this->container_skills->getId(), $user_id);
376 $mem_skills->removeAllSkillLevels($this->container->getRefId());
377 }
378
379 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
380 $ctrl->redirect($this, "listMembers");
381 }

References $_POST, $ctrl, and $lng.

◆ deassignCompetencesConfirm()

ilContSkillAdminGUI::deassignCompetencesConfirm ( )

Deassign competences confirmation.

Definition at line 331 of file class.ilContSkillAdminGUI.php.

332 {
337
338 $tabs->activateSubTab("members");
339
340 $user_ids = $_POST["usr_id"];
341 if (!is_array($_POST["usr_id"]) && $_GET["usr_id"] > 0) {
342 $user_ids[] = $_GET["usr_id"];
343 }
344
345 if (!is_array($user_ids) || count($user_ids) == 0) {
346 ilUtil::sendInfo($lng->txt("no_checkbox"), true);
347 $ctrl->redirect($this, "listMembers");
348 } else {
349 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
350 $cgui = new ilConfirmationGUI();
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");
355
356 foreach ($user_ids as $i) {
357 $name = ilUserUtil::getNamePresentation($i, false, false, "", true);
358 $cgui->addItem("usr_id[]", $i, $name);
359 }
360
361 $tpl->setContent($cgui->getHTML());
362 }
363 }
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:
if($format !==null) $name
Definition: metadata.php:230

References $_GET, $_POST, $ctrl, $i, $lng, $name, $tabs, $tpl, ilUserUtil\getNamePresentation(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ deleteSelectedLocalProfiles()

ilContSkillAdminGUI::deleteSelectedLocalProfiles ( )

Delete local profiles from course selection.

Definition at line 735 of file class.ilContSkillAdminGUI.php.

736 {
739
740 if (is_array($_POST["id"]) && count($_POST["id"]) > 0) {
741 foreach ($_POST["id"] as $id) {
742 if (ilSkillProfile::lookupRefId($id) > 0) {
743 $prof = new ilSkillProfile($id);
744 $prof->delete();
745 }
746 }
747 }
748 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
749
750 $ctrl->redirect($this, "listProfiles");
751 }

References $_POST, $ctrl, $lng, and ilSkillProfile\lookupRefId().

+ Here is the call graph for this function:

◆ deleteSingleLocalProfile()

ilContSkillAdminGUI::deleteSingleLocalProfile ( )

Delete single local profile from course.

Definition at line 785 of file class.ilContSkillAdminGUI.php.

786 {
789
790 $profile_id = (int) $this->params["profile_id"];
791
792 if ($profile_id > 0) {
793 $prof = new ilSkillProfile($profile_id);
794 $prof->delete();
795 }
796 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
797
798 $ctrl->redirect($this, "listProfiles");
799 }

References $ctrl, and $lng.

◆ executeCommand()

ilContSkillAdminGUI::executeCommand ( )

Execute command.

Definition at line 119 of file class.ilContSkillAdminGUI.php.

120 {
121 $next_class = $this->ctrl->getNextClass($this);
122 $cmd = $this->ctrl->getCmd("listMembers");
123
124 switch ($next_class) {
125 case "ilskillprofilegui":
126 $profile_gui = new ilSkillProfileGUI();
127 $this->ctrl->setReturn($this, "listProfiles");
128 $ret = $this->ctrl->forwardCommand($profile_gui);
129 break;
130 default:
131 if (
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")))
139 ||
140 ($this->access->checkAccess("grade", "", $this->ref_id) &&
141 in_array($cmd, array("listMembers", "assignCompetences",
142 "saveCompetenceAssignment", "publishAssignments", "deassignCompetencesConfirm", "deassignCompetences")))
143 ) {
144 $this->$cmd();
145 }
146 }
147 }
Skill profile GUI class.
$ret
Definition: parser.php:6

References $ret.

◆ getPathString()

ilContSkillAdminGUI::getPathString (   $a_skill_id,
  $a_tref_id = 0 
)

Get path string.

Returns
string path string

Definition at line 245 of file class.ilContSkillAdminGUI.php.

246 {
247 $skill_tree = $this->skill_tree;
248
249 $path = $skill_tree->getSkillTreePath($a_skill_id, $a_tref_id);
250 $titles = array();
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"];
254 }
255 }
256
257 return implode(" > ", $titles);
258 }

Referenced by initCompetenceAssignmentForm().

+ Here is the caller graph for this function:

◆ initCompetenceAssignmentForm()

ilContSkillAdminGUI::initCompetenceAssignmentForm ( )

Init competence assignment form.

Definition at line 187 of file class.ilContSkillAdminGUI.php.

188 {
192
193 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
194 $form = new ilPropertyFormGUI();
195
196 include_once("./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
197 $mem_skills = new ilContainerMemberSkills($this->container_skills->getId(), $this->user_id);
198 $mem_levels = $mem_skills->getSkillLevels();
199
200 // user name
201 $name = ilObjUser::_lookupName($this->user_id);
202 $ne = new ilNonEditableValueGUI($this->lng->txt("obj_user"), "");
203 $ne->setValue($name["lastname"] . ", " . $name["firstname"] . " [" . $name["login"] . "]");
204 $form->addItem($ne);
205
206 if (empty($this->container_skills->getOrderedSkills())) {
207 $tpl->setOnScreenMessage('info', $lng->txt("cont_skill_no_skills_selected"), true);
208 $ctrl->redirect($this, "listMembers");
209 }
210
211 foreach ($this->container_skills->getOrderedSkills() as $sk) {
212 $skill = new ilBasicSkill($sk["skill_id"]);
213
214 // skill level options
215 $options = array(
216 "-1" => $this->lng->txt("cont_skill_do_not_set"),
217 );
218 foreach ($skill->getLevelData() as $l) {
219 $options[$l["id"]] = $l["title"];
220 }
221 $si = new ilSelectInputGUI(ilBasicSkill::_lookupTitle($sk["skill_id"], $sk["tref_id"]), "skill_" . $sk["skill_id"] . "_" . $sk["tref_id"]);
222 $si->setOptions($options);
223 $si->setInfo($this->getPathString($sk["skill_id"], $sk["tref_id"]));
224 if (isset($mem_levels[$sk["skill_id"] . ":" . $sk["tref_id"]])) {
225 $si->setValue($mem_levels[$sk["skill_id"] . ":" . $sk["tref_id"]]);
226 }
227 $form->addItem($si);
228 }
229
230 // save and cancel commands
231 $form->addCommandButton("saveCompetenceAssignment", $this->lng->txt("save"));
232 $form->addCommandButton("listMembers", $this->lng->txt("cancel"));
233
234 $form->setTitle($this->lng->txt("cont_assign_skills"));
235 $form->setFormAction($this->ctrl->getFormAction($this));
236
237 return $form;
238 }
getPathString($a_skill_id, $a_tref_id=0)
Get path string.
This class represents a non editable value in a property form.
static _lookupName($a_user_id)
lookup user name
This class represents a property form user interface.
This class represents a selection list property in a property form.

References $ctrl, $lng, $name, $si, $tpl, ilObjUser\_lookupName(), ilSkillTreeNode\_lookupTitle(), and getPathString().

Referenced by assignCompetences(), and saveCompetenceAssignment().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSettingsForm()

ilContSkillAdminGUI::initSettingsForm ( )

Init settings form.

Definition at line 822 of file class.ilContSkillAdminGUI.php.

823 {
826
827 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
828 $form = new ilPropertyFormGUI();
829
830 // publish
831 $radg = new ilRadioGroupInputGUI($lng->txt("cont_skill_publish"), "cont_skill_publish");
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);
837 $radg->setValue(ilContainer::_lookupContainerSetting($this->container->getId(), "cont_skill_publish", 0));
838
839 $form->addCommandButton("saveSettings", $lng->txt("save"));
840
841 $form->setTitle($lng->txt("settings"));
842 $form->setFormAction($ctrl->getFormAction($this));
843
844 return $form;
845 }
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
This class represents a property in a property form.
This class represents an option in a radio group.

References $ctrl, $lng, and ilContainer\_lookupContainerSetting().

Referenced by saveSettings(), and settings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ listCompetences()

ilContSkillAdminGUI::listCompetences ( )

Select competences.

Definition at line 389 of file class.ilContSkillAdminGUI.php.

390 {
396
397 $tabs->activateSubTab("competences");
398
399 $toolbar->addButton(
400 $lng->txt("cont_add_skill"),
401 $ctrl->getLinkTarget($this, "selectSkill")
402 );
403
404 // table
405 include_once("./Services/Container/Skills/classes/class.ilContSkillTableGUI.php");
406 $tab = new ilContSkillTableGUI(
407 $this,
408 "listCompetences",
409 $this->container_skills,
410 $this->container_global_profiles,
411 $this->container_local_profiles
412 );
413
414 $tpl->setContent($tab->getHTML());
415 }
TableGUI class for competences in containers.

References $ctrl, $lng, $tabs, $toolbar, and $tpl.

◆ listMembers()

ilContSkillAdminGUI::listMembers ( )

List members.

Definition at line 154 of file class.ilContSkillAdminGUI.php.

155 {
158
159 $tabs->activateSubTab("members");
160
161 // table
162 include_once("./Services/Container/Skills/classes/class.ilContSkillMemberTableGUI.php");
163 $tab = new ilContSkillMemberTableGUI($this, "listMembers", $this->container_skills);
164
165 $tpl->setContent($tab->getHTML());
166 }
TableGUI class for container members / skill assignments.

References $tabs, and $tpl.

◆ listProfiles()

ilContSkillAdminGUI::listProfiles ( )

Select competence profiles.

Definition at line 511 of file class.ilContSkillAdminGUI.php.

512 {
518
519 $tabs->activateSubTab("profiles");
520
521 $options = array();
522 $options[0] = $lng->txt("please_select");
523
524 $selectable_profiles = array();
525 $all_profiles = ilSkillProfile::getGlobalProfiles();
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;
530 }
531 }
532
533 foreach ($selectable_profiles as $profile) {
534 $options[$profile["id"]] = $profile["title"];
535 }
536
537 if ($this->skmg_settings->getLocalAssignmentOfProfiles()) {
538 $select = new ilSelectInputGUI($lng->txt("skmg_profile"), "p_id");
539 $select->setOptions($options);
540 $select->setValue(0);
541 $toolbar->addInputItem($select, true);
542
543 $button = ilSubmitButton::getInstance();
544 $button->setCaption("cont_add_global_profile");
545 $button->setCommand("saveSelectedProfile");
546 $toolbar->addButtonInstance($button);
547 }
548
549 if ($this->skmg_settings->getLocalAssignmentOfProfiles()
550 && $this->skmg_settings->getAllowLocalProfiles()) {
551 $toolbar->addSeparator();
552 }
553
554 if ($this->skmg_settings->getAllowLocalProfiles()) {
555 $button = ilLinkButton::getInstance();
556 $button->setCaption("cont_add_local_profile");
557 $button->setUrl($ctrl->getLinkTargetByClass("ilskillprofilegui", "createLocal"));
558 $toolbar->addButtonInstance($button);
559 }
560
561 $toolbar->setFormAction($ctrl->getFormAction($this));
562
563 // table
564 $tab = new ilContProfileTableGUI(
565 $this,
566 "listProfiles",
567 $this->container_global_profiles,
568 $this->container_local_profiles
569 );
570
571 $tpl->setContent($tab->getHTML());
572 }
TableGUI class for competence profiles in containers.
static getInstance()
Factory.
static getGlobalProfiles()
Get global profiles.
static getInstance()
Factory.

References $ctrl, $lng, $tabs, $toolbar, $tpl, ilSkillProfile\getGlobalProfiles(), ilLinkButton\getInstance(), and ilSubmitButton\getInstance().

+ Here is the call graph for this function:

◆ publishAssignments()

ilContSkillAdminGUI::publishAssignments ( )

Publish assignments.

Definition at line 296 of file class.ilContSkillAdminGUI.php.

297 {
300
301 $user_ids = $_POST["usr_id"];
302 if (!is_array($_POST["usr_id"]) && $_GET["usr_id"] > 0) {
303 $user_ids[] = $_GET["usr_id"];
304 }
305
306 include_once("./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
307 $not_changed = array();
308 foreach ($user_ids as $user_id) {
309 $mem_skills = new ilContainerMemberSkills($this->container_skills->getId(), $user_id);
310 if (!$mem_skills->publish($this->container->getRefId())) {
311 $not_changed[] = $user_id;
312 }
313 }
314
315 if (count($not_changed) == 0) {
316 ilUtil::sendSuccess($lng->txt("cont_skll_published"), true);
317 } else {
318 $names = array_map(function ($id) {
319 return ilUserUtil::getNamePresentation($id, false, false, "", true);
320 }, $not_changed);
321 ilUtil::sendInfo($lng->txt("cont_skll_published_some_not") . " (" . implode("; ", $names) . ")", true);
322 }
323
324
325 $ctrl->redirect($this, "listMembers");
326 }

References $_GET, $_POST, $ctrl, $lng, ilUserUtil\getNamePresentation(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ removeSelectedGlobalProfiles()

ilContSkillAdminGUI::removeSelectedGlobalProfiles ( )

Remove global profiles from course selection.

Definition at line 634 of file class.ilContSkillAdminGUI.php.

635 {
638
639 if (is_array($_POST["id"]) && count($_POST["id"]) > 0) {
640 foreach ($_POST["id"] as $id) {
641 $this->container_global_profiles->removeProfile($id);
642 }
643 $this->container_global_profiles->save();
644 }
645 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
646
647 $ctrl->redirect($this, "listProfiles");
648 }

References $_POST, $ctrl, and $lng.

◆ removeSelectedSkill()

ilContSkillAdminGUI::removeSelectedSkill ( )

Remove skill from course selection.

Definition at line 487 of file class.ilContSkillAdminGUI.php.

488 {
491
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]);
496 }
497 $this->container_skills->save();
498 ilSkillUsage::setUsage($this->container->getId(), (int) $s[0], (int) $s[1], false);
499 }
500 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
501
502 $ctrl->redirect($this, "listCompetences");
503 }
static setUsage($a_obj_id, $a_skill_id, $a_tref_id, $a_use=true)
Set usage.

References $_POST, $ctrl, $lng, and ilSkillUsage\setUsage().

+ Here is the call graph for this function:

◆ removeSingleGlobalProfile()

ilContSkillAdminGUI::removeSingleGlobalProfile ( )

Remove single global profile from course.

Definition at line 682 of file class.ilContSkillAdminGUI.php.

683 {
686
687 $profile_id = (int) $this->params["profile_id"];
688
689 if ($profile_id > 0) {
690 $this->container_global_profiles->removeProfile($profile_id);
691 $this->container_global_profiles->save();
692 }
693 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
694
695 $ctrl->redirect($this, "listProfiles");
696 }

References $ctrl, and $lng.

◆ saveCompetenceAssignment()

ilContSkillAdminGUI::saveCompetenceAssignment ( )

Save competence assignment.

Parameters

Definition at line 265 of file class.ilContSkillAdminGUI.php.

266 {
269
270 $form = $this->initCompetenceAssignmentForm();
271 $form->checkInput();
272
273 $levels = array();
274 foreach ($this->container_skills->getSkills() as $sk) {
275 $l = $form->getInput("skill_" . $sk["skill_id"] . "_" . $sk["tref_id"]);
276 if ($l != -1) {
277 $levels[$sk["skill_id"] . ":" . $sk["tref_id"]] = $l;
278 }
279 }
280
281 include_once("./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
282 $mem_skills = new ilContainerMemberSkills($this->container_skills->getId(), $this->user_id);
283 $mem_skills->saveLevelForSkills($levels);
284
285 if (!ilContainer::_lookupContainerSetting($this->container->getId(), "cont_skill_publish", 0)) {
286 $mem_skills->publish($this->container->getRefId());
287 }
288
289 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
290 $ctrl->redirect($this, "listMembers");
291 }

References $ctrl, $lng, ilContainer\_lookupContainerSetting(), and initCompetenceAssignmentForm().

+ Here is the call graph for this function:

◆ saveSelectedProfile()

ilContSkillAdminGUI::saveSelectedProfile ( )

Save selected profile.

Definition at line 577 of file class.ilContSkillAdminGUI.php.

578 {
581
582 $profile_id = (int) $_POST["p_id"];
583
584 if (!$profile_id > 0) {
585 ilUtil::sendInfo($lng->txt("cont_skill_no_profile_selected"), true);
586 $ctrl->redirect($this, "listProfiles");
587 }
588
589 $this->container_global_profiles->addProfile((int) $profile_id);
590 $this->container_global_profiles->save();
591
592 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
593
594 $ctrl->redirect($this, "listProfiles");
595 }

References $_POST, $ctrl, $lng, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ saveSelectedSkill()

ilContSkillAdminGUI::saveSelectedSkill ( )

Save selected skill.

Definition at line 436 of file class.ilContSkillAdminGUI.php.

437 {
440
441 $s = explode(":", ($_GET["selected_skill"]));
442
443 $this->container_skills->addSkill((int) $s[0], (int) $s[1]);
444 $this->container_skills->save();
445 ilSkillUsage::setUsage($this->container->getId(), (int) $s[0], (int) $s[1]);
446
447 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
448
449 $ctrl->redirect($this, "listCompetences");
450 }

References $_GET, $ctrl, $lng, and ilSkillUsage\setUsage().

+ Here is the call graph for this function:

◆ saveSettings()

ilContSkillAdminGUI::saveSettings ( )

Save settings.

Definition at line 850 of file class.ilContSkillAdminGUI.php.

851 {
854
855 $form = $this->initSettingsForm();
856 $form->checkInput();
857 ilContainer::_writeContainerSetting($this->container->getId(), "cont_skill_publish", $form->getInput("cont_skill_publish"));
858
859 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
860
861 $ctrl->redirect($this, "settings");
862 }
initSettingsForm()
Init settings form.
static _writeContainerSetting($a_id, $a_keyword, $a_value)

References $ctrl, $lng, ilContainer\_writeContainerSetting(), and initSettingsForm().

+ Here is the call graph for this function:

◆ selectSkill()

ilContSkillAdminGUI::selectSkill ( )

Select skill for container.

Definition at line 420 of file class.ilContSkillAdminGUI.php.

421 {
424
425 $tabs->activateSubTab("competences");
426
427 $sel = new ilSkillSelectorGUI($this, "selectSkill", $this, "saveSelectedSkill");
428 if (!$sel->handleCommand()) {
429 $tpl->setContent($sel->getHTML());
430 }
431 }
Explorer class that works on tree objects (Services/Tree)

References $tabs, and $tpl.

◆ settings()

ilContSkillAdminGUI::settings ( )

Settings.

Definition at line 807 of file class.ilContSkillAdminGUI.php.

808 {
811
812 $tabs->activateSubTab("settings");
813
814 $form = $this->initSettingsForm();
815
816 $tpl->setContent($form->getHTML());
817 }

References $tabs, $tpl, and initSettingsForm().

+ Here is the call graph for this function:

Field Documentation

◆ $access

ilContSkillAdminGUI::$access
protected

Definition at line 72 of file class.ilContSkillAdminGUI.php.

◆ $container

ilContSkillAdminGUI::$container
protected

Definition at line 42 of file class.ilContSkillAdminGUI.php.

◆ $container_global_profiles

ilContSkillAdminGUI::$container_global_profiles
protected

Definition at line 52 of file class.ilContSkillAdminGUI.php.

◆ $container_gui

ilContSkillAdminGUI::$container_gui
protected

Definition at line 37 of file class.ilContSkillAdminGUI.php.

◆ $container_local_profiles

ilContSkillAdminGUI::$container_local_profiles
protected

Definition at line 57 of file class.ilContSkillAdminGUI.php.

◆ $container_skills

ilContSkillAdminGUI::$container_skills
protected

Definition at line 47 of file class.ilContSkillAdminGUI.php.

◆ $ctrl

◆ $lng

◆ $params

ilContSkillAdminGUI::$params
protected

Definition at line 77 of file class.ilContSkillAdminGUI.php.

◆ $skmg_settings

ilContSkillAdminGUI::$skmg_settings
protected

Definition at line 62 of file class.ilContSkillAdminGUI.php.

◆ $tabs

◆ $toolbar

ilContSkillAdminGUI::$toolbar
protected

Definition at line 67 of file class.ilContSkillAdminGUI.php.

Referenced by listCompetences(), and listProfiles().

◆ $tpl


The documentation for this class was generated from the following file: