/** singleton access. */ public static function _getInstance() { if (self::$instance == null) { self::$instance = new ilObjOrgUnitTree(); } return self::$instance; }
function fillRow($set) { global $ilUser, $Access, $lng, $ilAccess; $this->tpl->setVariable("FIRST_NAME", $set["first_name"]); $this->tpl->setVariable("LAST_NAME", $set["last_name"]); if ($this->recursive) { $orgUnitsTitles = array_values(ilObjOrgUnitTree::_getInstance()->getTitles($set['org_units'])); $this->tpl->setVariable("ORG_UNITS", implode(', ', $orgUnitsTitles)); } $this->ctrl->setParameterByClass("illearningprogressgui", "obj_id", $set["user_id"]); $this->ctrl->setParameterByClass("ilobjorgunitgui", "obj_id", $set["user_id"]); $selection = new ilAdvancedSelectionListGUI(); $selection->setListTitle($lng->txt("Actions")); $selection->setId("selection_list_user_lp_" . $set["user_id"]); if ($ilAccess->checkAccess("view_learning_progress", "", $_GET["ref_id"]) and ilObjUserTracking::_enabledLearningProgress() and ilObjUserTracking::_enabledUserRelatedData()) { $selection->addItem($lng->txt("show_learning_progress"), "show_learning_progress", $this->ctrl->getLinkTargetByClass(array("ilAdministrationGUI", "ilObjOrgUnitGUI", "ilLearningProgressGUI"), "")); } if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && !$this->recursive) { if ($this->staff == "employee") { $this->addEmployeeActions($selection); } if ($this->staff == "superior") { $this->addSuperiorActions($selection); } } $this->tpl->setVariable("ACTIONS", $selection->getHTML()); }
/** * @param integer $ref_id * @param integer $usr_id * * @return bool */ static function _checkAccessToUserLearningProgress($ref_id, $usr_id) { global $ilAccess; //Permission to view the Learning Progress of an OrgUnit if ($ilAccess->checkAccess("view_learning_progress", "", $ref_id) and in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getEmployees($_GET["ref_id"], false))) { return true; } //Permission to view the Learning Progress of an OrgUnit or SubOrgUnit! if ($ilAccess->checkAccess("view_learning_progress_rec", "", $ref_id) and in_array($usr_id, ilObjOrgUnitTree::_getInstance()->getEmployees($_GET["ref_id"], true))) { return true; } return false; }