ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilOrgUnitUserAssignmentTableGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
5
10{
11
19 protected $ctrl;
23 protected $parent_obj;
24
25
34 {
35 $this->parent_obj = $parent_obj;
36 $this->ilOrgUnitPosition = $position;
37 $this->ctrl = $GLOBALS["DIC"]->ctrl();
38 $this->setPrefix("il_orgu_" . $position->getId());
39 $this->setFormName('il_orgu_' . $position->getId());
40 $this->setId("il_orgu_" . $position->getId());
41
42 parent::__construct($parent_obj, $parent_cmd);
43
44 $this->setFormAction($this->ctrl->getFormAction($parent_obj));
45 $this->setTableHeaders();
46 $this->setTopCommands(true);
47 $this->setEnableHeader(true);
48 $this->setShowRowsSelector(true);
49 $this->setShowTemplates(false);
50 $this->setEnableHeader(true);
51 $this->setEnableTitle(true);
52 $this->setTitle($position->getTitle());
53 $this->setRowTemplate("tpl.staff_row.html", "Modules/OrgUnit");
54 $this->parseData();
55 }
56
57
58 protected function setTableHeaders()
59 {
60 $this->addColumn($this->lng->txt("firstname"), "first_name");
61 $this->addColumn($this->lng->txt("lastname"), "last_name");
62 $this->addColumn($this->lng->txt("action"));
63 }
64
65
66 public function parseData()
67 {
69 ->getAssignements($_GET["ref_id"], $this->ilOrgUnitPosition));
70
71 $this->setData($data);
72 }
73
74
80 protected function parseRows($user_ids)
81 {
82 $data = array();
83 foreach ($user_ids as $user_id) {
84 $set = array();
85 $this->setRowForUser($set, $user_id);
86 $data[] = $set;
87 }
88
89 return $data;
90 }
91
92
97 protected function setRowForUser(&$set, $user_id)
98 {
99 $user = new ilObjUser($user_id);
100 $set["first_name"] = $user->getFirstname();
101 $set["last_name"] = $user->getLastname();
102 $set["user_object"] = $user;
103 $set["user_id"] = $user_id;
104 }
105
106
110 public function fillRow($set)
111 {
112 global $DIC;
113
114 $lng = $DIC['lng'];
115 $ilAccess = $DIC['ilAccess'];
116 $this->tpl->setVariable("FIRST_NAME", $set["first_name"]);
117 $this->tpl->setVariable("LAST_NAME", $set["last_name"]);
118 // $this->ctrl->setParameterByClass(ilLearningProgressGUI::class, "obj_id", $set["user_id"]);
119 // $this->ctrl->setParameterByClass(ilObjOrgUnitGUI::class, "obj_id", $set["user_id"]);
120 $this->ctrl->setParameterByClass(ilOrgUnitUserAssignmentGUI::class, 'usr_id', $set["user_id"]);
121 $this->ctrl->setParameterByClass(ilOrgUnitUserAssignmentGUI::class, 'position_id', $this->ilOrgUnitPosition->getId());
122 $selection = new ilAdvancedSelectionListGUI();
123 $selection->setListTitle($lng->txt("Actions"));
124 $selection->setId("selection_list_user_lp_" . $set["user_id"]);
125
126 if ($ilAccess->checkAccess("view_learning_progress", "", $_GET["ref_id"])
129 $this->ctrl->setParameterByClass(ilLearningProgressGUI::class, 'obj_id', $set["user_id"]);
130 $selection->addItem($lng->txt("show_learning_progress"), "show_learning_progress", $this->ctrl->getLinkTargetByClass(array(
131 ilAdministrationGUI::class,
132 ilObjOrgUnitGUI::class,
133 ilLearningProgressGUI::class,
134 ), ""));
135 }
136 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
137 $this->addActions($selection);
138 }
139 $this->tpl->setVariable("ACTIONS", $selection->getHTML());
140 }
141
142
146 protected function addActions(&$selection)
147 {
148 $selection->addItem($this->lng->txt("remove"), "delete_from_employees", $this->ctrl->getLinkTargetByClass(ilOrgUnitUserAssignmentGUI::class, ilOrgUnitUserAssignmentGUI::CMD_CONFIRM));
149 }
150}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
User interface class for advanced drop-down selection lists.
static _enabledLearningProgress()
check wether learing progress is enabled or not
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
Class ilOrgUnitPosition.
Class ilOrgUnitUserAssignmentTableGUI.
__construct(BaseCommands $parent_obj, $parent_cmd, ilOrgUnitPosition $position)
ilOrgUnitUserAssignmentTableGUI constructor.
Class ilTable2GUI.
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
setEnableHeader($a_enableheader)
Set Enable Header.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setPrefix($a_prefix)
set prefix for sort and offset fields (if you have two or more tables on a page that you want to sort...
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setEnableTitle($a_enabletitle)
Set Enable Title.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setId($a_val)
Set id.
setFormName($a_formname="")
Set Form name.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setShowTemplates($a_value)
Toggle templates.
$user
Definition: migrateto20.php:57
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
global $DIC
Definition: saml.php:7