diff --git a/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificates.php b/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificates.php index 1d60017869f0..4a9f736cc974 100644 --- a/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificates.php +++ b/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificates.php @@ -7,7 +7,6 @@ use Certificate\API\UserCertificateAPI; use ILIAS\DI\Container; use ILIAS\MyStaff\ilMyStaffAccess; -use ilLPStatus; use ilMStListCertificatesGUI; use ilMyStaffGUI; use ilOrgUnitOperation; @@ -18,11 +17,7 @@ */ class ilMStListCertificates { - - /** - * @var Container - */ - protected $dic; + protected Container $dic; /** * ilMStListCertificates constructor. @@ -34,11 +29,9 @@ public function __construct(Container $dic) } /** - * @param array $arr_usr_ids - * @param array $options * @return UserCertificateDto[] */ - public function getData(array $options = array()) : array + final public function getData(array $options = array()) : array { //Permission Filter $operation_access = ilOrgUnitOperation::OP_VIEW_CERTIFICATES; @@ -67,15 +60,13 @@ public function getData(array $options = array()) : array $usr_data_filter = $usr_data_filter->withObjectTitle($options['filters']['obj_title']); } - $data = array_merge($data, $cert_api->getUserCertificateData($usr_data_filter, + array_merge($data, $cert_api->getUserCertificateData($usr_data_filter, [ilMyStaffGUI::class, ilMStListCertificatesGUI::class])); } $unique_cert_data = []; foreach ($data as $cert_data) { - /** - * @var UserCertificateDto $cert_data - */ + assert($cert_data instanceof UserCertificateDto); $unique_cert_data[$cert_data->getCertificateId()] = $cert_data; } diff --git a/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesGUI.php b/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesGUI.php index 71696bec18a6..0f2eff3ba267 100644 --- a/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesGUI.php +++ b/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesGUI.php @@ -16,19 +16,10 @@ class ilMStListCertificatesGUI const CMD_INDEX = 'index'; const CMD_GET_ACTIONS = "getActions"; const CMD_RESET_FILTER = 'resetFilter'; - /** - * @var ilTable2GUI - */ - protected $table; - /** - * @var ilMyStaffAccess - */ - protected $access; + protected ilTable2GUI $table; + protected ilMyStaffAccess $access; private \ilGlobalTemplateInterface $main_tpl; - /** - * - */ public function __construct() { global $DIC; @@ -36,10 +27,7 @@ public function __construct() $this->access = ilMyStaffAccess::getInstance(); } - /** - * - */ - protected function checkAccessOrFail() + protected function checkAccessOrFail(): void { global $DIC; @@ -51,10 +39,7 @@ protected function checkAccessOrFail() } } - /** - * - */ - public function executeCommand() + final public function executeCommand(): void { global $DIC; @@ -90,18 +75,12 @@ public function executeCommand() } } - /** - * - */ - public function index() + final public function index(): void { $this->listUsers(); } - /** - * - */ - public function listUsers() + final public function listUsers(): void { global $DIC; @@ -112,10 +91,7 @@ public function listUsers() $DIC->ui()->mainTemplate()->setContent($this->table->getHTML()); } - /** - * - */ - public function applyFilter() + final public function applyFilter(): void { $this->table = new ilMStListCertificatesTableGUI($this, self::CMD_APPLY_FILTER); $this->table->writeFilterToSession(); @@ -123,10 +99,7 @@ public function applyFilter() $this->index(); } - /** - * - */ - public function resetFilter() + final public function resetFilter(): void { $this->table = new ilMStListCertificatesTableGUI($this, self::CMD_RESET_FILTER); $this->table->resetOffset(); @@ -134,30 +107,21 @@ public function resetFilter() $this->index(); } - /** - * @return string - */ - public function getId() + final public function getId(): string { $this->table = new ilMStListCertificatesTableGUI($this, self::CMD_INDEX); return $this->table->getId(); } - /** - * - */ - public function cancel() + final public function cancel(): void { global $DIC; $DIC->ctrl()->redirect($this); } - /** - * - */ - public function getActions() + final public function getActions(): void { global $DIC; diff --git a/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesTableGUI.php b/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesTableGUI.php index 91a72604cc42..63b6a3a33fdd 100644 --- a/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesTableGUI.php +++ b/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesTableGUI.php @@ -22,20 +22,9 @@ */ class ilMStListCertificatesTableGUI extends ilTable2GUI { + protected array $filter = array(); + protected ilMyStaffAccess $access; - /** - * @var array - */ - protected $filter = array(); - /** - * @var ilMyStaffAccess - */ - protected $access; - - /** - * @param ilMStListCertificatesGUI $parent_obj - * @param string $parent_cmd - */ public function __construct(ilMStListCertificatesGUI $parent_obj, $parent_cmd = ilMStListCertificatesGUI::CMD_INDEX) { global $DIC; @@ -68,10 +57,7 @@ public function __construct(ilMStListCertificatesGUI $parent_obj, $parent_cmd = $this->parseData(); } - /** - * - */ - protected function parseData() : void + private function parseData() : void { global $DIC; @@ -101,7 +87,7 @@ protected function parseData() : void $this->setData($data); } - public function initFilter() : void + final public function initFilter() : void { global $DIC; @@ -133,10 +119,7 @@ public function initFilter() : void } } - /** - * @return array - */ - public function getSelectableColumns() : array + final public function getSelectableColumns() : array { global $DIC; @@ -200,10 +183,7 @@ public function getSelectableColumns() : array return $cols; } - /** - * - */ - private function addColumns() + private function addColumns() : void { global $DIC; @@ -224,14 +204,11 @@ private function addColumns() } } - /** - * @param array $a_set - */ - public function fillRow(array $a_set) : void + final public function fillRow(array $a_set) : void { global $DIC; - $propGetter = Closure::bind(function($prop) { + $propGetter = Closure::bind(function ($prop) { return $this->$prop; }, $a_set, $a_set); @@ -276,11 +253,6 @@ public function fillRow(array $a_set) : void $this->tpl->parseCurrentBlock(); } - /** - * @param ilExcel $a_excel excel wrapper - * @param int $a_row - * @param array $a_set - */ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : void { $col = 0; @@ -290,10 +262,6 @@ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : v } } - /** - * @param ilCSVWriter $a_csv - * @param array $a_set - */ protected function fillRowCSV(ilCSVWriter $a_csv, array $a_set) : void { foreach ($this->getFieldValuesForExport($a_set) as $k => $v) { @@ -302,13 +270,9 @@ protected function fillRowCSV(ilCSVWriter $a_csv, array $a_set) : void $a_csv->addRow(); } - /** - * @param UserCertificateDto $user_certificate_dto - * @return array - */ - protected function getFieldValuesForExport(UserCertificateDto $user_certificate_dto) + private function getFieldValuesForExport(UserCertificateDto $user_certificate_dto) : array { - $propGetter = Closure::bind(function($prop) { + $propGetter = Closure::bind(function ($prop) { return $this->$prop; }, $user_certificate_dto, $user_certificate_dto); diff --git a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkill.php b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkill.php index 4e5949f5ed1b..4501981a508c 100644 --- a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkill.php +++ b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkill.php @@ -6,41 +6,13 @@ */ class ilMStListCompetencesSkill { + protected string $skill_title; + protected string $skill_level; + protected string $login; + protected string $last_name; + protected string $first_name; + protected integer $user_id; - /** - * @var string - */ - protected $skill_title; - /** - * @var string - */ - protected $skill_level; - /** - * @var string - */ - protected $login; - /** - * @var string - */ - protected $last_name; - /** - * @var string - */ - protected $first_name; - /** - * @var integer - */ - protected $user_id; - - /** - * ilMStListCompetencesSkill constructor. - * @param string $skill_title - * @param string $skill_level - * @param string $login - * @param string $last_name - * @param string $first_name - * @param int $user_id - */ public function __construct( string $skill_title, string $skill_level, @@ -57,98 +29,62 @@ public function __construct( $this->user_id = $user_id; } - /** - * @return string - */ - public function getSkillTitle() : string + final public function getSkillTitle() : string { return $this->skill_title; } - /** - * @param string $skill_title - */ - public function setSkillTitle(string $skill_title) : void + final public function setSkillTitle(string $skill_title) : void { $this->skill_title = $skill_title; } - /** - * @return string - */ - public function getSkillLevel() : string + final public function getSkillLevel() : string { return $this->skill_level; } - /** - * @param string $skill_level - */ - public function setSkillLevel(string $skill_level) : void + final public function setSkillLevel(string $skill_level) : void { $this->skill_level = $skill_level; } - /** - * @return string - */ - public function getLogin() : string + final public function getLogin() : string { return $this->login; } - /** - * @param string $login - */ - public function setLogin(string $login) : void + final public function setLogin(string $login) : void { $this->login = $login; } - /** - * @return string - */ - public function getLastName() : string + final public function getLastName() : string { return $this->last_name; } - /** - * @param string $last_name - */ - public function setLastName(string $last_name) : void + final public function setLastName(string $last_name) : void { $this->last_name = $last_name; } - /** - * @return string - */ - public function getFirstName() : string + final public function getFirstName() : string { return $this->first_name; } - /** - * @param string $first_name - */ - public function setFirstName(string $first_name) : void + final public function setFirstName(string $first_name) : void { $this->first_name = $first_name; } - /** - * @return int - */ - public function getUserId() : int + final public function getUserId() : int { return $this->user_id; } - /** - * @param int $user_id - */ - public function setUserId(int $user_id) : void + final public function setUserId(int $user_id) : void { $this->user_id = $user_id; } diff --git a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkills.php b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkills.php index 3b4790824bd9..21dfd7ec3ae0 100644 --- a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkills.php +++ b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkills.php @@ -9,11 +9,7 @@ */ class ilMStListCompetencesSkills { - - /** - * @var Container - */ - protected $dic; + protected Container $dic; /** * ilMStListCompetencesSkills constructor. @@ -28,7 +24,7 @@ public function __construct(Container $dic) * @param int[] $options * @return ilMStListCompetencesSkill[] */ - public function getData(array $options) + final public function getData(array $options) { //Permission Filter $operation_access = ilOrgUnitOperation::OP_VIEW_COMPETENCES; @@ -98,10 +94,6 @@ public function getData(array $options) return $skills; } - /** - * @param array $filters - * @return string - */ protected function getAdditionalWhereStatement(array $filters) : string { $wheres = []; diff --git a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsGUI.php b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsGUI.php index e5a0fa1aa3a5..cfa0e5263305 100644 --- a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsGUI.php +++ b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsGUI.php @@ -11,27 +11,15 @@ */ class ilMStListCompetencesSkillsGUI { - const CMD_APPLY_FILTER = 'applyFilter'; - const CMD_INDEX = 'index'; - const CMD_GET_ACTIONS = "getActions"; - const CMD_RESET_FILTER = 'resetFilter'; - /** - * @var ilTable2GUI - */ - protected $table; - /** - * @var ilMyStaffAccess - */ - protected $access; - /** - * @var Container - */ - private $dic; + public const CMD_APPLY_FILTER = 'applyFilter'; + public const CMD_INDEX = 'index'; + public const CMD_GET_ACTIONS = "getActions"; + public const CMD_RESET_FILTER = 'resetFilter'; + protected ilTable2GUI $table; + protected ilMyStaffAccess $access; + private Container $dic; private \ilGlobalTemplateInterface $main_tpl; - /** - * @param Container $dic - */ public function __construct(Container $dic) { global $DIC; @@ -50,7 +38,7 @@ protected function checkAccessOrFail() : void } } - public function executeCommand() : void + final public function executeCommand() : void { $cmd = $this->dic->ctrl()->getCmd(); $next_class = $this->dic->ctrl()->getNextClass(); @@ -71,12 +59,12 @@ public function executeCommand() : void } } - public function index() : void + final public function index() : void { $this->listUsers(); } - public function listUsers() : void + final public function listUsers() : void { $this->checkAccessOrFail(); @@ -85,7 +73,7 @@ public function listUsers() : void $this->dic->ui()->mainTemplate()->setContent($this->table->getHTML()); } - public function applyFilter() : void + final public function applyFilter() : void { $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_APPLY_FILTER, $this->dic); $this->table->writeFilterToSession(); @@ -93,7 +81,7 @@ public function applyFilter() : void $this->index(); } - public function resetFilter() : void + final public function resetFilter() : void { $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_RESET_FILTER, $this->dic); $this->table->resetOffset(); @@ -101,17 +89,14 @@ public function resetFilter() : void $this->index(); } - /** - * @return string - */ - public function getId() : string + final public function getId() : string { $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_INDEX, $this->dic); return $this->table->getId(); } - public function cancel() : void + final public function cancel() : void { $this->dic->ctrl()->redirect($this); } diff --git a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsTableGUI.php b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsTableGUI.php index 4119faa60dab..a25a775734d9 100644 --- a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsTableGUI.php +++ b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsTableGUI.php @@ -24,26 +24,11 @@ */ class ilMStListCompetencesSkillsTableGUI extends ilTable2GUI { + protected array $filter = array(); + protected ilMyStaffAccess $access; + protected Container $dic; - /** - * @var array - */ - protected $filter = array(); - /** - * @var ilMyStaffAccess - */ - protected $access; - /** - * @var Container - */ - protected $dic; - - /** - * @param $parent_obj - * @param string $parent_cmd - * @param Container $dic - */ - public function __construct($parent_obj, string $parent_cmd, Container $dic) + public function __construct(\ilObjectGUI $parent_obj, string $parent_cmd, Container $dic) { $this->dic = $dic; $this->access = ilMyStaffAccess::getInstance(); @@ -74,9 +59,6 @@ public function __construct($parent_obj, string $parent_cmd, Container $dic) $this->parseData(); } - /** - * - */ protected function parseData() { $this->setExternalSorting(true); @@ -108,10 +90,7 @@ protected function parseData() $this->setData($data); } - /** - * - */ - public function initFilter() : void + final public function initFilter() : void { // skill $item = new ilTextInputGUI($this->dic->language()->txt("skmg_skill"), 'skill'); @@ -149,10 +128,7 @@ public function initFilter() : void } } - /** - * @return array - */ - public function getSelectableColumns() : array + final public function getSelectableColumns() : array { $cols = array(); @@ -199,10 +175,7 @@ public function getSelectableColumns() : array return $cols; } - /** - * - */ - private function addColumns() + private function addColumns(): void { foreach ($this->getSelectableColumns() as $k => $v) { if ($this->isColumnSelected($k)) { @@ -221,10 +194,7 @@ private function addColumns() } } - /** - * @param array $a_set - */ - public function fillRow(array $a_set) : void + final public function fillRow(array $a_set) : void { $propGetter = Closure::bind(function($prop) { return $this->$prop; @@ -259,11 +229,6 @@ public function fillRow(array $a_set) : void $this->tpl->parseCurrentBlock(); } - /** - * @param ilExcel $a_excel excel wrapper - * @param int $a_row - * @param array $a_set - */ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : void { $col = 0; @@ -273,10 +238,6 @@ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : v } } - /** - * @param ilCSVWriter $a_csv - * @param array $a_set - */ protected function fillRowCSV(ilCSVWriter $a_csv, array $a_set) : void { foreach ($this->getFieldValuesForExport($a_set) as $k => $v) { @@ -285,11 +246,7 @@ protected function fillRowCSV(ilCSVWriter $a_csv, array $a_set) : void $a_csv->addRow(); } - /** - * @param ilMStListCompetencesSkill $selected_skill - * @return array - */ - protected function getFieldValuesForExport(ilMStListCompetencesSkill $selected_skill) + protected function getFieldValuesForExport(ilMStListCompetencesSkill $selected_skill): array { $propGetter = Closure::bind(function($prop) { return $this->$prop; diff --git a/Services/MyStaff/classes/ListCompetences/class.ilMStListCompetencesGUI.php b/Services/MyStaff/classes/ListCompetences/class.ilMStListCompetencesGUI.php index bc76f3960535..5afd6f28a959 100644 --- a/Services/MyStaff/classes/ListCompetences/class.ilMStListCompetencesGUI.php +++ b/Services/MyStaff/classes/ListCompetences/class.ilMStListCompetencesGUI.php @@ -12,43 +12,24 @@ */ class ilMStListCompetencesGUI { - const CMD_APPLY_FILTER = 'applyFilter'; - const CMD_INDEX = 'index'; - const CMD_GET_ACTIONS = "getActions"; - const CMD_RESET_FILTER = 'resetFilter'; - const SUB_TAB_SKILLS = 'skills'; - /** - * @var ilTable2GUI - */ - protected $table; - /** - * @var ilMyStaffAccess - */ - protected $access; - /** - * @var Container - */ - private $dic; + public const CMD_APPLY_FILTER = 'applyFilter'; + public const CMD_INDEX = 'index'; + public const CMD_GET_ACTIONS = "getActions"; + public const CMD_RESET_FILTER = 'resetFilter'; + public const SUB_TAB_SKILLS = 'skills'; + protected ilTable2GUI $table; + protected ilMyStaffAccess $access; + private Container $dic; private \ilGlobalTemplateInterface $main_tpl; - /** - * @param Container $dic - */ - public function __construct(Container $dic = null) + public function __construct(Container $dic) { - $this->main_tpl = $DIC->ui()->mainTemplate(); - if (is_null($dic)) { - global $DIC; - $dic = $DIC; - } + $this->main_tpl = $dic->ui()->mainTemplate(); $this->access = ilMyStaffAccess::getInstance(); $this->dic = $dic; } - /** - * - */ - protected function checkAccessOrFail() + protected function checkAccessOrFail(): void { if ($this->access->hasCurrentUserAccessToMyStaff()) { return; @@ -58,10 +39,7 @@ protected function checkAccessOrFail() } } - /** - * - */ - public function executeCommand() + final public function executeCommand(): void { $cmd = $this->dic->ctrl()->getCmd(); $next_class = $this->dic->ctrl()->getNextClass(); @@ -84,9 +62,6 @@ public function executeCommand() } } - /** - * @param string $subtab_active - */ protected function addSubTabs(string $subtab_active) : void { $this->dic->language()->loadLanguageModule('skmg'); @@ -102,18 +77,12 @@ protected function addSubTabs(string $subtab_active) : void $this->dic->tabs()->activateSubTab($subtab_active); } - /** - * - */ - public function index() + final public function index(): void { $this->dic->ctrl()->redirectByClass(ilMStListCompetencesSkillsGUI::class); } - /** - * - */ - public function getActions() + final public function getActions(): void { $mst_co_usr_id = $this->dic->http()->request()->getQueryParams()['mst_lco_usr_id']; $mst_lco_crs_ref_id = $this->dic->http()->request()->getQueryParams()['mst_lco_crs_ref_id']; diff --git a/Services/MyStaff/classes/ListCourses/class.ilMStListCourse.php b/Services/MyStaff/classes/ListCourses/class.ilMStListCourse.php index c8c3e59615b2..7aa5cbbfc63b 100644 --- a/Services/MyStaff/classes/ListCourses/class.ilMStListCourse.php +++ b/Services/MyStaff/classes/ListCourses/class.ilMStListCourse.php @@ -11,222 +11,127 @@ */ class ilMStListCourse { - const MEMBERSHIP_STATUS_REQUESTED = 1; - const MEMBERSHIP_STATUS_WAITINGLIST = 2; - const MEMBERSHIP_STATUS_REGISTERED = 3; - /** - * @var int - */ - protected $crs_ref_id; - /** - * @var string - */ - protected $crs_title; - /** - * @var int - */ - protected $usr_id; - /** - * @var int - */ - protected $usr_reg_status; - /** - * @var int - */ - protected $usr_lp_status; - /** - * @var string - */ - protected $usr_login; - /** - * @var string - */ - protected $usr_firstname; - /** - * @var string - */ - protected $usr_lastname; - /** - * @var string - */ - protected $usr_email; - - public function get($prop) + public const MEMBERSHIP_STATUS_REQUESTED = 1; + public const MEMBERSHIP_STATUS_WAITINGLIST = 2; + public const MEMBERSHIP_STATUS_REGISTERED = 3; + + protected int $crs_ref_id; + protected string $crs_title; + protected int $usr_id; + protected int $usr_reg_status; + protected int $usr_lp_status; + protected string $usr_login; + protected string $usr_firstname; + protected string $usr_lastname; + protected string $usr_email; + + final public function get(string $prop) : int|string { return $this->$prop; } - /** - * @return int - */ - public function getCrsRefId() + final public function getCrsRefId() : int { return $this->crs_ref_id; } - /** - * @param int $crs_ref_id - */ - public function setCrsRefId($crs_ref_id) + final public function setCrsRefId(int $crs_ref_id) : void { $this->crs_ref_id = $crs_ref_id; } - /** - * @return string - */ - public function getCrsTitle() + final public function getCrsTitle() : string { return $this->crs_title; } - /** - * @param string $crs_title - */ - public function setCrsTitle($crs_title) + final public function setCrsTitle(string $crs_title) : void { $this->crs_title = $crs_title; } - /** - * @return int - */ - public function getUsrId() + final public function getUsrId() : int { return $this->usr_id; } - /** - * @param int $usr_id - */ - public function setUsrId($usr_id) + final public function setUsrId(int $usr_id) : void { $this->usr_id = $usr_id; } - /** - * @return int - */ - public function getUsrRegStatus() + final public function getUsrRegStatus() : int { return $this->usr_reg_status; } - /** - * @param int $usr_reg_status - */ - public function setUsrRegStatus($usr_reg_status) + final public function setUsrRegStatus(int $usr_reg_status) : void { $this->usr_reg_status = $usr_reg_status; } - /** - * @return int - */ - public function getUsrLpStatus() + final public function getUsrLpStatus() : int { return $this->usr_lp_status; } - /** - * @param int $usr_lp_status - */ - public function setUsrLpStatus($usr_lp_status) + final public function setUsrLpStatus(int $usr_lp_status) : void { $this->usr_lp_status = $usr_lp_status; } - /** - * @return string - */ - public function getUsrLogin() + final public function getUsrLogin() : string { return $this->usr_login; } - /** - * @param string $usr_login - */ - public function setUsrLogin($usr_login) + final public function setUsrLogin(string $usr_login) { $this->usr_login = $usr_login; } - /** - * @return string - */ - public function getUsrFirstname() + final public function getUsrFirstname() : string { return $this->usr_firstname; } - /** - * @param string $usr_firstname - */ - public function setUsrFirstname($usr_firstname) + final public function setUsrFirstname(string $usr_firstname) : void { $this->usr_firstname = $usr_firstname; } - /** - * @return string - */ - public function getUsrLastname() + final public function getUsrLastname() : string { return $this->usr_lastname; } - /** - * @param string $usr_lastname - */ - public function setUsrLastname($usr_lastname) + final public function setUsrLastname(string $usr_lastname) { $this->usr_lastname = $usr_lastname; } - /** - * @return string - */ - public function getUsrEmail() + final public function getUsrEmail() : string { return $this->usr_email; } - /** - * @param string $usr_email - */ - public function setUsrEmail($usr_email) + final public function setUsrEmail(string $usr_email) { $this->usr_email = $usr_email; } //Other - - /** - * @return ilObjUser - */ - public function returnIlUserObj() + final public function returnIlUserObj() : ilObjUser { - $il_user_obj = new ilObjUser($this->usr_id); - - return $il_user_obj; + return new ilObjUser($this->usr_id); } - /** - * @return ilObjCourse - */ - public function returnIlCourseObj() + final public function returnIlCourseObj() : ilObjCourse { - $il_course_obj = new ilObjCourse($this->crs_ref_id); - - return $il_course_obj; + return new ilObjCourse($this->crs_ref_id); } - /** - * @param int $status - * @return string - */ - public static function getMembershipStatusText($status) + final public static function getMembershipStatusText(int $status) : string { global $DIC; diff --git a/Services/MyStaff/classes/ListCourses/class.ilMStListCourses.php b/Services/MyStaff/classes/ListCourses/class.ilMStListCourses.php index e6434c2fd5df..8033bdc6d920 100644 --- a/Services/MyStaff/classes/ListCourses/class.ilMStListCourses.php +++ b/Services/MyStaff/classes/ListCourses/class.ilMStListCourses.php @@ -13,11 +13,7 @@ */ class ilMStListCourses { - - /** - * @var Container - */ - protected $dic; + protected Container $dic; /** * ilMStListCourses constructor. @@ -28,12 +24,7 @@ public function __construct(Container $dic) $this->dic = $dic; } - /** - * @param array $arr_usr_ids - * @param array $options - * @return array|int - */ - public function getData(array $arr_usr_ids = array(), array $options = array()) + final public function getData(array $arr_usr_ids = array(), array $options = array()): array|int { //Permission Filter $operation_access = ilOrgUnitOperation::OP_ACCESS_ENROLMENTS; @@ -130,12 +121,8 @@ public function getData(array $arr_usr_ids = array(), array $options = array()) /** * Returns the WHERE Part for the Queries using parameter $user_ids AND local variable $filters - * @param array $arr_usr_ids - * @param array $arr_filter - * @param string $tmp_table_user_matrix - * @return string */ - protected function createWhereStatement(array $arr_filter) + protected function createWhereStatement(array $arr_filter): string { $where = array(); diff --git a/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesGUI.php b/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesGUI.php index bcfcd3f534dd..7181e2499777 100644 --- a/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesGUI.php +++ b/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesGUI.php @@ -11,23 +11,14 @@ */ class ilMStListCoursesGUI { - const CMD_APPLY_FILTER = 'applyFilter'; - const CMD_INDEX = 'index'; - const CMD_GET_ACTIONS = "getActions"; - const CMD_RESET_FILTER = 'resetFilter'; - /** - * @var ilTable2GUI - */ - protected $table; - /** - * @var ilMyStaffAccess - */ - protected $access; + public const CMD_APPLY_FILTER = 'applyFilter'; + public const CMD_INDEX = 'index'; + public const CMD_GET_ACTIONS = "getActions"; + public const CMD_RESET_FILTER = 'resetFilter'; + protected ilTable2GUI $table; + protected ilMyStaffAccess $access; private \ilGlobalTemplateInterface $main_tpl; - /** - * - */ public function __construct() { global $DIC; @@ -35,10 +26,7 @@ public function __construct() $this->access = ilMyStaffAccess::getInstance(); } - /** - * - */ - protected function checkAccessOrFail() + protected function checkAccessOrFail() : void { global $DIC; @@ -50,10 +38,7 @@ protected function checkAccessOrFail() } } - /** - * - */ - public function executeCommand() + final public function executeCommand() : void { global $DIC; @@ -85,18 +70,12 @@ public function executeCommand() } } - /** - * - */ - public function index() + final public function index() : void { $this->listUsers(); } - /** - * - */ - public function listUsers() + final public function listUsers() : void { global $DIC; @@ -107,10 +86,7 @@ public function listUsers() $DIC->ui()->mainTemplate()->setContent($this->table->getHTML()); } - /** - * - */ - public function applyFilter() + final public function applyFilter() : void { $this->table = new ilMStListCoursesTableGUI($this, self::CMD_APPLY_FILTER); $this->table->writeFilterToSession(); @@ -118,10 +94,7 @@ public function applyFilter() $this->index(); } - /** - * - */ - public function resetFilter() + final public function resetFilter() : void { $this->table = new ilMStListCoursesTableGUI($this, self::CMD_RESET_FILTER); $this->table->resetOffset(); @@ -129,30 +102,20 @@ public function resetFilter() $this->index(); } - /** - * @return string - */ - public function getId() + final public function getId() : string { $this->table = new ilMStListCoursesTableGUI($this, self::CMD_INDEX); return $this->table->getId(); } - /** - * - */ - public function cancel() + final public function cancel() : void { global $DIC; - $DIC->ctrl()->redirect($this); } - /** - * - */ - public function getActions() + final public function getActions() : void { global $DIC; diff --git a/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesTableGUI.php b/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesTableGUI.php index e3ade142687e..791987eed2be 100644 --- a/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesTableGUI.php +++ b/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesTableGUI.php @@ -24,15 +24,8 @@ */ class ilMStListCoursesTableGUI extends ilTable2GUI { - - /** - * @var array - */ - protected $filter = array(); - /** - * @var ilMyStaffAccess - */ - protected $access; + protected array $filter = array(); + protected ilMyStaffAccess $access; /** * @param ilMStListCoursesGUI $parent_obj @@ -70,9 +63,6 @@ public function __construct(ilMStListCoursesGUI $parent_obj, $parent_cmd = ilMSt $this->parseData(); } - /** - * - */ protected function parseData() { global $DIC; @@ -108,10 +98,7 @@ protected function parseData() $this->setData($data); } - /** - * - */ - public function initFilter() : void + final public function initFilter() : void { global $DIC; @@ -185,10 +172,7 @@ public function initFilter() : void } } - /** - * @return array - */ - public function getSelectableColumns() : array + final public function getSelectableColumns() : array { global $DIC; @@ -262,10 +246,7 @@ public function getSelectableColumns() : array return $cols; } - /** - * - */ - private function addColumns() + private function addColumns() : void { global $DIC; @@ -286,14 +267,11 @@ private function addColumns() } } - /** - * @param array $a_set - */ - public function fillRow(array $a_set) : void + final public function fillRow(array $a_set) : void { global $DIC; - $propGetter = Closure::bind(function($prop) { + $propGetter = Closure::bind(function ($prop) { return $this->$prop; }, $a_set, $a_set); @@ -348,11 +326,6 @@ public function fillRow(array $a_set) : void $this->tpl->parseCurrentBlock(); } - /** - * @param ilExcel $a_excel excel wrapper - * @param int $a_row - * @param array $a_set - */ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : void { $col = 0; @@ -362,10 +335,6 @@ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : v } } - /** - * @param ilCSVWriter $a_csv - * @param array $a_set - */ protected function fillRowCSV(ilCSVWriter $a_csv, array $a_set) : void { foreach ($this->getFieldValuesForExport($a_set) as $k => $v) { @@ -374,13 +343,9 @@ protected function fillRowCSV(ilCSVWriter $a_csv, array $a_set) : void $a_csv->addRow(); } - /** - * @param ilMStListCourse $my_staff_course - * @return array - */ - protected function getFieldValuesForExport(ilMStListCourse $my_staff_course) + protected function getFieldValuesForExport(ilMStListCourse $my_staff_course) : array { - $propGetter = Closure::bind(function($prop) { + $propGetter = Closure::bind(function ($prop) { return $this->$prop; }, $my_staff_course, $my_staff_course); diff --git a/Services/MyStaff/classes/ListUsers/class.ilMStListUser.php b/Services/MyStaff/classes/ListUsers/class.ilMStListUser.php index 2a63a275cbcd..707b03bcdaeb 100644 --- a/Services/MyStaff/classes/ListUsers/class.ilMStListUser.php +++ b/Services/MyStaff/classes/ListUsers/class.ilMStListUser.php @@ -10,419 +10,230 @@ */ class ilMStListUser { - - /** - * @var int - */ - protected $usr_id; - /** - * @var int - */ - protected $gender; - /** - * @var int - */ - protected $time_limit_owner; - /** - * @var int - */ - protected $active; - /** - * @var string - */ - protected $login; - /** - * @var string - */ - protected $title; - /** - * @var string - */ - protected $hobby; - /** - * @var string - */ - protected $institution; - /** - * @var string - */ - protected $department; - /** - * @var string - */ - protected $street; - /** - * @var string - */ - protected $zipcode; - /** - * @var string - */ - protected $city; - /** - * @var string - */ - protected $country; - /** - * @var string - */ - protected $sel_country; - /** - * @var string - */ - protected $matriculation; - /** - * @var string - */ - protected $firstname; - /** - * @var string - */ - protected $lastname; - /** - * @var string - */ - protected $email; - /** - * @var string - */ - protected $phone; - /** - * @var string - */ - protected $mobile_phone; - /** - * @var ilObjUser - */ - protected $il_user_obj; - - /** - * @return int - */ - public function getUsrId() + protected int $usr_id; + protected int $gender; + protected int $time_limit_owner; + protected int $active; + protected string $login; + protected string $title; + protected string $hobby; + protected string $institution; + protected string $department; + protected string $street; + protected string $zipcode; + protected string $city; + protected string $country; + protected string $sel_country; + protected string $matriculation; + protected string $firstname; + protected string $lastname; + protected string $email; + protected string $phone; + protected string $mobile_phone; + protected ilObjUser $il_user_obj; + + final public function getUsrId() : int { return $this->usr_id; } - /** - * @param int $usr_id - */ - public function setUsrId($usr_id) + final public function setUsrId(int $usr_id) { $this->usr_id = $usr_id; } - /** - * @return int - */ - public function getTimeLimitOwner() + final public function getTimeLimitOwner() : int { return $this->time_limit_owner; } - /** - * @param int $time_limit_owner - */ - public function setTimeLimitOwner($time_limit_owner) + final public function setTimeLimitOwner(int $time_limit_owner) { $this->time_limit_owner = $time_limit_owner; } - /** - * @return int - */ - public function getActive() + final public function getActive() : int { return $this->active; } - /** - * @param int $active - */ - public function setActive($active) + final public function setActive(int $active) { $this->active = $active; } - /** - * @return string - */ - public function getLogin() + final public function getLogin() : string { return $this->login; } - /** - * @param string $login - */ - public function setLogin($login) + final public function setLogin(string $login) { $this->login = $login; } - /** - * @return string - */ - public function getFirstname() + final public function getFirstname() : string { return $this->firstname; } - /** - * @param string $firstname - */ - public function setFirstname($firstname) + final public function setFirstname(string $firstname) { $this->firstname = $firstname; } - /** - * @return string - */ - public function getLastname() + final public function getLastname() : string { return $this->lastname; } - /** - * @param string $lastname - */ - public function setLastname($lastname) + final public function setLastname(string $lastname) { $this->lastname = $lastname; } - /** - * @return string - */ - public function getEmail() + final public function getEmail() : string { return $this->email; } - /** - * @param string $email - */ - public function setEmail($email) + final public function setEmail(string $email) { $this->email = $email; } - /** - * @return string - */ - public function getPhone() + final public function getPhone() : string { return $this->phone; } - /** - * @param string $phone - */ - public function setPhone($phone) + final public function setPhone(string $phone) { $this->phone = $phone; } - /** - * @return string - */ - public function getMobilePhone() + final public function getMobilePhone() : string { return $this->mobile_phone; } - /** - * @param string $mobile_phone - */ - public function setMobilePhone($mobile_phone) + final public function setMobilePhone(string $mobile_phone) { $this->mobile_phone = $mobile_phone; } - /** - * @return int - */ - public function getGender() + final public function getGender() : int { return $this->gender; } - /** - * @param int $gender - */ - public function setGender($gender) + final public function setGender(int $gender) { $this->gender = $gender; } - /** - * @return string - */ - public function getTitle() + final public function getTitle() : string { return $this->title; } - /** - * @param string $title - */ - public function setTitle($title) + final public function setTitle(string $title) { $this->title = $title; } - /** - * @return string - */ - public function getHobby() + final public function getHobby() : string { return $this->hobby; } - /** - * @param string $hobby - */ - public function setHobby($hobby) + final public function setHobby(string $hobby) { $this->hobby = $hobby; } - /** - * @return string - */ - public function getInstitution() + final public function getInstitution() : string { return $this->institution; } - /** - * @param string $institution - */ - public function setInstitution($institution) + final public function setInstitution(string $institution) { $this->institution = $institution; } - /** - * @return string - */ - public function getDepartment() + final public function getDepartment() : string { return $this->department; } - /** - * @param string $department - */ - public function setDepartment($department) + final public function setDepartment(string $department) { $this->department = $department; } - /** - * @return string - */ - public function getStreet() + final public function getStreet() : string { return $this->street; } - /** - * @param string $street - */ - public function setStreet($street) + final public function setStreet(string $street) { $this->street = $street; } - /** - * @return string - */ - public function getZipcode() + final public function getZipcode() : string { return $this->zipcode; } - /** - * @param string $zipcode - */ - public function setZipcode($zipcode) + final public function setZipcode(string $zipcode) { $this->zipcode = $zipcode; } - /** - * @return string - */ - public function getCity() + final public function getCity() : string { return $this->city; } - /** - * @param string $city - */ - public function setCity($city) + final public function setCity(string $city) { $this->city = $city; } - /** - * @return string - */ - public function getCountry() + final public function getCountry() : string { return $this->country; } - /** - * @param string $country - */ - public function setCountry($country) + final public function setCountry(string $country) { $this->country = $country; } - /** - * @return string - */ - public function getSelCountry() + final public function getSelCountry() : string { return $this->sel_country; } - /** - * @param string $sel_country - */ - public function setSelCountry($sel_country) + final public function setSelCountry(string $sel_country) { $this->sel_country = $sel_country; } - /** - * @return string - */ - public function getMatriculation() + final public function getMatriculation() : string { return $this->matriculation; } - /** - * @param string $matriculation - */ - public function setMatriculation($matriculation) + final public function setMatriculation(string $matriculation) { $this->matriculation = $matriculation; } - /** - * @return ilObjUser - */ - public function returnIlUserObj() + final public function returnIlUserObj() : ilObjUser { - $il_obj_user = new ilObjUser($this->usr_id); - - return $il_obj_user; + return new ilObjUser($this->usr_id); } } diff --git a/Services/MyStaff/classes/ListUsers/class.ilMStListUsers.php b/Services/MyStaff/classes/ListUsers/class.ilMStListUsers.php index 8252d9b09c4d..62f2e4ce303f 100644 --- a/Services/MyStaff/classes/ListUsers/class.ilMStListUsers.php +++ b/Services/MyStaff/classes/ListUsers/class.ilMStListUsers.php @@ -10,11 +10,7 @@ */ class ilMStListUsers { - - /** - * @var Container - */ - protected $dic; + protected Container $dic; /** * ilMStListUsers constructor. @@ -25,12 +21,7 @@ public function __construct(Container $dic) $this->dic = $dic; } - /** - * @param array $arr_usr_ids - * @param array $options - * @return array|int - */ - public function getData(array $arr_usr_ids = array(), array $options = array()) + final public function getData(array $arr_usr_ids = array(), array $options = array()): array|int { //Permissions if (count($arr_usr_ids) == 0) { @@ -122,11 +113,8 @@ public function getData(array $arr_usr_ids = array(), array $options = array()) /** * Returns the WHERE Part for the Queries using parameter $user_ids AND local variable $filters - * @param array $arr_usr_ids - * @param array $arr_filter - * @return string */ - private function createWhereStatement(array $arr_usr_ids, array $arr_filter) + private function createWhereStatement(array $arr_usr_ids, array $arr_filter): string { $where = array(); diff --git a/Services/MyStaff/classes/ListUsers/class.ilMStListUsersGUI.php b/Services/MyStaff/classes/ListUsers/class.ilMStListUsersGUI.php index d41b023cd47e..00a524dbabe8 100644 --- a/Services/MyStaff/classes/ListUsers/class.ilMStListUsersGUI.php +++ b/Services/MyStaff/classes/ListUsers/class.ilMStListUsersGUI.php @@ -10,24 +10,15 @@ */ class ilMStListUsersGUI { - const CMD_RESET_FILTER = 'resetFilter'; - const CMD_APPLY_FILTER = 'applyFilter'; - const CMD_INDEX = 'index'; - const CMD_GET_ACTIONS = "getActions"; - const CMD_ADD_USER_AUTO_COMPLETE = 'addUserAutoComplete'; - /** - * @var ilTable2GUI - */ - protected $table; - /** - * @var ilMyStaffAccess - */ - protected $access; + public const CMD_RESET_FILTER = 'resetFilter'; + public const CMD_APPLY_FILTER = 'applyFilter'; + public const CMD_INDEX = 'index'; + public const CMD_GET_ACTIONS = "getActions"; + public const CMD_ADD_USER_AUTO_COMPLETE = 'addUserAutoComplete'; + protected ilTable2GUI $table; + protected ilMyStaffAccess $access; private \ilGlobalTemplateInterface $main_tpl; - /** - * - */ public function __construct() { global $DIC; @@ -35,9 +26,6 @@ public function __construct() $this->access = ilMyStaffAccess::getInstance(); } - /** - * - */ protected function checkAccessOrFail() { global $DIC; @@ -50,10 +38,7 @@ protected function checkAccessOrFail() } } - /** - * - */ - public function executeCommand() + final public function executeCommand(): void { global $DIC; @@ -75,18 +60,12 @@ public function executeCommand() } } - /** - * - */ - public function index() + final public function index(): void { $this->listUsers(); } - /** - * - */ - public function listUsers() + final public function listUsers(): void { global $DIC; @@ -95,10 +74,7 @@ public function listUsers() $DIC->ui()->mainTemplate()->setContent($this->table->getHTML()); } - /** - * - */ - public function applyFilter() + final public function applyFilter(): void { $this->table = new ilMStListUsersTableGUI($this, self::CMD_APPLY_FILTER); $this->table->writeFilterToSession(); @@ -106,10 +82,7 @@ public function applyFilter() $this->index(); } - /** - * - */ - public function resetFilter() + final public function resetFilter(): void { $this->table = new ilMStListUsersTableGUI($this, self::CMD_RESET_FILTER); $this->table->resetOffset(); @@ -117,20 +90,14 @@ public function resetFilter() $this->index(); } - /** - * - */ - public function cancel() + final public function cancel(): void { global $DIC; $DIC->ctrl()->redirect($this); } - /** - * - */ - public function getActions() + final public function getActions(): void { global $DIC; diff --git a/Services/MyStaff/classes/ListUsers/class.ilMStListUsersTableGUI.php b/Services/MyStaff/classes/ListUsers/class.ilMStListUsersTableGUI.php index 4ced91348242..ae675727049f 100644 --- a/Services/MyStaff/classes/ListUsers/class.ilMStListUsersTableGUI.php +++ b/Services/MyStaff/classes/ListUsers/class.ilMStListUsersTableGUI.php @@ -22,15 +22,8 @@ */ class ilMStListUsersTableGUI extends ilTable2GUI { - - /** - * @var array - */ - protected $filter = array(); - /** - * @var ilMyStaffAccess - */ - protected $access; + protected array $filter = array(); + protected ilMyStaffAccess $access; /** * @param ilMStListUsersGUI $parent_obj @@ -67,10 +60,7 @@ public function __construct(ilMStListUsersGUI $parent_obj, $parent_cmd = ilMStLi $this->parseData(); } - /** - * - */ - protected function parseData() + protected function parseData() : void { global $DIC; @@ -107,10 +97,7 @@ protected function parseData() $this->setData($data); } - /** - * - */ - public function initFilter() : void + final public function initFilter() : void { global $DIC; @@ -143,10 +130,7 @@ public function initFilter() : void } } - /** - * @return array - */ - public function getSelectableColumns() : array + final public function getSelectableColumns() : array { $arr_fields_without_table_sort = array( 'org_units', @@ -165,10 +149,7 @@ public function getSelectableColumns() : array return $cols; } - /** - * - */ - private function addColumns() + private function addColumns() : void { global $DIC; @@ -193,14 +174,11 @@ private function addColumns() } } - /** - * @param array $a_set - */ - public function fillRow(array $a_set) : void + final public function fillRow(array $a_set) : void { global $DIC; - $propGetter = Closure::bind(function($prop) { + $propGetter = Closure::bind(function ($prop) { return $this->$prop; }, $a_set, $a_set); @@ -275,11 +253,7 @@ public function fillRow(array $a_set) : void $this->tpl->parseCurrentBlock(); } - /** - * Get profile back url - * @return string - */ - private function getProfileBackUrl() + private function getProfileBackUrl() : string { global $DIC; @@ -287,11 +261,6 @@ private function getProfileBackUrl() ilMyStaffGUI::CMD_INDEX)); } - /** - * @param ilExcel $a_excel excel wrapper - * @param int $a_row - * @param array $a_set - */ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : void { $col = 0; @@ -301,10 +270,6 @@ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : v } } - /** - * @param ilCSVWriter $a_csv - * @param array $a_set - */ protected function fillRowCSV(ilCSVWriter $a_csv, array $a_set) : void { foreach ($this->getFieldValuesForExport($a_set) as $k => $v) { @@ -313,15 +278,11 @@ protected function fillRowCSV(ilCSVWriter $a_csv, array $a_set) : void $a_csv->addRow(); } - /** - * @param ilMStListUser $my_staff_user - * @return array - */ - protected function getFieldValuesForExport(ilMStListUser $my_staff_user) + protected function getFieldValuesForExport(ilMStListUser $my_staff_user) : array { global $DIC; - $propGetter = Closure::bind(function($prop) { + $propGetter = Closure::bind(function ($prop) { return $this->$prop; }, $my_staff_user, $my_staff_user); diff --git a/Services/MyStaff/classes/Provider/StaffMainBarProvider.php b/Services/MyStaff/classes/Provider/StaffMainBarProvider.php index 36b8e2df0140..9843ce72b30d 100644 --- a/Services/MyStaff/classes/Provider/StaffMainBarProvider.php +++ b/Services/MyStaff/classes/Provider/StaffMainBarProvider.php @@ -27,7 +27,7 @@ class StaffMainBarProvider extends AbstractStaticMainMenuProvider /** * @inheritDoc */ - public function getStaticTopItems() : array + final public function getStaticTopItems() : array { return []; } @@ -35,7 +35,7 @@ public function getStaticTopItems() : array /** * @inheritDoc */ - public function getStaticSubItems() : array + final public function getStaticSubItems() : array { $this->dic->language()->loadLanguageModule('mst'); $dic = $this->dic; diff --git a/Services/MyStaff/classes/ShowUser/Competences/class.ilMStShowUserCompetencesGUI.php b/Services/MyStaff/classes/ShowUser/Competences/class.ilMStShowUserCompetencesGUI.php index 5cc9b20b5226..ac676bed3e04 100644 --- a/Services/MyStaff/classes/ShowUser/Competences/class.ilMStShowUserCompetencesGUI.php +++ b/Services/MyStaff/classes/ShowUser/Competences/class.ilMStShowUserCompetencesGUI.php @@ -13,27 +13,12 @@ class ilMStShowUserCompetencesGUI const CMD_SHOW_SKILLS = 'showSkills'; const CMD_INDEX = self::CMD_SHOW_SKILLS; const SUB_TAB_SKILLS = 'skills'; - /** - * @var int - */ - protected $usr_id; - /** - * @var ilTable2GUI - */ - protected $table; - /** - * @var ilMyStaffAccess - */ - protected $access; - /** - * @var Container - */ - private $dic; + private int $usr_id; + protected ilTable2GUI $table; + protected ilMyStaffAccess $access; + private Container $dic; private \ilGlobalTemplateInterface $main_tpl; - /** - * @param Container $dic - */ public function __construct(Container $dic) { global $DIC; @@ -45,10 +30,7 @@ public function __construct(Container $dic) $this->dic->ctrl()->setParameter($this, 'usr_id', $this->usr_id); } - /** - * - */ - protected function checkAccessOrFail() + protected function checkAccessOrFail() : void { if (!$this->usr_id) { $this->main_tpl->setOnScreenMessage('failure', $this->dic->language()->txt("permission_denied"), true); @@ -65,10 +47,7 @@ protected function checkAccessOrFail() } } - /** - * - */ - public function executeCommand() + final public function executeCommand() : void { $this->checkAccessOrFail(); @@ -88,10 +67,7 @@ public function executeCommand() } } - /** - * @param string $active_sub_tab - */ - protected function addSubTabs(string $active_sub_tab) + protected function addSubTabs(string $active_sub_tab) : void { $this->dic->language()->loadLanguageModule('skmg'); $this->dic->tabs()->addSubTab( @@ -103,10 +79,7 @@ protected function addSubTabs(string $active_sub_tab) $this->dic->tabs()->activateSubTab($active_sub_tab); } - /** - * - */ - protected function showSkills() + protected function showSkills() : void { $skills_gui = new ilPersonalSkillsGUI(); $skills = ilPersonalSkill::getSelectedUserSkills($this->usr_id); diff --git a/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesGUI.php b/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesGUI.php index 09246937fded..69fc4425a016 100644 --- a/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesGUI.php +++ b/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesGUI.php @@ -12,27 +12,15 @@ */ class ilMStShowUserCoursesGUI { - const CMD_INDEX = 'index'; - const CMD_RESET_FILTER = 'resetFilter'; - const CMD_APPLY_FILTER = 'applyFilter'; - const CMD_GET_ACTIONS = "getActions"; - /** - * @var int - */ - protected $usr_id; - /** - * @var ilTable2GUI - */ - protected $table; - /** - * @var ilMyStaffAccess - */ - protected $access; + public const CMD_INDEX = 'index'; + public const CMD_RESET_FILTER = 'resetFilter'; + public const CMD_APPLY_FILTER = 'applyFilter'; + public const CMD_GET_ACTIONS = "getActions"; + protected int $usr_id; + protected ilTable2GUI $table; + protected ilMyStaffAccess $access; private \ilGlobalTemplateInterface $main_tpl; - /** - * - */ public function __construct() { global $DIC; @@ -44,9 +32,6 @@ public function __construct() $DIC->ctrl()->setParameter($this, 'usr_id', $this->usr_id); } - /** - * - */ protected function checkAccessOrFail() { global $DIC; @@ -66,10 +51,7 @@ protected function checkAccessOrFail() } } - /** - * - */ - public function executeCommand() + final public function executeCommand() { global $DIC; @@ -99,17 +81,11 @@ public function executeCommand() } } - /** - * - */ - protected function index() + protected function index() : void { $this->listUsers(); } - /** - * - */ protected function listUsers() { global $DIC; @@ -122,10 +98,7 @@ protected function listUsers() $DIC->ui()->mainTemplate()->setContent($this->table->getHTML()); } - /** - * - */ - protected function applyFilter() + protected function applyFilter() : void { $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_APPLY_FILTER); $this->table->writeFilterToSession(); @@ -133,10 +106,7 @@ protected function applyFilter() $this->index(); } - /** - * - */ - protected function resetFilter() + protected function resetFilter() : void { $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_RESET_FILTER); $this->table->resetOffset(); @@ -144,30 +114,20 @@ protected function resetFilter() $this->index(); } - /** - * @return string - */ - public function getId() + final public function getId() : string { $this->table = new ilMStShowUserCoursesTableGUI($this, self::CMD_INDEX); return $this->table->getId(); } - /** - * - */ - public function cancel() + final public function cancel() : void { global $DIC; - $DIC->ctrl()->redirect($this); } - /** - * - */ - public function getActions() + final public function getActions() : void { global $DIC; diff --git a/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesTableGUI.php b/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesTableGUI.php index e19a06113144..7759001706a2 100644 --- a/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesTableGUI.php +++ b/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesTableGUI.php @@ -24,24 +24,10 @@ */ class ilMStShowUserCoursesTableGUI extends ilTable2GUI { + protected int $usr_id; + protected array $filter = array(); + protected ilMyStaffAccess $access; - /** - * @var int - */ - protected $usr_id; - /** - * @var array - */ - protected $filter = array(); - /** - * @var ilMyStaffAccess - */ - protected $access; - - /** - * @param ilMStShowUserCoursesGUI $parent_obj - * @param string $parent_cmd - */ public function __construct(ilMStShowUserCoursesGUI $parent_obj, $parent_cmd = ilMStShowUserCoursesGUI::CMD_INDEX) { global $DIC; @@ -74,10 +60,7 @@ public function __construct(ilMStShowUserCoursesGUI $parent_obj, $parent_cmd = i $this->parseData(); } - /** - * - */ - protected function parseData() + protected function parseData() : void { global $DIC; @@ -116,10 +99,7 @@ protected function parseData() $this->setData($data); } - /** - * - */ - public function initFilter() : void + final public function initFilter() : void { global $DIC; @@ -170,10 +150,7 @@ public function initFilter() : void } } - /** - * @return array - */ - public function getSelectableColumns() : array + final public function getSelectableColumns() : array { global $DIC; @@ -203,10 +180,7 @@ public function getSelectableColumns() : array return $cols; } - /** - * - */ - private function addColumns() + private function addColumns() : void { global $DIC; @@ -226,14 +200,11 @@ private function addColumns() } } - /** - * @param array $a_set - */ public function fillRow(array $a_set) : void { global $DIC; - $propGetter = Closure::bind(function($prop) { + $propGetter = Closure::bind(function ($prop) { return $this->$prop; }, $a_set, $a_set); @@ -283,11 +254,6 @@ public function fillRow(array $a_set) : void $this->tpl->parseCurrentBlock(); } - /** - * @param ilExcel $a_excel excel wrapper - * @param int $a_row - * @param array $a_set - */ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : void { $col = 0; @@ -297,10 +263,6 @@ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : v } } - /** - * @param ilCSVWriter $a_csv - * @param array $a_set - */ protected function fillRowCSV(ilCSVWriter $a_csv, array $a_set) : void { foreach ($this->getFieldValuesForExport($a_set) as $k => $v) { @@ -309,12 +271,9 @@ protected function fillRowCSV(ilCSVWriter $a_csv, array $a_set) : void $a_csv->addRow(); } - /** - * @param ilMStListCourse $my_staff_course - */ - protected function getFieldValuesForExport(ilMStListCourse $my_staff_course) + protected function getFieldValuesForExport(ilMStListCourse $my_staff_course) : array { - $propGetter = Closure::bind(function($prop) { + $propGetter = Closure::bind(function ($prop) { return $this->$prop; }, $my_staff_course, $my_staff_course); @@ -337,7 +296,7 @@ protected function getFieldValuesForExport(ilMStListCourse $my_staff_course) return $field_values; } - protected function getSpaceOrValue(string $string) + protected function getSpaceOrValue(string $string) : string { if (!$this->getExportMode()) { if (empty($string)) { diff --git a/Services/MyStaff/classes/ShowUser/class.ilMStShowUserGUI.php b/Services/MyStaff/classes/ShowUser/class.ilMStShowUserGUI.php index bb260c754550..6ce95ac9f579 100644 --- a/Services/MyStaff/classes/ShowUser/class.ilMStShowUserGUI.php +++ b/Services/MyStaff/classes/ShowUser/class.ilMStShowUserGUI.php @@ -10,27 +10,17 @@ */ class ilMStShowUserGUI { - const CMD_INDEX = 'index'; - const CMD_SHOW_USER = 'showUser'; - - const TAB_SHOW_USER = 'show_user'; - const TAB_SHOW_COURSES = 'show_courses'; - const TAB_SHOW_CERTIFICATES = 'show_certificates'; - const TAB_SHOW_COMPETENCES = 'show_competences'; - - /** - * @var int - */ - protected $usr_id; - /** - * @var ilMyStaffAccess - */ - protected $access; + public const CMD_INDEX = 'index'; + public const CMD_SHOW_USER = 'showUser'; + public const TAB_SHOW_USER = 'show_user'; + public const TAB_SHOW_COURSES = 'show_courses'; + public const TAB_SHOW_CERTIFICATES = 'show_certificates'; + public const TAB_SHOW_COMPETENCES = 'show_competences'; + + protected int $usr_id; + protected ilMyStaffAccess $access; private \ilGlobalTemplateInterface $main_tpl; - /** - * - */ public function __construct() { global $DIC; @@ -45,10 +35,7 @@ public function __construct() $DIC->ui()->mainTemplate()->setTitleIcon(ilObjUser::_getPersonalPicturePath($this->usr_id, "xxsmall")); } - /** - * - */ - protected function checkAccessOrFail() + protected function checkAccessOrFail() : void { global $DIC; @@ -66,10 +53,7 @@ protected function checkAccessOrFail() } } - /** - * - */ - public function executeCommand() + final public function executeCommand() : void { global $DIC; @@ -113,19 +97,13 @@ public function executeCommand() } } - /** - * - */ - protected function index() + protected function index() : void { global $DIC; $DIC->ctrl()->redirectByClass(ilMStShowUserCoursesGUI::class); } - /** - * - */ - protected function showUser() + protected function showUser() : void { global $DIC; @@ -139,20 +117,14 @@ protected function showUser() $DIC->ui()->mainTemplate()->setContent($pub_profile->getEmbeddable()); } - /** - * - */ - public function cancel() + public function cancel() : void { global $DIC; $DIC->ctrl()->redirect($this); } - /** - * @param string $active_tab_id - */ - protected function addTabs($active_tab_id) + protected function addTabs(string $active_tab_id) : void { global $DIC; diff --git a/Services/MyStaff/classes/class.ilMyStaffAccess.php b/Services/MyStaff/classes/class.ilMyStaffAccess.php index 8d78a42d6a05..14424a29ff30 100644 --- a/Services/MyStaff/classes/class.ilMyStaffAccess.php +++ b/Services/MyStaff/classes/class.ilMyStaffAccess.php @@ -16,27 +16,19 @@ class ilMyStaffAccess extends ilObjectAccess { - const TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_SPEC_PERMISSIONS = 'tmp_obj_spec_perm'; - const TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_DEFAULT_PERMISSIONS = 'tmp_obj_def_perm'; - const TMP_DEFAULT_TABLE_NAME_PREFIX_IL_ORGU_DEFAULT_PERMISSIONS = 'tmp_orgu_def_perm'; - const TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS = 'tmp_crs_members'; - const TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS = 'tmp_orgu_members'; - const TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX = 'tmp_obj_user_matr'; - const DEFAULT_ORG_UNIT_OPERATION = ilOrgUnitOperation::OP_ACCESS_ENROLMENTS; - const DEFAULT_CONTEXT = 'crs'; - /** - * @var self - */ - protected static $instance = null; - /** - * @var - */ - protected static $orgu_users_of_current_user_show_staff_permission; - - /** - * @return self - */ - public static function getInstance() + public const TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_SPEC_PERMISSIONS = 'tmp_obj_spec_perm'; + public const TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_DEFAULT_PERMISSIONS = 'tmp_obj_def_perm'; + public const TMP_DEFAULT_TABLE_NAME_PREFIX_IL_ORGU_DEFAULT_PERMISSIONS = 'tmp_orgu_def_perm'; + public const TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS = 'tmp_crs_members'; + public const TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS = 'tmp_orgu_members'; + public const TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX = 'tmp_obj_user_matr'; + public const DEFAULT_ORG_UNIT_OPERATION = ilOrgUnitOperation::OP_ACCESS_ENROLMENTS; + public const DEFAULT_CONTEXT = 'crs'; + + protected static ?self $instance = null; + protected static array $orgu_users_of_current_user_show_staff_permission; + + public static function getInstance() : self { global $DIC; @@ -58,16 +50,10 @@ public static function getInstance() return self::$instance; } - /** - * - */ private function __construct() { } - /** - * @return bool - */ public function hasCurrentUserAccessToMyStaff() : bool { global $DIC; @@ -106,9 +92,6 @@ public function hasCurrentUserAccessToMyStaff() : bool return false; } - /** - * @return bool - */ public function hasCurrentUserAccessToCertificates() : bool { global $DIC; @@ -127,9 +110,6 @@ public function hasCurrentUserAccessToCertificates() : bool return false; } - /** - * @return bool - */ public function hasCurrentUserAccessToCompetences() : bool { global $DIC; @@ -148,11 +128,7 @@ public function hasCurrentUserAccessToCompetences() : bool return false; } - /** - * @param int $usr_id - * @return bool - */ - public function hasCurrentUserAccessToUser($usr_id = 0) : bool + public function hasCurrentUserAccessToUser(int $usr_id = 0) : bool { global $DIC; @@ -164,20 +140,13 @@ public function hasCurrentUserAccessToUser($usr_id = 0) : bool return false; } - /** - * @param int $ref_id - * @return bool - */ - public function hasCurrentUserAccessToLearningProgressInObject($ref_id = 0) : bool + public function hasCurrentUserAccessToLearningProgressInObject(int $ref_id = 0) : bool { global $DIC; return $DIC->access()->checkPositionAccess(ilOrgUnitOperation::OP_READ_LEARNING_PROGRESS, $ref_id); } - /** - * @return bool - */ public function hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser() : bool { global $DIC; @@ -192,11 +161,7 @@ public function hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser() return false; } - /** - * @param int $user_id - * @return int - */ - public function countOrgusOfUserWithAtLeastOneOperation($user_id) + public function countOrgusOfUserWithAtLeastOneOperation(int $user_id) : int { global $DIC; @@ -212,17 +177,11 @@ public function countOrgusOfUserWithAtLeastOneOperation($user_id) return $rec['cnt']; } - /** - * @param int $user_id - * @param string $org_unit_operation_string see ilOrgUnitOperation - * @param string $context - * @return int - */ public function countOrgusOfUserWithOperationAndContext( - $user_id, - $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, - $context = self::DEFAULT_CONTEXT - ) { + int $user_id, + string $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, + string $context = self::DEFAULT_CONTEXT + ) : int { global $DIC; /** @@ -244,19 +203,12 @@ public function countOrgusOfUserWithOperationAndContext( return $rec['cnt']; } - /** - * @param int $user_id - * @param string $org_unit_operation_string - * @param string $context - * @param string $tmp_table_name_prefix - * @return array - */ public function getUsersForUserOperationAndContext( - $user_id, - $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, - $context = self::DEFAULT_CONTEXT, - $tmp_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX - ) { + int $user_id, + string $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, + string $context = self::DEFAULT_CONTEXT, + string $tmp_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX + ) : array { global $DIC; $tmp_table_name = $this->buildTempTableIlobjectsUserMatrixForUserOperationAndContext($user_id, @@ -275,11 +227,7 @@ public function getUsersForUserOperationAndContext( return $arr_users; } - /** - * @param $user_id - * @return array - */ - public function getUsersForUserPerPosition($user_id) : array + public function getUsersForUserPerPosition(int $user_id) : array { $users = []; $user_assignments = ilOrgUnitUserAssignmentQueries::getInstance()->getAssignmentsOfUserId($user_id); @@ -292,11 +240,9 @@ public function getUsersForUserPerPosition($user_id) : array } /** - * @param int $user_id - * @param int|null $position_id * @return int[] */ - public function getUsersForUser($user_id, ?int $position_id = null) : array + public function getUsersForUser(int $user_id, ?int $position_id = null) : array { global $DIC; @@ -361,12 +307,6 @@ public function getUsersForUser($user_id, ?int $position_id = null) : array return $arr_users; } - /** - * @param int $user_id - * @param string $operation - * @param bool $return_ref_id - * @return int[] - */ public function getIdsForUserAndOperation(int $user_id, string $operation, bool $return_ref_id = false) : array { $user_assignments = ilOrgUnitUserAssignmentQueries::getInstance()->getAssignmentsOfUserId($user_id); @@ -375,19 +315,13 @@ public function getIdsForUserAndOperation(int $user_id, string $operation, bool $ref_ids = $this->getIdsForPositionAndOperation($user_assignment->getPositionId(), $operation, $return_ref_id); if (count($ref_ids) > 0) { - $ids = array_merge($ids, $ref_ids); + array_merge($ids, $ref_ids); } } return $ids; } - /** - * @param int $position_id - * @param string $operation - * @param bool $return_ref_id - * @return array - */ public function getIdsForPositionAndOperation(int $position_id, string $operation, bool $return_ref_id) : array { $ids = []; @@ -395,7 +329,7 @@ public function getIdsForPositionAndOperation(int $position_id, string $operatio $ref_ids = $this->getIdsForPositionAndOperationAndContext($position_id, $operation, $context, $return_ref_id); if (count($ref_ids) > 0) { - $ids = array_merge($ids, $ref_ids); + array_merge($ids, $ref_ids); } } @@ -406,11 +340,6 @@ public function getIdsForPositionAndOperation(int $position_id, string $operatio * returns all obj_ids/ref_ids (depending on flag "ref_id") of objects of type $context, * to which the position with $position_id has permissions * on the operation with $operation_id - * @param int $position_id - * @param string $operation - * @param string $context - * @param bool $return_ref_id - * @return array */ public function getIdsForPositionAndOperationAndContext( int $position_id, @@ -443,17 +372,11 @@ public function getIdsForPositionAndOperationAndContext( $query .= ' where position_id = ' . $position_id . ' and context_id = ' . $context_id . ' and operations like \'%"' . $operation_id . '"%\' and parent_id <> -1'; } - return array_map(function($item) use ($return_ref_id) { + return array_map(function ($item) use ($return_ref_id) { return $return_ref_id ? $item['ref_id'] : $item['obj_id']; }, $DIC->database()->fetchAll($DIC->database()->query($query))); } - /** - * @param int $position_id - * @param int $operation_id - * @param int $context_id - * @return bool - */ public function hasPositionDefaultPermissionForOperationInContext( int $position_id, int $operation_id, @@ -469,23 +392,16 @@ public function hasPositionDefaultPermissionForOperationInContext( return (bool) $DIC->database()->numRows($res) > 0; } - /** - * @param int $user_id - * @param string $org_unit_operation_string - * @param string $context - * @return array - */ public function getIlobjectsAndUsersForUserOperationAndContext( - $user_id, - $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, - $context = self::DEFAULT_CONTEXT - ) { + int $user_id, + string $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, + string $context = self::DEFAULT_CONTEXT + ) : array { global $DIC; - /** - * @var ilOrgUnitOperation $operation - */ + $operation = ilOrgUnitOperationQueries::findByOperationString($org_unit_operation_string, $context); + assert($operation instanceof ilOrgUnitOperation); $tmp_table_name = 'tmp_ilobj_user_matrix_' . $operation->getOperationId(); @@ -505,27 +421,18 @@ public function getIlobjectsAndUsersForUserOperationAndContext( return $arr_user_obj; } - /** - * @param int $user_id - * @param string $org_unit_operation_string - * @param string $context - * @param string $temporary_table_name_prefix - * @return string - */ public function buildTempTableIlobjectsUserMatrixForUserOperationAndContext( - $user_id, - $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, - $context = self::DEFAULT_CONTEXT, - $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX - ) { + int $user_id, + string $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, + string $context = self::DEFAULT_CONTEXT, + string $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX + ) : string { global $DIC; $temporary_table_name = $temporary_table_name_prefix . "_" . $org_unit_operation_string . "_" . $context; - /** - * @var ilOrgUnitOperation $operation - */ $operation = ilOrgUnitOperationQueries::findByOperationString($org_unit_operation_string, $context); + assert($operation instanceof ilOrgUnitOperation); $all_users_for_user = $this->getUsersForUser($GLOBALS['DIC']->user()->getId()); @@ -644,25 +551,17 @@ public function buildTempTableIlobjectsUserMatrixForUserOperationAndContext( return $temporary_table_name; } - /** - * @param string $org_unit_operation_string - * @param string $context - * @param string $temporary_table_name_prefix - * @return string - */ public function buildTempTableIlobjectsSpecificPermissionSetForOperationAndContext( - $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, - $context = self::DEFAULT_CONTEXT, - $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_SPEC_PERMISSIONS - ) { + string $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, + string $context = self::DEFAULT_CONTEXT, + string $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_SPEC_PERMISSIONS + ) : string { global $DIC; $temporary_table_name = $temporary_table_name_prefix . "_" . $org_unit_operation_string . "_" . $context; - /** - * @var ilOrgUnitOperation $operation - */ $operation = ilOrgUnitOperationQueries::findByOperationString($org_unit_operation_string, $context); + assert($operation instanceof ilOrgUnitOperation); if ($temporary_table_name != self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_SPEC_PERMISSIONS . "_" . self::DEFAULT_ORG_UNIT_OPERATION . "_" . self::DEFAULT_CONTEXT @@ -696,17 +595,11 @@ public function buildTempTableIlobjectsSpecificPermissionSetForOperationAndConte return $temporary_table_name; } - /** - * @param string $org_unit_operation_string - * @param string $context - * @param string $temporary_table_name_prefix - * @return string - */ public function buildTempTableIlobjectsDefaultPermissionSetForOperationAndContext( - $org_unit_operation_string = ilOrgUnitOperation::OP_ACCESS_ENROLMENTS, - $context = self::DEFAULT_CONTEXT, - $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_DEFAULT_PERMISSIONS - ) { + string $org_unit_operation_string = ilOrgUnitOperation::OP_ACCESS_ENROLMENTS, + string $context = self::DEFAULT_CONTEXT, + string $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_DEFAULT_PERMISSIONS + ) : string { global $DIC; $temporary_table_name = $temporary_table_name_prefix . "_" . $org_unit_operation_string . "_" . $context; @@ -765,10 +658,10 @@ public function buildTempTableIlobjectsDefaultPermissionSetForOperationAndContex * @return string */ public function buildTempTableIlorgunitDefaultPermissionSetForOperationAndContext( - $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, - $context = self::DEFAULT_CONTEXT, - $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_ORGU_DEFAULT_PERMISSIONS - ) { + string $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, + string $context = self::DEFAULT_CONTEXT, + string $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_ORGU_DEFAULT_PERMISSIONS + ) : string { global $DIC; $temporary_table_name = $temporary_table_name_prefix . "_" . $org_unit_operation_string . "_" . $context; @@ -807,15 +700,10 @@ public function buildTempTableIlorgunitDefaultPermissionSetForOperationAndContex return $temporary_table_name; } - /** - * @param string $temporary_table_name_prefix - * @param array $only_courses_of_user_ids - * @return string - */ public function buildTempTableCourseMemberships( - $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS, + string $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS, array $only_courses_of_user_ids = array() - ) { + ) : string { global $DIC; $temporary_table_name = $temporary_table_name_prefix . "_user_id_" . $DIC->user()->getId(); @@ -852,15 +740,10 @@ public function buildTempTableCourseMemberships( return $temporary_table_name; } - /** - * @param string $temporary_table_name_prefix - * @param array $only_orgus_of_user_ids - * @return string - */ public function buildTempTableOrguMemberships( - $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS, + string $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS, array $only_orgus_of_user_ids = array() - ) { + ) : string { global $DIC; $temporary_table_name = $temporary_table_name_prefix . "_user_id_" . $DIC->user()->getId(); @@ -898,17 +781,11 @@ public function buildTempTableOrguMemberships( return $temporary_table_name; } - /** - * @param string $temporary_table_name - * @return bool - */ - public function dropTempTable($temporary_table_name) + public function dropTempTable(string $temporary_table_name) : void { global $DIC; $q = "DROP TABLE IF EXISTS " . $temporary_table_name; $DIC->database()->manipulate($q); - - return true; } } diff --git a/Services/MyStaff/classes/class.ilMyStaffCachedAccessDecorator.php b/Services/MyStaff/classes/class.ilMyStaffCachedAccessDecorator.php index d8905693173a..df0a7cf52528 100644 --- a/Services/MyStaff/classes/class.ilMyStaffCachedAccessDecorator.php +++ b/Services/MyStaff/classes/class.ilMyStaffCachedAccessDecorator.php @@ -32,7 +32,7 @@ public function __construct(Container $dic, ilMyStaffAccess $origin) $this->origin = $origin; } - public function hasCurrentUserAccessToMyStaff() : bool + final public function hasCurrentUserAccessToMyStaff() : bool { static $cache = null; @@ -46,7 +46,7 @@ public function hasCurrentUserAccessToMyStaff() : bool return $cache; } - public function hasCurrentUserAccessToCertificates() : bool + final public function hasCurrentUserAccessToCertificates() : bool { static $cache = null; @@ -57,7 +57,7 @@ public function hasCurrentUserAccessToCertificates() : bool return $cache; } - public function hasCurrentUserAccessToCompetences() : bool + final public function hasCurrentUserAccessToCompetences() : bool { static $cache = null; @@ -68,7 +68,7 @@ public function hasCurrentUserAccessToCompetences() : bool return $cache; } - public function hasCurrentUserAccessToUser($usr_id = 0) : bool + final public function hasCurrentUserAccessToUser($usr_id = 0) : bool { static $cache = []; @@ -79,7 +79,7 @@ public function hasCurrentUserAccessToUser($usr_id = 0) : bool return $cache[$usr_id]; } - public function hasCurrentUserAccessToLearningProgressInObject($ref_id = 0) : bool + final public function hasCurrentUserAccessToLearningProgressInObject($ref_id = 0) : bool { static $cache = []; @@ -90,7 +90,7 @@ public function hasCurrentUserAccessToLearningProgressInObject($ref_id = 0) : bo return $cache[$ref_id]; } - public function hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser() : bool + final public function hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser() : bool { static $cache = null; @@ -121,12 +121,12 @@ public function hasPositionDefaultPermissionForOperationInContext( return $cache[$cache_key]; } - public function countOrgusOfUserWithAtLeastOneOperation($user_id) : int + final public function countOrgusOfUserWithAtLeastOneOperation($user_id) : int { return $this->origin->countOrgusOfUserWithAtLeastOneOperation($user_id); } - public function countOrgusOfUserWithOperationAndContext( + final public function countOrgusOfUserWithOperationAndContext( $user_id, $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, $context = self::DEFAULT_CONTEXT @@ -138,7 +138,7 @@ public function countOrgusOfUserWithOperationAndContext( ); } - public function getUsersForUserOperationAndContext( + final public function getUsersForUserOperationAndContext( $user_id, $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, $context = self::DEFAULT_CONTEXT, @@ -152,17 +152,17 @@ public function getUsersForUserOperationAndContext( ); } - public function getUsersForUserPerPosition($user_id) : array + final public function getUsersForUserPerPosition($user_id) : array { return $this->origin->getUsersForUserPerPosition($user_id); } - public function getUsersForUser($user_id, ?int $position_id = null) : array + final public function getUsersForUser($user_id, ?int $position_id = null) : array { return $this->origin->getUsersForUser($user_id, $position_id); } - public function getIdsForUserAndOperation(int $user_id, string $operation, bool $return_ref_id = false) : array + final public function getIdsForUserAndOperation(int $user_id, string $operation, bool $return_ref_id = false) : array { return $this->origin->getIdsForUserAndOperation( $user_id, @@ -171,7 +171,7 @@ public function getIdsForUserAndOperation(int $user_id, string $operation, bool ); } - public function getIdsForPositionAndOperation(int $position_id, string $operation, bool $return_ref_id) : array + final public function getIdsForPositionAndOperation(int $position_id, string $operation, bool $return_ref_id) : array { return $this->origin->getIdsForPositionAndOperation( $position_id, @@ -180,7 +180,7 @@ public function getIdsForPositionAndOperation(int $position_id, string $operatio ); } - public function getIdsForPositionAndOperationAndContext( + final public function getIdsForPositionAndOperationAndContext( int $position_id, string $operation, string $context, @@ -194,7 +194,7 @@ public function getIdsForPositionAndOperationAndContext( ); } - public function getIlobjectsAndUsersForUserOperationAndContext( + final public function getIlobjectsAndUsersForUserOperationAndContext( $user_id, $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, $context = self::DEFAULT_CONTEXT @@ -206,7 +206,7 @@ public function getIlobjectsAndUsersForUserOperationAndContext( ); } - public function buildTempTableIlobjectsUserMatrixForUserOperationAndContext( + final public function buildTempTableIlobjectsUserMatrixForUserOperationAndContext( $user_id, $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, $context = self::DEFAULT_CONTEXT, @@ -220,7 +220,7 @@ public function buildTempTableIlobjectsUserMatrixForUserOperationAndContext( ); } - public function buildTempTableIlobjectsSpecificPermissionSetForOperationAndContext( + final public function buildTempTableIlobjectsSpecificPermissionSetForOperationAndContext( $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, $context = self::DEFAULT_CONTEXT, $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_SPEC_PERMISSIONS @@ -232,7 +232,7 @@ public function buildTempTableIlobjectsSpecificPermissionSetForOperationAndConte ); } - public function buildTempTableIlobjectsDefaultPermissionSetForOperationAndContext( + final public function buildTempTableIlobjectsDefaultPermissionSetForOperationAndContext( $org_unit_operation_string = ilOrgUnitOperation::OP_ACCESS_ENROLMENTS, $context = self::DEFAULT_CONTEXT, $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_DEFAULT_PERMISSIONS @@ -244,7 +244,7 @@ public function buildTempTableIlobjectsDefaultPermissionSetForOperationAndContex ); } - public function buildTempTableIlorgunitDefaultPermissionSetForOperationAndContext( + final public function buildTempTableIlorgunitDefaultPermissionSetForOperationAndContext( $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, $context = self::DEFAULT_CONTEXT, $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_ORGU_DEFAULT_PERMISSIONS @@ -256,7 +256,7 @@ public function buildTempTableIlorgunitDefaultPermissionSetForOperationAndContex ); } - public function buildTempTableCourseMemberships( + final public function buildTempTableCourseMemberships( $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS, array $only_courses_of_user_ids = [] ) : string { @@ -276,8 +276,8 @@ public function buildTempTableOrguMemberships( ); } - public function dropTempTable($temporary_table_name) : bool + final public function dropTempTable($temporary_table_name) : void { - return $this->origin->dropTempTable($temporary_table_name); + $this->origin->dropTempTable($temporary_table_name); } } diff --git a/Services/MyStaff/classes/class.ilMyStaffGUI.php b/Services/MyStaff/classes/class.ilMyStaffGUI.php index 03b746d32133..faa6f52021af 100644 --- a/Services/MyStaff/classes/class.ilMyStaffGUI.php +++ b/Services/MyStaff/classes/class.ilMyStaffGUI.php @@ -9,16 +9,13 @@ */ class ilMyStaffGUI { - const CMD_INDEX = 'index'; - const TAB_LIST_USERS = 'list_users'; - const TAB_LIST_COURSES = 'list_courses'; - const TAB_LIST_CERTIFICATES = 'list_certificates'; - const TAB_LIST_COMPETENCES = 'list_competences'; - const TAB_LIST_STUDY_PROGRAMME = 'list_study_programme'; - - /** - * - */ + public const CMD_INDEX = 'index'; + public const TAB_LIST_USERS = 'list_users'; + public const TAB_LIST_COURSES = 'list_courses'; + public const TAB_LIST_CERTIFICATES = 'list_certificates'; + public const TAB_LIST_COMPETENCES = 'list_competences'; + public const TAB_LIST_STUDY_PROGRAMME = 'list_study_programme'; + public function __construct() { global $DIC; @@ -31,10 +28,7 @@ public function __construct() $DIC->ui()->mainTemplate()->setTitle($DIC->language()->txt('mst_my_staff')); } - /** - * - */ - public function executeCommand() + final public function executeCommand(): void { global $DIC; @@ -71,17 +65,11 @@ public function executeCommand() $DIC->ui()->mainTemplate()->printToStdout(); } - /** - * @param ilAdvancedSelectionListGUI $selection - * @param int $usr_id - * @param string $return_url - * @return ilAdvancedSelectionListGUI - */ - public static function extendActionMenuWithUserActions( + final public static function extendActionMenuWithUserActions( ilAdvancedSelectionListGUI $selection, - $usr_id = 0, - $return_url = "" - ) { + int $usr_id = 0, + string $return_url = "" + ): ilAdvancedSelectionListGUI { global $DIC; $user_action_collector = ilUserActionCollector::getInstance($DIC->user()->getId(), @@ -116,11 +104,7 @@ public static function extendActionMenuWithUserActions( return $selection; } - /** - * @param ilMStListCourse $my_staff_course - * @return string - */ - public static function getUserLpStatusAsHtml(ilMStListCourse $my_staff_course) + final public static function getUserLpStatusAsHtml(ilMStListCourse $my_staff_course): string { global $DIC; @@ -136,11 +120,7 @@ public static function getUserLpStatusAsHtml(ilMStListCourse $my_staff_course) return ' '; } - /** - * @param ilMStListCourse $my_staff_course - * @return string - */ - public static function getUserLpStatusAsText(ilMStListCourse $my_staff_course) + final public static function getUserLpStatusAsText(ilMStListCourse $my_staff_course): string { if (ilMyStaffAccess::getInstance()->hasCurrentUserAccessToLearningProgressInObject($my_staff_course->getCrsRefId())) { return ilLearningProgressBaseGUI::_getStatusText(intval($my_staff_course->getUsrLpStatus()));