3 require_once(
"./Services/Table/classes/class.ilTable2GUI.php");
4 require_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
5 require_once(
"./Services/Tracking/classes/class.ilObjUserTracking.php");
30 $this->tabs = $ilTabs;
39 $this->
setFormAction($this->ctrl->getFormAction($parent_obj));
50 $this->
setTitle($this->lng->txt(
"Staff"));
56 $this->
addColumn($this->lng->txt(
"firstname"),
"first_name");
57 $this->
addColumn($this->lng->txt(
"lastname"),
"last_name");
58 if ($this->recursive) {
59 $this->
addColumn($this->lng->txt(
'obj_orgu'),
'org_units');
61 $this->
addColumn($this->lng->txt(
"action"));
65 if($this->staff ==
"employee")
67 elseif($this->staff ==
"superior")
70 throw new Exception(
"The ilOrgUnitStaffTableGUI's staff variable has to be either 'employee' or 'superior'");
77 foreach($user_ids as $user_id){
103 $set[
"first_name"] = $user->getFirstname();
104 $set[
"last_name"] = $user->getLastname();
105 $set[
"user_object"] = $user;
106 $set[
"user_id"] = $user_id;
112 $this->tpl->setVariable(
"FIRST_NAME", $set[
"first_name"]);
113 $this->tpl->setVariable(
"LAST_NAME", $set[
"last_name"]);
114 if ($this->recursive) {
116 $this->tpl->setVariable(
"ORG_UNITS", implode(
', ', $orgUnitsTitles));
118 $this->ctrl->setParameterByClass(
"illearningprogressgui",
"obj_id", $set[
"user_id"]);
119 $this->ctrl->setParameterByClass(
"ilobjorgunitgui",
"obj_id", $set[
"user_id"]);
121 $selection->setListTitle($lng->txt(
"Actions"));
122 $selection->setId(
"selection_list_user_lp_".$set[
"user_id"]);
126 $selection->addItem($lng->txt(
"show_learning_progress"),
"show_learning_progress", $this->ctrl->getLinkTargetByClass(array(
"ilAdministrationGUI",
"ilObjOrgUnitGUI",
"ilLearningProgressGUI"),
""));
129 if($this->staff ==
"employee")
131 if($this->staff ==
"superior")
134 $this->tpl->setVariable(
"ACTIONS", $selection->getHTML());
142 $selection->addItem($this->lng->txt(
"remove"),
"delete_from_employees", $this->ctrl->getLinkTargetByClass(
"ilOrgUnitStaffGUI",
"confirmRemoveFromEmployees"));
143 $selection->addItem($this->lng->txt(
"change_to_superior"),
"change_to_superior", $this->ctrl->getLinkTargetByClass(
"ilOrgUnitStaffGUI",
"fromEmployeeToSuperior"));
150 $selection->addItem($this->lng->txt(
"remove"),
"delete_from_superiors", $this->ctrl->getLinkTargetByClass(
"ilOrgUnitStaffGUI",
"confirmRemoveFromSuperiors"));
151 $selection->addItem($this->lng->txt(
"change_to_employee"),
"change_to_employee", $this->ctrl->getLinkTargetByClass(
"ilOrgUnitStaffGUI",
"fromSuperiorToEmployee"));