From 05b4f65e4bb184d1e4bfff292c3f768e410d3a87 Mon Sep 17 00:00:00 2001 From: EMokross <74303328+EMokross@users.noreply.github.com> Date: Sat, 26 Feb 2022 18:06:35 +0100 Subject: [PATCH] new code style (#4021) Co-authored-by: Martin Studer --- .../class.ilMStListCertificates.php | 14 +- .../class.ilMStListCertificatesGUI.php | 22 +-- .../class.ilMStListCertificatesTableGUI.php | 24 +-- .../class.ilMStListCompetencesSkill.php | 25 +-- .../class.ilMStListCompetencesSkills.php | 27 +-- .../class.ilMStListCompetencesSkillsGUI.php | 17 +- ...ass.ilMStListCompetencesSkillsTableGUI.php | 26 +-- .../class.ilMStListCompetencesGUI.php | 16 +- .../ListCourses/class.ilMStListCourse.php | 24 +-- .../ListCourses/class.ilMStListCourses.php | 46 ++--- .../ListCourses/class.ilMStListCoursesGUI.php | 22 +-- .../class.ilMStListCoursesTableGUI.php | 35 ++-- .../classes/ListUsers/class.ilMStListUser.php | 43 +---- .../ListUsers/class.ilMStListUsers.php | 37 ++-- .../ListUsers/class.ilMStListUsersGUI.php | 56 +++--- .../class.ilMStListUsersTableGUI.php | 35 ++-- .../classes/Provider/StaffMainBarProvider.php | 10 +- .../class.ilMStShowUserCompetencesGUI.php | 7 - .../Courses/class.ilMStShowUserCourses.php | 2 +- .../Courses/class.ilMStShowUserCoursesGUI.php | 20 +-- .../class.ilMStShowUserCoursesTableGUI.php | 33 ++-- .../ShowUser/class.ilMStShowUserGUI.php | 45 +++-- .../MyStaff/classes/class.ilMyStaffAccess.php | 159 ++++++++---------- .../MyStaff/classes/class.ilMyStaffGUI.php | 28 ++- Services/MyStaff/maintenance.json | 24 +-- .../default/tpl.list_courses_row.html | 8 +- .../default/tpl.list_skills_row.html | 8 +- .../default/tpl.list_user_courses_row.html | 8 +- .../templates/default/tpl.list_users_row.html | 18 +- 29 files changed, 326 insertions(+), 513 deletions(-) diff --git a/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificates.php b/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificates.php index 658b61522770..1d60017869f0 100644 --- a/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificates.php +++ b/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificates.php @@ -14,7 +14,6 @@ /** * Class ilMStListCertificates - * * @author Martin Studer */ class ilMStListCertificates @@ -25,10 +24,8 @@ class ilMStListCertificates */ protected $dic; - /** * ilMStListCertificates constructor. - * * @param Container $dic */ public function __construct(Container $dic) @@ -36,11 +33,9 @@ public function __construct(Container $dic) $this->dic = $dic; } - /** * @param array $arr_usr_ids * @param array $options - * * @return UserCertificateDto[] */ public function getData(array $options = array()) : array @@ -48,7 +43,6 @@ public function getData(array $options = array()) : array //Permission Filter $operation_access = ilOrgUnitOperation::OP_VIEW_CERTIFICATES; - $_options = array( 'filters' => array(), 'sort' => array(), @@ -63,8 +57,8 @@ public function getData(array $options = array()) : array foreach ($users_per_position as $position_id => $users) { $usr_data_filter = new UserDataFilter(); $usr_data_filter = $usr_data_filter->withUserIds($users); - $usr_data_filter = $usr_data_filter->withObjIds(ilMyStaffAccess::getInstance()->getIdsForUserAndOperation($this->dic->user()->getId(), $operation_access)); - + $usr_data_filter = $usr_data_filter->withObjIds(ilMyStaffAccess::getInstance()->getIdsForUserAndOperation($this->dic->user()->getId(), + $operation_access)); if (!empty($options['filters']['user'])) { $usr_data_filter = $usr_data_filter->withUserLogin($options['filters']['user']); @@ -73,8 +67,8 @@ 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, [ilMyStaffGUI::class, ilMStListCertificatesGUI::class])); + $data = array_merge($data, $cert_api->getUserCertificateData($usr_data_filter, + [ilMyStaffGUI::class, ilMStListCertificatesGUI::class])); } $unique_cert_data = []; diff --git a/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesGUI.php b/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesGUI.php index 68fd9deb4222..71696bec18a6 100644 --- a/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesGUI.php +++ b/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesGUI.php @@ -5,9 +5,7 @@ /** * Class ilMStListCertificatesGUI - * * @author Martin Studer - * * @ilCtrl_IsCalledBy ilMStListCertificatesGUI: ilMyStaffGUI * @ilCtrl_Calls ilMStListCertificatesGUI: ilFormPropertyDispatchGUI * @ilCtrl_Calls ilMStListCertificatesGUI: ilUserCertificateApiGUI @@ -28,7 +26,6 @@ class ilMStListCertificatesGUI protected $access; private \ilGlobalTemplateInterface $main_tpl; - /** * */ @@ -39,7 +36,6 @@ public function __construct() $this->access = ilMyStaffAccess::getInstance(); } - /** * */ @@ -55,7 +51,6 @@ protected function checkAccessOrFail() } } - /** * */ @@ -95,7 +90,6 @@ public function executeCommand() } } - /** * */ @@ -104,7 +98,6 @@ public function index() $this->listUsers(); } - /** * */ @@ -119,7 +112,6 @@ public function listUsers() $DIC->ui()->mainTemplate()->setContent($this->table->getHTML()); } - /** * */ @@ -131,7 +123,6 @@ public function applyFilter() $this->index(); } - /** * */ @@ -143,7 +134,6 @@ public function resetFilter() $this->index(); } - /** * @return string */ @@ -154,7 +144,6 @@ public function getId() return $this->table->getId(); } - /** * */ @@ -165,7 +154,6 @@ public function cancel() $DIC->ctrl()->redirect($this); } - /** * */ @@ -181,22 +169,24 @@ public function getActions() if ($DIC->access()->checkAccess("visible", "", $mst_lco_crs_ref_id)) { $link = ilLink::_getStaticLink($mst_lco_crs_ref_id, ilMyStaffAccess::DEFAULT_CONTEXT); - $selection->addItem(ilObject2::_lookupTitle(ilObject2::_lookupObjectId($mst_lco_crs_ref_id)), '', $link); + $selection->addItem(ilObject2::_lookupTitle(ilObject2::_lookupObjectId($mst_lco_crs_ref_id)), '', + $link); }; $org_units = ilOrgUnitPathStorage::getTextRepresentationOfOrgUnits('ref_id'); foreach (ilOrgUnitUserAssignment::innerjoin('object_reference', 'orgu_id', 'ref_id')->where(array( 'user_id' => $mst_co_usr_id, 'object_reference.deleted' => null - ), array( 'user_id' => '=', 'object_reference.deleted' => '!=' ))->get() as $org_unit_assignment) { + ), array('user_id' => '=', 'object_reference.deleted' => '!='))->get() as $org_unit_assignment) { if ($DIC->access()->checkAccess("read", "", $org_unit_assignment->getOrguId())) { $link = ilLink::_getStaticLink($org_unit_assignment->getOrguId(), 'orgu'); $selection->addItem($org_units[$org_unit_assignment->getOrguId()], '', $link); } } - $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, rawurlencode($DIC->ctrl() - ->getLinkTarget($this, self::CMD_INDEX))); + $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, + rawurlencode($DIC->ctrl() + ->getLinkTarget($this, self::CMD_INDEX))); echo $selection->getHTML(true); } diff --git a/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesTableGUI.php b/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesTableGUI.php index 84fd305408a7..91a72604cc42 100644 --- a/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesTableGUI.php +++ b/Services/MyStaff/classes/ListCertificates/class.ilMStListCertificatesTableGUI.php @@ -18,7 +18,6 @@ /** * Class ilMStListCertificatesTableGUI - * * @author Martin Studer */ class ilMStListCertificatesTableGUI extends ilTable2GUI @@ -33,7 +32,6 @@ class ilMStListCertificatesTableGUI extends ilTable2GUI */ protected $access; - /** * @param ilMStListCertificatesGUI $parent_obj * @param string $parent_cmd @@ -70,7 +68,6 @@ public function __construct(ilMStListCertificatesGUI $parent_obj, $parent_cmd = $this->parseData(); } - /** * */ @@ -104,7 +101,6 @@ protected function parseData() : void $this->setData($data); } - public function initFilter() : void { global $DIC; @@ -116,7 +112,8 @@ public function initFilter() : void //user $item = new ilTextInputGUI($DIC->language()->txt("login") . "/" . $DIC->language()->txt("email") . "/" . $DIC->language() - ->txt("name"), "user"); + ->txt("name"), + "user"); $this->addFilterItem($item); $item->readFromSession(); @@ -136,7 +133,6 @@ public function initFilter() : void } } - /** * @return array */ @@ -204,7 +200,6 @@ public function getSelectableColumns() : array return $cols; } - /** * */ @@ -229,7 +224,6 @@ private function addColumns() } } - /** * @param array $a_set */ @@ -237,7 +231,7 @@ 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); @@ -246,7 +240,8 @@ public function fillRow(array $a_set) : void switch ($k) { case 'usr_assinged_orgus': $this->tpl->setCurrentBlock('td'); - $this->tpl->setVariable('VALUE', strval(ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_set->getUserId()))); + $this->tpl->setVariable('VALUE', + strval(ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_set->getUserId()))); $this->tpl->parseCurrentBlock(); break; case 'issuedOnTimestamp': @@ -258,7 +253,8 @@ public function fillRow(array $a_set) : void default: if ($propGetter($k) !== null) { $this->tpl->setCurrentBlock('td'); - $this->tpl->setVariable('VALUE', (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))); + $this->tpl->setVariable('VALUE', + (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock('td'); @@ -280,7 +276,6 @@ public function fillRow(array $a_set) : void $this->tpl->parseCurrentBlock(); } - /** * @param ilExcel $a_excel excel wrapper * @param int $a_row @@ -295,7 +290,6 @@ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : v } } - /** * @param ilCSVWriter $a_csv * @param array $a_set @@ -308,15 +302,13 @@ 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) { - $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 4c7a65b59145..4e5949f5ed1b 100644 --- a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkill.php +++ b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkill.php @@ -2,7 +2,6 @@ /** * Class ilMStListCompetencesSkill - * * @author Theodor Truffer */ class ilMStListCompetencesSkill @@ -33,10 +32,8 @@ class ilMStListCompetencesSkill */ protected $user_id; - /** * ilMStListCompetencesSkill constructor. - * * @param string $skill_title * @param string $skill_level * @param string $login @@ -44,8 +41,14 @@ class ilMStListCompetencesSkill * @param string $first_name * @param int $user_id */ - public function __construct(string $skill_title, string $skill_level, string $login, string $last_name, string $first_name, int $user_id) - { + public function __construct( + string $skill_title, + string $skill_level, + string $login, + string $last_name, + string $first_name, + int $user_id + ) { $this->skill_title = $skill_title; $this->skill_level = $skill_level; $this->login = $login; @@ -54,7 +57,6 @@ public function __construct(string $skill_title, string $skill_level, string $lo $this->user_id = $user_id; } - /** * @return string */ @@ -63,7 +65,6 @@ public function getSkillTitle() : string return $this->skill_title; } - /** * @param string $skill_title */ @@ -72,7 +73,6 @@ public function setSkillTitle(string $skill_title) : void $this->skill_title = $skill_title; } - /** * @return string */ @@ -81,7 +81,6 @@ public function getSkillLevel() : string return $this->skill_level; } - /** * @param string $skill_level */ @@ -90,7 +89,6 @@ public function setSkillLevel(string $skill_level) : void $this->skill_level = $skill_level; } - /** * @return string */ @@ -99,7 +97,6 @@ public function getLogin() : string return $this->login; } - /** * @param string $login */ @@ -108,7 +105,6 @@ public function setLogin(string $login) : void $this->login = $login; } - /** * @return string */ @@ -117,7 +113,6 @@ public function getLastName() : string return $this->last_name; } - /** * @param string $last_name */ @@ -126,7 +121,6 @@ public function setLastName(string $last_name) : void $this->last_name = $last_name; } - /** * @return string */ @@ -135,7 +129,6 @@ public function getFirstName() : string return $this->first_name; } - /** * @param string $first_name */ @@ -144,7 +137,6 @@ public function setFirstName(string $first_name) : void $this->first_name = $first_name; } - /** * @return int */ @@ -153,7 +145,6 @@ public function getUserId() : int return $this->user_id; } - /** * @param int $user_id */ diff --git a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkills.php b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkills.php index 2638ec0eab58..3b4790824bd9 100644 --- a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkills.php +++ b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkills.php @@ -5,7 +5,6 @@ /** * Class ilMStListCompetencesSkills - * * @author Theodor Truffer */ class ilMStListCompetencesSkills @@ -16,10 +15,8 @@ class ilMStListCompetencesSkills */ protected $dic; - /** * ilMStListCompetencesSkills constructor. - * * @param Container $dic */ public function __construct(Container $dic) @@ -27,10 +24,8 @@ public function __construct(Container $dic) $this->dic = $dic; } - /** * @param int[] $options - * * @return ilMStListCompetencesSkill[] */ public function getData(array $options) @@ -63,8 +58,10 @@ public function getData(array $options) $arr_query = []; foreach ($users_per_position as $position_id => $users) { - $obj_ids = ilMyStaffAccess::getInstance()->getIdsForUserAndOperation($this->dic->user()->getId(), $operation_access); - $arr_query[] = $query . $this->dic->database()->in('ulvl.trigger_obj_id', $obj_ids, false, 'integer') . " AND " . $this->dic->database()->in('sk.user_id ', $users, false, 'integer') + $obj_ids = ilMyStaffAccess::getInstance()->getIdsForUserAndOperation($this->dic->user()->getId(), + $operation_access); + $arr_query[] = $query . $this->dic->database()->in('ulvl.trigger_obj_id', $obj_ids, false, + 'integer') . " AND " . $this->dic->database()->in('sk.user_id ', $users, false, 'integer') . $this->getAdditionalWhereStatement($options['filters']); } @@ -101,10 +98,8 @@ public function getData(array $options) return $skills; } - /** * @param array $filters - * * @return string */ protected function getAdditionalWhereStatement(array $filters) : string @@ -120,10 +115,16 @@ protected function getAdditionalWhereStatement(array $filters) : string } if (!empty($filters['user'])) { - $wheres[] = "(" . $this->dic->database()->like("ud.login", "text", "%" . $filters['user'] . "%") . " " . "OR " . $this->dic->database() - ->like("ud.firstname", "text", "%" . $filters['user'] . "%") . " " . "OR " . $this->dic->database() - ->like("ud.lastname", "text", "%" . $filters['user'] . "%") . " " . "OR " . $this->dic->database() - ->like("ud.email", "text", "%" . $filters['user'] . "%") . ") "; + $wheres[] = "(" . $this->dic->database()->like("ud.login", "text", + "%" . $filters['user'] . "%") . " " . "OR " . $this->dic->database() + ->like("ud.firstname", "text", + "%" . $filters['user'] . "%") . " " . "OR " . $this->dic->database() + ->like("ud.lastname", + "text", + "%" . $filters['user'] . "%") . " " . "OR " . $this->dic->database() + ->like("ud.email", + "text", + "%" . $filters['user'] . "%") . ") "; } if (!empty($arr_filter['org_unit'])) { diff --git a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsGUI.php b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsGUI.php index 80f08093274c..e5a0fa1aa3a5 100644 --- a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsGUI.php +++ b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsGUI.php @@ -6,9 +6,7 @@ /** * Class ilMStListCompetencesSkillsGUI - * * @package ILIAS\MyStaff\ListCompetences - * * @author Theodor Truffer */ class ilMStListCompetencesSkillsGUI @@ -31,7 +29,6 @@ class ilMStListCompetencesSkillsGUI private $dic; private \ilGlobalTemplateInterface $main_tpl; - /** * @param Container $dic */ @@ -43,7 +40,6 @@ public function __construct(Container $dic) $this->dic = $dic; } - protected function checkAccessOrFail() : void { if ($this->access->hasCurrentUserAccessToMyStaff()) { @@ -54,7 +50,6 @@ protected function checkAccessOrFail() : void } } - public function executeCommand() : void { $cmd = $this->dic->ctrl()->getCmd(); @@ -76,13 +71,11 @@ public function executeCommand() : void } } - public function index() : void { $this->listUsers(); } - public function listUsers() : void { $this->checkAccessOrFail(); @@ -92,7 +85,6 @@ public function listUsers() : void $this->dic->ui()->mainTemplate()->setContent($this->table->getHTML()); } - public function applyFilter() : void { $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_APPLY_FILTER, $this->dic); @@ -101,7 +93,6 @@ public function applyFilter() : void $this->index(); } - public function resetFilter() : void { $this->table = new ilMStListCompetencesSkillsTableGUI($this, self::CMD_RESET_FILTER, $this->dic); @@ -110,7 +101,6 @@ public function resetFilter() : void $this->index(); } - /** * @return string */ @@ -121,13 +111,11 @@ public function getId() : string return $this->table->getId(); } - public function cancel() : void { $this->dic->ctrl()->redirect($this); } - protected function getActions() : void { global $DIC; @@ -137,8 +125,9 @@ protected function getActions() : void if ($mst_co_usr_id > 0) { $selection = new ilAdvancedSelectionListGUI(); - $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, rawurlencode($DIC->ctrl() - ->getLinkTarget($this, self::CMD_INDEX))); + $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, + rawurlencode($DIC->ctrl() + ->getLinkTarget($this, self::CMD_INDEX))); echo $selection->getHTML(true); } diff --git a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsTableGUI.php b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsTableGUI.php index 055d27ccc438..4119faa60dab 100644 --- a/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsTableGUI.php +++ b/Services/MyStaff/classes/ListCompetences/Skills/class.ilMStListCompetencesSkillsTableGUI.php @@ -20,7 +20,6 @@ /** * Class ilMStListCompetencesTableGUI - * * @author Martin Studer */ class ilMStListCompetencesSkillsTableGUI extends ilTable2GUI @@ -39,7 +38,6 @@ class ilMStListCompetencesSkillsTableGUI extends ilTable2GUI */ protected $dic; - /** * @param $parent_obj * @param string $parent_cmd @@ -76,7 +74,6 @@ public function __construct($parent_obj, string $parent_cmd, Container $dic) $this->parseData(); } - /** * */ @@ -99,7 +96,6 @@ protected function parseData() ), ); - $skills_fetcher = new ilMStListCompetencesSkills($this->dic); $count = $skills_fetcher->getData($options); $options['limit'] = array( @@ -112,7 +108,6 @@ protected function parseData() $this->setData($data); } - /** * */ @@ -132,7 +127,8 @@ public function initFilter() : void //user $item = new ilTextInputGUI($this->dic->language()->txt("login") . "/" . $this->dic->language()->txt("email") . "/" . $this->dic->language() - ->txt("name"), "user"); + ->txt("name"), + "user"); $this->addFilterItem($item); $item->readFromSession(); @@ -153,7 +149,6 @@ public function initFilter() : void } } - /** * @return array */ @@ -204,7 +199,6 @@ public function getSelectableColumns() : array return $cols; } - /** * */ @@ -227,13 +221,12 @@ private function addColumns() } } - /** * @param array $a_set */ public function fillRow(array $a_set) : void { - $propGetter = Closure::bind(function ($prop) { + $propGetter = Closure::bind(function($prop) { return $this->$prop; }, $a_set, $a_set); @@ -241,7 +234,8 @@ public function fillRow(array $a_set) : void if ($this->isColumnSelected($k)) { if ($propGetter($k) !== null) { $this->tpl->setCurrentBlock('td'); - $this->tpl->setVariable('VALUE', (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))); + $this->tpl->setVariable('VALUE', + (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock('td'); @@ -258,12 +252,13 @@ public function fillRow(array $a_set) : void $this->dic->ctrl()->setParameterByClass(get_class($this->parent_obj), 'mst_lcom_usr_id', $a_set->getUserId()); $actions->setAsynchUrl(str_replace("\\", "\\\\", $this->dic->ctrl() - ->getLinkTarget($this->parent_obj, ilMStListCompetencesSkillsGUI::CMD_GET_ACTIONS, "", true))); + ->getLinkTarget($this->parent_obj, + ilMStListCompetencesSkillsGUI::CMD_GET_ACTIONS, + "", true))); $this->tpl->setVariable('ACTIONS', $actions->getHTML()); $this->tpl->parseCurrentBlock(); } - /** * @param ilExcel $a_excel excel wrapper * @param int $a_row @@ -278,7 +273,6 @@ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : v } } - /** * @param ilCSVWriter $a_csv * @param array $a_set @@ -291,15 +285,13 @@ 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) { - $propGetter = Closure::bind(function ($prop) { + $propGetter = Closure::bind(function($prop) { return $this->$prop; }, $selected_skill, $selected_skill); diff --git a/Services/MyStaff/classes/ListCompetences/class.ilMStListCompetencesGUI.php b/Services/MyStaff/classes/ListCompetences/class.ilMStListCompetencesGUI.php index eaada686c25d..bc76f3960535 100644 --- a/Services/MyStaff/classes/ListCompetences/class.ilMStListCompetencesGUI.php +++ b/Services/MyStaff/classes/ListCompetences/class.ilMStListCompetencesGUI.php @@ -5,9 +5,7 @@ /** * Class ilMStListCompetencesGUI - * * @author Martin Studer - * * @ilCtrl_IsCalledBy ilMStListCompetencesGUI: ilMyStaffGUI * @ilCtrl_Calls ilMStListCompetencesGUI: ilMStListCompetencesSkillsGUI * @ilCtrl_Calls ilMStListCompetencesGUI: ilMStListCompetencesProfilesGUI @@ -33,7 +31,6 @@ class ilMStListCompetencesGUI private $dic; private \ilGlobalTemplateInterface $main_tpl; - /** * @param Container $dic */ @@ -48,7 +45,6 @@ public function __construct(Container $dic = null) $this->dic = $dic; } - /** * */ @@ -62,7 +58,6 @@ protected function checkAccessOrFail() } } - /** * */ @@ -89,7 +84,6 @@ public function executeCommand() } } - /** * @param string $subtab_active */ @@ -108,7 +102,6 @@ protected function addSubTabs(string $subtab_active) : void $this->dic->tabs()->activateSubTab($subtab_active); } - /** * */ @@ -117,7 +110,6 @@ public function index() $this->dic->ctrl()->redirectByClass(ilMStListCompetencesSkillsGUI::class); } - /** * */ @@ -131,7 +123,8 @@ public function getActions() if ($this->dic->access()->checkAccess("visible", "", $mst_lco_crs_ref_id)) { $link = ilLink::_getStaticLink($mst_lco_crs_ref_id, ilMyStaffAccess::DEFAULT_CONTEXT); - $selection->addItem(ilObject2::_lookupTitle(ilObject2::_lookupObjectId($mst_lco_crs_ref_id)), '', $link); + $selection->addItem(ilObject2::_lookupTitle(ilObject2::_lookupObjectId($mst_lco_crs_ref_id)), '', + $link); }; $org_units = ilOrgUnitPathStorage::getTextRepresentationOfOrgUnits('ref_id'); @@ -147,8 +140,9 @@ public function getActions() } } - $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, rawurlencode($this->dic->ctrl() - ->getLinkTarget($this, self::CMD_INDEX))); + $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, + rawurlencode($this->dic->ctrl() + ->getLinkTarget($this, self::CMD_INDEX))); echo $selection->getHTML(true); } diff --git a/Services/MyStaff/classes/ListCourses/class.ilMStListCourse.php b/Services/MyStaff/classes/ListCourses/class.ilMStListCourse.php index fb227a496d61..c8c3e59615b2 100644 --- a/Services/MyStaff/classes/ListCourses/class.ilMStListCourse.php +++ b/Services/MyStaff/classes/ListCourses/class.ilMStListCourse.php @@ -1,4 +1,5 @@ */ class ilMStListCourse @@ -15,7 +15,6 @@ class ilMStListCourse const MEMBERSHIP_STATUS_WAITINGLIST = 2; const MEMBERSHIP_STATUS_REGISTERED = 3; /** - * * @var int */ protected $crs_ref_id; @@ -65,7 +64,6 @@ public function getCrsRefId() return $this->crs_ref_id; } - /** * @param int $crs_ref_id */ @@ -74,7 +72,6 @@ public function setCrsRefId($crs_ref_id) $this->crs_ref_id = $crs_ref_id; } - /** * @return string */ @@ -83,7 +80,6 @@ public function getCrsTitle() return $this->crs_title; } - /** * @param string $crs_title */ @@ -92,7 +88,6 @@ public function setCrsTitle($crs_title) $this->crs_title = $crs_title; } - /** * @return int */ @@ -101,7 +96,6 @@ public function getUsrId() return $this->usr_id; } - /** * @param int $usr_id */ @@ -110,7 +104,6 @@ public function setUsrId($usr_id) $this->usr_id = $usr_id; } - /** * @return int */ @@ -119,7 +112,6 @@ public function getUsrRegStatus() return $this->usr_reg_status; } - /** * @param int $usr_reg_status */ @@ -128,7 +120,6 @@ public function setUsrRegStatus($usr_reg_status) $this->usr_reg_status = $usr_reg_status; } - /** * @return int */ @@ -137,7 +128,6 @@ public function getUsrLpStatus() return $this->usr_lp_status; } - /** * @param int $usr_lp_status */ @@ -146,7 +136,6 @@ public function setUsrLpStatus($usr_lp_status) $this->usr_lp_status = $usr_lp_status; } - /** * @return string */ @@ -155,7 +144,6 @@ public function getUsrLogin() return $this->usr_login; } - /** * @param string $usr_login */ @@ -164,7 +152,6 @@ public function setUsrLogin($usr_login) $this->usr_login = $usr_login; } - /** * @return string */ @@ -173,7 +160,6 @@ public function getUsrFirstname() return $this->usr_firstname; } - /** * @param string $usr_firstname */ @@ -182,7 +168,6 @@ public function setUsrFirstname($usr_firstname) $this->usr_firstname = $usr_firstname; } - /** * @return string */ @@ -191,7 +176,6 @@ public function getUsrLastname() return $this->usr_lastname; } - /** * @param string $usr_lastname */ @@ -200,7 +184,6 @@ public function setUsrLastname($usr_lastname) $this->usr_lastname = $usr_lastname; } - /** * @return string */ @@ -209,7 +192,6 @@ public function getUsrEmail() return $this->usr_email; } - /** * @param string $usr_email */ @@ -220,7 +202,6 @@ public function setUsrEmail($usr_email) //Other - /** * @return ilObjUser */ @@ -231,7 +212,6 @@ public function returnIlUserObj() return $il_user_obj; } - /** * @return ilObjCourse */ @@ -242,10 +222,8 @@ public function returnIlCourseObj() return $il_course_obj; } - /** * @param int $status - * * @return string */ public static function getMembershipStatusText($status) diff --git a/Services/MyStaff/classes/ListCourses/class.ilMStListCourses.php b/Services/MyStaff/classes/ListCourses/class.ilMStListCourses.php index 39bef2c4d656..e6434c2fd5df 100644 --- a/Services/MyStaff/classes/ListCourses/class.ilMStListCourses.php +++ b/Services/MyStaff/classes/ListCourses/class.ilMStListCourses.php @@ -1,4 +1,5 @@ */ class ilMStListCourses { - /** * @var Container */ protected $dic; - /** * ilMStListCourses constructor. - * * @param Container $dic */ public function __construct(Container $dic) @@ -34,7 +31,6 @@ public function __construct(Container $dic) /** * @param array $arr_usr_ids * @param array $options - * * @return array|int */ public function getData(array $arr_usr_ids = array(), array $options = array()) @@ -70,11 +66,11 @@ public function getData(array $arr_usr_ids = array(), array $options = array()) ) AS memb INNER JOIN object_data AS crs on crs.obj_id = memb.obj_id AND crs.type = ' . $this->dic->database() - ->quote(ilMyStaffAccess::DEFAULT_CONTEXT, 'text') . ' + ->quote(ilMyStaffAccess::DEFAULT_CONTEXT, + 'text') . ' INNER JOIN object_reference AS crs_ref on crs_ref.obj_id = crs.obj_id AND crs_ref.deleted IS NULL INNER JOIN usr_data on usr_data.usr_id = memb.usr_id AND usr_data.active = 1'; - $data = []; $users_per_position = ilMyStaffAccess::getInstance()->getUsersForUserPerPosition($this->dic->user()->getId()); @@ -88,8 +84,10 @@ public function getData(array $arr_usr_ids = array(), array $options = array()) $arr_query = []; foreach ($users_per_position as $position_id => $users) { - $obj_ids = ilMyStaffAccess::getInstance()->getIdsForUserAndOperation($this->dic->user()->getId(), $operation_access); - $arr_query[] = $query . " AND " . $this->dic->database()->in('crs.obj_id', $obj_ids, false, 'integer') . " AND " . $this->dic->database()->in('usr_data.usr_id', $users, false, 'integer'); + $obj_ids = ilMyStaffAccess::getInstance()->getIdsForUserAndOperation($this->dic->user()->getId(), + $operation_access); + $arr_query[] = $query . " AND " . $this->dic->database()->in('crs.obj_id', $obj_ids, false, + 'integer') . " AND " . $this->dic->database()->in('usr_data.usr_id', $users, false, 'integer'); } $union_query = "SELECT * FROM ((" . implode(') UNION (', $arr_query) . ")) as a_table"; @@ -130,23 +128,20 @@ public function getData(array $arr_usr_ids = array(), array $options = array()) return $crs_data; } - /** * 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) { $where = array(); - if (!empty($arr_filter['crs_title'])) { - $where[] = '(crs_title LIKE ' . $this->dic->database()->quote('%' . $arr_filter['crs_title'] . '%', 'text') . ')'; + $where[] = '(crs_title LIKE ' . $this->dic->database()->quote('%' . $arr_filter['crs_title'] . '%', + 'text') . ')'; } if ($arr_filter['course'] > 0) { @@ -157,10 +152,12 @@ protected function createWhereStatement(array $arr_filter) switch ($arr_filter['lp_status']) { case ilLPStatus::LP_STATUS_NOT_ATTEMPTED_NUM: //if a user has the lp status not attempted it could be, that the user hase no records in table ut_lp_marks - $where[] = '(lp_status = ' . $this->dic->database()->quote($arr_filter['lp_status'], 'integer') . ' OR lp_status is NULL)'; + $where[] = '(lp_status = ' . $this->dic->database()->quote($arr_filter['lp_status'], + 'integer') . ' OR lp_status is NULL)'; break; default: - $where[] = '(lp_status = ' . $this->dic->database()->quote($arr_filter['lp_status'], 'integer') . ')'; + $where[] = '(lp_status = ' . $this->dic->database()->quote($arr_filter['lp_status'], + 'integer') . ')'; break; } } @@ -170,15 +167,22 @@ protected function createWhereStatement(array $arr_filter) } if (!empty($arr_filter['user'])) { - $where[] = "(" . $this->dic->database()->like("usr_login", "text", "%" . $arr_filter['user'] . "%") . " " . "OR " . $this->dic->database() - ->like("usr_firstname", "text", "%" . $arr_filter['user'] . "%") . " " . "OR " . $this->dic->database() - ->like("usr_lastname", "text", "%" . $arr_filter['user'] . "%") . " " . "OR " . $this->dic->database() - ->like("usr_email", "text", "%" . $arr_filter['user'] . "%") . ") "; + $where[] = "(" . $this->dic->database()->like("usr_login", "text", + "%" . $arr_filter['user'] . "%") . " " . "OR " . $this->dic->database() + ->like("usr_firstname", "text", + "%" . $arr_filter['user'] . "%") . " " . "OR " . $this->dic->database() + ->like("usr_lastname", + "text", + "%" . $arr_filter['user'] . "%") . " " . "OR " . $this->dic->database() + ->like("usr_email", + "text", + "%" . $arr_filter['user'] . "%") . ") "; } if (!empty($arr_filter['org_unit'])) { $where[] = 'usr_id IN (SELECT user_id FROM il_orgu_ua WHERE orgu_id = ' . $this->dic->database() - ->quote($arr_filter['org_unit'], 'integer') . ')'; + ->quote($arr_filter['org_unit'], + 'integer') . ')'; } if (!empty($where)) { diff --git a/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesGUI.php b/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesGUI.php index c07e73b0b8c5..bcfcd3f534dd 100644 --- a/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesGUI.php +++ b/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesGUI.php @@ -5,9 +5,7 @@ /** * Class ilMStListCoursesGUI - * * @author Martin Studer - * * @ilCtrl_IsCalledBy ilMStListCoursesGUI: ilMyStaffGUI * @ilCtrl_Calls ilMStListCoursesGUI: ilFormPropertyDispatchGUI */ @@ -27,7 +25,6 @@ class ilMStListCoursesGUI protected $access; private \ilGlobalTemplateInterface $main_tpl; - /** * */ @@ -38,7 +35,6 @@ public function __construct() $this->access = ilMyStaffAccess::getInstance(); } - /** * */ @@ -54,7 +50,6 @@ protected function checkAccessOrFail() } } - /** * */ @@ -90,7 +85,6 @@ public function executeCommand() } } - /** * */ @@ -99,7 +93,6 @@ public function index() $this->listUsers(); } - /** * */ @@ -114,7 +107,6 @@ public function listUsers() $DIC->ui()->mainTemplate()->setContent($this->table->getHTML()); } - /** * */ @@ -126,7 +118,6 @@ public function applyFilter() $this->index(); } - /** * */ @@ -138,7 +129,6 @@ public function resetFilter() $this->index(); } - /** * @return string */ @@ -149,7 +139,6 @@ public function getId() return $this->table->getId(); } - /** * */ @@ -160,7 +149,6 @@ public function cancel() $DIC->ctrl()->redirect($this); } - /** * */ @@ -176,22 +164,24 @@ public function getActions() if ($DIC->access()->checkAccess("visible", "", $mst_lco_crs_ref_id)) { $link = ilLink::_getStaticLink($mst_lco_crs_ref_id, ilMyStaffAccess::DEFAULT_CONTEXT); - $selection->addItem(ilObject2::_lookupTitle(ilObject2::_lookupObjectId($mst_lco_crs_ref_id)), '', $link); + $selection->addItem(ilObject2::_lookupTitle(ilObject2::_lookupObjectId($mst_lco_crs_ref_id)), '', + $link); }; $org_units = ilOrgUnitPathStorage::getTextRepresentationOfOrgUnits('ref_id'); foreach (ilOrgUnitUserAssignment::innerjoin('object_reference', 'orgu_id', 'ref_id')->where(array( 'user_id' => $mst_co_usr_id, 'object_reference.deleted' => null - ), array( 'user_id' => '=', 'object_reference.deleted' => '!=' ))->get() as $org_unit_assignment) { + ), array('user_id' => '=', 'object_reference.deleted' => '!='))->get() as $org_unit_assignment) { if ($DIC->access()->checkAccess("read", "", $org_unit_assignment->getOrguId())) { $link = ilLink::_getStaticLink($org_unit_assignment->getOrguId(), 'orgu'); $selection->addItem($org_units[$org_unit_assignment->getOrguId()], '', $link); } } - $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, rawurlencode($DIC->ctrl() - ->getLinkTarget($this, self::CMD_INDEX))); + $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, + rawurlencode($DIC->ctrl() + ->getLinkTarget($this, self::CMD_INDEX))); echo $selection->getHTML(true); } diff --git a/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesTableGUI.php b/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesTableGUI.php index 0638e7b00d0b..e3ade142687e 100644 --- a/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesTableGUI.php +++ b/Services/MyStaff/classes/ListCourses/class.ilMStListCoursesTableGUI.php @@ -1,4 +1,5 @@ */ class ilMStListCoursesTableGUI extends ilTable2GUI @@ -34,7 +34,6 @@ class ilMStListCoursesTableGUI extends ilTable2GUI */ protected $access; - /** * @param ilMStListCoursesGUI $parent_obj * @param string $parent_cmd @@ -61,7 +60,7 @@ public function __construct(ilMStListCoursesGUI $parent_obj, $parent_cmd = ilMSt $this->setDisableFilterHiding(true); $this->setEnableNumInfo(true); - $this->setExportFormats(array( self::EXPORT_EXCEL, self::EXPORT_CSV )); + $this->setExportFormats(array(self::EXPORT_EXCEL, self::EXPORT_CSV)); $this->setFilterCols(5); $this->initFilter(); @@ -71,7 +70,6 @@ public function __construct(ilMStListCoursesGUI $parent_obj, $parent_cmd = ilMSt $this->parseData(); } - /** * */ @@ -110,7 +108,6 @@ protected function parseData() $this->setData($data); } - /** * */ @@ -128,7 +125,7 @@ public function initFilter() : void $item->setParent($this->getParentObject()); $item->setSelectText($DIC->language()->txt("mst_select_course")); $item->setHeaderMessage($DIC->language()->txt("mst_please_select_course")); - $item->setClickableTypes(array( ilMyStaffAccess::DEFAULT_CONTEXT )); + $item->setClickableTypes(array(ilMyStaffAccess::DEFAULT_CONTEXT)); $this->addFilterItem($item); $item->readFromSession(); $item->setParent($this->getParentObject()); @@ -167,7 +164,8 @@ public function initFilter() : void //user $item = new ilTextInputGUI($DIC->language()->txt("login") . "/" . $DIC->language()->txt("email") . "/" . $DIC->language() - ->txt("name"), "user"); + ->txt("name"), + "user"); $this->addFilterItem($item); $item->readFromSession(); @@ -187,7 +185,6 @@ public function initFilter() : void } } - /** * @return array */ @@ -265,7 +262,6 @@ public function getSelectableColumns() : array return $cols; } - /** * */ @@ -290,7 +286,6 @@ private function addColumns() } } - /** * @param array $a_set */ @@ -298,7 +293,7 @@ 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); @@ -307,12 +302,14 @@ public function fillRow(array $a_set) : void switch ($k) { case 'usr_assinged_orgus': $this->tpl->setCurrentBlock('td'); - $this->tpl->setVariable('VALUE', strval(ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_set->getUsrId()))); + $this->tpl->setVariable('VALUE', + strval(ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_set->getUsrId()))); $this->tpl->parseCurrentBlock(); break; case 'usr_reg_status': $this->tpl->setCurrentBlock('td'); - $this->tpl->setVariable('VALUE', ilMStListCourse::getMembershipStatusText($a_set->getUsrRegStatus())); + $this->tpl->setVariable('VALUE', + ilMStListCourse::getMembershipStatusText($a_set->getUsrRegStatus())); $this->tpl->parseCurrentBlock(); break; case 'usr_lp_status': @@ -323,7 +320,8 @@ public function fillRow(array $a_set) : void default: if ($propGetter($k) !== null) { $this->tpl->setCurrentBlock('td'); - $this->tpl->setVariable('VALUE', (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))); + $this->tpl->setVariable('VALUE', + (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock('td'); @@ -344,12 +342,12 @@ public function fillRow(array $a_set) : void $DIC->ctrl()->setParameterByClass(ilMStListCoursesGUI::class, 'mst_lco_crs_ref_id', $a_set->getCrsRefId()); $actions->setAsynchUrl(str_replace("\\", "\\\\", $DIC->ctrl() - ->getLinkTarget($this->parent_obj, ilMStListCoursesGUI::CMD_GET_ACTIONS, "", true))); + ->getLinkTarget($this->parent_obj, + ilMStListCoursesGUI::CMD_GET_ACTIONS, "", true))); $this->tpl->setVariable('ACTIONS', $actions->getHTML()); $this->tpl->parseCurrentBlock(); } - /** * @param ilExcel $a_excel excel wrapper * @param int $a_row @@ -364,7 +362,6 @@ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : v } } - /** * @param ilCSVWriter $a_csv * @param array $a_set @@ -377,15 +374,13 @@ 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) { - $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 a8f15e1e9d01..2a63a275cbcd 100644 --- a/Services/MyStaff/classes/ListUsers/class.ilMStListUser.php +++ b/Services/MyStaff/classes/ListUsers/class.ilMStListUser.php @@ -1,11 +1,11 @@ */ class ilMStListUser @@ -96,7 +96,6 @@ class ilMStListUser */ protected $il_user_obj; - /** * @return int */ @@ -105,7 +104,6 @@ public function getUsrId() return $this->usr_id; } - /** * @param int $usr_id */ @@ -114,7 +112,6 @@ public function setUsrId($usr_id) $this->usr_id = $usr_id; } - /** * @return int */ @@ -123,7 +120,6 @@ public function getTimeLimitOwner() return $this->time_limit_owner; } - /** * @param int $time_limit_owner */ @@ -132,7 +128,6 @@ public function setTimeLimitOwner($time_limit_owner) $this->time_limit_owner = $time_limit_owner; } - /** * @return int */ @@ -141,7 +136,6 @@ public function getActive() return $this->active; } - /** * @param int $active */ @@ -150,7 +144,6 @@ public function setActive($active) $this->active = $active; } - /** * @return string */ @@ -159,7 +152,6 @@ public function getLogin() return $this->login; } - /** * @param string $login */ @@ -168,7 +160,6 @@ public function setLogin($login) $this->login = $login; } - /** * @return string */ @@ -177,7 +168,6 @@ public function getFirstname() return $this->firstname; } - /** * @param string $firstname */ @@ -186,7 +176,6 @@ public function setFirstname($firstname) $this->firstname = $firstname; } - /** * @return string */ @@ -195,7 +184,6 @@ public function getLastname() return $this->lastname; } - /** * @param string $lastname */ @@ -204,7 +192,6 @@ public function setLastname($lastname) $this->lastname = $lastname; } - /** * @return string */ @@ -213,7 +200,6 @@ public function getEmail() return $this->email; } - /** * @param string $email */ @@ -222,7 +208,6 @@ public function setEmail($email) $this->email = $email; } - /** * @return string */ @@ -231,7 +216,6 @@ public function getPhone() return $this->phone; } - /** * @param string $phone */ @@ -240,7 +224,6 @@ public function setPhone($phone) $this->phone = $phone; } - /** * @return string */ @@ -249,7 +232,6 @@ public function getMobilePhone() return $this->mobile_phone; } - /** * @param string $mobile_phone */ @@ -258,7 +240,6 @@ public function setMobilePhone($mobile_phone) $this->mobile_phone = $mobile_phone; } - /** * @return int */ @@ -267,7 +248,6 @@ public function getGender() return $this->gender; } - /** * @param int $gender */ @@ -276,7 +256,6 @@ public function setGender($gender) $this->gender = $gender; } - /** * @return string */ @@ -285,7 +264,6 @@ public function getTitle() return $this->title; } - /** * @param string $title */ @@ -294,7 +272,6 @@ public function setTitle($title) $this->title = $title; } - /** * @return string */ @@ -303,7 +280,6 @@ public function getHobby() return $this->hobby; } - /** * @param string $hobby */ @@ -312,7 +288,6 @@ public function setHobby($hobby) $this->hobby = $hobby; } - /** * @return string */ @@ -321,7 +296,6 @@ public function getInstitution() return $this->institution; } - /** * @param string $institution */ @@ -330,7 +304,6 @@ public function setInstitution($institution) $this->institution = $institution; } - /** * @return string */ @@ -339,7 +312,6 @@ public function getDepartment() return $this->department; } - /** * @param string $department */ @@ -348,7 +320,6 @@ public function setDepartment($department) $this->department = $department; } - /** * @return string */ @@ -357,7 +328,6 @@ public function getStreet() return $this->street; } - /** * @param string $street */ @@ -366,7 +336,6 @@ public function setStreet($street) $this->street = $street; } - /** * @return string */ @@ -375,7 +344,6 @@ public function getZipcode() return $this->zipcode; } - /** * @param string $zipcode */ @@ -384,7 +352,6 @@ public function setZipcode($zipcode) $this->zipcode = $zipcode; } - /** * @return string */ @@ -393,7 +360,6 @@ public function getCity() return $this->city; } - /** * @param string $city */ @@ -402,7 +368,6 @@ public function setCity($city) $this->city = $city; } - /** * @return string */ @@ -411,7 +376,6 @@ public function getCountry() return $this->country; } - /** * @param string $country */ @@ -420,7 +384,6 @@ public function setCountry($country) $this->country = $country; } - /** * @return string */ @@ -429,7 +392,6 @@ public function getSelCountry() return $this->sel_country; } - /** * @param string $sel_country */ @@ -438,7 +400,6 @@ public function setSelCountry($sel_country) $this->sel_country = $sel_country; } - /** * @return string */ @@ -447,7 +408,6 @@ public function getMatriculation() return $this->matriculation; } - /** * @param string $matriculation */ @@ -456,7 +416,6 @@ public function setMatriculation($matriculation) $this->matriculation = $matriculation; } - /** * @return ilObjUser */ diff --git a/Services/MyStaff/classes/ListUsers/class.ilMStListUsers.php b/Services/MyStaff/classes/ListUsers/class.ilMStListUsers.php index 3c4c198d836c..8252d9b09c4d 100644 --- a/Services/MyStaff/classes/ListUsers/class.ilMStListUsers.php +++ b/Services/MyStaff/classes/ListUsers/class.ilMStListUsers.php @@ -1,11 +1,11 @@ */ class ilMStListUsers @@ -16,10 +16,8 @@ class ilMStListUsers */ protected $dic; - /** * ilMStListUsers constructor. - * * @param Container $dic */ public function __construct(Container $dic) @@ -30,7 +28,6 @@ public function __construct(Container $dic) /** * @param array $arr_usr_ids * @param array $options - * * @return array|int */ public function getData(array $arr_usr_ids = array(), array $options = array()) @@ -123,13 +120,10 @@ public function getData(array $arr_usr_ids = array(), array $options = array()) return $user_data; } - /** * 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) @@ -139,31 +133,42 @@ private function createWhereStatement(array $arr_usr_ids, array $arr_filter) $where[] = $this->dic->database()->in('usr_data.usr_id', $arr_usr_ids, false, 'integer'); if (!empty($arr_filter['user'])) { - $where[] = "(" . $this->dic->database()->like("usr_data.login", "text", "%" . $arr_filter['user'] . "%") . " " . "OR " . $this->dic->database() - ->like("usr_data.firstname", "text", "%" . $arr_filter['user'] . "%") . " " . "OR " . $this->dic->database() - ->like("usr_data.lastname", "text", "%" . $arr_filter['user'] . "%") . " " . "OR " . $this->dic->database() - ->like("usr_data.email", "text", "%" . $arr_filter['user'] . "%") . ") "; + $where[] = "(" . $this->dic->database()->like("usr_data.login", "text", + "%" . $arr_filter['user'] . "%") . " " . "OR " . $this->dic->database() + ->like("usr_data.firstname", "text", + "%" . $arr_filter['user'] . "%") . " " . "OR " . $this->dic->database() + ->like("usr_data.lastname", + "text", + "%" . $arr_filter['user'] . "%") . " " . "OR " . $this->dic->database() + ->like("usr_data.email", + "text", + "%" . $arr_filter['user'] . "%") . ") "; } if (!empty($arr_filter['org_unit'])) { $where[] = 'usr_data.usr_id IN (SELECT user_id FROM il_orgu_ua WHERE orgu_id = ' . $this->dic->database() - ->quote($arr_filter['org_unit'], 'integer') . ')'; + ->quote($arr_filter['org_unit'], + 'integer') . ')'; } if (!empty($arr_filter['lastname'])) { - $where[] = '(lastname LIKE ' . $this->dic->database()->quote('%' . str_replace('*', '%', $arr_filter['lastname']) . '%', 'text') . ')'; + $where[] = '(lastname LIKE ' . $this->dic->database()->quote('%' . str_replace('*', '%', + $arr_filter['lastname']) . '%', 'text') . ')'; } if (!empty($arr_filter['firstname'])) { - $where[] = '(firstname LIKE ' . $this->dic->database()->quote('%' . str_replace('*', '%', $arr_filter['firstname']) . '%', 'text') . ')'; + $where[] = '(firstname LIKE ' . $this->dic->database()->quote('%' . str_replace('*', '%', + $arr_filter['firstname']) . '%', 'text') . ')'; } if (!empty($arr_filter['email'])) { - $where[] = '(email LIKE ' . $this->dic->database()->quote('%' . str_replace('*', '%', $arr_filter['email']) . '%', 'text') . ')'; + $where[] = '(email LIKE ' . $this->dic->database()->quote('%' . str_replace('*', '%', + $arr_filter['email']) . '%', 'text') . ')'; } if (!empty($arr_filter['title'])) { - $where[] = '(title LIKE ' . $this->dic->database()->quote('%' . str_replace('*', '%', $arr_filter['title']) . '%', 'text') . ')'; + $where[] = '(title LIKE ' . $this->dic->database()->quote('%' . str_replace('*', '%', + $arr_filter['title']) . '%', 'text') . ')'; } if ($arr_filter['activation']) { diff --git a/Services/MyStaff/classes/ListUsers/class.ilMStListUsersGUI.php b/Services/MyStaff/classes/ListUsers/class.ilMStListUsersGUI.php index c203eac3ff60..d41b023cd47e 100644 --- a/Services/MyStaff/classes/ListUsers/class.ilMStListUsersGUI.php +++ b/Services/MyStaff/classes/ListUsers/class.ilMStListUsersGUI.php @@ -5,9 +5,7 @@ /** * Class ilMStListUsersGUI - * * @author Martin Studer - * * @ilCtrl_IsCalledBy ilMStListUsersGUI: ilMyStaffGUI */ class ilMStListUsersGUI @@ -27,7 +25,6 @@ class ilMStListUsersGUI protected $access; private \ilGlobalTemplateInterface $main_tpl; - /** * */ @@ -38,7 +35,6 @@ public function __construct() $this->access = ilMyStaffAccess::getInstance(); } - /** * */ @@ -54,7 +50,6 @@ protected function checkAccessOrFail() } } - /** * */ @@ -80,7 +75,6 @@ public function executeCommand() } } - /** * */ @@ -89,7 +83,6 @@ public function index() $this->listUsers(); } - /** * */ @@ -102,7 +95,6 @@ public function listUsers() $DIC->ui()->mainTemplate()->setContent($this->table->getHTML()); } - /** * */ @@ -114,7 +106,6 @@ public function applyFilter() $this->index(); } - /** * */ @@ -126,7 +117,6 @@ public function resetFilter() $this->index(); } - /** * */ @@ -137,7 +127,6 @@ public function cancel() $DIC->ctrl()->redirect($this); } - /** * */ @@ -151,37 +140,40 @@ public function getActions() if ($this->access->hasCurrentUserAccessToMyStaff()) { $DIC->ctrl()->setParameterByClass(ilMStShowUserCoursesGUI::class, 'usr_id', $mst_lus_usr_id); - $selection->addItem($DIC->language()->txt('mst_show_courses'), '', $DIC->ctrl()->getLinkTargetByClass(array( - ilDashboardGUI::class, - ilMyStaffGUI::class, - ilMStShowUserGUI::class, - ilMStShowUserCoursesGUI::class, - ))); + $selection->addItem($DIC->language()->txt('mst_show_courses'), '', + $DIC->ctrl()->getLinkTargetByClass(array( + ilDashboardGUI::class, + ilMyStaffGUI::class, + ilMStShowUserGUI::class, + ilMStShowUserCoursesGUI::class, + ))); } if ($this->access->hasCurrentUserAccessToCertificates()) { $DIC->ctrl()->setParameterByClass(ilUserCertificateGUI::class, 'usr_id', $mst_lus_usr_id); - $selection->addItem($DIC->language()->txt('mst_list_certificates'), '', $DIC->ctrl()->getLinkTargetByClass(array( - ilDashboardGUI::class, - ilMyStaffGUI::class, - ilMStShowUserGUI::class, - ilUserCertificateGUI::class, - ))); + $selection->addItem($DIC->language()->txt('mst_list_certificates'), '', + $DIC->ctrl()->getLinkTargetByClass(array( + ilDashboardGUI::class, + ilMyStaffGUI::class, + ilMStShowUserGUI::class, + ilUserCertificateGUI::class, + ))); } if ($this->access->hasCurrentUserAccessToCompetences()) { $DIC->ctrl()->setParameterByClass(ilMStShowUserCompetencesGUI::class, 'usr_id', $mst_lus_usr_id); - $selection->addItem($DIC->language()->txt('mst_list_competences'), '', $DIC->ctrl()->getLinkTargetByClass(array( - ilDashboardGUI::class, - ilMyStaffGUI::class, - ilMStShowUserGUI::class, - ilMStShowUserCompetencesGUI::class, - ))); + $selection->addItem($DIC->language()->txt('mst_list_competences'), '', + $DIC->ctrl()->getLinkTargetByClass(array( + ilDashboardGUI::class, + ilMyStaffGUI::class, + ilMStShowUserGUI::class, + ilMStShowUserCompetencesGUI::class, + ))); } - - $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_lus_usr_id, rawurlencode($DIC->ctrl() - ->getLinkTarget($this, self::CMD_INDEX))); + $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_lus_usr_id, + rawurlencode($DIC->ctrl() + ->getLinkTarget($this, self::CMD_INDEX))); echo $selection->getHTML(true); } diff --git a/Services/MyStaff/classes/ListUsers/class.ilMStListUsersTableGUI.php b/Services/MyStaff/classes/ListUsers/class.ilMStListUsersTableGUI.php index 346886d6195e..4ced91348242 100644 --- a/Services/MyStaff/classes/ListUsers/class.ilMStListUsersTableGUI.php +++ b/Services/MyStaff/classes/ListUsers/class.ilMStListUsersTableGUI.php @@ -1,4 +1,5 @@ */ class ilMStListUsersTableGUI extends ilTable2GUI @@ -32,7 +32,6 @@ class ilMStListUsersTableGUI extends ilTable2GUI */ protected $access; - /** * @param ilMStListUsersGUI $parent_obj * @param string $parent_cmd @@ -59,7 +58,7 @@ public function __construct(ilMStListUsersGUI $parent_obj, $parent_cmd = ilMStLi $this->setDisableFilterHiding(true); $this->setEnableNumInfo(true); - $this->setExportFormats(array( self::EXPORT_EXCEL, self::EXPORT_CSV )); + $this->setExportFormats(array(self::EXPORT_EXCEL, self::EXPORT_CSV)); $this->setFilterCols(4); $this->initFilter(); @@ -68,7 +67,6 @@ public function __construct(ilMStListUsersGUI $parent_obj, $parent_cmd = ilMStLi $this->parseData(); } - /** * */ @@ -109,7 +107,6 @@ protected function parseData() $this->setData($data); } - /** * */ @@ -119,7 +116,8 @@ public function initFilter() : void // User name, login, email filter $item = new ilTextInputGUI($DIC->language()->txt("login") . "/" . $DIC->language()->txt("email") . "/" . $DIC->language() - ->txt("name"), "user"); + ->txt("name"), + "user"); //$item->setDataSource($DIC->ctrl()->getLinkTarget($this->getParentObject(),"addUserAutoComplete", "", true)); //$item->setSize(20); //$item->setSubmitFormOnEnter(true); @@ -145,7 +143,6 @@ public function initFilter() : void } } - /** * @return array */ @@ -168,7 +165,6 @@ public function getSelectableColumns() : array return $cols; } - /** * */ @@ -197,7 +193,6 @@ private function addColumns() } } - /** * @param array $a_set */ @@ -205,7 +200,7 @@ 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); @@ -223,7 +218,8 @@ public function fillRow(array $a_set) : void switch ($k) { case 'org_units': $this->tpl->setCurrentBlock('td'); - $this->tpl->setVariable('VALUE', strval(ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_set->getUsrId()))); + $this->tpl->setVariable('VALUE', + strval(ilOrgUnitPathStorage::getTextRepresentationOfUsersOrgUnits($a_set->getUsrId()))); $this->tpl->parseCurrentBlock(); break; case 'gender': @@ -252,7 +248,8 @@ public function fillRow(array $a_set) : void default: if ($propGetter($k) !== null) { $this->tpl->setCurrentBlock('td'); - $this->tpl->setVariable('VALUE', (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))); + $this->tpl->setVariable('VALUE', + (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock('td'); @@ -272,25 +269,24 @@ public function fillRow(array $a_set) : void $DIC->ctrl()->setParameterByClass(ilMStListUsersGUI::class, 'mst_lus_usr_id', $a_set->getUsrId()); $actions->setAsynchUrl(str_replace("\\", "\\\\", $DIC->ctrl() - ->getLinkTarget($this->parent_obj, ilMStListUsersGUI::CMD_GET_ACTIONS, "", true))); + ->getLinkTarget($this->parent_obj, + ilMStListUsersGUI::CMD_GET_ACTIONS, "", true))); $this->tpl->setVariable('ACTIONS', $actions->getHTML()); $this->tpl->parseCurrentBlock(); } - /** * Get profile back url - * * @return string */ private function getProfileBackUrl() { global $DIC; - return rawurlencode($DIC->ctrl()->getLinkTargetByClass(strtolower(ilMyStaffGUI::class), ilMyStaffGUI::CMD_INDEX)); + return rawurlencode($DIC->ctrl()->getLinkTargetByClass(strtolower(ilMyStaffGUI::class), + ilMyStaffGUI::CMD_INDEX)); } - /** * @param ilExcel $a_excel excel wrapper * @param int $a_row @@ -305,7 +301,6 @@ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : v } } - /** * @param ilCSVWriter $a_csv * @param array $a_set @@ -318,17 +313,15 @@ 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) { 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 11788594d4be..36b8e2df0140 100644 --- a/Services/MyStaff/classes/Provider/StaffMainBarProvider.php +++ b/Services/MyStaff/classes/Provider/StaffMainBarProvider.php @@ -19,7 +19,6 @@ /** * Class StaffMainBarProvider - * * @author Fabian Schmid */ class StaffMainBarProvider extends AbstractStaticMainMenuProvider @@ -33,7 +32,6 @@ public function getStaticTopItems() : array return []; } - /** * @inheritDoc */ @@ -45,7 +43,8 @@ public function getStaticSubItems() : array $top = StandardTopItemsProvider::getInstance()->getOrganisationIdentification(); $title = $this->dic->language()->txt("mm_staff_list"); - $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(ilUtil::getImagePath("outlined/icon_stff.svg"), $title); + $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(ilUtil::getImagePath("outlined/icon_stff.svg"), + $title); // My Staff $items[] = $this->mainmenu->link($this->if->identifier('mm_pd_mst')) @@ -72,7 +71,8 @@ function () : bool { )->withNonAvailableReason($dic->ui()->factory()->legacy("{$dic->language()->txt('component_not_active')}")); $title = $this->dic->language()->txt("mm_enrolments"); - $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(ilUtil::getImagePath("outlined/icon_enrl.svg"), $title); + $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(ilUtil::getImagePath("outlined/icon_enrl.svg"), + $title); // My Enrolments $items[] = $this->mainmenu->link($this->if->identifier('mm_pd_enrol')) @@ -123,7 +123,6 @@ function () : bool { } )->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt("component_not_active")}")); - // My Competences $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::SKMG, $title)->withIsOutlined(true); $items[] = $this->mainmenu->link($this->if->identifier("mm_pd_comp")) @@ -149,7 +148,6 @@ function () : bool { } )->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt("component_not_active")}")); - return $items; } } diff --git a/Services/MyStaff/classes/ShowUser/Competences/class.ilMStShowUserCompetencesGUI.php b/Services/MyStaff/classes/ShowUser/Competences/class.ilMStShowUserCompetencesGUI.php index 87351e322eae..5cc9b20b5226 100644 --- a/Services/MyStaff/classes/ShowUser/Competences/class.ilMStShowUserCompetencesGUI.php +++ b/Services/MyStaff/classes/ShowUser/Competences/class.ilMStShowUserCompetencesGUI.php @@ -5,9 +5,7 @@ /** * Class ilMStShowUserCompetencesGUI - * * @author Theodor Truffer - * * @ilCtrl_IsCalledBy ilMStShowUserCompetencesGUI: ilMStShowUserGUI */ class ilMStShowUserCompetencesGUI @@ -33,7 +31,6 @@ class ilMStShowUserCompetencesGUI private $dic; private \ilGlobalTemplateInterface $main_tpl; - /** * @param Container $dic */ @@ -48,7 +45,6 @@ public function __construct(Container $dic) $this->dic->ctrl()->setParameter($this, 'usr_id', $this->usr_id); } - /** * */ @@ -69,7 +65,6 @@ protected function checkAccessOrFail() } } - /** * */ @@ -93,7 +88,6 @@ public function executeCommand() } } - /** * @param string $active_sub_tab */ @@ -109,7 +103,6 @@ protected function addSubTabs(string $active_sub_tab) $this->dic->tabs()->activateSubTab($active_sub_tab); } - /** * */ diff --git a/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCourses.php b/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCourses.php index 023c8149bffe..ed74d6dc25f2 100644 --- a/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCourses.php +++ b/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCourses.php @@ -1,11 +1,11 @@ */ class ilMStShowUserCourses extends ilMStListCourses diff --git a/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesGUI.php b/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesGUI.php index 88e009a7926b..09246937fded 100644 --- a/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesGUI.php +++ b/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesGUI.php @@ -5,11 +5,8 @@ /** * Class ilMStShowUserCoursesGUI - * * @package ILIAS\MyStaff\Courses\ShowUser - * * @author Theodor Truffer - * * @ilCtrl_IsCalledBy ilMStShowUserCoursesGUI: ilMStShowUserGUI * @ilCtrl_Calls ilMStShowUserCoursesGUI: ilFormPropertyDispatchGUI */ @@ -33,7 +30,6 @@ class ilMStShowUserCoursesGUI protected $access; private \ilGlobalTemplateInterface $main_tpl; - /** * */ @@ -48,7 +44,6 @@ public function __construct() $DIC->ctrl()->setParameter($this, 'usr_id', $this->usr_id); } - /** * */ @@ -71,7 +66,6 @@ protected function checkAccessOrFail() } } - /** * */ @@ -105,7 +99,6 @@ public function executeCommand() } } - /** * */ @@ -114,7 +107,6 @@ protected function index() $this->listUsers(); } - /** * */ @@ -141,7 +133,6 @@ protected function applyFilter() $this->index(); } - /** * */ @@ -153,7 +144,6 @@ protected function resetFilter() $this->index(); } - /** * @return string */ @@ -164,7 +154,6 @@ public function getId() return $this->table->getId(); } - /** * */ @@ -175,7 +164,6 @@ public function cancel() $DIC->ctrl()->redirect($this); } - /** * */ @@ -191,7 +179,8 @@ public function getActions() if ($DIC->access()->checkAccess("visible", "", $mst_lco_crs_ref_id)) { $link = ilLink::_getStaticLink($mst_lco_crs_ref_id, ilMyStaffAccess::DEFAULT_CONTEXT); - $selection->addItem(ilObject2::_lookupTitle(ilObject2::_lookupObjectId($mst_lco_crs_ref_id)), '', $link); + $selection->addItem(ilObject2::_lookupTitle(ilObject2::_lookupObjectId($mst_lco_crs_ref_id)), '', + $link); }; $org_units = ilOrgUnitPathStorage::getTextRepresentationOfOrgUnits('ref_id'); @@ -207,8 +196,9 @@ public function getActions() } } - $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, rawurlencode($DIC->ctrl() - ->getLinkTarget($this, self::CMD_INDEX))); + $selection = ilMyStaffGUI::extendActionMenuWithUserActions($selection, $mst_co_usr_id, + rawurlencode($DIC->ctrl() + ->getLinkTarget($this, self::CMD_INDEX))); echo $selection->getHTML(true); } diff --git a/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesTableGUI.php b/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesTableGUI.php index 0d0096fe15e6..e19a06113144 100644 --- a/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesTableGUI.php +++ b/Services/MyStaff/classes/ShowUser/Courses/class.ilMStShowUserCoursesTableGUI.php @@ -20,7 +20,6 @@ /** * Class ilMStShowUserCoursesTableGUI - * * @author Martin Studer */ class ilMStShowUserCoursesTableGUI extends ilTable2GUI @@ -39,7 +38,6 @@ class ilMStShowUserCoursesTableGUI extends ilTable2GUI */ protected $access; - /** * @param ilMStShowUserCoursesGUI $parent_obj * @param string $parent_cmd @@ -58,8 +56,7 @@ public function __construct(ilMStShowUserCoursesGUI $parent_obj, $parent_cmd = i parent::__construct($parent_obj, $parent_cmd, ''); $this->setRowTemplate('tpl.list_user_courses_row.html', "Services/MyStaff"); - $this->setFormAction($DIC->ctrl()->getFormAction($parent_obj)); - ; + $this->setFormAction($DIC->ctrl()->getFormAction($parent_obj));; $this->setDefaultOrderDirection('desc'); $this->setShowRowsSelector(true); @@ -77,7 +74,6 @@ public function __construct(ilMStShowUserCoursesGUI $parent_obj, $parent_cmd = i $this->parseData(); } - /** * */ @@ -93,7 +89,8 @@ protected function parseData() $this->determineOffsetAndOrder(); $arr_usr_id = $this->access->getUsersForUserOperationAndContext($DIC->user() - ->getId(), ilOrgUnitOperation::OP_ACCESS_ENROLMENTS, ilMyStaffAccess::DEFAULT_CONTEXT); + ->getId(), + ilOrgUnitOperation::OP_ACCESS_ENROLMENTS, ilMyStaffAccess::DEFAULT_CONTEXT); $this->filter['usr_id'] = $this->usr_id; $options = array( @@ -119,7 +116,6 @@ protected function parseData() $this->setData($data); } - /** * */ @@ -174,7 +170,6 @@ public function initFilter() : void } } - /** * @return array */ @@ -208,7 +203,6 @@ public function getSelectableColumns() : array return $cols; } - /** * */ @@ -232,7 +226,6 @@ private function addColumns() } } - /** * @param array $a_set */ @@ -240,7 +233,7 @@ 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); @@ -249,18 +242,21 @@ public function fillRow(array $a_set) : void switch ($k) { case 'usr_reg_status': $this->tpl->setCurrentBlock('td'); - $this->tpl->setVariable('VALUE', $this->getSpaceOrValue(ilMStListCourse::getMembershipStatusText($a_set->getUsrRegStatus()))); + $this->tpl->setVariable('VALUE', + $this->getSpaceOrValue(ilMStListCourse::getMembershipStatusText($a_set->getUsrRegStatus()))); $this->tpl->parseCurrentBlock(); break; case 'usr_lp_status': $this->tpl->setCurrentBlock('td'); - $this->tpl->setVariable('VALUE', $this->getSpaceOrValue(ilMyStaffGUI::getUserLpStatusAsHtml($a_set))); + $this->tpl->setVariable('VALUE', + $this->getSpaceOrValue(ilMyStaffGUI::getUserLpStatusAsHtml($a_set))); $this->tpl->parseCurrentBlock(); break; default: if ($propGetter($k) !== null) { $this->tpl->setCurrentBlock('td'); - $this->tpl->setVariable('VALUE', (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))); + $this->tpl->setVariable('VALUE', + (is_array($propGetter($k)) ? implode(", ", $propGetter($k)) : $propGetter($k))); $this->tpl->parseCurrentBlock(); } else { $this->tpl->setCurrentBlock('td'); @@ -281,12 +277,12 @@ public function fillRow(array $a_set) : void $DIC->ctrl()->setParameterByClass(ilMStShowUserCoursesGUI::class, 'mst_lco_crs_ref_id', $a_set->getCrsRefId()); $actions->setAsynchUrl(str_replace("\\", "\\\\", $DIC->ctrl() - ->getLinkTarget($this->parent_obj, ilMStShowUserCoursesGUI::CMD_GET_ACTIONS, "", true))); + ->getLinkTarget($this->parent_obj, + ilMStShowUserCoursesGUI::CMD_GET_ACTIONS, "", true))); $this->tpl->setVariable('ACTIONS', $actions->getHTML()); $this->tpl->parseCurrentBlock(); } - /** * @param ilExcel $a_excel excel wrapper * @param int $a_row @@ -301,7 +297,6 @@ protected function fillRowExcel(ilExcel $a_excel, int &$a_row, array $a_set) : v } } - /** * @param ilCSVWriter $a_csv * @param array $a_set @@ -314,13 +309,12 @@ 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) { - $propGetter = Closure::bind(function ($prop) { + $propGetter = Closure::bind(function($prop) { return $this->$prop; }, $my_staff_course, $my_staff_course); @@ -343,7 +337,6 @@ protected function getFieldValuesForExport(ilMStListCourse $my_staff_course) return $field_values; } - protected function getSpaceOrValue(string $string) { if (!$this->getExportMode()) { diff --git a/Services/MyStaff/classes/ShowUser/class.ilMStShowUserGUI.php b/Services/MyStaff/classes/ShowUser/class.ilMStShowUserGUI.php index 585feec77fde..bb260c754550 100644 --- a/Services/MyStaff/classes/ShowUser/class.ilMStShowUserGUI.php +++ b/Services/MyStaff/classes/ShowUser/class.ilMStShowUserGUI.php @@ -4,11 +4,9 @@ /** * Class ilMStShowUserGUI - * * @author Martin Studer - * * @ilCtrl_IsCalledBy ilMStShowUserGUI: ilMyStaffGUI - * @ilCtrl_Calls ilMStShowUserGUI: ilUserCertificateGUI + * @ilCtrl_Calls ilMStShowUserGUI: ilUserCertificateGUI */ class ilMStShowUserGUI { @@ -30,7 +28,6 @@ class ilMStShowUserGUI protected $access; private \ilGlobalTemplateInterface $main_tpl; - /** * */ @@ -48,7 +45,6 @@ public function __construct() $DIC->ui()->mainTemplate()->setTitleIcon(ilObjUser::_getPersonalPicturePath($this->usr_id, "xxsmall")); } - /** * */ @@ -70,7 +66,6 @@ protected function checkAccessOrFail() } } - /** * */ @@ -118,7 +113,6 @@ public function executeCommand() } } - /** * */ @@ -128,7 +122,6 @@ protected function index() $DIC->ctrl()->redirectByClass(ilMStShowUserCoursesGUI::class); } - /** * */ @@ -146,7 +139,6 @@ protected function showUser() $DIC->ui()->mainTemplate()->setContent($pub_profile->getEmbeddable()); } - /** * */ @@ -157,7 +149,6 @@ public function cancel() $DIC->ctrl()->redirect($this); } - /** * @param string $active_tab_id */ @@ -172,30 +163,32 @@ protected function addTabs($active_tab_id) ))); if ($this->access->hasCurrentUserAccessToMyStaff()) { - $DIC->tabs()->addTab(self::TAB_SHOW_COURSES, $DIC->language()->txt('mst_list_courses'), $DIC->ctrl()->getLinkTargetByClass(array( - ilMyStaffGUI::class, - self::class, - ilMStShowUserCoursesGUI::class, - ))); + $DIC->tabs()->addTab(self::TAB_SHOW_COURSES, $DIC->language()->txt('mst_list_courses'), + $DIC->ctrl()->getLinkTargetByClass(array( + ilMyStaffGUI::class, + self::class, + ilMStShowUserCoursesGUI::class, + ))); } if ($this->access->hasCurrentUserAccessToCertificates()) { - $DIC->tabs()->addTab(self::TAB_SHOW_CERTIFICATES, $DIC->language()->txt('mst_list_certificates'), $DIC->ctrl()->getLinkTargetByClass(array( - ilMyStaffGUI::class, - self::class, - ilUserCertificateGUI::class, - ))); + $DIC->tabs()->addTab(self::TAB_SHOW_CERTIFICATES, $DIC->language()->txt('mst_list_certificates'), + $DIC->ctrl()->getLinkTargetByClass(array( + ilMyStaffGUI::class, + self::class, + ilUserCertificateGUI::class, + ))); } if ($this->access->hasCurrentUserAccessToCompetences()) { - $DIC->tabs()->addTab(self::TAB_SHOW_COMPETENCES, $DIC->language()->txt('mst_list_competences'), $DIC->ctrl()->getLinkTargetByClass(array( - ilMyStaffGUI::class, - self::class, - ilMStShowUserCompetencesGUI::class, - ))); + $DIC->tabs()->addTab(self::TAB_SHOW_COMPETENCES, $DIC->language()->txt('mst_list_competences'), + $DIC->ctrl()->getLinkTargetByClass(array( + ilMyStaffGUI::class, + self::class, + ilMStShowUserCompetencesGUI::class, + ))); } - $user = new ilObjUser($this->usr_id); if ($user->hasPublicProfile()) { $DIC->ctrl()->setParameterByClass(self::class, 'usr_id', $this->usr_id); diff --git a/Services/MyStaff/classes/class.ilMyStaffAccess.php b/Services/MyStaff/classes/class.ilMyStaffAccess.php index b56be2c837d3..8d78a42d6a05 100644 --- a/Services/MyStaff/classes/class.ilMyStaffAccess.php +++ b/Services/MyStaff/classes/class.ilMyStaffAccess.php @@ -11,7 +11,6 @@ /** * Class ilMyStaffAccess - * * @author: Martin Studer */ class ilMyStaffAccess extends ilObjectAccess @@ -34,7 +33,6 @@ class ilMyStaffAccess extends ilObjectAccess */ protected static $orgu_users_of_current_user_show_staff_permission; - /** * @return self */ @@ -60,7 +58,6 @@ public static function getInstance() return self::$instance; } - /** * */ @@ -68,7 +65,6 @@ private function __construct() { } - /** * @return bool */ @@ -88,7 +84,8 @@ public function hasCurrentUserAccessToMyStaff() : bool return true; } - if ($this->countOrgusOfUserWithOperationAndContext($DIC->user()->getId(), ilOrgUnitOperation::OP_ACCESS_ENROLMENTS, self::DEFAULT_CONTEXT) + if ($this->countOrgusOfUserWithOperationAndContext($DIC->user()->getId(), + ilOrgUnitOperation::OP_ACCESS_ENROLMENTS, self::DEFAULT_CONTEXT) > 0 ) { return true; @@ -109,7 +106,6 @@ public function hasCurrentUserAccessToMyStaff() : bool return false; } - /** * @return bool */ @@ -121,7 +117,8 @@ public function hasCurrentUserAccessToCertificates() : bool return false; } - if ($this->countOrgusOfUserWithOperationAndContext($DIC->user()->getId(), ilOrgUnitOperation::OP_VIEW_CERTIFICATES, self::DEFAULT_CONTEXT) + if ($this->countOrgusOfUserWithOperationAndContext($DIC->user()->getId(), + ilOrgUnitOperation::OP_VIEW_CERTIFICATES, self::DEFAULT_CONTEXT) > 0 ) { return true; @@ -130,7 +127,6 @@ public function hasCurrentUserAccessToCertificates() : bool return false; } - /** * @return bool */ @@ -142,7 +138,8 @@ public function hasCurrentUserAccessToCompetences() : bool return false; } - if ($this->countOrgusOfUserWithOperationAndContext($DIC->user()->getId(), ilOrgUnitOperation::OP_VIEW_COMPETENCES, self::DEFAULT_CONTEXT) + if ($this->countOrgusOfUserWithOperationAndContext($DIC->user()->getId(), + ilOrgUnitOperation::OP_VIEW_COMPETENCES, self::DEFAULT_CONTEXT) > 0 ) { return true; @@ -151,10 +148,8 @@ public function hasCurrentUserAccessToCompetences() : bool return false; } - /** * @param int $usr_id - * * @return bool */ public function hasCurrentUserAccessToUser($usr_id = 0) : bool @@ -169,10 +164,8 @@ public function hasCurrentUserAccessToUser($usr_id = 0) : bool return false; } - /** * @param int $ref_id - * * @return bool */ public function hasCurrentUserAccessToLearningProgressInObject($ref_id = 0) : bool @@ -182,7 +175,6 @@ public function hasCurrentUserAccessToLearningProgressInObject($ref_id = 0) : bo return $DIC->access()->checkPositionAccess(ilOrgUnitOperation::OP_READ_LEARNING_PROGRESS, $ref_id); } - /** * @return bool */ @@ -191,7 +183,8 @@ public function hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser() global $DIC; $arr_usr_id = $this->getUsersForUserOperationAndContext($DIC->user() - ->getId(), ilOrgUnitOperation::OP_READ_LEARNING_PROGRESS, self::DEFAULT_CONTEXT); + ->getId(), + ilOrgUnitOperation::OP_READ_LEARNING_PROGRESS, self::DEFAULT_CONTEXT); if (count($arr_usr_id) > 0) { return true; } @@ -199,10 +192,8 @@ public function hasCurrentUserAccessToCourseLearningProgressForAtLeastOneUser() return false; } - /** * @param int $user_id - * * @return int */ public function countOrgusOfUserWithAtLeastOneOperation($user_id) @@ -212,7 +203,8 @@ public function countOrgusOfUserWithAtLeastOneOperation($user_id) $q = "SELECT COUNT(orgu_ua.orgu_id) AS 'cnt' FROM il_orgu_permissions AS perm INNER JOIN il_orgu_ua AS orgu_ua ON orgu_ua.position_id = perm.position_id INNER JOIN il_orgu_op_contexts AS contexts on contexts.id = perm.context_id AND contexts.context is not NULL - WHERE orgu_ua.user_id = " . $DIC->database()->quote($user_id, 'integer') . " AND perm.operations is not NULL AND perm.parent_id = -1"; + WHERE orgu_ua.user_id = " . $DIC->database()->quote($user_id, + 'integer') . " AND perm.operations is not NULL AND perm.parent_id = -1"; $set = $DIC->database()->query($q); $rec = $DIC->database()->fetchAssoc($set); @@ -220,16 +212,17 @@ 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) - { + public function countOrgusOfUserWithOperationAndContext( + $user_id, + $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, + $context = self::DEFAULT_CONTEXT + ) { global $DIC; /** @@ -240,7 +233,8 @@ public function countOrgusOfUserWithOperationAndContext($user_id, $org_unit_oper $q = "SELECT COUNT(orgu_ua.orgu_id) AS cnt FROM il_orgu_permissions AS perm INNER JOIN il_orgu_ua AS orgu_ua ON orgu_ua.position_id = perm.position_id INNER JOIN il_orgu_op_contexts AS contexts on contexts.id = perm.context_id AND contexts.context = '" . $context . "' - and orgu_ua.user_id = " . $DIC->database()->quote($user_id, 'integer') . " AND perm.operations LIKE '%\"" + and orgu_ua.user_id = " . $DIC->database()->quote($user_id, + 'integer') . " AND perm.operations LIKE '%\"" . $operation->getOperationId() . "\"%' WHERE perm.parent_id = -1"; @@ -250,13 +244,11 @@ public function countOrgusOfUserWithOperationAndContext($user_id, $org_unit_oper 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( @@ -267,7 +259,8 @@ public function getUsersForUserOperationAndContext( ) { global $DIC; - $tmp_table_name = $this->buildTempTableIlobjectsUserMatrixForUserOperationAndContext($user_id, $org_unit_operation_string, $context, $tmp_table_name_prefix); + $tmp_table_name = $this->buildTempTableIlobjectsUserMatrixForUserOperationAndContext($user_id, + $org_unit_operation_string, $context, $tmp_table_name_prefix); $q = 'SELECT usr_id FROM ' . $tmp_table_name; @@ -282,10 +275,8 @@ public function getUsersForUserOperationAndContext( return $arr_users; } - /** * @param $user_id - * * @return array */ public function getUsersForUserPerPosition($user_id) : array @@ -293,25 +284,24 @@ public function getUsersForUserPerPosition($user_id) : array $users = []; $user_assignments = ilOrgUnitUserAssignmentQueries::getInstance()->getAssignmentsOfUserId($user_id); foreach ($user_assignments as $user_assignment) { - $users[$user_assignment->getPositionId()] = $this->getUsersForUser($user_id, $user_assignment->getPositionId()); + $users[$user_assignment->getPositionId()] = $this->getUsersForUser($user_id, + $user_assignment->getPositionId()); } return $users; } - /** * @param int $user_id - * * @param int|null $position_id - * * @return int[] */ public function getUsersForUser($user_id, ?int $position_id = null) : array { global $DIC; - $tmp_orgu_members = $this->buildTempTableOrguMemberships(self::TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS, array()); + $tmp_orgu_members = $this->buildTempTableOrguMemberships(self::TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS, + array()); $position_limitation = ''; if (!is_null($position_id)) { @@ -321,7 +311,8 @@ public function getUsersForUser($user_id, ?int $position_id = null) : array $q = "SELECT " . $tmp_orgu_members . ".user_id AS usr_id FROM " . $tmp_orgu_members . " - INNER JOIN il_orgu_ua AS orgu_ua_current_user on orgu_ua_current_user.user_id = " . $DIC->database()->quote($user_id, 'integer') . " + INNER JOIN il_orgu_ua AS orgu_ua_current_user on orgu_ua_current_user.user_id = " . $DIC->database()->quote($user_id, + 'integer') . " INNER JOIN il_orgu_authority AS auth ON auth.position_id = orgu_ua_current_user.position_id " . $position_limitation . " WHERE ( @@ -370,12 +361,10 @@ 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 @@ -383,8 +372,9 @@ public function getIdsForUserAndOperation(int $user_id, string $operation, bool $user_assignments = ilOrgUnitUserAssignmentQueries::getInstance()->getAssignmentsOfUserId($user_id); $ids = []; foreach ($user_assignments as $user_assignment) { - $ref_ids = $this->getIdsForPositionAndOperation($user_assignment->getPositionId(), $operation, $return_ref_id); - if(count($ref_ids) > 0) { + $ref_ids = $this->getIdsForPositionAndOperation($user_assignment->getPositionId(), $operation, + $return_ref_id); + if (count($ref_ids) > 0) { $ids = array_merge($ids, $ref_ids); } } @@ -392,20 +382,19 @@ public function getIdsForUserAndOperation(int $user_id, string $operation, bool 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 = []; foreach (ilOrgUnitOperationContext::$available_contexts as $context) { - $ref_ids = $this->getIdsForPositionAndOperationAndContext($position_id, $operation, $context, $return_ref_id); - if(count($ref_ids) > 0) { + $ref_ids = $this->getIdsForPositionAndOperationAndContext($position_id, $operation, $context, + $return_ref_id); + if (count($ref_ids) > 0) { $ids = array_merge($ids, $ref_ids); } } @@ -413,22 +402,22 @@ public function getIdsForPositionAndOperation(int $position_id, string $operatio return $ids; } - /** * 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, string $operation, string $context, bool $return_ref_id) : array - { + public function getIdsForPositionAndOperationAndContext( + int $position_id, + string $operation, + string $context, + bool $return_ref_id + ) : array { global $DIC; $context_id = ilOrgUnitOperationContextQueries::findByName($context)->getId(); $operation_object = ilOrgUnitOperationQueries::findByOperationString($operation, $context); @@ -454,21 +443,22 @@ public function getIdsForPositionAndOperationAndContext(int $position_id, string $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, int $context_id) : bool - { + public function hasPositionDefaultPermissionForOperationInContext( + int $position_id, + int $operation_id, + int $context_id + ) : bool { global $DIC; $res = $DIC->database()->query('SELECT * FROM il_orgu_permissions ' . ' WHERE context_id = ' . $context_id . ' ' . @@ -479,16 +469,17 @@ public function hasPositionDefaultPermissionForOperationInContext(int $position_ 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) - { + public function getIlobjectsAndUsersForUserOperationAndContext( + $user_id, + $org_unit_operation_string = self::DEFAULT_ORG_UNIT_OPERATION, + $context = self::DEFAULT_CONTEXT + ) { global $DIC; /** @@ -498,7 +489,8 @@ public function getIlobjectsAndUsersForUserOperationAndContext($user_id, $org_un $tmp_table_name = 'tmp_ilobj_user_matrix_' . $operation->getOperationId(); - $this->buildTempTableIlobjectsUserMatrixForUserOperationAndContext($user_id, $org_unit_operation_string, $context, $tmp_table_name); + $this->buildTempTableIlobjectsUserMatrixForUserOperationAndContext($user_id, $org_unit_operation_string, + $context, $tmp_table_name); $q = 'SELECT * FROM ' . $tmp_table_name; @@ -513,13 +505,11 @@ public function getIlobjectsAndUsersForUserOperationAndContext($user_id, $org_un 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( @@ -557,11 +547,14 @@ public function buildTempTableIlobjectsUserMatrixForUserOperationAndContext( self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_ORGU_DEFAULT_PERMISSIONS ); - $tmp_table_course_members = $this->buildTempTableCourseMemberships(self::TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS, $all_users_for_user); + $tmp_table_course_members = $this->buildTempTableCourseMemberships(self::TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS, + $all_users_for_user); - $tmp_table_orgu_members = $this->buildTempTableOrguMemberships(self::TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS, $all_users_for_user); + $tmp_table_orgu_members = $this->buildTempTableOrguMemberships(self::TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS, + $all_users_for_user); - $tmp_table_orgu_member_path = $this->buildTempTableOrguMemberships('tmp_orgu_members_path', $all_users_for_user); + $tmp_table_orgu_member_path = $this->buildTempTableOrguMemberships('tmp_orgu_members_path', + $all_users_for_user); if ($temporary_table_name != self::TMP_DEFAULT_TABLE_NAME_PREFIX_IL_OBJ_USER_MATRIX . "_" . self::DEFAULT_ORG_UNIT_OPERATION . "_" . self::DEFAULT_CONTEXT @@ -601,7 +594,8 @@ public function buildTempTableIlobjectsUserMatrixForUserOperationAndContext( ) AS user_perm_matrix INNER JOIN " . $tmp_table_orgu_member_path . " AS path on path.user_id = user_perm_matrix.usr_id - INNER JOIN il_orgu_ua AS orgu_ua_current_user on orgu_ua_current_user.user_id = " . $DIC->database()->quote($user_id, 'integer') . " + INNER JOIN il_orgu_ua AS orgu_ua_current_user on orgu_ua_current_user.user_id = " . $DIC->database()->quote($user_id, + 'integer') . " INNER JOIN il_orgu_permissions AS perm on perm.position_id = orgu_ua_current_user.position_id AND perm.parent_id = -1 INNER JOIN il_orgu_op_contexts AS contexts on contexts.id = perm.context_id AND contexts.context = '$context' and perm.operations LIKE '%\"" . $operation->getOperationId() . "\"%' @@ -650,12 +644,10 @@ 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( @@ -691,7 +683,7 @@ public function buildTempTableIlobjectsSpecificPermissionSetForOperationAndConte il_orgu_permissions AS perm INNER JOIN il_orgu_ua AS orgu_ua ON orgu_ua.position_id = perm.position_id INNER JOIN il_orgu_authority AS auth ON auth.position_id = orgu_ua.position_id AND orgu_ua.user_id = " . $GLOBALS['DIC']->user() - ->getId() . " + ->getId() . " INNER JOIN object_reference AS obj_ref ON obj_ref.ref_id = perm.parent_id INNER JOIN object_data AS obj ON obj.obj_id = obj_ref.obj_id AND obj.type = '$context' INNER JOIN il_orgu_op_contexts AS contexts on contexts.id = perm.context_id AND contexts.context = '$context' @@ -704,12 +696,10 @@ 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( @@ -747,7 +737,7 @@ public function buildTempTableIlobjectsDefaultPermissionSetForOperationAndContex INNER JOIN il_orgu_permissions AS perm ON perm.operations LIKE '%\"" . $operation->getOperationId() . "\"%' AND perm.parent_id = -1 INNER JOIN il_orgu_op_contexts AS contexts on contexts.id = perm.context_id AND contexts.context = '" . $context . "' INNER JOIN il_orgu_ua AS orgu_ua ON orgu_ua.position_id = perm.position_id AND orgu_ua.user_id = " . $GLOBALS['DIC']->user() - ->getId() . " + ->getId() . " INNER JOIN il_orgu_authority AS auth ON auth.position_id = orgu_ua.position_id WHERE @@ -768,12 +758,10 @@ public function buildTempTableIlobjectsDefaultPermissionSetForOperationAndContex return $temporary_table_name; } - /** * @param string $org_unit_operation_string * @param string $context * @param string $temporary_table_name_prefix - * * @return string */ public function buildTempTableIlorgunitDefaultPermissionSetForOperationAndContext( @@ -819,15 +807,15 @@ 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, array $only_courses_of_user_ids = array()) - { + public function buildTempTableCourseMemberships( + $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_CRS_MEMBERS, + array $only_courses_of_user_ids = array() + ) { global $DIC; $temporary_table_name = $temporary_table_name_prefix . "_user_id_" . $DIC->user()->getId(); @@ -844,13 +832,16 @@ public function buildTempTableCourseMemberships($temporary_table_name_prefix = s SELECT crs_members_crs_ref.ref_id, crs_members.usr_id, orgu_ua.position_id, orgu_ua.orgu_id FROM ( SELECT obj_id, usr_id FROM obj_members WHERE member = 1 - AND " . $DIC->database()->in('obj_members.usr_id', $only_courses_of_user_ids, false, 'integer') . " + AND " . $DIC->database()->in('obj_members.usr_id', $only_courses_of_user_ids, false, + 'integer') . " UNION SELECT obj_id, usr_id FROM crs_waiting_list - WHERE " . $DIC->database()->in('crs_waiting_list.usr_id', $only_courses_of_user_ids, false, 'integer') . " + WHERE " . $DIC->database()->in('crs_waiting_list.usr_id', $only_courses_of_user_ids, false, + 'integer') . " UNION SELECT obj_id, usr_id FROM il_subscribers - WHERE " . $DIC->database()->in('il_subscribers.usr_id', $only_courses_of_user_ids, false, 'integer') . " + WHERE " . $DIC->database()->in('il_subscribers.usr_id', $only_courses_of_user_ids, false, + 'integer') . " ) AS crs_members INNER JOIN object_reference AS crs_members_crs_ref on crs_members_crs_ref.obj_id = crs_members.obj_id INNER JOIN il_orgu_ua AS orgu_ua on orgu_ua.user_id = crs_members.usr_id @@ -861,15 +852,15 @@ public function buildTempTableCourseMemberships($temporary_table_name_prefix = s 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, array $only_orgus_of_user_ids = array()) - { + public function buildTempTableOrguMemberships( + $temporary_table_name_prefix = self::TMP_DEFAULT_TABLE_NAME_PREFIX_ORGU_MEMBERS, + array $only_orgus_of_user_ids = array() + ) { global $DIC; $temporary_table_name = $temporary_table_name_prefix . "_user_id_" . $DIC->user()->getId(); @@ -907,10 +898,8 @@ public function buildTempTableOrguMemberships($temporary_table_name_prefix = sel return $temporary_table_name; } - /** * @param string $temporary_table_name - * * @return bool */ public function dropTempTable($temporary_table_name) diff --git a/Services/MyStaff/classes/class.ilMyStaffGUI.php b/Services/MyStaff/classes/class.ilMyStaffGUI.php index 74de75bb8263..03b746d32133 100644 --- a/Services/MyStaff/classes/class.ilMyStaffGUI.php +++ b/Services/MyStaff/classes/class.ilMyStaffGUI.php @@ -5,7 +5,6 @@ /** * Class ilMyStaffGUI - * * @author Martin Studer */ class ilMyStaffGUI @@ -17,7 +16,6 @@ class ilMyStaffGUI const TAB_LIST_COMPETENCES = 'list_competences'; const TAB_LIST_STUDY_PROGRAMME = 'list_study_programme'; - /** * */ @@ -33,7 +31,6 @@ public function __construct() $DIC->ui()->mainTemplate()->setTitle($DIC->language()->txt('mst_my_staff')); } - /** * */ @@ -74,19 +71,21 @@ public function executeCommand() $DIC->ui()->mainTemplate()->printToStdout(); } - /** * @param ilAdvancedSelectionListGUI $selection * @param int $usr_id * @param string $return_url - * * @return ilAdvancedSelectionListGUI */ - public static function extendActionMenuWithUserActions(ilAdvancedSelectionListGUI $selection, $usr_id = 0, $return_url = "") - { + public static function extendActionMenuWithUserActions( + ilAdvancedSelectionListGUI $selection, + $usr_id = 0, + $return_url = "" + ) { global $DIC; - $user_action_collector = ilUserActionCollector::getInstance($DIC->user()->getId(), new ilAwarenessUserActionContext()); + $user_action_collector = ilUserActionCollector::getInstance($DIC->user()->getId(), + new ilAwarenessUserActionContext()); $action_collection = $user_action_collector->getActionsForTargetUser($usr_id); if (count($action_collection->getActions()) > 0) { foreach ($action_collection->getActions() as $action) { @@ -102,11 +101,13 @@ public static function extendActionMenuWithUserActions(ilAdvancedSelectionListGU case "invite_osd": //direct chat (start conversation) //do only display those actions if the displayed user is not the current user if ($usr_id != $DIC->user()->getId()) { - $selection->addItem($action->getText(), "", $action->getHref(), "", "", "", "", false, "", "", "", "", true, $action->getData()); + $selection->addItem($action->getText(), "", $action->getHref(), "", "", "", "", false, "", + "", "", "", true, $action->getData()); } break; default: - $selection->addItem($action->getText(), "", $action->getHref(), "", "", "", "", false, "", "", "", "", true, $action->getData()); + $selection->addItem($action->getText(), "", $action->getHref(), "", "", "", "", false, "", "", + "", "", true, $action->getData()); break; } } @@ -115,10 +116,8 @@ public static function extendActionMenuWithUserActions(ilAdvancedSelectionListGU return $selection; } - /** * @param ilMStListCourse $my_staff_course - * * @return string */ public static function getUserLpStatusAsHtml(ilMStListCourse $my_staff_course) @@ -127,7 +126,8 @@ public static function getUserLpStatusAsHtml(ilMStListCourse $my_staff_course) if (ilMyStaffAccess::getInstance()->hasCurrentUserAccessToLearningProgressInObject($my_staff_course->getCrsRefId())) { $lp_icon = $DIC->ui()->factory()->image() - ->standard(ilLearningProgressBaseGUI::_getImagePathForStatus($my_staff_course->getUsrLpStatus()), ilLearningProgressBaseGUI::_getStatusText(intval($my_staff_course->getUsrLpStatus()))); + ->standard(ilLearningProgressBaseGUI::_getImagePathForStatus($my_staff_course->getUsrLpStatus()), + ilLearningProgressBaseGUI::_getStatusText(intval($my_staff_course->getUsrLpStatus()))); return $DIC->ui()->renderer()->render($lp_icon) . ' ' . ilLearningProgressBaseGUI::_getStatusText(intval($my_staff_course->getUsrLpStatus())); @@ -136,10 +136,8 @@ public static function getUserLpStatusAsHtml(ilMStListCourse $my_staff_course) return ' '; } - /** * @param ilMStListCourse $my_staff_course - * * @return string */ public static function getUserLpStatusAsText(ilMStListCourse $my_staff_course) diff --git a/Services/MyStaff/maintenance.json b/Services/MyStaff/maintenance.json index bc1433ce0fdc..51efb6b9ed7e 100644 --- a/Services/MyStaff/maintenance.json +++ b/Services/MyStaff/maintenance.json @@ -1,14 +1,14 @@ { - "maintenance_model": "Classic", - "first_maintainer": "mstuder(8473)", - "second_maintainer": "rklees(34047)", - "implicit_maintainers": [], - "coordinator": [ - "" - ], - "tester": "", - "testcase_writer": "", - "path": "Services/MyStaff", - "belong_to_component": "Staff", - "used_in_components": [] + "maintenance_model": "Classic", + "first_maintainer": "mstuder(8473)", + "second_maintainer": "rklees(34047)", + "implicit_maintainers": [], + "coordinator": [ + "" + ], + "tester": "", + "testcase_writer": "", + "path": "Services/MyStaff", + "belong_to_component": "Staff", + "used_in_components": [] } \ No newline at end of file diff --git a/Services/MyStaff/templates/default/tpl.list_courses_row.html b/Services/MyStaff/templates/default/tpl.list_courses_row.html index 87540769fd33..add2beb04923 100644 --- a/Services/MyStaff/templates/default/tpl.list_courses_row.html +++ b/Services/MyStaff/templates/default/tpl.list_courses_row.html @@ -1,6 +1,6 @@ - - {VALUE} - - {ACTIONS} + + {VALUE} + + {ACTIONS} \ No newline at end of file diff --git a/Services/MyStaff/templates/default/tpl.list_skills_row.html b/Services/MyStaff/templates/default/tpl.list_skills_row.html index 87540769fd33..add2beb04923 100644 --- a/Services/MyStaff/templates/default/tpl.list_skills_row.html +++ b/Services/MyStaff/templates/default/tpl.list_skills_row.html @@ -1,6 +1,6 @@ - - {VALUE} - - {ACTIONS} + + {VALUE} + + {ACTIONS} \ No newline at end of file diff --git a/Services/MyStaff/templates/default/tpl.list_user_courses_row.html b/Services/MyStaff/templates/default/tpl.list_user_courses_row.html index 87540769fd33..add2beb04923 100644 --- a/Services/MyStaff/templates/default/tpl.list_user_courses_row.html +++ b/Services/MyStaff/templates/default/tpl.list_user_courses_row.html @@ -1,6 +1,6 @@ - - {VALUE} - - {ACTIONS} + + {VALUE} + + {ACTIONS} \ No newline at end of file diff --git a/Services/MyStaff/templates/default/tpl.list_users_row.html b/Services/MyStaff/templates/default/tpl.list_users_row.html index f133f149985a..b2efa35b584b 100644 --- a/Services/MyStaff/templates/default/tpl.list_users_row.html +++ b/Services/MyStaff/templates/default/tpl.list_users_row.html @@ -1,11 +1,11 @@ - - - {user_profile_picture} - - - - {VALUE} - - {ACTIONS} + + + {user_profile_picture} + + + + {VALUE} + + {ACTIONS} \ No newline at end of file