19 declare(strict_types=1);
46 $to_int =
$dic[
'refinery']->kindlyTo()->int();
47 $this->orgu_ref_id =
$dic[
'query']->retrieve(
'ref_id', $to_int);
50 $this->dropdownbuilder =
$dic[
'dropdownbuilder'];
71 $this->
addColumn($this->
lng->txt(
"firstname"),
"first_name");
72 $this->
addColumn($this->
lng->txt(
"lastname"),
"last_name");
81 $access = $DIC[
'ilAccess'];
86 $parent = (
int) $orgu_tree->getParent($this->orgu_ref_id);
88 while ($parent !== $root) {
91 self::$permission_access_staff_recursive,
92 $orgu_tree->getAllChildren($parent)
95 $parent = (
int) $orgu_tree->getParent($parent);
98 foreach ($orgu_tree->getAllChildren($this->orgu_ref_id) as
$ref_id) {
99 $recursive = in_array(
$ref_id, self::$permission_access_staff_recursive);
105 self::$permission_access_staff_recursive,
106 $orgu_tree->getAllChildren(
$ref_id)
114 foreach ($orgu_tree->getAssignedUsers([
$ref_id], $this->position->getId()) as $usr_id) {
115 if (!array_key_exists($usr_id,
$data)) {
118 'login' => $user->getLogin(),
119 'first_name' => $user->getFirstname(),
120 'last_name' => $user->getLastname(),
121 'user_id' => $usr_id,
122 'active' => $user->getActive(),
123 'orgu_assignments' => [],
126 $data[$usr_id] = $set;
131 $data[$usr_id][
'view_lp'] = $permission_view_lp ||
$data[$usr_id][
'view_lp'];
140 if ($this->
access->checkAccess(
"view_learning_progress",
"", $ref_id)) {
145 $checked_children = [];
146 while ($current !== $root) {
147 if (!array_key_exists($current, self::$permission_view_lp_recursive)) {
148 self::$permission_view_lp_recursive[$current]
149 = $this->
access->checkAccess(
"view_learning_progress_rec",
"", $current);
151 if (self::$permission_view_lp_recursive[$current]) {
153 foreach ($checked_children as $child) {
154 self::$permission_view_lp_recursive[$child] =
true;
159 $checked_children[] = $current;
168 $this->tpl->setVariable(
"LOGIN", $a_set[
"login"]);
169 $this->tpl->setVariable(
"FIRST_NAME", $a_set[
"first_name"]);
170 $this->tpl->setVariable(
"LAST_NAME", $a_set[
"last_name"]);
171 if($a_set[
"active"] ===
false) {
172 $this->tpl->setVariable(
"INACTIVE", $this->
lng->txt(
'usr_account_inactive'));
175 $orgus = $a_set[
'orgu_assignments'];
177 $this->tpl->setVariable(
"ORG_UNITS", implode(
',', $orgus));
180 $this->
ctrl->setParameterByClass(ilOrgUnitUserAssignmentGUI::class,
'usr_id', $a_set[
"user_id"]);
181 $this->
ctrl->setParameterByClass(
182 ilOrgUnitUserAssignmentGUI::class,
184 $this->position->getId()
187 $dropdownbuilder = $this->dropdownbuilder
189 'show_learning_progress',
190 $this->
ctrl->getLinkTargetByClass([
191 ilAdministrationGUI::class,
192 ilObjOrgUnitGUI::class,
193 ilLearningProgressGUI::class,
201 $this->
ctrl->getLinkTargetByClass(
202 ilOrgUnitUserAssignmentGUI::class,
205 $this->
access->checkAccess(
"write",
"", $this->orgu_ref_id)
207 $this->tpl->setVariable(
"ACTIONS", $dropdownbuilder->
get());
static _checkAccessStaffRec(int $ref_id)
static array $permission_access_staff_recursive
setTopCommands(bool $a_val)
mayViewLPIn(int $ref_id, ilObjOrgUnitTree $orgu_tree)
setFormAction(string $a_form_action, bool $a_multipart=false)
setEnableTitle(bool $a_enabletitle)
DropdownBuilder $dropdownbuilder
setShowTemplates(bool $a_value)
__construct(BaseCommands $parent_obj, string $parent_cmd, protected ilOrgUnitPosition $position)
withItem(string $label_lang_var, string $url, bool $condition=true)
setFormName(string $a_name="")
This is to construct/collect the entries (=Links) of a row's action-dropdown.
static _lookupObjId(int $ref_id)
static _enabledUserRelatedData()
static _enabledLearningProgress()
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector.
static _lookupTitle(int $obj_id)
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template.
const CMD_CONFIRM_RECURSIVE
static _checkAccessStaff(int $ref_id)
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
Class ilOrgUnitRecursiveUserAssignmentTableGUI.
static array $permission_view_lp_recursive
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)
setEnableHeader(bool $a_enableheader)
static _lookupActive(int $a_usr_id)
setPrefix(string $a_prefix)