44 $this->ctrl = $DIC->ctrl();
45 $this->
setPrefix(
"il_orgu_" . $position->getId());
46 $this->
setFormName(
'il_orgu_' . $position->getId());
47 $this->
setId(
"il_orgu_" . $position->getId());
48 $this->orgu_ref_id = filter_input(INPUT_GET,
"ref_id", FILTER_SANITIZE_NUMBER_INT);
51 $this->
setFormAction($this->ctrl->getFormAction($parent_obj));
59 $this->
setTitle($position->getTitle());
67 $this->
addColumn($this->lng->txt(
"login"),
"login");
68 $this->
addColumn($this->lng->txt(
"firstname"),
"first_name");
69 $this->
addColumn($this->lng->txt(
"lastname"),
"last_name");
70 $this->
addColumn($this->lng->txt(
"obj_orgu"),
"orgus");
71 $this->
addColumn($this->lng->txt(
"action"));
80 $access = $DIC[
'ilAccess'];
85 $parent = (int) $orgu_tree->getParent($this->orgu_ref_id);
87 while ($parent !== $root) {
89 self::$permission_access_staff_recursive = array_merge(
90 self::$permission_access_staff_recursive,
91 $orgu_tree->getAllChildren($parent)
94 $parent = (int) $orgu_tree->getParent($parent);
97 foreach ($orgu_tree->getAllChildren($this->orgu_ref_id) as $ref_id) {
98 $recursive = in_array($ref_id, self::$permission_access_staff_recursive);
104 self::$permission_access_staff_recursive = array_merge(
105 self::$permission_access_staff_recursive,
106 $orgu_tree->getAllChildren($ref_id)
113 $permission_view_lp = $this->
mayViewLPIn($ref_id, $access, $orgu_tree);
114 foreach ($orgu_tree->getAssignements($ref_id, $this->ilOrgUnitPosition) as $usr_id) {
115 $usr_id = (int) $usr_id;
116 if (!array_key_exists($usr_id,
$data)) {
118 $set[
"login"] = $user->getLogin();
119 $set[
"first_name"] = $user->getFirstname();
120 $set[
"last_name"] = $user->getLastname();
121 $set[
"user_id"] = $user_id;
122 $set[
"orgu_assignments"] = [];
123 $set[
'view_lp'] =
false;
124 $set[
'user_id'] = $usr_id;
125 $data[$usr_id] = $set;
128 $data[$usr_id][
'view_lp'] = $permission_view_lp ||
$data[$usr_id][
'view_lp'];
143 if ($access->
checkAccess(
"view_learning_progress",
"", $ref_id)) {
146 $current = (int) $ref_id;
148 $checked_children = [];
149 while ($current !== $root) {
150 if (!array_key_exists($current, self::$permission_view_lp_recursive)) {
151 self::$permission_view_lp_recursive[$current]
152 = $access->
checkAccess(
"view_learning_progress_rec",
"", $current);
154 if (self::$permission_view_lp_recursive[$current]) {
156 foreach ($checked_children as $child) {
157 self::$permission_view_lp_recursive[$child] =
true;
162 $checked_children[] = $current;
163 $current = (int) $orgu_tree->
getParent($current);
178 $ilAccess = $DIC[
'ilAccess'];
179 $this->tpl->setVariable(
"LOGIN", $set[
"login"]);
180 $this->tpl->setVariable(
"FIRST_NAME", $set[
"first_name"]);
181 $this->tpl->setVariable(
"LAST_NAME", $set[
"last_name"]);
182 $orgus = $set[
'orgu_assignments'];
184 $this->tpl->setVariable(
"ORG_UNITS", implode(
',', $orgus));
185 $this->ctrl->setParameterByClass(ilOrgUnitUserAssignmentGUI::class,
'usr_id', $set[
"user_id"]);
186 $this->ctrl->setParameterByClass(ilOrgUnitUserAssignmentGUI::class,
'position_id', $this->
ilOrgUnitPosition->getId());
188 $selection->setListTitle(
$lng->txt(
"Actions"));
189 $selection->setId(
"selection_list_user_lp_" . $set[
"user_id"]);
194 $selection->addItem(
$lng->txt(
"show_learning_progress"),
"show_learning_progress", $this->ctrl->getLinkTargetByClass(array(
195 ilAdministrationGUI::class,
196 ilObjOrgUnitGUI::class,
197 ilLearningProgressGUI::class,
200 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) {
203 $this->tpl->setVariable(
"ACTIONS", $selection->getHTML());
213 $this->lng->txt(
"remove"),
214 "delete_from_employees",
mayViewLPIn($ref_id, ilAccess $access, ilObjOrgUnitTree $orgu_tree)
setShowTemplates($a_value)
Toggle templates.
static _checkAccessStaff($ref_id)
__construct(BaseCommands $parent_obj, string $parent_cmd, ilOrgUnitPosition $position)
ilOrgUnitUserAssignmentTableGUI constructor.
static _lookupTitle($a_id)
lookup object title
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
static _enabledUserRelatedData()
check wether user related tracking is enabled or not
static _enabledLearningProgress()
check wether learing progress is enabled or not
setTopCommands($a_val)
Set top commands (display command buttons on top of table, too)
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)(option...
static _lookupObjId($a_id)
static $permission_access_staff_recursive
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Class ilOrgUnitRecursiveUserAssignmentTableGUI.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
setFormName($a_formname="")
Set Form name.
__construct(Container $dic, ilPlugin $plugin)
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.
setShowRowsSelector($a_value)
Toggle rows-per-page selector.
setEnableHeader($a_enableheader)
Set Enable Header.
setEnableTitle($a_enabletitle)
Set Enable Title.
static $permission_view_lp_recursive
static _checkAccessStaffRec($ref_id)