67 $this->ctrl = $DIC->ctrl();
68 $this->tabs = $DIC->tabs();
69 $this->lng = $DIC->language();
70 $this->tpl = $DIC[
"tpl"];
71 $this->toolbar = $DIC->toolbar();
72 $this->access = $DIC->access();
74 $this->container_gui = $a_container_gui;
75 $this->container = $a_container_gui->object;
76 $this->ref_id = $this->container->getRefId();
78 include_once(
"./Services/Skill/classes/class.ilSkillTree.php");
81 include_once(
"./Services/Container/Skills/classes/class.ilContainerSkills.php");
84 $this->user_id = (int)
$_GET[
"usr_id"];
92 $next_class = $this->ctrl->getNextClass($this);
93 $cmd = $this->ctrl->getCmd(
"listMembers");
95 switch ($next_class) {
98 ($this->access->checkAccess(
"write",
"", $this->ref_id) &&
99 in_array($cmd,
array(
"listCompetences",
"settings",
"saveSettings",
"selectSkill",
100 "saveSelectedSkill",
"confirmRemoveSelectedSkill",
"removeSelectedSkill")))
102 ($this->access->checkAccess(
"grade",
"", $this->ref_id) &&
103 in_array($cmd,
array(
"listMembers",
"assignCompetences",
104 "saveCompetenceAssignment",
"publishAssignments",
"deassignCompetencesConfirm",
"deassignCompetences")))
121 $tabs->activateSubTab(
"members");
124 include_once(
"./Services/Container/Skills/classes/class.ilContSkillMemberTableGUI.php");
139 $ctrl->saveParameter($this,
"usr_id");
140 $tabs->activateSubTab(
"members");
151 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
154 include_once(
"./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
164 foreach ($this->container_skills->getOrderedSkills() as $sk) {
169 "-1" => $this->lng->txt(
"cont_skill_do_not_set"),
171 foreach ($skill->getLevelData() as
$l) {
177 if (isset($mem_levels[$sk[
"skill_id"] .
":" . $sk[
"tref_id"]])) {
178 $si->setValue($mem_levels[$sk[
"skill_id"] .
":" . $sk[
"tref_id"]]);
184 $form->addCommandButton(
"saveCompetenceAssignment", $this->lng->txt(
"save"));
185 $form->addCommandButton(
"listMembers", $this->lng->txt(
"cancel"));
187 $form->setTitle($this->lng->txt(
"cont_assign_skills"));
188 $form->setFormAction($this->ctrl->getFormAction($this));
200 $skill_tree = $this->skill_tree;
202 $path = $skill_tree->getSkillTreePath($a_skill_id, $a_tref_id);
204 foreach (
$path as $v) {
205 if ($v[
"type"] !=
"skrt" && !($v[
"skill_id"] == $a_skill_id && $v[
"tref_id"] == $a_tref_id)) {
206 $titles[] = $v[
"title"];
210 return implode(
" > ", $titles);
227 foreach ($this->container_skills->getSkills() as $sk) {
228 $l =
$form->getInput(
"skill_" . $sk[
"skill_id"] .
"_" . $sk[
"tref_id"]);
230 $levels[$sk[
"skill_id"] .
":" . $sk[
"tref_id"]] =
$l;
234 include_once(
"./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
239 $mem_skills->publish($this->container->getRefId());
243 $ctrl->redirect($this,
"listMembers");
254 $user_ids =
$_POST[
"usr_id"];
255 if (!is_array(
$_POST[
"usr_id"]) &&
$_GET[
"usr_id"] > 0) {
256 $user_ids[] =
$_GET[
"usr_id"];
259 include_once(
"./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
260 $not_changed =
array();
261 foreach ($user_ids as $user_id) {
263 if (!$mem_skills->publish($this->container->getRefId())) {
264 $not_changed[] = $user_id;
268 if (count($not_changed) == 0) {
278 $ctrl->redirect($this,
"listMembers");
291 $tabs->activateSubTab(
"members");
293 $user_ids =
$_POST[
"usr_id"];
294 if (!is_array(
$_POST[
"usr_id"]) &&
$_GET[
"usr_id"] > 0) {
295 $user_ids[] =
$_GET[
"usr_id"];
298 if (!is_array($user_ids) || count($user_ids) == 0) {
300 $ctrl->redirect($this,
"listMembers");
302 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
304 $cgui->setFormAction(
$ctrl->getFormAction($this));
305 $cgui->setHeaderText(
$lng->txt(
"cont_really_deassign_skills"));
306 $cgui->setCancel(
$lng->txt(
"cancel"),
"listMembers");
307 $cgui->setConfirm(
$lng->txt(
"cont_deassign_competence"),
"deassignCompetences");
309 foreach ($user_ids as
$i) {
311 $cgui->addItem(
"usr_id[]", $i,
$name);
314 $tpl->setContent($cgui->getHTML());
326 foreach (
$_POST[
"usr_id"] as $user_id) {
327 include_once(
"./Services/Container/Skills/classes/class.ilContainerMemberSkills.php");
333 $ctrl->redirect($this,
"listMembers");
350 $tabs->activateSubTab(
"competences");
353 $lng->txt(
"cont_add_skill"),
354 $ctrl->getLinkTarget($this,
"selectSkill")
358 include_once(
"./Services/Container/Skills/classes/class.ilContSkillTableGUI.php");
372 $tabs->activateSubTab(
"competences");
374 include_once(
"./Services/Skill/classes/class.ilSkillSelectorGUI.php");
376 if (!$sel->handleCommand()) {
377 $tpl->setContent($sel->getHTML());
389 $s = explode(
":", (
$_GET[
"selected_skill"]));
391 $this->container_skills->addSkill((
int)
$s[0], (
int) $s[1]);
392 $this->container_skills->save();
396 $ctrl->redirect($this,
"listCompetences");
408 if (!is_array(
$_POST[
"id"]) || count(
$_POST[
"id"]) == 0) {
410 $ctrl->redirect($this,
"listCompetences");
412 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
414 $cgui->setFormAction(
$ctrl->getFormAction($this));
415 $cgui->setHeaderText(
$lng->txt(
"cont_really_remove_skill_from_course"));
416 $cgui->setCancel(
$lng->txt(
"cancel"),
"listCompetences");
417 $cgui->setConfirm(
$lng->txt(
"remove"),
"removeSelectedSkill");
420 $s = explode(
":", $i);
424 $tpl->setContent($cgui->getHTML());
436 if (is_array(
$_POST[
"id"]) && count(
$_POST[
"id"]) > 0) {
438 $s = explode(
":", $id);
439 $this->container_skills->removeSkill(
$s[0],
$s[1]);
441 $this->container_skills->save();
445 $ctrl->redirect($this,
"listCompetences");
459 $tabs->activateSubTab(
"settings");
474 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
479 $op1 =
new ilRadioOption(
$lng->txt(
"cont_skill_publish_auto"), 0,
$lng->txt(
"cont_skill_publish_auto_info"));
480 $radg->addOption($op1);
481 $op2 =
new ilRadioOption(
$lng->txt(
"cont_skill_publish_manual"), 1,
$lng->txt(
"cont_skill_publish_manual_info"));
482 $radg->addOption($op2);
483 $form->addItem($radg);
486 $form->addCommandButton(
"saveSettings",
$lng->txt(
"save"));
489 $form->setFormAction(
$ctrl->getFormAction($this));
508 $ctrl->redirect($this,
"settings");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupName($a_user_id)
lookup user name
This class represents an option in a radio group.
executeCommand()
Execute command.
saveCompetenceAssignment()
Save competence assignment.
setValue($a_value)
Set Value.
getSkillLevels()
Get Skill levels.
getPathString($a_skill_id, $a_tref_id=0)
Get path string.
selectSkill()
Select skill for container.
deassignCompetencesConfirm()
Deassign competences confirmation.
TableGUI class for competences in containers.
if(!array_key_exists('StateId', $_REQUEST)) $id
listMembers()
List members.
saveLevelForSkills($a_level_data)
Save levels for skills.
confirmRemoveSelectedSkill()
Confirm.
TableGUI class for container members / skill assignments.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
deassignCompetences()
Deassign competences.
saveSelectedSkill()
Save selected skill.
if(isset($_POST['submit'])) $form
listCompetences()
Select competences.
initSettingsForm()
Init settings form.
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:
__construct($a_container_gui)
Constructor.
saveSettings()
Save settings.
Create styles array
The data for the language used.
assignCompetences()
Assign competences to a member.
static _lookupTitle($a_obj_id, $a_tref_id=0)
Lookup Title.
publishAssignments()
Publish assignments.
Explorer class that works on tree objects (Services/Tree)
removeSelectedSkill()
Remove skill from course selection.
Container skills administration.
This class represents a non editable value in a property form.
initCompetenceAssignmentForm()
Init competence assignment form.
static _writeContainerSetting($a_id, $a_keyword, $a_value)
removeAllSkillLevels()
Remove all skill levels.
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
Confirmation screen class.