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;
46 $this->
setTitle($this->lng->txt(
"Staff"));
52 $this->
addColumn($this->lng->txt(
"firstname"),
"first_name");
53 $this->
addColumn($this->lng->txt(
"lastname"),
"last_name");
54 if ($this->recursive) {
55 $this->
addColumn($this->lng->txt(
'obj_orgu'),
'org_units');
57 $this->
addColumn($this->lng->txt(
"action"));
61 if($this->staff ==
"employee")
63 elseif($this->staff ==
"superior")
66 throw new Exception(
"The ilOrgUnitStaffTableGUI's staff variable has to be either 'employee' or 'superior'");
73 foreach($user_ids as $user_id){
99 $set[
"first_name"] = $user->getFirstname();
100 $set[
"last_name"] = $user->getLastname();
101 $set[
"user_object"] = $user;
102 $set[
"user_id"] = $user_id;
108 $this->tpl->setVariable(
"FIRST_NAME", $set[
"first_name"]);
109 $this->tpl->setVariable(
"LAST_NAME", $set[
"last_name"]);
110 if ($this->recursive) {
112 $this->tpl->setVariable(
"ORG_UNITS", implode(
', ', $orgUnitsTitles));
114 $this->ctrl->setParameterByClass(
"illearningprogressgui",
"obj_id", $set[
"user_id"]);
115 $this->ctrl->setParameterByClass(
"ilobjorgunitgui",
"obj_id", $set[
"user_id"]);
117 $selection->setListTitle($lng->txt(
"Actions"));
118 $selection->setId(
"selection_list_user_lp_".$set[
"user_id"]);
122 $selection->addItem($lng->txt(
"show_learning_progress"),
"show_learning_progress", $this->ctrl->getLinkTargetByClass(array(
"ilAdministrationGUI",
"ilObjOrgUnitGUI",
"ilLearningProgressGUI"),
""));
125 if($this->staff ==
"employee")
127 if($this->staff ==
"superior")
130 $this->tpl->setVariable(
"ACTIONS", $selection->getHTML());
138 $selection->addItem($this->lng->txt(
"remove"),
"delete_from_employees", $this->ctrl->getLinkTargetByClass(
"ilOrgUnitStaffGUI",
"confirmRemoveFromEmployees"));
139 $selection->addItem($this->lng->txt(
"change_to_superior"),
"change_to_superior", $this->ctrl->getLinkTargetByClass(
"ilOrgUnitStaffGUI",
"fromEmployeeToSuperior"));
146 $selection->addItem($this->lng->txt(
"remove"),
"delete_from_superiors", $this->ctrl->getLinkTargetByClass(
"ilOrgUnitStaffGUI",
"confirmRemoveFromSuperiors"));
147 $selection->addItem($this->lng->txt(
"change_to_employee"),
"change_to_employee", $this->ctrl->getLinkTargetByClass(
"ilOrgUnitStaffGUI",
"fromSuperiorToEmployee"));