diff --git a/Modules/OrgUnit/PublicApi/OrgUnitUserService.php b/Modules/OrgUnit/PublicApi/OrgUnitUserService.php index 75290d0b8f52..571fbcd32350 100644 --- a/Modules/OrgUnit/PublicApi/OrgUnitUserService.php +++ b/Modules/OrgUnit/PublicApi/OrgUnitUserService.php @@ -1,4 +1,5 @@ getUsers([292,291]); ``` -This will return a list of ilOrgUnitUser. The Positions and the Superios can be lazy loaded. -Position: A position in ILIAS is a possibility to assign users to an organisational unit. For example, a user can be assigned to an organisational unit in the position superior or employee. The positions Employees and Superiors are standard ILIAS positions. Note Additional Positions can be configured arbitrarily in ILIAS. +This will return a list of ilOrgUnitUser. The Positions and the Superios can be lazy loaded. + +Position: A position in ILIAS is a possibility to assign users to an organisational unit. For example, a user can be +assigned to an organisational unit in the position superior or employee. The positions Employees and Superiors are +standard ILIAS positions. Note Additional Positions can be configured arbitrarily in ILIAS. -Superiors: Superiors of a user are those users who are assigned as superiors to the ILIAS organisational unit for which a user has assigned the position Employee. +Superiors: Superiors of a user are those users who are assigned as superiors to the ILIAS organisational unit for which +a user has assigned the position Employee. You may load them by: + ``` foreach($orgu_users as $orgu_user) { /** @@ -22,6 +29,7 @@ foreach($orgu_users as $orgu_user) { ``` If you know that you will use Superiors or Positions for the whole list. Load it Eager by: + ``` $orgunit = new OrgUnitUserService(); $orgu_users = $orgunit->getUsers([292,291],$with_superios = true, $with_positions = true); diff --git a/Modules/OrgUnit/classes/ARHelper/BaseCommands.php b/Modules/OrgUnit/classes/ARHelper/BaseCommands.php index 9a2d17cb7cd1..42bf0e97aaac 100644 --- a/Modules/OrgUnit/classes/ARHelper/BaseCommands.php +++ b/Modules/OrgUnit/classes/ARHelper/BaseCommands.php @@ -4,12 +4,12 @@ /** * Interface BaseCommands - * * @author Fabian Schmid */ abstract class BaseCommands { use DIC; + const CMD_INDEX = "index"; const CMD_ADD = "add"; const CMD_CREATE = "create"; @@ -24,7 +24,6 @@ abstract class BaseCommands */ protected $parent_gui = null; - /** * @return \ILIAS\Modules\OrgUnit\ARHelper\BaseCommands */ @@ -33,7 +32,6 @@ public function getParentGui() return $this->parent_gui; } - /** * @param \ILIAS\Modules\OrgUnit\ARHelper\BaseCommands $parent_gui */ @@ -42,10 +40,8 @@ public function setParentGui($parent_gui) $this->parent_gui = $parent_gui; } - abstract protected function index(); - /** * @return array of GUI_Class-Names */ @@ -54,7 +50,6 @@ protected function getPossibleNextClasses() return array(); } - /** * @return null|string of active Tab */ @@ -63,13 +58,11 @@ protected function getActiveTabId() return null; } - protected function cancel() { $this->ctrl()->redirect($this, self::CMD_INDEX); } - /*** * @param $html */ @@ -78,7 +71,6 @@ protected function setContent($html) $this->tpl()->setContent($html); } - public function executeCommand() { $this->dic()->language()->loadLanguageModule("orgu"); @@ -111,7 +103,6 @@ public function executeCommand() } } - /** * @param $subtab_id * @param $url @@ -121,7 +112,6 @@ protected function pushSubTab($subtab_id, $url) $this->dic()->tabs()->addSubTab($subtab_id, $this->txt($subtab_id), $url); } - /** * @param $subtab_id */ @@ -130,7 +120,6 @@ protected function activeSubTab($subtab_id) $this->dic()->tabs()->activateSubTab($subtab_id); } - protected function checkRequestReferenceId() { /** @@ -144,7 +133,6 @@ protected function checkRequestReferenceId() return true; } - /** * @return int|null */ @@ -156,7 +144,6 @@ protected function getParentRefId() return $ref_id; } - public function addSubTabs() { } diff --git a/Modules/OrgUnit/classes/ARHelper/BaseForm.php b/Modules/OrgUnit/classes/ARHelper/BaseForm.php index e7f347c7d0bd..a328edc557f3 100644 --- a/Modules/OrgUnit/classes/ARHelper/BaseForm.php +++ b/Modules/OrgUnit/classes/ARHelper/BaseForm.php @@ -4,7 +4,6 @@ /** * Class BaseForm - * * @package ILIAS\Modules\OrgUnit\CtrlHelper */ abstract class BaseForm extends \ilPropertyFormGUI @@ -23,10 +22,8 @@ abstract class BaseForm extends \ilPropertyFormGUI */ protected $object; - /** * BaseForm constructor. - * * @param \ILIAS\Modules\OrgUnit\ARHelper\BaseCommands $parent_gui * @param \ActiveRecord $object */ @@ -42,16 +39,12 @@ public function __construct(BaseCommands $parent_gui, \ActiveRecord $object) parent::__construct(); } - abstract protected function initFormElements(); - abstract public function fillForm(); - abstract protected function fillObject(); - /** * @return int ID of the object */ @@ -69,7 +62,6 @@ public function saveObject() return $this->object->getId(); } - protected function initButtons() { if (!$this->object->getId()) { @@ -83,10 +75,8 @@ protected function initButtons() } } - /** * @param $key - * * @return string */ protected function txt($key) @@ -94,10 +84,8 @@ protected function txt($key) return $this->parent_gui->txt($key); } - /** * @param $key - * * @return string */ protected function infoTxt($key) @@ -105,7 +93,6 @@ protected function infoTxt($key) return $this->parent_gui->txt($key . '_info'); } - /** * @return \ILIAS\DI\Container */ diff --git a/Modules/OrgUnit/classes/ARHelper/DIC.php b/Modules/OrgUnit/classes/ARHelper/DIC.php index 91b51cf73669..c10e1b62b61f 100644 --- a/Modules/OrgUnit/classes/ARHelper/DIC.php +++ b/Modules/OrgUnit/classes/ARHelper/DIC.php @@ -2,7 +2,9 @@ namespace ILIAS\Modules\OrgUnit\ARHelper; -use ILIAS\HTTP\RawHTTPServices;/** +use ILIAS\HTTP\RawHTTPServices; + +/** * Class DIC * @author Fabian Schmid */ @@ -17,7 +19,6 @@ public function dic() return $GLOBALS['DIC']; } - /** * @return \ilCtrl */ @@ -26,10 +27,8 @@ protected function ctrl() return $this->dic()->ctrl(); } - /** * @param $variable - * * @return string */ public function txt($variable) @@ -37,7 +36,6 @@ public function txt($variable) return $this->lng()->txt($variable); } - /** * @return \ilTemplate */ @@ -46,7 +44,6 @@ protected function tpl() return $this->dic()->ui()->mainTemplate(); } - /** * @return \ilLanguage */ @@ -55,7 +52,6 @@ protected function lng() return $this->dic()->language(); } - /** * @return \ilTabsGUI */ @@ -64,7 +60,6 @@ protected function tabs() return $this->dic()->tabs(); } - /** * @return \ILIAS\DI\UIServices */ @@ -73,7 +68,6 @@ protected function ui() return $this->dic()->ui(); } - /** * @return \ilObjUser */ @@ -82,7 +76,6 @@ protected function user() return $this->dic()->user(); } - /** * @return \ILIAS\HTTP\Services */ @@ -91,7 +84,6 @@ protected function http() return $this->dic()->http(); } - /** * @return \ilAccessHandler */ @@ -100,7 +92,6 @@ protected function access() return $this->dic()->access(); } - /** * @return \ilToolbarGUI */ @@ -109,7 +100,6 @@ protected function toolbar() return $this->dic()->toolbar(); } - /** * @return \ilDB */ @@ -128,10 +118,8 @@ public function checkPermissionAndFail($a_perm) } } - /** * @param $a_perm - * * @return bool */ public function checkPermissionBoolAndReturn($a_perm) diff --git a/Modules/OrgUnit/classes/Exceptions/class.ilOrguException.php b/Modules/OrgUnit/classes/Exceptions/class.ilOrguException.php index 1988e8b65be0..3643e68848a1 100644 --- a/Modules/OrgUnit/classes/Exceptions/class.ilOrguException.php +++ b/Modules/OrgUnit/classes/Exceptions/class.ilOrguException.php @@ -2,9 +2,7 @@ /** * Class ilOrguException - * * @author Oskar Truffer - * * This is the base class for OrgUnit Exceptions as described in the dev guide. */ class ilOrguException extends ilException diff --git a/Modules/OrgUnit/classes/Exceptions/ilPositionPermissionsNotActive.php b/Modules/OrgUnit/classes/Exceptions/ilPositionPermissionsNotActive.php index b8682dec663c..39570216f9da 100644 --- a/Modules/OrgUnit/classes/Exceptions/ilPositionPermissionsNotActive.php +++ b/Modules/OrgUnit/classes/Exceptions/ilPositionPermissionsNotActive.php @@ -2,7 +2,6 @@ /** * Class ilPositionPermissionsNotActive - * * @author Oskar Truffer */ class ilPositionPermissionsNotActive extends ilOrguException @@ -11,10 +10,8 @@ class ilPositionPermissionsNotActive extends ilOrguException /** @var string */ protected $object_type = ""; - /** * ilPositionPermissionsNotActive constructor. - * * @param string $message * @param string $type * @param int $code @@ -26,7 +23,6 @@ public function __construct($message, $type, $code = 0) $this->object_type = $type; } - /** * @return string */ diff --git a/Modules/OrgUnit/classes/ExtId/class.ilExtIdGUI.php b/Modules/OrgUnit/classes/ExtId/class.ilExtIdGUI.php index ae1e91f5dd32..be29494be8a8 100644 --- a/Modules/OrgUnit/classes/ExtId/class.ilExtIdGUI.php +++ b/Modules/OrgUnit/classes/ExtId/class.ilExtIdGUI.php @@ -3,7 +3,6 @@ /** * Class ilExtIdGUI - * * @author Oskar Truffer * @author Martin Studer */ @@ -43,7 +42,6 @@ class ilExtIdGUI */ protected $ilAccess; - /** * @param $parent_gui */ @@ -71,7 +69,6 @@ public function __construct($parent_gui) } } - /** * @return bool */ @@ -91,14 +88,12 @@ public function executeCommand() return true; } - public function edit() { $form = $this->initForm(); $this->tpl->setContent($form->getHTML()); } - public function initForm() { $form = new ilPropertyFormGUI(); @@ -111,7 +106,6 @@ public function initForm() return $form; } - public function update() { $form = $this->initForm(); diff --git a/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtension.php b/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtension.php index 509862c80277..f3099e05731d 100644 --- a/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtension.php +++ b/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtension.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitExtension - * * @author Oskar Truffer */ abstract class ilOrgUnitExtension extends ilObjectPlugin @@ -11,10 +10,8 @@ abstract class ilOrgUnitExtension extends ilObjectPlugin protected int $parent_ref_id; protected ilTree $tree; - /** * ilOrgUnitExtension constructor. - * * @param int $a_ref_id */ public function __construct($a_ref_id = 0) @@ -28,10 +25,8 @@ public function __construct($a_ref_id = 0) $this->tree = $tree; } - /** * Returns all Orgu Plugin Ids of active plugins where the Plugin wants to be shown in the tree. ($plugin->showInTree() == true) - * * @return string[] */ public static function getActivePluginIdsForTree() @@ -55,9 +50,7 @@ public static function getActivePluginIdsForTree() /** * Get all user ids of employees of the underlying OrgUnit. - * * @param bool $recursively include all employees in the suborgunits - * * @return int[] */ public function getEmployees($recursively = false) @@ -65,12 +58,9 @@ public function getEmployees($recursively = false) return $this->ilObjOrgUnitTree->getEmployees($this->parent_ref_id, $recursively); } - /** * Get all user ids of superiors of the underlying OrgUnit - * * @param bool $recursively - * * @return int[] */ public function getSuperiors($recursively = false) @@ -78,7 +68,6 @@ public function getSuperiors($recursively = false) return $this->ilObjOrgUnitTree->getSuperiors($this->parent_ref_id, $recursively); } - /** * @return ilObjOrgUnit */ @@ -87,7 +76,6 @@ public function getOrgUnit() return ilObjectFactory::getInstanceByRefId($this->parent_ref_id); } - /** * @return int[] RefIds from the root OrgUnit to the underlying OrgUnit */ @@ -101,9 +89,7 @@ public function getOrgUnitPathRefIds() return $path; } - /** - * * @return array Returns the path to the underlying OrgUnit starting with the root OrgUnit. The array are nodes of the global $tree. */ public function getOrgUnitPath() @@ -111,7 +97,6 @@ public function getOrgUnitPath() return $this->tree->getPathFull($this->parent_ref_id, ilObjOrgUnit::getRootOrgRefId()); } - /** * @return string[] Returns the titles to the underlying OrgUnit starting with the root OrgUnit. */ @@ -128,11 +113,9 @@ public function getOrgUnitPathTitles() return $titles; } - /** * @param bool $with_data if this is set to true, only the ids are delivered * @param string $type what type are you looking for? - * * @return array */ public function getOrgUnitSubtree($with_data = true, $type = "") diff --git a/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionAccess.php b/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionAccess.php index 3a922c3ef740..9d578c4a639c 100644 --- a/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionAccess.php +++ b/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionAccess.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitExtensionAccess - * * @author Oskar Truffer */ class ilOrgUnitExtensionAccess extends ilObjectPluginAccess diff --git a/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionGUI.php b/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionGUI.php index 41c8c8b7d134..22e873f7eaf2 100644 --- a/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionGUI.php +++ b/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionGUI.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitExtensionGUI - * * @author Oskar Truffer */ abstract class ilOrgUnitExtensionGUI extends ilObjectPluginGUI @@ -13,10 +12,8 @@ abstract class ilOrgUnitExtensionGUI extends ilObjectPluginGUI */ protected $ilLocator; - /** * ilOrgUnitExtensionGUI constructor. - * * @param int $a_ref_id * @param int $a_id_type * @param int $a_parent_node_id @@ -51,7 +48,6 @@ protected function lookupParentTitleInCreationMode() : string return $parent; } - /** * @return bool returns true iff this object supports cloning. */ @@ -60,7 +56,6 @@ protected function supportsCloning() : bool return false; } - /** * Override the locator (breadcrumbs). We want the breadcrumbs with the Admin Org Unit node as a root and not the repository. */ @@ -90,7 +85,6 @@ protected function setLocator() : void $tpl->setLocator(); } - /** * Views in the Org Unit have the Navigation Tree enabled by default. Thus we display it as well in the plugins. */ @@ -98,14 +92,14 @@ public function showTree() { $this->ctrl->setParameterByClass("ilObjPluginDispatchGUI", "ref_id", $_GET["ref_id"]); $this->ctrl->setParameterByClass("ilObjOrgUnitGUI", "ref_id", $_GET["ref_id"]); - $tree = new ilOrgUnitExplorerGUI("orgu_explorer", array("ilAdministrationGUI", "ilObjOrgUnitGUI"), "showTree", new ilTree(1)); + $tree = new ilOrgUnitExplorerGUI("orgu_explorer", array("ilAdministrationGUI", "ilObjOrgUnitGUI"), "showTree", + new ilTree(1)); $tree->setTypeWhiteList($this->getTreeWhiteList()); if (!$tree->handleCommand()) { $this->tpl->setLeftNavContent($tree->getHTML()); } } - /** * @return array */ diff --git a/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionListGUI.php b/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionListGUI.php index c8ab70e59f70..f4129158b601 100644 --- a/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionListGUI.php +++ b/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionListGUI.php @@ -2,8 +2,6 @@ /** * Class ilOrgUnitExtensionListGUI - * - * * @author Oskar Truffer */ abstract class ilOrgUnitExtensionListGUI extends ilObjectPluginListGUI @@ -21,28 +19,28 @@ protected function initListActions() : void $this->timings_enabled = false; } - /** * @param string $a_type * @param int $a_ref_id * @param int $a_obj_id * @param bool $a_header_actions * @param bool $a_check_write_access - * * @return bool */ - protected function isCommentsActivated($a_type, $a_ref_id, $a_obj_id, $a_header_actions, $a_check_write_access = true) - { + protected function isCommentsActivated( + $a_type, + $a_ref_id, + $a_obj_id, + $a_header_actions, + $a_check_write_access = true + ) { return $this->comments_enabled; } - /** * Comments cannot be enabled. - * * @param bool $a_value * @param bool $a_enable_comments_settings - * * @return bool */ public function enableComments($a_value, $a_enable_comments_settings = true) @@ -50,10 +48,8 @@ public function enableComments($a_value, $a_enable_comments_settings = true) return false; } - /** * @param bool $a_value - * * @return bool */ public function enableNotes($a_value) @@ -61,10 +57,8 @@ public function enableNotes($a_value) return false; } - /** * @param bool $a_value - * * @return bool */ public function enableTags($a_value) diff --git a/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionPlugin.php b/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionPlugin.php index 5524faf0b00f..4d6062a98f25 100644 --- a/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionPlugin.php +++ b/Modules/OrgUnit/classes/Extension/class.ilOrgUnitExtensionPlugin.php @@ -2,12 +2,11 @@ /** * Class ilOrgUnitExtensionPlugin - * * @author Oskar Truffer */ abstract class ilOrgUnitExtensionPlugin extends ilRepositoryObjectPlugin { - /** + /** * @return array */ public function getParentTypes() : array @@ -17,11 +16,9 @@ public function getParentTypes() : array return $par_types; } - /** * @param $a_type * @param $a_size - * * @return string */ public static function _getIcon(string $a_type) : string @@ -37,10 +34,8 @@ public static function _getIcon(string $a_type) : string ); } - /** * @param $a_id - * * @return string */ public static function _getName($a_id) : string @@ -50,10 +45,8 @@ public static function _getName($a_id) : string return $component_repository->getPluginById($a_id)->getName(); } - /** * return true iff this item should be displayed in the tree. - * * @return bool */ public function showInTree() diff --git a/Modules/OrgUnit/classes/LocalUser/class.ilLocalUserGUI.php b/Modules/OrgUnit/classes/LocalUser/class.ilLocalUserGUI.php index 8d115af93eb0..16941ed8ddb2 100644 --- a/Modules/OrgUnit/classes/LocalUser/class.ilLocalUserGUI.php +++ b/Modules/OrgUnit/classes/LocalUser/class.ilLocalUserGUI.php @@ -3,7 +3,6 @@ /** * Class ilLocalUserGUI - * * @author Oskar Truffer * @author Martin Studer */ @@ -71,7 +70,6 @@ public function __construct($parent_gui) } } - /** * @return bool */ @@ -82,7 +80,8 @@ public function executeCommand() case "assignRoles": case "assignSave": $this->tabs_gui->clearTargets(); - $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index')); + $this->tabs_gui->setBackTarget($this->lng->txt("back"), + $this->ctrl->getLinkTargetByClass("illocalusergui", 'index')); $this->$cmd(); break; default: @@ -93,7 +92,6 @@ public function executeCommand() return true; } - /** * Reset filter * (note: this function existed before data table filter has been introduced @@ -106,10 +104,8 @@ protected function resetFilter() $this->index(); } - /** * Apply filter - * * @return */ protected function applyFilter() @@ -120,7 +116,6 @@ protected function applyFilter() $this->index(); } - public function index($show_delete = false) { global $DIC; @@ -161,7 +156,6 @@ public function index($show_delete = false) return true; } - /** * Show auto complete results */ @@ -180,7 +174,6 @@ protected function addUserAutoCompleteObject() exit(); } - /** * Delete User */ @@ -205,7 +198,6 @@ public function performDeleteUsers() return true; } - public function deleteUsers() { $this->checkPermission("cat_administrate_users"); @@ -231,7 +223,6 @@ public function deleteUsers() $this->tpl->setContent($confirm->getHTML()); } - public function assignRoles() { global $DIC; @@ -284,7 +275,6 @@ public function assignRoles() $this->__showRolesTable($f_result, "assignRolesObject"); } - public function assignSave() { global $DIC; @@ -325,7 +315,6 @@ public function assignSave() return true; } - public function __checkGlobalRoles($new_assigned) { global $DIC; @@ -365,7 +354,6 @@ public function __checkGlobalRoles($new_assigned) return true; } - public function __getAssignableRoles() { global $DIC; @@ -385,7 +373,6 @@ public function __getAssignableRoles() return $roles = array_merge($global_roles, $rbacreview->getAssignableChildRoles($this->object->getRefId())); } - public function __showRolesTable($a_result_set, $a_from = "") { if (!$this->ilAccess->checkAccess("cat_administrate_users", "", $_GET["ref_id"])) { @@ -476,7 +463,6 @@ protected function __setTableGUIBasicData($tbl, &$result_set, string $a_from = " $tbl->setData($result_set); } - /** * @param $permission */ diff --git a/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php b/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php index e2d1598452c2..a7d509f71424 100644 --- a/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php +++ b/Modules/OrgUnit/classes/PathStorage/class.ilOrgUnitPathStorage.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitPathStorage - * * @author Fabian Schmid */ class ilOrgUnitPathStorage extends ActiveRecord @@ -14,7 +13,6 @@ class ilOrgUnitPathStorage extends ActiveRecord const MAX_MIDDLE_PATH_LENGTH = 50; /** * @var int - * * @con_is_primary true * @con_is_unique true * @con_has_field true @@ -24,7 +22,6 @@ class ilOrgUnitPathStorage extends ActiveRecord protected $ref_id = 0; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 8 @@ -32,7 +29,6 @@ class ilOrgUnitPathStorage extends ActiveRecord protected $obj_id = 0; /** * @var string - * * @con_has_field true * @con_fieldtype clob */ @@ -42,7 +38,6 @@ class ilOrgUnitPathStorage extends ActiveRecord */ protected static $orgu_names = array(); - /** * @return array */ @@ -53,7 +48,6 @@ public static function getAllOrguRefIds() return array_keys($names); } - public function store() : void { if (self::where(array('ref_id' => $this->getRefId()))->hasSets()) { @@ -63,19 +57,19 @@ public function store() : void } } - /** * Format comma seperated ref_ids into comma seperated string representation (also filters out deleted orgunits). * Return "-" if $string is empty - * - * @param int $user_id + * @param int $user_id * @param string $separator - * @param bool $using_tmp_table second implementation - * + * @param bool $using_tmp_table second implementation * @return string comma seperated string representations of format: [OrgUnit Title] - [OrgUnits corresponding Level 1 Title] */ - public static function getTextRepresentationOfUsersOrgUnits($user_id, $separator = self::ORG_SEPARATOR, $using_tmp_table = true) - { + public static function getTextRepresentationOfUsersOrgUnits( + $user_id, + $separator = self::ORG_SEPARATOR, + $using_tmp_table = true + ) { if ($using_tmp_table) { global $DIC; /** @@ -84,7 +78,9 @@ public static function getTextRepresentationOfUsersOrgUnits($user_id, $separator $ilDB = $DIC['ilDB']; ilObjOrgUnitTree::_getInstance()->buildTempTableWithUsrAssignements(); - $res = $ilDB->queryF("SELECT " . $ilDB->groupConcat("path", $separator) . " AS orgus FROM orgu_usr_assignements WHERE user_id = %s GROUP BY user_id;", array('integer'), array($user_id)); + $res = $ilDB->queryF("SELECT " . $ilDB->groupConcat("path", + $separator) . " AS orgus FROM orgu_usr_assignements WHERE user_id = %s GROUP BY user_id;", + array('integer'), array($user_id)); $dat = $ilDB->fetchObject($res); return (isset($dat->orgus) && $dat->orgus) ? $dat->orgus : '-'; @@ -100,12 +96,9 @@ public static function getTextRepresentationOfUsersOrgUnits($user_id, $separator } } - /** * Get ref id path array - * * @param bool $sort_by_title - * * @return array */ public static function getTextRepresentationOfOrgUnits($sort_by_title = true) @@ -117,10 +110,8 @@ public static function getTextRepresentationOfOrgUnits($sort_by_title = true) } } - /** * @param $ref_id - * * @return bool */ public static function writePathByRefId($ref_id) @@ -163,7 +154,6 @@ public static function writePathByRefId($ref_id) return true; } - public static function clearDeleted() { global $DIC; @@ -176,10 +166,8 @@ public static function clearDeleted() $ilDB->manipulate($q); } - /** * @param $ref_id - * * @return bool * @currently_unused */ @@ -215,10 +203,8 @@ protected static function writeFullPathByRefId($ref_id) return true; } - /** * @param null $lng_key - * * @return array */ public static function getAllOrguNames($lng_key = null) @@ -240,7 +226,6 @@ public static function getAllOrguNames($lng_key = null) return self::$orgu_names; } - /** * @return string */ @@ -249,7 +234,6 @@ public function getConnectorContainerName() : string return self::TABLE_NAME; } - /** * @return int */ @@ -258,7 +242,6 @@ public function getRefId() return $this->ref_id; } - /** * @param int $ref_id */ @@ -267,7 +250,6 @@ public function setRefId($ref_id) $this->ref_id = $ref_id; } - /** * @return string */ @@ -276,7 +258,6 @@ public function getPath() return $this->path; } - /** * @param string $path */ @@ -285,7 +266,6 @@ public function setPath($path) $this->path = $path; } - /** * @return int */ @@ -294,7 +274,6 @@ public function getObjId() return $this->obj_id; } - /** * @param int $obj_id */ diff --git a/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthority.php b/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthority.php index f817431c7321..499015ef7512 100644 --- a/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthority.php +++ b/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthority.php @@ -4,7 +4,6 @@ /** * Class ilOrguAuthority - * * @author Fabian Schmid */ class ilOrgUnitAuthority extends \ActiveRecord @@ -25,7 +24,6 @@ class ilOrgUnitAuthority extends \ActiveRecord // self::SCOPE_ALL_ORGUS, ); - /** * @return array */ @@ -34,7 +32,6 @@ public static function getScopes() return self::$scopes; } - /** * @return string */ @@ -43,10 +40,8 @@ public static function returnDbTableName() : string return "il_orgu_authority"; } - /** * @var int - * * @con_is_primary true * @con_is_unique true * @con_sequence true @@ -57,7 +52,6 @@ public static function returnDbTableName() : string protected $id = 0; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 1 @@ -65,7 +59,6 @@ public static function returnDbTableName() : string protected $over = self::OVER_EVERYONE; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 1 @@ -73,7 +66,6 @@ public static function returnDbTableName() : string protected $scope = self::SCOPE_SAME_ORGU; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 1 @@ -84,10 +76,8 @@ public static function returnDbTableName() : string */ protected static $name_render; - /** * ilOrgUnitAuthority constructor. - * * @param int $primary_key * @param \arConnector|null $connector */ @@ -95,13 +85,12 @@ public function __construct($primary_key = 0, \arConnector $connector = null) { parent::__construct($primary_key, $connector); if (!self::$name_render) { - self::$name_render = function ($id) { + self::$name_render = function($id) { return $id; }; } } - /** * @param \Closure $closure */ @@ -110,7 +99,6 @@ public static function replaceNameRenderer(Closure $closure) self::$name_render = $closure; } - /** * @return string */ @@ -121,7 +109,6 @@ public function __toString() return $renderer($this->getId()); } - /** * @return array */ @@ -135,7 +122,6 @@ public function __toArray() ); } - /** * @return int */ @@ -144,7 +130,6 @@ public function getId() return $this->id; } - /** * @param int $id */ @@ -153,7 +138,6 @@ public function setId($id) $this->id = $id; } - /** * @return int */ @@ -162,10 +146,8 @@ public function getOver() return $this->over; } - /** * This is either an ID of a position or ilOrgUnitAuthority::OVER_EVERYONE - * * @param int $over */ public function setOver($over) @@ -173,7 +155,6 @@ public function setOver($over) $this->over = $over; } - /** * @return int */ @@ -182,13 +163,10 @@ public function getScope() return $this->scope; } - /** * This is either ilOrgUnitAuthority::SCOPE_SAME_ORGU, ilOrgUnitAuthority::SCOPE_ALL_ORGUS or * ilOrgUnitAuthority::SCOPE_SUBSEQUENT_ORGUS - * * @param int $scope - * * @throws \ilException */ public function setScope($scope) @@ -199,7 +177,6 @@ public function setScope($scope) $this->scope = $scope; } - /** * @return int */ @@ -208,7 +185,6 @@ public function getPositionId() return $this->position_id; } - /** * @param int $position_id */ diff --git a/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthorityFormGUI.php b/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthorityFormGUI.php index 944736ed0494..4db8f2958a53 100644 --- a/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthorityFormGUI.php +++ b/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthorityFormGUI.php @@ -4,7 +4,6 @@ /** * Class ilOrgUnitAuthorityFormGUI - * * @author Fabian Schmid */ class ilOrgUnitAuthorityFormGUI extends BaseForm @@ -17,7 +16,6 @@ class ilOrgUnitAuthorityFormGUI extends BaseForm const F_TITLE = 'title'; const F_DESCRIPTION = 'description'; - protected function initFormElements() { $te = new ilTextInputGUI($this->txt(self::F_TITLE), self::F_TITLE); @@ -32,14 +30,13 @@ protected function initFormElements() $r = $this->parent_gui->dic()->ui()->renderer(); $modal = $f->modal()->roundtrip("Modal", $f->legacy(''))->withCloseWithKeyboard(false); $button = $f->button() - ->shy($this->txt("open_authorities_modal"), '#') - ->withOnClick($modal->getShowSignal()); + ->shy($this->txt("open_authorities_modal"), '#') + ->withOnClick($modal->getShowSignal()); $c->setHtml($r->render([$button, $modal])); $this->addItem($c); } - public function fillForm() { $array = array( @@ -50,10 +47,8 @@ public function fillForm() $this->setValuesByArray($array); } - /** * returns whether checkinput was successful or not. - * * @return bool */ public function fillObject() diff --git a/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthorityInputGUI.php b/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthorityInputGUI.php index 144e417006c0..a74af8c0ea33 100644 --- a/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthorityInputGUI.php +++ b/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitAuthorityInputGUI.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitAuthorityInputGUI - * * @author Fabian Schmid */ class ilOrgUnitAuthorityInputGUI extends ilFormPropertyGUI implements ilMultiValuesItem @@ -13,17 +12,15 @@ class ilOrgUnitAuthorityInputGUI extends ilFormPropertyGUI implements ilMultiVal */ protected $value; - /** * ilOrgUnitAuthorityInputGUI constructor. - * * @param string $a_title * @param string $a_postvar */ public function __construct($a_title, $a_postvar) { parent::__construct($a_title, $a_postvar); - ilOrgUnitAuthority::replaceNameRenderer(function ($id) { + ilOrgUnitAuthority::replaceNameRenderer(function($id) { /** * @var $a ilOrgUnitAuthority */ @@ -34,7 +31,6 @@ public function __construct($a_title, $a_postvar) }); } - /** * @param \ilTemplate $a_tpl */ @@ -47,7 +43,6 @@ public function insert(ilTemplate $a_tpl) $a_tpl->parseCurrentBlock(); } - /** * @param array $values */ @@ -63,7 +58,6 @@ public function setValueByArray(array $values) $this->setValue($authorities); } - /** * @param $a_value \ilOrgUnitAuthority[] */ @@ -72,7 +66,6 @@ public function setValue($a_value) $this->value = $a_value; } - /** * @return \ilOrgUnitAuthority[] */ @@ -81,7 +74,6 @@ public function getValue() return $this->value; } - protected function render() { $tpl = new ilTemplate("tpl.authority_input.html", true, true, "Modules/OrgUnit"); @@ -136,7 +128,6 @@ protected function render() return $tpl->get(); } - /** * @return \ILIAS\DI\Container */ @@ -145,7 +136,6 @@ protected function dic() return $GLOBALS["DIC"]; } - /** * @return \ilLanguage */ @@ -161,7 +151,6 @@ protected function lang() return $lang; } - /** * @return bool */ @@ -170,7 +159,6 @@ public function getMulti() : bool return false; } - protected function initJS() { // Global JS diff --git a/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitGenericMultiInputGUI.php b/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitGenericMultiInputGUI.php index dcf97b0edfe1..6f872109c23c 100644 --- a/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitGenericMultiInputGUI.php +++ b/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitGenericMultiInputGUI.php @@ -3,7 +3,6 @@ /** * Class ilDclGenericMultiInputGUI - * * @author Michael Herren * @author Theodor Truffer */ @@ -73,10 +72,8 @@ class ilOrgUnitGenericMultiInputGUI extends ilFormPropertyGUI */ protected $render_one_for_empty_value = true; - /** * Constructor - * * @param string $a_title Title * @param string $a_postvar Post Variable */ @@ -88,7 +85,6 @@ public function __construct($a_title = "", $a_postvar = "") $this->initCSSandJS(); } - /** * @return string */ @@ -101,7 +97,6 @@ public function getHook($key) return false; } - /** * @param array $options */ @@ -110,10 +105,8 @@ public function addHook($key, $options) $this->hooks[$key] = $options; } - /** * @param $key - * * @return bool */ public function removeHook($key) @@ -127,7 +120,6 @@ public function removeHook($key) return false; } - /** * @param $input * @param array $options @@ -139,7 +131,6 @@ public function addInput(\ilFormPropertyGUI $input, $options = array()) $this->counter++; } - /** * @return mixed */ @@ -148,7 +139,6 @@ public function getTemplateDir() return $this->template_dir; } - /** * @param mixed $template_dir */ @@ -157,7 +147,6 @@ public function setTemplateDir($template_dir) $this->template_dir = $template_dir; } - /** * @return boolean */ @@ -166,7 +155,6 @@ public function isShowLabel() return $this->show_label; } - /** * @param boolean $show_label */ @@ -175,10 +163,8 @@ public function setShowLabel($show_label) $this->show_label = $show_label; } - /** * Get Options. - * * @return array Options. Array ("value" => "option_text") */ public function getInputs() @@ -186,7 +172,6 @@ public function getInputs() return $this->inputs; } - /** * @param bool $a_multi */ @@ -195,10 +180,8 @@ public function setMulti(bool $a_multi, bool $a_sortable = false, bool $a_addrem $this->multi = $a_multi; } - /** * Set Value. - * * @param string $a_value Value */ public function setValue($a_value) @@ -213,10 +196,8 @@ public function setValue($a_value) $this->value = $a_value; } - /** * Get Value. - * * @return string Value */ public function getValue() @@ -229,10 +210,8 @@ public function getValue() return $out; } - /** * Set value by array - * * @param array $a_values value array */ public function setValueByArray($a_values) @@ -245,7 +224,6 @@ public function setValueByArray($a_values) } } - /** * Check input, strip slashes etc. set alert, if input is not ok. * @return boolean Input ok, true/false @@ -288,7 +266,6 @@ public function checkInput() : bool return $valid; } - /** * @param $key * @param $value @@ -303,7 +280,6 @@ public function addCustomAttribute($key, $value, $override = false) } } - /** * @return array */ @@ -312,11 +288,9 @@ public function getCustomAttributes() return (array) $this->cust_attr; } - /** * @param $iterator_id * @param \ilFormPropertyGUI $input - * * @return string */ protected function createInputPostVar($iterator_id, \ilFormPropertyGUI $input) @@ -328,12 +302,9 @@ protected function createInputPostVar($iterator_id, \ilFormPropertyGUI $input) } } - /** * Render item - * * @param int $iterator_id - * * @return string * @throws \ilException */ @@ -456,17 +427,14 @@ public function render($iterator_id = 0, $clean_render = false) return $tpl->get(); } - public function initCSSandJS() { global $tpl; $tpl->addJavascript('Modules/OrgUnit/js/generic_multi_line_input.js'); } - /** * Insert property html - * * @return int Size */ public function insert(&$a_tpl) @@ -509,7 +477,6 @@ public function insert(&$a_tpl) $a_tpl->parseCurrentBlock(); } - /** * Get HTML for table filter */ @@ -520,7 +487,6 @@ public function getTableFilterHTML() return $html; } - /** * Get HTML for toolbar */ @@ -531,7 +497,6 @@ public function getToolbarHTML() return $html; } - /** * @return boolean */ @@ -540,7 +505,6 @@ public function isPositionMovable() return $this->position_movable; } - /** * @param boolean $position_movable */ @@ -549,7 +513,6 @@ public function setPositionMovable($position_movable) $this->position_movable = $position_movable; } - /** * @return boolean */ @@ -558,7 +521,6 @@ public function isShowLabelOnce() return $this->show_label_once; } - /** * @param boolean $show_label_once */ @@ -568,7 +530,6 @@ public function setShowLabelOnce($show_label_once) $this->show_label_once = $show_label_once; } - /** * @return boolean */ @@ -577,7 +538,6 @@ public function isShowInfo() return $this->show_info; } - /** * @param boolean $show_info */ @@ -586,7 +546,6 @@ public function setShowInfo($show_info) $this->show_info = $show_info; } - /** * @return bool */ @@ -595,7 +554,6 @@ public function isRenderOneForEmptyValue() return $this->render_one_for_empty_value; } - /** * @param bool $render_one_for_empty_value */ diff --git a/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitMultiLineInputGUI.php b/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitMultiLineInputGUI.php index b0087942b1ed..a338783609f1 100644 --- a/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitMultiLineInputGUI.php +++ b/Modules/OrgUnit/classes/Positions/Authorities/class.ilOrgUnitMultiLineInputGUI.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitMultiLineInputGUI - * * @author Michael Herren * @author Fabian Schmid */ @@ -68,10 +67,8 @@ class ilOrgUnitMultiLineInputGUI extends \ilFormPropertyGUI */ protected $show_info = false; - /** * Constructor - * * @param string $a_title Title * @param string $a_postvar Post Variable */ @@ -83,7 +80,6 @@ public function __construct($a_title = "", $a_postvar = "") $this->initCSSandJS(); } - /** * @return string */ @@ -96,7 +92,6 @@ public function getHook($key) return false; } - /** * @param array $options */ @@ -105,10 +100,8 @@ public function addHook($key, $options) $this->hooks[$key] = $options; } - /** * @param $key - * * @return bool */ public function removeHook($key) @@ -122,7 +115,6 @@ public function removeHook($key) return false; } - /** * @param $input * @param array $options @@ -134,7 +126,6 @@ public function addInput(\ilFormPropertyGUI $input, $options = array()) $this->counter++; } - /** * @return mixed */ @@ -143,7 +134,6 @@ public function getTemplateDir() return $this->template_dir; } - /** * @param mixed $template_dir */ @@ -152,7 +142,6 @@ public function setTemplateDir($template_dir) $this->template_dir = $template_dir; } - /** * @return boolean */ @@ -161,7 +150,6 @@ public function isShowLabel() return $this->show_label; } - /** * @param boolean $show_label */ @@ -170,10 +158,8 @@ public function setShowLabel($show_label) $this->show_label = $show_label; } - /** * Get Options. - * * @return array Options. Array ("value" => "option_text") */ public function getInputs() @@ -181,7 +167,6 @@ public function getInputs() return $this->inputs; } - /** * @param bool $a_multi */ @@ -190,10 +175,8 @@ public function setMulti(bool $a_multi, bool $a_sortable = false, bool $a_addrem $this->multi = $a_multi; } - /** * Set Value. - * * @param string $a_value Value */ public function setValue($a_value) @@ -208,10 +191,8 @@ public function setValue($a_value) $this->value = $a_value; } - /** * Get Value. - * * @return string Value */ public function getValue() @@ -224,10 +205,8 @@ public function getValue() return $out; } - /** * Set value by array - * * @param array $a_values value array */ public function setValueByArray($a_values) @@ -240,7 +219,6 @@ public function setValueByArray($a_values) } } - /** * Check input, strip slashes etc. set alert, if input is not ok. * @return boolean Input ok, true/false @@ -277,7 +255,6 @@ public function checkInput() : bool return $valid; } - /** * @param $key * @param $value @@ -292,7 +269,6 @@ public function addCustomAttribute($key, $value, $override = false) } } - /** * @return array */ @@ -301,11 +277,9 @@ public function getCustomAttributes() return (array) $this->cust_attr; } - /** * @param $iterator_id * @param \ilFormPropertyGUI $input - * * @return string */ protected function createInputPostVar($iterator_id, \ilFormPropertyGUI $input) @@ -317,19 +291,17 @@ protected function createInputPostVar($iterator_id, \ilFormPropertyGUI $input) } } - /** * Render item - * * @param int $iterator_id - * * @return string * @throws \ilException */ public function render($iterator_id = 0, $clean_render = false) { $first_label = true; - $tpl = new \ilTemplate("tpl.multi_line_input.html", true, true, 'Customizing/global/plugins/Services/Repository/RepositoryObject/LiveVoting'); + $tpl = new \ilTemplate("tpl.multi_line_input.html", true, true, + 'Customizing/global/plugins/Services/Repository/RepositoryObject/LiveVoting'); $class = 'multi_input_line'; $this->addCustomAttribute('class', $class, true); foreach ($this->getCustomAttributes() as $key => $value) { @@ -443,17 +415,14 @@ public function render($iterator_id = 0, $clean_render = false) return $tpl->get(); } - public function initCSSandJS() { global $tpl; $tpl->addJavascript('./Modules/OrgUnit/templates/default/multi_line_input.js'); } - /** * Insert property html - * * @return int Size */ public function insert(&$a_tpl) @@ -481,7 +450,6 @@ public function insert(&$a_tpl) $a_tpl->parseCurrentBlock(); } - /** * Get HTML for table filter */ @@ -492,7 +460,6 @@ public function getTableFilterHTML() return $html; } - /** * Get HTML for toolbar */ @@ -503,7 +470,6 @@ public function getToolbarHTML() return $html; } - /** * @return boolean */ @@ -512,7 +478,6 @@ public function isPositionMovable() return $this->position_movable; } - /** * @param boolean $position_movable */ @@ -521,7 +486,6 @@ public function setPositionMovable($position_movable) $this->position_movable = $position_movable; } - /** * @return boolean */ @@ -530,7 +494,6 @@ public function isShowLabelOnce() return $this->show_label_once; } - /** * @param boolean $show_label_once */ @@ -540,7 +503,6 @@ public function setShowLabelOnce($show_label_once) $this->show_label_once = $show_label_once; } - /** * @return boolean */ @@ -549,7 +511,6 @@ public function isShowInfo() return $this->show_info; } - /** * @param boolean $show_info */ diff --git a/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperation.php b/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperation.php index 433fea978a1b..c762f91b5748 100644 --- a/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperation.php +++ b/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperation.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitOperation - * * @author Fabian Schmid */ class ilOrgUnitOperation extends ActiveRecord @@ -24,7 +23,6 @@ class ilOrgUnitOperation extends ActiveRecord /** * @var int - * * @con_is_primary true * @con_is_unique true * @con_sequence true @@ -35,7 +33,6 @@ class ilOrgUnitOperation extends ActiveRecord protected $operation_id = 0; /** * @var string - * * @con_has_field true * @con_fieldtype text * @con_length 127 @@ -44,7 +41,6 @@ class ilOrgUnitOperation extends ActiveRecord protected $operation_string = ''; /** * @var string - * * @con_has_field true * @con_fieldtype text * @con_length 512 @@ -52,7 +48,6 @@ class ilOrgUnitOperation extends ActiveRecord protected $description = ''; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 8 @@ -61,7 +56,6 @@ class ilOrgUnitOperation extends ActiveRecord protected $list_order = 0; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 8 @@ -69,7 +63,6 @@ class ilOrgUnitOperation extends ActiveRecord */ protected $context_id = 0; - public function create() : void { if (self::where(array( @@ -82,7 +75,6 @@ public function create() : void parent::create(); } - /** * @return int */ @@ -91,7 +83,6 @@ public function getOperationId() return $this->operation_id; } - /** * @param int $operation_id */ @@ -100,7 +91,6 @@ public function setOperationId($operation_id) $this->operation_id = $operation_id; } - /** * @return string */ @@ -109,7 +99,6 @@ public function getOperationString() return $this->operation_string; } - /** * @param string $operation_string */ @@ -118,7 +107,6 @@ public function setOperationString($operation_string) $this->operation_string = $operation_string; } - /** * @return string */ @@ -127,7 +115,6 @@ public function getDescription() return $this->description; } - /** * @param string $description */ @@ -136,7 +123,6 @@ public function setDescription($description) $this->description = $description; } - /** * @return int */ @@ -145,7 +131,6 @@ public function getListOrder() return $this->list_order; } - /** * @param int $list_order */ @@ -154,7 +139,6 @@ public function setListOrder($list_order) $this->list_order = $list_order; } - /** * @return int */ @@ -163,7 +147,6 @@ public function getContextId() return $this->context_id; } - /** * @param int $context_id */ @@ -172,7 +155,6 @@ public function setContextId($context_id) $this->context_id = $context_id; } - /** * @return string */ diff --git a/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperationContext.php b/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperationContext.php index e8681e824cd6..1ef6832fa86d 100644 --- a/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperationContext.php +++ b/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperationContext.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitOperationContext - * * @author Fabian Schmid */ class ilOrgUnitOperationContext extends ActiveRecord @@ -32,10 +31,6 @@ class ilOrgUnitOperationContext extends ActiveRecord self::CONTEXT_PRG, ]; - - - - /** * @return array if own and */ @@ -47,7 +42,6 @@ public function getPopulatedContextNames() return $contexts; } - /** * @return array if own and */ @@ -59,10 +53,8 @@ public function getPopulatedContextIds() return $contexts; } - /** * @var int - * * @con_is_primary true * @con_is_unique true * @con_has_field true @@ -73,7 +65,6 @@ public function getPopulatedContextIds() protected $id = 0; /** * @var string - * * @con_has_field true * @con_is_unique true * @con_fieldtype text @@ -83,14 +74,12 @@ public function getPopulatedContextIds() protected $context = self::CONTEXT_OBJECT; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 8 */ protected $parent_context_id = 0; - /** * @return int */ @@ -99,7 +88,6 @@ public function getId() return $this->id; } - /** * @param int $id */ @@ -108,7 +96,6 @@ public function setId($id) $this->id = $id; } - /** * @return string */ @@ -117,7 +104,6 @@ public function getContext() return $this->context; } - /** * @param string $context */ @@ -126,7 +112,6 @@ public function setContext($context) $this->context = $context; } - /** * @return int */ @@ -135,7 +120,6 @@ public function getParentContextId() return $this->parent_context_id; } - /** * @param int $parent_context_id */ @@ -144,7 +128,6 @@ public function setParentContextId($parent_context_id) $this->parent_context_id = $parent_context_id; } - /** * @return string */ @@ -153,7 +136,6 @@ public static function returnDbTableName() : string return 'il_orgu_op_contexts'; } - public function create() : void { if (self::where(array('context' => $this->getContext()))->hasSets()) { @@ -162,7 +144,6 @@ public function create() : void parent::create(); } - /** * @param $contexts */ @@ -180,7 +161,6 @@ protected function appendParentContextName(&$contexts) } } - /** * @param $contexts */ diff --git a/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperationContextQueries.php b/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperationContextQueries.php index 5d8d5dae31cb..de05a01a3e9b 100644 --- a/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperationContextQueries.php +++ b/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperationContextQueries.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitOperationContextQueries - * * @author Fabian Schmid */ class ilOrgUnitOperationContextQueries @@ -10,9 +9,7 @@ class ilOrgUnitOperationContextQueries /** * @param $context_name - * * @param null $parent_context - * * @throws \ilException */ public static function registerNewContext($context_name, $parent_context = null) @@ -37,32 +34,27 @@ public static function registerNewContext($context_name, $parent_context = null) $context->create(); } - /** * @var array */ protected static $instance_by_name = array(); - /** * @param $context_name - * * @return \ilOrgUnitOperationContext */ public static function findByName($context_name) { if (!isset(self::$instance_by_name[$context_name])) { self::$instance_by_name[$context_name] = ilOrgUnitOperationContext::where(array('context' => $context_name)) - ->first(); + ->first(); } return self::$instance_by_name[$context_name]; } - /** * @param int $id - * * @return \ilOrgUnitOperationContext */ public static function findById($id) @@ -70,10 +62,8 @@ public static function findById($id) return ilOrgUnitOperationContext::find($id); } - /** * @param int $ref_id - * * @return \ilOrgUnitOperationContext */ public static function findByRefId($ref_id) @@ -83,10 +73,8 @@ public static function findByRefId($ref_id) return self::findByName($type_context); } - /** * @param int $obj_id - * * @return \ilOrgUnitOperationContext */ public static function findByObjId($obj_id) diff --git a/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperationQueries.php b/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperationQueries.php index aa65efca20e6..9aec456c8ccb 100644 --- a/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperationQueries.php +++ b/Modules/OrgUnit/classes/Positions/Operation/class.ilOrgUnitOperationQueries.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitOperationQueries - * * @author Fabian Schmid */ class ilOrgUnitOperationQueries @@ -18,11 +17,13 @@ class ilOrgUnitOperationQueries * use a more specific for your object type but the related context must * exist. Register a new context using * ilOrgUnitOperationContext::registerNewContext() for plugins - * * @throws \ilException */ - public static function registerNewOperation($operation_name, $description, $context = ilOrgUnitOperationContext::CONTEXT_OBJECT) - { + public static function registerNewOperation( + $operation_name, + $description, + $context = ilOrgUnitOperationContext::CONTEXT_OBJECT + ) { $contextList = ilOrgUnitOperationContext::where(array('context' => $context)); if (!$contextList->hasSets()) { throw new ilException('Context does not exist! register context first using ilOrgUnitOperationContext::registerNewContext()'); @@ -46,12 +47,10 @@ public static function registerNewOperation($operation_name, $description, $cont $operation->create(); } - /** * @param $operation_name * @param $description * @param array $contexts - * * @see registerNewOperation */ public static function registerNewOperationForMultipleContexts($operation_name, $description, array $contexts) @@ -61,10 +60,8 @@ public static function registerNewOperationForMultipleContexts($operation_name, } } - /** * @param $context_name - * * @return ilOrgUnitOperation[] */ public static function getOperationsForContextName($context_name) @@ -75,13 +72,11 @@ public static function getOperationsForContextName($context_name) $context = ilOrgUnitOperationContextQueries::findByName($context_name); return ilOrgUnitOperation::where(array('context_id' => $context->getPopulatedContextIds())) - ->get(); + ->get(); } - /** * @param $context_id - * * @return \ilOrgUnitOperation[] */ public static function getOperationsForContextId($context_id) @@ -92,13 +87,11 @@ public static function getOperationsForContextId($context_id) $context = ilOrgUnitOperationContextQueries::findById($context_id); return ilOrgUnitOperation::where(array('context_id' => $context->getPopulatedContextIds())) - ->get(); + ->get(); } - /** * @param int $operation_id - * * @return \ilOrgUnitOperation */ public static function findById($operation_id) @@ -106,16 +99,16 @@ public static function findById($operation_id) return ilOrgUnitOperation::findOrFail($operation_id); } - /** * @param string $operation_string - * * @return \ilOrgUnitOperation */ public static function findByOperationString($operation_string, $context_name) { $context = ilOrgUnitOperationContextQueries::findByName($context_name); - return ilOrgUnitOperation::where(['operation_string' => $operation_string, 'context_id' => $context->getId()])->first(); + return ilOrgUnitOperation::where(['operation_string' => $operation_string, + 'context_id' => $context->getId() + ])->first(); } } diff --git a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitDefaultPermissionFormGUI.php b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitDefaultPermissionFormGUI.php index e6d4074e6896..a6de54a2401d 100644 --- a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitDefaultPermissionFormGUI.php +++ b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitDefaultPermissionFormGUI.php @@ -4,7 +4,6 @@ /** * Class ilOrgUnitDefaultPermissionFormGUI - * * @author Fabian Schmid */ class ilOrgUnitDefaultPermissionFormGUI extends ilPropertyFormGUI @@ -19,10 +18,8 @@ class ilOrgUnitDefaultPermissionFormGUI extends ilPropertyFormGUI */ protected $ilOrgUnitPermissions = []; - /** * ilOrgUnitDefaultPermissionFormGUI constructor. - * * @param \ILIAS\Modules\OrgUnit\ARHelper\BaseCommands $parent_gui * @param ilOrgUnitPermission[] $ilOrgUnitPermissionsFilter */ @@ -38,7 +35,6 @@ public function __construct(BaseCommands $parent_gui, array $ilOrgUnitPermission parent::__construct(); } - /** * @return int ID of the object */ @@ -54,7 +50,6 @@ public function saveObject() return true; } - protected function initButtons() { $this->setTitle($this->txt("form_title_org_default_permissions_" @@ -63,7 +58,6 @@ protected function initButtons() $this->addCommandButton(BaseCommands::CMD_CANCEL, $this->txt(BaseCommands::CMD_CANCEL)); } - protected function initFormElements() { foreach ($this->ilOrgUnitPermissions as $ilOrgUnitPermission) { @@ -82,7 +76,6 @@ protected function initFormElements() } } - public function fillForm() { $operations = array(); @@ -96,7 +89,6 @@ public function fillForm() $this->setValuesByArray($operations); } - protected function fillObject() { if (!$this->checkInput()) { @@ -118,7 +110,6 @@ protected function fillObject() return true; } - /** * @return \ilOrgUnitPermission[] */ @@ -127,7 +118,6 @@ public function getIlOrgUnitPermissions() return $this->ilOrgUnitPermissions; } - /** * @param \ilOrgUnitPermission[] $ilOrgUnitPermissions */ @@ -136,7 +126,6 @@ public function setIlOrgUnitPermissions($ilOrgUnitPermissions) $this->ilOrgUnitPermissions = $ilOrgUnitPermissions; } - /** * @return \ILIAS\DI\Container */ @@ -145,10 +134,8 @@ protected function dic() return $GLOBALS["DIC"]; } - /** * @param $key - * * @return mixed */ protected function txt($key) diff --git a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitDefaultPermissionGUI.php b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitDefaultPermissionGUI.php index 7e017751eea2..d0e6effc3fe4 100644 --- a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitDefaultPermissionGUI.php +++ b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitDefaultPermissionGUI.php @@ -4,19 +4,19 @@ /** * Class ilOrgUnitDefaultPermissionGUI - * * @author Fabian Schmid - * * @ilCtrl_IsCalledBy ilOrgUnitDefaultPermissionGUI: ilOrgUnitPositionGUI */ class ilOrgUnitDefaultPermissionGUI extends BaseCommands { private \ilGlobalTemplateInterface $main_tpl; + public function __construct() { global $DIC; $this->main_tpl = $DIC->ui()->mainTemplate(); } + protected function index() { $this->getParentGui()->addSubTabs(); @@ -28,11 +28,11 @@ protected function index() $this->setContent($ilOrgUnitDefaultPermissionFormGUI->getHTML()); } - protected function update() { $this->getParentGui()->addSubTabs(); - $ilOrgUnitPermissions = ilOrgUnitPermissionQueries::getAllTemplateSetsForAllActivedContexts($this->getCurrentPositionId(), true); + $ilOrgUnitPermissions = ilOrgUnitPermissionQueries::getAllTemplateSetsForAllActivedContexts($this->getCurrentPositionId(), + true); $ilOrgUnitDefaultPermissionFormGUI = new ilOrgUnitDefaultPermissionFormGUI($this, $ilOrgUnitPermissions); if ($ilOrgUnitDefaultPermissionFormGUI->saveObject()) { $this->main_tpl->setOnScreenMessage('success', $this->txt('msg_success_permission_saved'), true); @@ -42,7 +42,6 @@ protected function update() $this->setContent($ilOrgUnitDefaultPermissionFormGUI->getHTML()); } - /** * @return int */ @@ -56,7 +55,6 @@ protected function getCurrentPositionId() return (int) $id; } - protected function cancel() { $this->ctrl()->redirectByClass(ilOrgUnitPositionGUI::class); diff --git a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitDefaultPermissionTableGUI.php b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitDefaultPermissionTableGUI.php index d733f4ac317a..f612c7833b23 100644 --- a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitDefaultPermissionTableGUI.php +++ b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitDefaultPermissionTableGUI.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitPermissionTableGUI - * * @author Fabian Schmid */ class ilOrgUnitDefaultPermissionTableGUI extends ilTable2GUI @@ -17,10 +16,8 @@ class ilOrgUnitDefaultPermissionTableGUI extends ilTable2GUI */ private $ilOrgUnitPermission = null; - /** * ilOrgUnitDefaultPermissionTableGUI constructor. - * * @param object $a_parent_obj * @param string $a_parent_cmd * @param \ilOrgUnitPermission $ilOrgUnitPermission @@ -37,9 +34,9 @@ public function __construct($a_parent_obj, $a_parent_cmd, ilOrgUnitPermission $i $this->setId('objpositionperm_' . $this->type); $this->dic() - ->ui() - ->mainTemplate() - ->addJavaScript('./Services/AccessControl/js/ilPermSelect.js'); + ->ui() + ->mainTemplate() + ->addJavaScript('./Services/AccessControl/js/ilPermSelect.js'); $this->setTitle( $this->dic()->language()->txt('orgu_permission_settings_' @@ -57,7 +54,6 @@ public function __construct($a_parent_obj, $a_parent_cmd, ilOrgUnitPermission $i $this->setCloseFormTag(false); } - public function start() { $this->setEnableHeader(false); @@ -67,14 +63,12 @@ public function start() $this->addMultiCommand(ilOrgUnitDefaultPermissionGUI::CMD_UPDATE, $this->lng->txt('save')); } - public function end() { $this->setCloseFormTag(true); $this->addCommandButton(ilOrgUnitDefaultPermissionGUI::CMD_UPDATE, $this->lng->txt('save')); } - /** * @param array $a_set * @return void @@ -93,12 +87,10 @@ public function fillRow(array $a_set) : void . $a_set->getOperationString())); } - public function collectData() { } - /** * @return \ILIAS\DI\Container */ diff --git a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermission.php b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermission.php index 644c459df637..3c9e4b46d974 100644 --- a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermission.php +++ b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermission.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitPermissionGUI - * * @author Fabian Schmid */ class ilOrgUnitPermission extends ActiveRecord @@ -11,7 +10,6 @@ class ilOrgUnitPermission extends ActiveRecord const TABLE_NAME = 'il_orgu_permissions'; /** * @var int - * * @con_is_primary true * @con_is_unique true * @con_has_field true @@ -22,7 +20,6 @@ class ilOrgUnitPermission extends ActiveRecord protected $id = 0; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 8 @@ -30,7 +27,6 @@ class ilOrgUnitPermission extends ActiveRecord protected $context_id = 0; /** * @var \ilOrgUnitOperation[] - * * @con_has_field true * @con_fieldtype text * @con_length 2048 @@ -46,7 +42,6 @@ class ilOrgUnitPermission extends ActiveRecord protected $selected_operation_ids = []; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 8 @@ -54,7 +49,6 @@ class ilOrgUnitPermission extends ActiveRecord protected $parent_id = self::PARENT_TEMPLATE; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 8 @@ -66,7 +60,6 @@ class ilOrgUnitPermission extends ActiveRecord protected $context; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 1 @@ -77,7 +70,6 @@ class ilOrgUnitPermission extends ActiveRecord */ protected $newly_created = false; - public function update() { if ($this->isProtected()) { @@ -86,7 +78,6 @@ public function update() parent::update(); } - public function create() : void { if ($this->isProtected()) { @@ -95,7 +86,6 @@ public function create() : void parent::create(); } - public function delete() { if ($this->isProtected()) { @@ -104,7 +94,6 @@ public function delete() parent::delete(); } - public function afterObjectLoad() : void { $this->possible_operations = ilOrgUnitOperationQueries::getOperationsForContextId($this->getContextId()); @@ -115,7 +104,6 @@ public function afterObjectLoad() : void $this->context = ilOrgUnitOperationContextQueries::findById($this->getContextId()); } - /** * @return int */ @@ -124,7 +112,6 @@ public function getId() return $this->id; } - /** * @param int $id */ @@ -133,7 +120,6 @@ public function setId($id) $this->id = $id; } - /** * @return int */ @@ -142,7 +128,6 @@ public function getContextId() return $this->context_id; } - /** * @param int $context_id */ @@ -151,7 +136,6 @@ public function setContextId($context_id) $this->context_id = $context_id; } - /** * @return \ilOrgUnitOperation[] */ @@ -160,7 +144,6 @@ public function getOperations() return $this->operations; } - /** * @param \ilOrgUnitOperation[] $operations */ @@ -169,7 +152,6 @@ public function setOperations($operations) $this->operations = $operations; } - /** * @return int */ @@ -178,7 +160,6 @@ public function getParentId() return $this->parent_id; } - /** * @param int $parent_id */ @@ -187,7 +168,6 @@ public function setParentId($parent_id) $this->parent_id = $parent_id; } - /** * @return \ilOrgUnitOperation[] */ @@ -196,7 +176,6 @@ public function getPossibleOperations() return $this->possible_operations; } - /** * @return int[] */ @@ -205,10 +184,8 @@ public function getSelectedOperationIds() return $this->selected_operation_ids; } - /** * @param $operation_id - * * @return bool */ public function isOperationIdSelected($operation_id) @@ -216,7 +193,6 @@ public function isOperationIdSelected($operation_id) return in_array($operation_id, $this->selected_operation_ids); } - /** * @return \ilOrgUnitOperationContext */ @@ -225,7 +201,6 @@ public function getContext() return $this->context; } - /** * @param \ilOrgUnitOperationContext $context */ @@ -234,7 +209,6 @@ public function setContext($context) $this->context = $context; } - /** * @return string */ @@ -243,7 +217,6 @@ public static function returnDbTableName() : string return self::TABLE_NAME; } - /** * @return int */ @@ -252,7 +225,6 @@ public function getPositionId() return $this->position_id; } - /** * @param int $position_id */ @@ -261,7 +233,6 @@ public function setPositionId($position_id) $this->position_id = $position_id; } - /** * @return bool */ @@ -270,7 +241,6 @@ public function isTemplate() return ($this->getParentId() == self::PARENT_TEMPLATE); } - /** * @return bool */ @@ -279,7 +249,6 @@ public function isDedicated() return ($this->getParentId() != self::PARENT_TEMPLATE); } - /** * @return bool */ @@ -288,7 +257,6 @@ public function isProtected() return $this->protected; } - /** * @param bool $protected */ @@ -297,7 +265,6 @@ public function setProtected($protected) $this->protected = $protected; } - /** * @return bool */ @@ -306,7 +273,6 @@ public function isNewlyCreated() return $this->newly_created; } - /** * @param bool $newly_created */ @@ -315,10 +281,8 @@ public function setNewlyCreated($newly_created) $this->newly_created = $newly_created; } - /** * @param $field_name - * * @return mixed|string */ public function sleep($field_name) @@ -336,11 +300,9 @@ public function sleep($field_name) return parent::sleep($field_name); } - /** * @param $field_name * @param $field_value - * * @return mixed */ public function wakeUp($field_name, $field_value) diff --git a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermissionGUI.php b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermissionGUI.php index fc26b065fb4a..31c00bd95f34 100644 --- a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermissionGUI.php +++ b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermissionGUI.php @@ -4,9 +4,7 @@ /** * Class ilOrgUnitPermissionGUI - * * @author Fabian Schmid - * * @ilCtrl_IsCalledBy ilOrgUnitPermissionGUI: ilOrgUnitPositionGUI */ class ilOrgUnitPermissionGUI extends BaseCommands diff --git a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermissionQueries.php b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermissionQueries.php index a41478856a6d..32e6b7345b87 100644 --- a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermissionQueries.php +++ b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermissionQueries.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitPermissionQueries - * * @author Fabian Schmid */ class ilOrgUnitPermissionQueries @@ -10,11 +9,8 @@ class ilOrgUnitPermissionQueries /** * @param $context_name - * * @param $position_id - * * @param bool $editable - * * @return \ilOrgUnitPermission * @throws \ilException */ @@ -50,11 +46,9 @@ public static function getTemplateSetForContextName($context_name, $position_id, return $template_set; } - /** * @param $ref_id * @param $position_id - * * @return bool */ public static function hasLocalSet($ref_id, $position_id) @@ -65,14 +59,10 @@ public static function hasLocalSet($ref_id, $position_id) ])->hasSets()); } - /** * @param $ref_id - * * @param $position_id - * * @return \ilOrgUnitPermission - * * @throws \ilException */ public static function getSetForRefId($ref_id, $position_id) @@ -86,7 +76,8 @@ public static function getSetForRefId($ref_id, $position_id) $ilOrgUnitObjectPositionSetting = $ilOrgUnitGlobalSettings->getObjectPositionSettingsByType($context->getContext()); if (!$ilOrgUnitObjectPositionSetting->isActive()) { - throw new ilPositionPermissionsNotActive("Postion-related permissions not active in {$context->getContext()}", $context->getContext()); + throw new ilPositionPermissionsNotActive("Postion-related permissions not active in {$context->getContext()}", + $context->getContext()); } /** @@ -104,11 +95,9 @@ public static function getSetForRefId($ref_id, $position_id) return ilOrgUnitPermissionQueries::getTemplateSetForContextName($context->getContext(), $position_id); } - /** * @param $ref_id * @param $position_id - * * @return \ilOrgUnitPermission * @throws \ilException */ @@ -125,7 +114,8 @@ public static function findOrCreateSetForRefId($ref_id, $position_id) $ilOrgUnitObjectPositionSetting = $ilOrgUnitGlobalSettings->getObjectPositionSettingsByType($context->getContext()); if (!$ilOrgUnitObjectPositionSetting->isActive()) { - throw new ilPositionPermissionsNotActive("Position-related permissions not active in {$context->getContext()}", $context->getContext()); + throw new ilPositionPermissionsNotActive("Position-related permissions not active in {$context->getContext()}", + $context->getContext()); } $dedicated_set = ilOrgUnitPermission::where([ @@ -151,11 +141,9 @@ public static function findOrCreateSetForRefId($ref_id, $position_id) return $set; } - /** * @param $ref_id * @param $position_id - * * @return bool * @throws \ilException */ @@ -172,7 +160,8 @@ public static function removeLocalSetForRefId($ref_id, $position_id) $ilOrgUnitObjectPositionSetting = $ilOrgUnitGlobalSettings->getObjectPositionSettingsByType($context->getContext()); if (!$ilOrgUnitObjectPositionSetting->isActive()) { - throw new ilPositionPermissionsNotActive("Position-related permissions not active in {$context->getContext()}", $context->getContext()); + throw new ilPositionPermissionsNotActive("Position-related permissions not active in {$context->getContext()}", + $context->getContext()); } $dedicated_set = ilOrgUnitPermission::where([ @@ -190,12 +179,9 @@ public static function removeLocalSetForRefId($ref_id, $position_id) return false; } - /** * @param $position_id - * * @param bool $editable - * * @return \ilOrgUnitPermission[] */ public static function getAllTemplateSetsForAllActivedContexts($position_id, $editable = false) @@ -214,7 +200,6 @@ public static function getAllTemplateSetsForAllActivedContexts($position_id, $ed return $sets; } - /** * @param $user_id * @param $ref_id @@ -227,7 +212,6 @@ public static function getRelevantPermissionSetsForUserIdAndRefIdAndOperation($u WHERE il_orgu_op_contexts.context IN(\'crs\', \'object\') AND operation_string = \'viewmembers\';'; } - private static function getAllowedOperationsOnRefIdAndPosition($ref_id, $position_id) { global $DIC; @@ -250,10 +234,8 @@ private static function getAllowedOperationsOnRefIdAndPosition($ref_id, $positio ($r->numRows() > 0); } - /** * @param $ref_id - * * @return \ilOrgUnitOperationContext * @throws \ilException */ @@ -267,11 +249,9 @@ protected static function getContextByRefId($ref_id) return $context; } - /** * @param $ref_id * @param $position_id - * * @throws \ilException */ protected static function checkRefIdAndPositionId($ref_id, $position_id) diff --git a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermissionTableGUI.php b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermissionTableGUI.php index 923106692147..6b736a8bcf58 100644 --- a/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermissionTableGUI.php +++ b/Modules/OrgUnit/classes/Positions/Permissions/class.ilOrgUnitPermissionTableGUI.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitPermissionTableGUI - * * @author Fabian Schmid */ class ilOrgUnitPermissionTableGUI extends ilTable2GUI @@ -13,10 +12,8 @@ class ilOrgUnitPermissionTableGUI extends ilTable2GUI */ private $ref_id = null; - /** * ilOrgUnitPermissionTableGUI constructor. - * * @param \ILIAS\Modules\OrgUnit\ARHelper\BaseCommands $a_parent_obj * @param string $a_parent_cmd * @param string $a_ref_id @@ -49,7 +46,6 @@ public function __construct($a_parent_obj, $a_parent_cmd, $a_ref_id) $this->addCommandButton(ilPermissionGUI::CMD_SAVE_POSITIONS_PERMISSIONS, $this->lng->txt('save')); } - /** * @return int */ @@ -58,7 +54,6 @@ public function getRefId() return (int) $this->ref_id; } - /** * @return int Object-ID of current object */ @@ -67,7 +62,6 @@ public function getObjId() return (int) ilObject::_lookupObjId($this->getRefId()); } - /** * @return string */ @@ -76,7 +70,6 @@ public function getObjType() return (string) ilObject::_lookupType($this->getObjId()); } - /** * @param array $a_set * @return void @@ -130,7 +123,6 @@ public function fillRow(array $a_set) : void } } - public function collectData() { $positions = ilOrgUnitPosition::get(); @@ -147,7 +139,8 @@ public function collectData() $ops = []; foreach ($positions as $position) { - $ilOrgUnitPermission = ilOrgUnitPermissionQueries::getSetForRefId($this->getRefId(), $position->getId()); + $ilOrgUnitPermission = ilOrgUnitPermissionQueries::getSetForRefId($this->getRefId(), + $position->getId()); $is_template = $ilOrgUnitPermission->isTemplate(); $from_templates[$position->getId()] = $is_template; @@ -171,7 +164,7 @@ public function collectData() "template" => $from_templates, ]; if (ilOrgUnitGlobalSettings::getInstance() - ->isPositionAccessActiveForObject($this->getObjId()) + ->isPositionAccessActiveForObject($this->getObjId()) ) { $perms[] = [ "header_command" => true, @@ -185,10 +178,8 @@ public function collectData() return; } - /** * @param array $positions - * * @return bool */ protected function initColumns(array $positions) @@ -200,7 +191,6 @@ protected function initColumns(array $positions) return true; } - /** * @return \ILIAS\DI\Container */ @@ -209,7 +199,6 @@ private function dic() return $GLOBALS['DIC']; } - /** * @param $row */ @@ -233,7 +222,6 @@ protected function fillSelectAll($row) } } - /** * @param $row */ @@ -246,8 +234,8 @@ protected function fillHeaderCommand($row) $this->tpl->setCurrentBlock('header_command'); $this->tpl->setVariable('POSITION_ID', $position->getId()); $this->tpl->setVariable('HEADER_COMMAND_TXT', $this->dic() - ->language() - ->txt('positions_override_operations')); + ->language() + ->txt('positions_override_operations')); if (ilOrgUnitPermissionQueries::hasLocalSet($this->getRefId(), $position->getId())) { $this->tpl->setVariable('HEADER_CHECKED', "checked='checked'"); } diff --git a/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitRecursiveUserAssignmentTableGUI.php b/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitRecursiveUserAssignmentTableGUI.php index 48597f29b4f0..390806e9e351 100644 --- a/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitRecursiveUserAssignmentTableGUI.php +++ b/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitRecursiveUserAssignmentTableGUI.php @@ -5,7 +5,6 @@ /** * Class ilOrgUnitRecursiveUserAssignmentTableGUI - * * @author dkloepfer * @author Martin Studer */ @@ -21,7 +20,6 @@ class ilOrgUnitRecursiveUserAssignmentTableGUI extends ilTable2GUI /** * ilOrgUnitUserAssignmentTableGUI constructor. - * * @param \ILIAS\Modules\OrgUnit\ARHelper\BaseCommands $parent_obj * @param string $parent_cmd * @param \ilOrgUnitPosition $position @@ -52,7 +50,6 @@ public function __construct(BaseCommands $parent_obj, string $parent_cmd, ilOrgU $this->setData($this->loadData()); } - protected function setTableHeaders() { $this->addColumn($this->lng->txt("login"), "login"); @@ -62,10 +59,6 @@ protected function setTableHeaders() $this->addColumn($this->lng->txt("action")); } - - - - /** * @return array */ @@ -123,9 +116,6 @@ public function loadData() return $data; } - - - /** * @return bool */ @@ -157,7 +147,6 @@ private function mayViewLPIn($ref_id, ilAccess $access, ilObjOrgUnitTree $orgu_t return false; } - /** * @param array $a_set */ @@ -174,7 +163,8 @@ public function fillRow(array $a_set) : void sort($orgus); $this->tpl->setVariable("ORG_UNITS", implode(',', $orgus)); $this->ctrl->setParameterByClass(ilOrgUnitUserAssignmentGUI::class, 'usr_id', $a_set["user_id"]); - $this->ctrl->setParameterByClass(ilOrgUnitUserAssignmentGUI::class, 'position_id', $this->ilOrgUnitPosition->getId()); + $this->ctrl->setParameterByClass(ilOrgUnitUserAssignmentGUI::class, 'position_id', + $this->ilOrgUnitPosition->getId()); $selection = new ilAdvancedSelectionListGUI(); $selection->setListTitle($lng->txt("Actions")); $selection->setId("selection_list_user_lp_" . $a_set["user_id"]); @@ -182,11 +172,12 @@ public function fillRow(array $a_set) : void && ilObjUserTracking::_enabledLearningProgress() && ilObjUserTracking::_enabledUserRelatedData() ) { - $selection->addItem($lng->txt("show_learning_progress"), "show_learning_progress", $this->ctrl->getLinkTargetByClass(array( - ilAdministrationGUI::class, - ilObjOrgUnitGUI::class, - ilLearningProgressGUI::class, - ), "")); + $selection->addItem($lng->txt("show_learning_progress"), "show_learning_progress", + $this->ctrl->getLinkTargetByClass(array( + ilAdministrationGUI::class, + ilObjOrgUnitGUI::class, + ilLearningProgressGUI::class, + ), "")); } if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { $this->addActions($selection); @@ -194,12 +185,13 @@ public function fillRow(array $a_set) : void $this->tpl->setVariable("ACTIONS", $selection->getHTML()); } - /** * @param $selection ilAdvancedSelectionListGUI */ protected function addActions(&$selection) { - $selection->addItem($this->lng->txt("remove"), "delete_from_employees", $this->ctrl->getLinkTargetByClass(ilOrgUnitUserAssignmentGUI::class, ilOrgUnitUserAssignmentGUI::CMD_CONFIRM)); + $selection->addItem($this->lng->txt("remove"), "delete_from_employees", + $this->ctrl->getLinkTargetByClass(ilOrgUnitUserAssignmentGUI::class, + ilOrgUnitUserAssignmentGUI::CMD_CONFIRM)); } } diff --git a/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignment.php b/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignment.php index c2b5bdfe9be5..6d554c536aa7 100644 --- a/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignment.php +++ b/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignment.php @@ -4,10 +4,8 @@ /** * Class ilOrgUnitUserAssignment - * * @author Fabian Schmid */ - class ilOrgUnitUserAssignment extends \ActiveRecord { @@ -19,10 +17,8 @@ public static function returnDbTableName() : string return 'il_orgu_ua'; } - /** * @var int - * * @con_is_primary true * @con_is_unique true * @con_sequence true @@ -33,7 +29,6 @@ public static function returnDbTableName() : string protected $id = 0; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 8 @@ -41,7 +36,6 @@ public static function returnDbTableName() : string protected $user_id = 0; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 8 @@ -49,19 +43,16 @@ public static function returnDbTableName() : string protected $position_id = 0; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 8 */ protected $orgu_id = 0; - /** * @param $user_id * @param $position_id * @param $orgu_id - * * @return \ilOrgUnitUserAssignment */ public static function findOrCreateAssignment($user_id, $position_id, $orgu_id) @@ -111,7 +102,6 @@ public function delete() parent::delete(); } - /** * @return int */ @@ -120,7 +110,6 @@ public function getId() return $this->id; } - /** * @param int $id */ @@ -129,7 +118,6 @@ public function setId($id) $this->id = $id; } - /** * @return int */ @@ -138,7 +126,6 @@ public function getUserId() return $this->user_id; } - /** * @param int $user_id */ @@ -147,7 +134,6 @@ public function setUserId($user_id) $this->user_id = $user_id; } - /** * @return int */ @@ -156,7 +142,6 @@ public function getPositionId() return $this->position_id; } - /** * @param int $position_id */ @@ -165,7 +150,6 @@ public function setPositionId($position_id) $this->position_id = $position_id; } - /** * @return int */ @@ -174,7 +158,6 @@ public function getOrguId() return $this->orgu_id; } - /** * @param int $orgu_id */ diff --git a/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentGUI.php b/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentGUI.php index f866fdb8f16d..479ddfe17375 100644 --- a/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentGUI.php +++ b/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentGUI.php @@ -4,10 +4,9 @@ /** * Class ilOrgUnitUserAssignmentGUI - * * @author Fabian Schmid - * @author dkloepfer - * @author Martin Studer + * @author dkloepfer + * @author Martin Studer * @ilCtrl_Calls ilOrgUnitUserAssignmentGUI: ilRepositorySearchGUI */ class ilOrgUnitUserAssignmentGUI extends BaseCommands @@ -17,6 +16,7 @@ class ilOrgUnitUserAssignmentGUI extends BaseCommands const SUBTAB_ASSIGNMENTS = 'user_assignments'; const SUBTAB_ASSIGNMENTS_RECURSIVE = 'user_assignments_recursive'; private \ilGlobalTemplateInterface $main_tpl; + public function __construct() { global $DIC; @@ -25,7 +25,8 @@ public function __construct() public function executeCommand() { - if (!ilObjOrgUnitAccess::_checkAccessPositions((int) filter_input(INPUT_GET, "ref_id", FILTER_SANITIZE_NUMBER_INT))) { + if (!ilObjOrgUnitAccess::_checkAccessPositions((int) filter_input(INPUT_GET, "ref_id", + FILTER_SANITIZE_NUMBER_INT))) { $this->main_tpl->setOnScreenMessage('failure', $this->lng()->txt("permission_denied"), true); $this->ctrl()->redirectByClass(ilObjOrgUnitGUI::class); } @@ -52,7 +53,6 @@ public function executeCommand() } } - protected function index() { $this->addSubTabs(); @@ -71,7 +71,8 @@ protected function index() // Tables $html = ''; foreach (ilOrgUnitPosition::getActiveForPosition($this->getParentRefId()) as $ilOrgUnitPosition) { - $ilOrgUnitUserAssignmentTableGUI = new ilOrgUnitUserAssignmentTableGUI($this, self::CMD_INDEX, $ilOrgUnitPosition); + $ilOrgUnitUserAssignmentTableGUI = new ilOrgUnitUserAssignmentTableGUI($this, self::CMD_INDEX, + $ilOrgUnitPosition); $html .= $ilOrgUnitUserAssignmentTableGUI->getHTML(); } $this->setContent($html); @@ -95,7 +96,6 @@ protected function assignmentsRecursive() $this->setContent($html); } - protected function confirm() { $this->ctrl()->saveParameter($this, 'position_id'); @@ -109,29 +109,28 @@ protected function confirm() $confirmation->setCancel($this->txt(self::CMD_CANCEL), self::CMD_CANCEL); $confirmation->setConfirm($this->txt('remove_user'), self::CMD_DELETE); $confirmation->setHeaderText(sprintf($this->txt('msg_confirm_remove_user'), $ilOrgUnitPosition->getTitle())); - $confirmation->addItem('usr_id', $r->getQueryParams()['usr_id'], ilObjUser::_lookupLogin($r->getQueryParams()['usr_id'])); + $confirmation->addItem('usr_id', $r->getQueryParams()['usr_id'], + ilObjUser::_lookupLogin($r->getQueryParams()['usr_id'])); $this->setContent($confirmation->getHTML()); } - protected function delete() { $r = $this->http()->request(); $ua = ilOrgUnitUserAssignmentQueries::getInstance() - ->getAssignmentOrFail($_POST['usr_id'], $r->getQueryParams()['position_id'], $this->getParentRefId()); + ->getAssignmentOrFail($_POST['usr_id'], $r->getQueryParams()['position_id'], + $this->getParentRefId()); $ua->delete(); $this->main_tpl->setOnScreenMessage('success', $this->txt('remove_successful'), true); $this->cancel(); } - protected function cancel() { $this->ctrl()->redirect($this, self::CMD_INDEX); } - public function addStaff() { if (!$this->dic()->access()->checkAccess("write", "", $this->getParentRefId())) { @@ -170,8 +169,9 @@ public function addStaff() public function addSubTabs() { $this->pushSubTab(self::SUBTAB_ASSIGNMENTS, $this->ctrl() - ->getLinkTarget($this, self::CMD_INDEX)); + ->getLinkTarget($this, self::CMD_INDEX)); $this->pushSubTab(self::SUBTAB_ASSIGNMENTS_RECURSIVE, $this->ctrl() - ->getLinkTarget($this, self::CMD_ASSIGNMENTS_RECURSIVE)); + ->getLinkTarget($this, + self::CMD_ASSIGNMENTS_RECURSIVE)); } } diff --git a/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentQueries.php b/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentQueries.php index 201fe1575246..72c342e1467e 100644 --- a/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentQueries.php +++ b/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentQueries.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitUserAssignmentQueries - * * @author Fabian Schmid */ class ilOrgUnitUserAssignmentQueries @@ -13,7 +12,6 @@ class ilOrgUnitUserAssignmentQueries */ protected static $instance; - /** * @return \ilOrgUnitUserAssignmentQueries */ @@ -26,10 +24,8 @@ public static function getInstance() return self::$instance; } - /** * @param $user_id - * * @return ilOrgUnitPosition[] */ public function getPositionsOfUserId($user_id) @@ -45,12 +41,10 @@ public function getPositionsOfUserId($user_id) return $positions; } - /** * @param int $user_id * @param int $position_id * @param int $orgu_id Org-Units Ref-ID - * * @return \ActiveRecord * @throws \ilException */ @@ -68,15 +62,12 @@ public function getAssignmentOrFail($user_id, $position_id, $orgu_id) return $ua; } - public function filterUserIdsDueToAuthorities($user_id, array $user_ids) { } - /** * @param $user_id - * * @return ilOrgUnitUserAssignment[] */ public function getAssignmentsOfUserId($user_id) @@ -84,51 +75,44 @@ public function getAssignmentsOfUserId($user_id) return ilOrgUnitUserAssignment::where(['user_id' => $user_id])->get(); } - /** * @param $orgunit_ref_id - * * @return ilOrgUnitUserAssignment[] */ public function getUserIdsOfOrgUnit($orgunit_ref_id) { return ilOrgUnitUserAssignment::where(['orgu_id' => $orgunit_ref_id]) - ->getArray(null, 'user_id'); + ->getArray(null, 'user_id'); } - /** * @param $orgunit_ref_id - * * @return ilOrgUnitUserAssignment[] */ public function getUserIdsOfOrgUnits(array $orgunit_ref_id) { return ilOrgUnitUserAssignment::where(['orgu_id' => $orgunit_ref_id]) - ->getArray(null, 'user_id'); + ->getArray(null, 'user_id'); } - /** * @param $position_id * @param $user_id - * * @param bool $recursive - * * @return \ilOrgUnitUserAssignment[] * @internal param $orgunit_ref_id */ public function getUserIdsOfOrgUnitsOfUsersPosition($position_id, $user_id, $recursive = false) { - return ilOrgUnitUserAssignment::where(['orgu_id' => $this->getOrgUnitIdsOfUsersPosition($position_id, $user_id, $recursive)]) - ->getArray(null, 'user_id'); + return ilOrgUnitUserAssignment::where(['orgu_id' => $this->getOrgUnitIdsOfUsersPosition($position_id, $user_id, + $recursive) + ]) + ->getArray(null, 'user_id'); } - /** * @param array $orgu_ids * @param $position_id - * * @return int[] */ public function getUserIdsOfOrgUnitsInPosition(array $orgu_ids, $position_id) @@ -139,14 +123,11 @@ public function getUserIdsOfOrgUnitsInPosition(array $orgu_ids, $position_id) ])->getArray(null, 'user_id'); } - /** * @param $user_id * @param $users_position_id * @param $position_id - * * @param bool $recursive - * * @return int[] */ public function getUserIdsOfUsersOrgUnitsInPosition($user_id, $users_position_id, $position_id, $recursive = false) @@ -157,13 +138,10 @@ public function getUserIdsOfUsersOrgUnitsInPosition($user_id, $users_position_id ])->getArray(null, 'user_id'); } - /** * @param $position_id * @param $user_id - * * @param bool $recursive - * * @return int[] */ public function getOrgUnitIdsOfUsersPosition($position_id, $user_id, $recursive = false) @@ -186,10 +164,8 @@ public function getOrgUnitIdsOfUsersPosition($position_id, $user_id, $recursive return $recursive_orgu_ids; } - /** * @param $position_id - * * @return int[] */ public function getUserIdsOfPosition($position_id) @@ -199,10 +175,8 @@ public function getUserIdsOfPosition($position_id) ])->getArray(null, 'user_id'); } - /** * @param $position_id - * * @return ilOrgUnitUserAssignment[] */ public function getUserAssignmentsOfPosition($position_id) @@ -212,10 +186,8 @@ public function getUserAssignmentsOfPosition($position_id) ])->get(); } - /** * @param int $user_id - * * @return void */ public function deleteAllAssignmentsOfUser($user_id) diff --git a/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentRepository.php b/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentRepository.php index eafb4b9b52d7..3d406888bbe4 100644 --- a/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentRepository.php +++ b/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentRepository.php @@ -15,7 +15,6 @@ class ilOrgUnitUserAssignmentRepository */ protected static $instance; - /** * @return ilOrgUnitUserAssignmentRepository */ @@ -28,12 +27,10 @@ public static function getInstance() return self::$instance; } - /** * @param $user_id * @param $position_id * @param $orgu_id - * * @return \ilOrgUnitUserAssignment */ public function findOrCreateAssignment($user_id, $position_id, $orgu_id) @@ -60,13 +57,10 @@ public function findOrCreateAssignment($user_id, $position_id, $orgu_id) return $user_assignment; } - /** * @param $arr_user_ids [] - * * @return \ilOrgUnitUserAssignment[] - * [user_id][][$user_assignment] - * + * [user_id][][$user_assignment] */ public function findAllUserAssingmentsByUserIds($arr_user_ids) : array { @@ -83,10 +77,8 @@ public function findAllUserAssingmentsByUserIds($arr_user_ids) : array return $user_assignment_list_by_user; } - /** * @param $arr_empl_user_ids - * * @return array * [user_id as an employee][][ user_id as a superior] */ @@ -119,10 +111,8 @@ public function getEmplSuperiorList($arr_empl_user_ids) : array return $empl_id__sup_ids; } - /** * @param $user_id - * * @return ilOrgUnitPosition[] */ public function getPositionsOfUserId($user_id) @@ -138,12 +128,10 @@ public function getPositionsOfUserId($user_id) return $positions; } - /** * @param int $user_id * @param int $position_id * @param int $orgu_id Org-Units Ref-ID - * * @return \ActiveRecord * @throws \ilException */ @@ -161,15 +149,12 @@ public function getAssignmentOrFail($user_id, $position_id, $orgu_id) return $ua; } - public function filterUserIdsDueToAuthorities($user_id, array $user_ids) { } - /** * @param $user_id - * * @return ilOrgUnitUserAssignment[] */ public function getAssignmentsOfUserId($user_id) @@ -177,10 +162,8 @@ public function getAssignmentsOfUserId($user_id) return ilOrgUnitUserAssignment::where(['user_id' => $user_id])->get(); } - /** * @param $orgunit_ref_id - * * @return ilOrgUnitUserAssignment[] */ public function getUserIdsOfOrgUnit($orgunit_ref_id) @@ -188,10 +171,8 @@ public function getUserIdsOfOrgUnit($orgunit_ref_id) return ilOrgUnitUserAssignment::where(['orgu_id' => $orgunit_ref_id])->getArray(null, 'user_id'); } - /** * @param $orgunit_ref_id - * * @return ilOrgUnitUserAssignment[] */ public function getUserIdsOfOrgUnits(array $orgunit_ref_id) @@ -199,27 +180,24 @@ public function getUserIdsOfOrgUnits(array $orgunit_ref_id) return ilOrgUnitUserAssignment::where(['orgu_id' => $orgunit_ref_id])->getArray(null, 'user_id'); } - /** * @param $position_id * @param $user_id - * * @param bool $recursive - * * @return \ilOrgUnitUserAssignment[] * @internal param $orgunit_ref_id */ public function getUserIdsOfOrgUnitsOfUsersPosition($position_id, $user_id, $recursive = false) { - return ilOrgUnitUserAssignment::where(['orgu_id' => $this->getOrgUnitIdsOfUsersPosition($position_id, $user_id, $recursive)]) - ->getArray(null, 'user_id'); + return ilOrgUnitUserAssignment::where(['orgu_id' => $this->getOrgUnitIdsOfUsersPosition($position_id, $user_id, + $recursive) + ]) + ->getArray(null, 'user_id'); } - /** * @param array $orgu_ids * @param $position_id - * * @return int[] */ public function getUserIdsOfOrgUnitsInPosition(array $orgu_ids, $position_id) @@ -230,14 +208,11 @@ public function getUserIdsOfOrgUnitsInPosition(array $orgu_ids, $position_id) ])->getArray(null, 'user_id'); } - /** * @param $user_id * @param $users_position_id * @param $position_id - * * @param bool $recursive - * * @return int[] */ public function getUserIdsOfUsersOrgUnitsInPosition($user_id, $users_position_id, $position_id, $recursive = false) @@ -248,13 +223,10 @@ public function getUserIdsOfUsersOrgUnitsInPosition($user_id, $users_position_id ])->getArray(null, 'user_id'); } - /** * @param $position_id * @param $user_id - * * @param bool $recursive - * * @return int[] */ public function getOrgUnitIdsOfUsersPosition($position_id, $user_id, $recursive = false) @@ -277,10 +249,8 @@ public function getOrgUnitIdsOfUsersPosition($position_id, $user_id, $recursive return $recursive_orgu_ids; } - /** * @param $position_id - * * @return int[] */ public function getUserIdsOfPosition($position_id) @@ -290,10 +260,8 @@ public function getUserIdsOfPosition($position_id) ])->getArray(null, 'user_id'); } - /** * @param $position_id - * * @return ilOrgUnitUserAssignment[] */ public function getUserAssignmentsOfPosition($position_id) @@ -303,10 +271,8 @@ public function getUserAssignmentsOfPosition($position_id) ])->get(); } - /** * @param int $user_id - * * @return void */ public function deleteAllAssignmentsOfUser($user_id) diff --git a/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentTableGUI.php b/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentTableGUI.php index e1fe8d3635be..8689531f275c 100644 --- a/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentTableGUI.php +++ b/Modules/OrgUnit/classes/Positions/UserAssignment/class.ilOrgUnitUserAssignmentTableGUI.php @@ -16,7 +16,6 @@ class ilOrgUnitUserAssignmentTableGUI extends ilTable2GUI /** * ilOrgUnitUserAssignmentTableGUI constructor. - * * @param \ILIAS\Modules\OrgUnit\ARHelper\BaseCommands $parent_obj * @param string $parent_cmd * @param \ilOrgUnitPosition $position @@ -45,7 +44,6 @@ public function __construct(BaseCommands $parent_obj, $parent_cmd, ilOrgUnitPosi $this->parseData(); } - protected function setTableHeaders() { $this->addColumn($this->lng->txt("login"), "login"); @@ -54,19 +52,16 @@ protected function setTableHeaders() $this->addColumn($this->lng->txt("action")); } - public function parseData() { $data = $this->parseRows(ilObjOrgUnitTree::_getInstance() - ->getAssignements($_GET["ref_id"], $this->ilOrgUnitPosition)); + ->getAssignements($_GET["ref_id"], $this->ilOrgUnitPosition)); $this->setData($data); } - /** * @param $user_ids - * * @return array */ protected function parseRows($user_ids) @@ -81,7 +76,6 @@ protected function parseRows($user_ids) return $data; } - /** * @param $set * @param $user_id @@ -96,7 +90,6 @@ protected function setRowForUser(&$set, $user_id) $set["user_id"] = $user_id; } - /** * @param array $a_set */ @@ -112,7 +105,8 @@ public function fillRow(array $a_set) : void // $this->ctrl->setParameterByClass(ilLearningProgressGUI::class, "obj_id", $set["user_id"]); // $this->ctrl->setParameterByClass(ilObjOrgUnitGUI::class, "obj_id", $set["user_id"]); $this->ctrl->setParameterByClass(ilOrgUnitUserAssignmentGUI::class, 'usr_id', $a_set["user_id"]); - $this->ctrl->setParameterByClass(ilOrgUnitUserAssignmentGUI::class, 'position_id', $this->ilOrgUnitPosition->getId()); + $this->ctrl->setParameterByClass(ilOrgUnitUserAssignmentGUI::class, 'position_id', + $this->ilOrgUnitPosition->getId()); $selection = new ilAdvancedSelectionListGUI(); $selection->setListTitle($lng->txt("Actions")); $selection->setId("selection_list_user_lp_" . $a_set["user_id"]); @@ -122,11 +116,12 @@ public function fillRow(array $a_set) : void && ilObjUserTracking::_enabledUserRelatedData() ) { $this->ctrl->setParameterByClass(ilLearningProgressGUI::class, 'obj_id', $a_set["user_id"]); - $selection->addItem($lng->txt("show_learning_progress"), "show_learning_progress", $this->ctrl->getLinkTargetByClass(array( - ilAdministrationGUI::class, - ilObjOrgUnitGUI::class, - ilLearningProgressGUI::class, - ), "")); + $selection->addItem($lng->txt("show_learning_progress"), "show_learning_progress", + $this->ctrl->getLinkTargetByClass(array( + ilAdministrationGUI::class, + ilObjOrgUnitGUI::class, + ilLearningProgressGUI::class, + ), "")); } if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) { $this->addActions($selection); @@ -134,12 +129,13 @@ public function fillRow(array $a_set) : void $this->tpl->setVariable("ACTIONS", $selection->getHTML()); } - /** * @param $selection ilAdvancedSelectionListGUI */ protected function addActions(&$selection) { - $selection->addItem($this->lng->txt("remove"), "delete_from_employees", $this->ctrl->getLinkTargetByClass(ilOrgUnitUserAssignmentGUI::class, ilOrgUnitUserAssignmentGUI::CMD_CONFIRM)); + $selection->addItem($this->lng->txt("remove"), "delete_from_employees", + $this->ctrl->getLinkTargetByClass(ilOrgUnitUserAssignmentGUI::class, + ilOrgUnitUserAssignmentGUI::CMD_CONFIRM)); } } diff --git a/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPosition.php b/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPosition.php index 7d901dc9155d..d1fada2c355f 100644 --- a/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPosition.php +++ b/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPosition.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitPosition - * * @author Fabian Schmid */ class ilOrgUnitPosition extends \ActiveRecord @@ -10,7 +9,6 @@ class ilOrgUnitPosition extends \ActiveRecord const CORE_POSITION_EMPLOYEE = 1; const CORE_POSITION_SUPERIOR = 2; - /** * @return string */ @@ -19,10 +17,8 @@ public static function returnDbTableName() : string return "il_orgu_positions"; } - /** * Override for correct on return value - * * @return \ilOrgUnitPosition[] */ public static function get() : array @@ -31,10 +27,8 @@ public static function get() : array return parent::get(); } - /** * @param $core_identifier - * * @return \ilOrgUnitPosition */ public static function getCorePosition($core_identifier) @@ -43,10 +37,8 @@ public static function getCorePosition($core_identifier) return ilOrgUnitPosition::where(['core_identifier' => $core_identifier])->first(); } - /** * @param $core_identifier - * * @return int */ public static function getCorePositionId($core_identifier) @@ -54,7 +46,6 @@ public static function getCorePositionId($core_identifier) return self::getCorePosition($core_identifier)->getId(); } - /** * @throws \ilException whenever you try to delete a core-position like employee or superior */ @@ -66,7 +57,6 @@ public function delete() parent::delete(); } - /** * @return \ilOrgUnitPosition[] array of Positions (all core-positions and all positions which * have already UserAssignments) @@ -93,10 +83,8 @@ public static function getActive() return $positions; } - /** * @param int $orgu_ref_id - * * @return \ilOrgUnitPosition[] array of Positions (all core-positions and all positions which * have already UserAssignments at this place) */ @@ -122,10 +110,8 @@ public static function getActiveForPosition($orgu_ref_id) return $positions; } - /** * @var int - * * @con_is_primary true * @con_is_unique true * @con_sequence true @@ -136,7 +122,6 @@ public static function getActiveForPosition($orgu_ref_id) protected $id = 0; /** * @var string - * * @con_has_field true * @con_fieldtype text * @con_length 512 @@ -144,7 +129,6 @@ public static function getActiveForPosition($orgu_ref_id) protected $title = ""; /** * @var string - * * @con_has_field true * @con_fieldtype text * @con_length 4000 @@ -152,7 +136,6 @@ public static function getActiveForPosition($orgu_ref_id) protected $description = ""; /** * @var bool - * * @con_has_field true * @con_fieldtype integer * @con_length 1 @@ -160,7 +143,6 @@ public static function getActiveForPosition($orgu_ref_id) protected $core_position = false; /** * @var int - * * @con_has_field true * @con_fieldtype integer * @con_length 4 @@ -171,28 +153,24 @@ public static function getActiveForPosition($orgu_ref_id) */ protected $authorities = array(); - public function afterObjectLoad() : void { $this->authorities = ilOrgUnitAuthority::where(array(ilOrgUnitAuthority::POSITION_ID => $this->getId())) - ->get(); + ->get(); } - public function update() { parent::update(); $this->storeAuthorities(); } - public function create() : void { parent::create(); $this->storeAuthorities(); } - /** * @return array */ @@ -206,7 +184,6 @@ public function getAuthoritiesAsArray() return $return; } - /** * @return string */ @@ -215,21 +192,19 @@ public function __toString() return $this->getTitle(); } - /** * @return array it's own authorities and also all which use this position */ public function getDependentAuthorities() { $dependent = ilOrgUnitAuthority::where(array(ilOrgUnitAuthority::FIELD_OVER => $this->getId())) - ->get(); + ->get(); $arr = $dependent + $this->authorities; return (array) $arr; } - /** * This deletes the Position, it's Authorities, dependent Authorities and all User-Assignements! */ @@ -246,7 +221,6 @@ public function deleteWithAllDependencies() parent::delete(); } - /** * @return int */ @@ -255,7 +229,6 @@ public function getId() return $this->id; } - /** * @param int $id */ @@ -264,7 +237,6 @@ public function setId($id) $this->id = $id; } - /** * @return string */ @@ -273,7 +245,6 @@ public function getTitle() return $this->title; } - /** * @param string $title */ @@ -282,7 +253,6 @@ public function setTitle($title) $this->title = $title; } - /** * @return string */ @@ -291,7 +261,6 @@ public function getDescription() return $this->description; } - /** * @param string $description */ @@ -300,7 +269,6 @@ public function setDescription($description) $this->description = $description; } - /** * @return bool */ @@ -309,7 +277,6 @@ public function isCorePosition() return $this->core_position; } - /** * @param bool $core_position */ @@ -318,7 +285,6 @@ public function setCorePosition($core_position) $this->core_position = $core_position; } - /** * @return \ilOrgUnitAuthority[] */ @@ -327,7 +293,6 @@ public function getAuthorities() return $this->authorities; } - /** * @param \ilOrgUnitAuthority[] $authorities */ @@ -336,7 +301,6 @@ public function setAuthorities($authorities) $this->authorities = $authorities; } - /** * @return int */ @@ -345,7 +309,6 @@ public function getCoreIdentifier() return $this->core_identifier; } - /** * @param int $core_identifier */ @@ -354,7 +317,6 @@ public function setCoreIdentifier($core_identifier) $this->core_identifier = $core_identifier; } - private function storeAuthorities() { $ids = []; diff --git a/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPositionFormGUI.php b/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPositionFormGUI.php index 66eee9ede1ed..0e4f5daa8588 100644 --- a/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPositionFormGUI.php +++ b/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPositionFormGUI.php @@ -4,7 +4,6 @@ /** * Class ilOrgUnitPositionFormGUI - * * @author Fabian Schmid */ class ilOrgUnitPositionFormGUI extends BaseForm @@ -17,7 +16,6 @@ class ilOrgUnitPositionFormGUI extends BaseForm const F_TITLE = 'title'; const F_DESCRIPTION = 'description'; - protected function initFormElements() { $te = new ilTextInputGUI($this->txt(self::F_TITLE), self::F_TITLE); @@ -56,7 +54,6 @@ protected function initFormElements() $this->addItem($m); } - public function fillForm() { $array = array( @@ -68,10 +65,8 @@ public function fillForm() $this->setValuesByArray($array); } - /** * returns whether checkinput was successful or not. - * * @return bool */ public function fillObject() diff --git a/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPositionGUI.php b/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPositionGUI.php index 5931a5481e53..f898aa50e577 100644 --- a/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPositionGUI.php +++ b/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPositionGUI.php @@ -4,7 +4,6 @@ /** * Class ilOrgUnitPositionGUI - * * @author Fabian Schmid */ class ilOrgUnitPositionGUI extends BaseCommands @@ -27,7 +26,6 @@ public function __construct() } } - /** * @return array */ @@ -39,7 +37,6 @@ protected function getPossibleNextClasses() ); } - /** * @return string */ @@ -48,7 +45,6 @@ protected function getActiveTabId() return ilObjOrgUnitGUI::TAB_POSITIONS; } - protected function index() { self::initAuthoritiesRenderer(); @@ -61,14 +57,12 @@ protected function index() $this->setContent($table->getHTML()); } - protected function add() { $form = new ilOrgUnitPositionFormGUI($this, new ilOrgUnitPosition()); $this->tpl()->setContent($form->getHTML()); } - protected function create() { $form = new ilOrgUnitPositionFormGUI($this, new ilOrgUnitPosition()); @@ -80,7 +74,6 @@ protected function create() $this->tpl()->setContent($form->getHTML()); } - protected function edit() { $this->addSubTabs(); @@ -91,7 +84,6 @@ protected function edit() $this->tpl()->setContent($form->getHTML()); } - protected function update() { $position = $this->getPositionFromRequest(); @@ -105,7 +97,6 @@ protected function update() $this->tpl()->setContent($form->getHTML()); } - protected function assign() { $position = $this->getPositionFromRequest(); @@ -118,14 +109,14 @@ protected function assign() $employee_position = ilOrgUnitPosition::getCorePosition(ilOrgUnitPosition::CORE_POSITION_EMPLOYEE); foreach ($assignments as $assignment) { - ilOrgUnitUserAssignment::findOrCreateAssignment($assignment->getUserId(), $employee_position->getId(), $assignment->getOrguId()); + ilOrgUnitUserAssignment::findOrCreateAssignment($assignment->getUserId(), $employee_position->getId(), + $assignment->getOrguId()); $assignment->delete(); } $this->main_tpl->setOnScreenMessage('success', $this->txt('msg_assignment_to_employee_done'), true); } - protected function confirmDeletion() { $position = $this->getPositionFromRequest(); @@ -167,7 +158,6 @@ protected function confirmDeletion() $this->tpl()->setContent($confirmation->getHTML()); } - protected function delete() { if ($_POST['assign_users']) { @@ -179,13 +169,11 @@ protected function delete() $this->ctrl()->redirect($this, self::CMD_INDEX); } - protected function cancel() { $this->ctrl()->redirect($this, self::CMD_INDEX); } - /** * @return mixed */ @@ -197,7 +185,6 @@ protected function getARIdFromRequest() return $post ? $post : $get; } - /** * @return \ilOrgUnitPosition */ @@ -206,7 +193,6 @@ protected function getPositionFromRequest() return ilOrgUnitPosition::find($this->getARIdFromRequest()); } - public static function initAuthoritiesRenderer() { $lang = $GLOBALS['DIC']->language(); @@ -222,7 +208,7 @@ public static function initAuthoritiesRenderer() $t[$key] = $lang->txt($key); } - ilOrgUnitAuthority::replaceNameRenderer(function ($id) use ($t) { + ilOrgUnitAuthority::replaceNameRenderer(function($id) use ($t) { /** * @var $ilOrgUnitAuthority ilOrgUnitAuthority */ @@ -243,7 +229,7 @@ public static function initAuthoritiesRenderer() break; default: $over_txt = ilOrgUnitPosition::findOrGetInstance($ilOrgUnitAuthority->getOver()) - ->getTitle(); + ->getTitle(); break; } @@ -251,14 +237,14 @@ public static function initAuthoritiesRenderer() }); } - public function addSubTabs() { $this->ctrl()->saveParameter($this, 'arid'); $this->ctrl()->saveParameterByClass(ilOrgUnitDefaultPermissionGUI::class, 'arid'); $this->pushSubTab(self::SUBTAB_SETTINGS, $this->ctrl() - ->getLinkTarget($this, self::CMD_EDIT)); + ->getLinkTarget($this, self::CMD_EDIT)); $this->pushSubTab(self::SUBTAB_PERMISSIONS, $this->ctrl() - ->getLinkTargetByClass(ilOrgUnitDefaultPermissionGUI::class, self::CMD_INDEX)); + ->getLinkTargetByClass(ilOrgUnitDefaultPermissionGUI::class, + self::CMD_INDEX)); } } diff --git a/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPositionTableGUI.php b/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPositionTableGUI.php index e461d702b912..995d503fccfa 100644 --- a/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPositionTableGUI.php +++ b/Modules/OrgUnit/classes/Positions/class.ilOrgUnitPositionTableGUI.php @@ -4,7 +4,6 @@ /** * Class ilOrgUnitPositionTableGUI - * * @author Fabian Schmid */ class ilOrgUnitPositionTableGUI extends ilTable2GUI @@ -24,10 +23,8 @@ class ilOrgUnitPositionTableGUI extends ilTable2GUI 'authorities', ); - /** * ilOrgUnitPositionTableGUI constructor. - * * @param \ILIAS\Modules\OrgUnit\ARHelper\BaseCommands $parent_obj * @param string $parent_cmd */ @@ -44,7 +41,6 @@ public function __construct(BaseCommands $parent_obj, $parent_cmd) $this->setFormAction($this->DIC->ctrl()->getFormAction($this->parent_obj)); } - /** * Pass data to row template * @param array $a_set @@ -61,21 +57,22 @@ public function fillRow(array $a_set) : void $this->tpl->setVariable('AUTHORITIES', implode("
", $obj->getAuthorities())); $this->DIC->ctrl() - ->setParameterByClass(ilOrgUnitPositionGUI::class, BaseCommands::AR_ID, $a_set['id']); + ->setParameterByClass(ilOrgUnitPositionGUI::class, BaseCommands::AR_ID, $a_set['id']); $selection = new ilAdvancedSelectionListGUI(); $selection->setListTitle($this->DIC->language()->txt('actions')); $selection->setId(BaseCommands::AR_ID . $a_set['id']); $selection->addItem($this->DIC->language()->txt('edit'), 'edit', $this->DIC->ctrl() - ->getLinkTargetByClass(ilOrgUnitPositionGUI::class, ilOrgUnitPositionGUI::CMD_EDIT)); + ->getLinkTargetByClass(ilOrgUnitPositionGUI::class, + ilOrgUnitPositionGUI::CMD_EDIT)); if (!$obj->isCorePosition()) { $selection->addItem($this->DIC->language()->txt('delete'), 'delete', $this->DIC->ctrl() - ->getLinkTargetByClass(ilOrgUnitPositionGUI::class, ilOrgUnitPositionGUI::CMD_CONFIRM_DELETION)); + ->getLinkTargetByClass(ilOrgUnitPositionGUI::class, + ilOrgUnitPositionGUI::CMD_CONFIRM_DELETION)); } $this->tpl->setVariable('ACTIONS', $selection->getHTML()); } - /** * Add columns */ @@ -86,7 +83,6 @@ protected function initColumns() } } - /** * Build and set data for table. */ diff --git a/Modules/OrgUnit/classes/Provider/OrgUnitMainBarProvider.php b/Modules/OrgUnit/classes/Provider/OrgUnitMainBarProvider.php index 61b76cb47737..90ea0ffc0661 100644 --- a/Modules/OrgUnit/classes/Provider/OrgUnitMainBarProvider.php +++ b/Modules/OrgUnit/classes/Provider/OrgUnitMainBarProvider.php @@ -33,7 +33,7 @@ public function getStaticSubItems() : array $title = $this->dic->language()->txt("objs_orgu"); $action = "ilias.php?baseClass=ilAdministrationGUI&ref_id=" . ilObjOrgUnit::getRootOrgRefId() . "&cmd=jump"; $icon = $this->dic->ui()->factory()->symbol()->icon()->standard('orgu', $title) - ->withIsOutlined(true); + ->withIsOutlined(true); $items[] = $this->mainmenu->link($this->if->identifier('mm_adm_orgu')) ->withAlwaysAvailable(true) @@ -44,8 +44,9 @@ public function getStaticSubItems() : array ->withSymbol($icon) ->withPosition(65) ->withVisibilityCallable( - $access_helper->hasAdministrationAccess(function () : bool { - return (bool) $this->dic->access()->checkAccess('read', '', ilObjOrgUnit::getRootOrgRefId()); + $access_helper->hasAdministrationAccess(function() : bool { + return (bool) $this->dic->access()->checkAccess('read', '', + ilObjOrgUnit::getRootOrgRefId()); }) ); diff --git a/Modules/OrgUnit/classes/Provider/OrgUnitToolProvider.php b/Modules/OrgUnit/classes/Provider/OrgUnitToolProvider.php index 7d48fa8c50cb..c3dd7d4fccf6 100644 --- a/Modules/OrgUnit/classes/Provider/OrgUnitToolProvider.php +++ b/Modules/OrgUnit/classes/Provider/OrgUnitToolProvider.php @@ -37,17 +37,18 @@ public function getToolsForContextStack(CalledContexts $called_contexts) : array $tools = []; if ($called_contexts->current()->getAdditionalData()->is(self::SHOW_ORGU_TREE, true)) { - $iff = function (string $id) { + $iff = function(string $id) { return $this->identification_provider->contextAwareIdentifier($id); }; - $t = function (string $key) : string { + $t = function(string $key) : string { return $this->dic->language()->txt($key); }; $tools[] = $this->factory->treeTool($iff('tree_new')) ->withTitle($t('tree')) - ->withSymbol($this->dic->ui()->factory()->symbol()->icon()->standard('orgu', 'Orgu')) + ->withSymbol($this->dic->ui()->factory()->symbol()->icon()->standard('orgu', + 'Orgu')) ->withTree($this->getTree()); } @@ -63,7 +64,7 @@ private function getTree() : Tree $parent_node_id = $DIC->repositoryTree()->getParentId(ilObjOrgUnit::getRootOrgRefId()); return $this->dic->ui()->factory()->tree()->expandable($lng->txt("org_units"), $tree) - ->withData($tree->getChildsOfNode($parent_node_id)); + ->withData($tree->getChildsOfNode($parent_node_id)); } private function getTreeRecursion() : TreeRecursion diff --git a/Modules/OrgUnit/classes/Settings/class.ilObjOrgUnitSettingsFormGUI.php b/Modules/OrgUnit/classes/Settings/class.ilObjOrgUnitSettingsFormGUI.php index 03c724687bbf..19a8d5c29502 100644 --- a/Modules/OrgUnit/classes/Settings/class.ilObjOrgUnitSettingsFormGUI.php +++ b/Modules/OrgUnit/classes/Settings/class.ilObjOrgUnitSettingsFormGUI.php @@ -2,7 +2,6 @@ /** * Class ilObjOrgUnitSettingsFormGUI - * * @author Stefan Wanzenried */ class ilObjOrgUnitSettingsFormGUI extends ilPropertyFormGUI @@ -17,7 +16,6 @@ class ilObjOrgUnitSettingsFormGUI extends ilPropertyFormGUI */ protected $parent_gui; - public function __construct($parent_gui, ilObjOrgUnit $obj_orgu) { global $DIC; @@ -34,10 +32,8 @@ public function __construct($parent_gui, ilObjOrgUnit $obj_orgu) $this->initForm(); } - /** * Update object - * * @return bool */ public function saveObject() @@ -51,7 +47,6 @@ public function saveObject() return true; } - /** * Add all fields to the form */ @@ -95,10 +90,8 @@ protected function initForm() $this->addCommandButton('updateSettings', $this->lng->txt('save')); } - /** * Check validity of form and pass values from form to object - * * @return bool */ protected function fillObject() @@ -115,7 +108,6 @@ protected function fillObject() return true; } - /** * Update title and description for the default language of translation */ @@ -130,7 +122,8 @@ protected function updateTranslation() } $lang_codes[] = $translation['lang']; } - $lang_code = (in_array($this->user->getLanguage(), $lang_codes)) ? $this->user->getLanguage() : $lang_code_default; + $lang_code = (in_array($this->user->getLanguage(), + $lang_codes)) ? $this->user->getLanguage() : $lang_code_default; $this->obj_orgu->updateTranslation($this->getInput('title'), $this->getInput('description'), $lang_code, 0); } } diff --git a/Modules/OrgUnit/classes/Settings/class.ilOrgUnitGlobalSettings.php b/Modules/OrgUnit/classes/Settings/class.ilOrgUnitGlobalSettings.php index 5240568be997..cab60d65cdd8 100644 --- a/Modules/OrgUnit/classes/Settings/class.ilOrgUnitGlobalSettings.php +++ b/Modules/OrgUnit/classes/Settings/class.ilOrgUnitGlobalSettings.php @@ -4,9 +4,7 @@ /** * Global settings for org units - * * @author Stefan Meyer - * */ class ilOrgUnitGlobalSettings { @@ -25,12 +23,10 @@ class ilOrgUnitGlobalSettings private $position_settings = []; /** * Array with key obj_id => active status - * * @var array */ private $object_position_cache = []; - /** * Singelton constructor */ @@ -40,10 +36,8 @@ protected function __construct() $this->readSettings(); } - /** * Get instance - * * @return ilOrgUnitGlobalSettings */ public static function getInstance() @@ -55,12 +49,9 @@ public static function getInstance() return self::$instance; } - /** * Get object position settings by type - * * @param string $a_obj_type - * * @return ilOrgUnitObjectTypePositionSetting * @throws \InvalidArgumentException */ @@ -74,12 +65,9 @@ public function getObjectPositionSettingsByType($a_obj_type) return $this->position_settings[$a_obj_type]; } - /** * Check of position access is activate for object - * * @param int $a_obj_id - * * @return bool */ public function isPositionAccessActiveForObject($a_obj_id) @@ -117,10 +105,8 @@ public function isPositionAccessActiveForObject($a_obj_id) return $this->object_position_cache[$a_obj_id]; } - /** * Set and save the default activation status according to settings. - * * @param int $a_obj_id */ public function saveDefaultPositionActivationStatus($a_obj_id) @@ -140,7 +126,6 @@ public function saveDefaultPositionActivationStatus($a_obj_id) return; } - /** * read settings */ @@ -151,7 +136,6 @@ protected function readSettings() } } - /** * @return \ilOrgUnitObjectTypePositionSetting[] */ diff --git a/Modules/OrgUnit/classes/Settings/class.ilOrgUnitGlobalSettingsGUI.php b/Modules/OrgUnit/classes/Settings/class.ilOrgUnitGlobalSettingsGUI.php index 0606ce052493..147be335efa3 100644 --- a/Modules/OrgUnit/classes/Settings/class.ilOrgUnitGlobalSettingsGUI.php +++ b/Modules/OrgUnit/classes/Settings/class.ilOrgUnitGlobalSettingsGUI.php @@ -4,11 +4,8 @@ /** * Global orgunit settings GUI - * * @author Stefan Meyer - * * @ilCtrl_IsCalledBy ilOrgUnitGlobalSettingsGUI: ilObjOrgUnitGUI - * */ class ilOrgUnitGlobalSettingsGUI { @@ -26,10 +23,8 @@ class ilOrgUnitGlobalSettingsGUI */ protected $tpl; - /** * Default constructor - * * @global type $DIC */ public function __construct() @@ -48,7 +43,6 @@ public function __construct() } } - /** * Ctrl execute command */ @@ -64,10 +58,8 @@ public function executeCommand() } } - /** * Show settings - * * @param ilPropertyFormGUI $form */ protected function settings(ilPropertyFormGUI $form = null) @@ -78,7 +70,6 @@ protected function settings(ilPropertyFormGUI $form = null) $this->tpl->setContent($form->getHTML()); } - /** * Init settings form */ @@ -126,14 +117,16 @@ protected function initSettingsForm() $type->setValue(1); $type->setChecked($setting->isActive()); if ($is_multi) { - $scope = new ilRadioGroupInputGUI($this->lng->txt('orgu_global_set_type_changeable'), $object_type . '_changeable'); + $scope = new ilRadioGroupInputGUI($this->lng->txt('orgu_global_set_type_changeable'), + $object_type . '_changeable'); $scope->setValue((int) $setting->isChangeableForObject()); $scope_object = new ilRadioOption( $this->lng->txt('orgu_global_set_type_changeable_object'), 1 ); - $default = new ilCheckboxInputGUI($this->lng->txt('orgu_global_set_type_default'), $object_type . '_default'); + $default = new ilCheckboxInputGUI($this->lng->txt('orgu_global_set_type_default'), + $object_type . '_default'); $default->setInfo($this->lng->txt('orgu_global_set_type_default_info')); $default->setValue(ilOrgUnitObjectTypePositionSetting::DEFAULT_ON); $default->setChecked($setting->getActivationDefault()); @@ -156,7 +149,6 @@ protected function initSettingsForm() return $form; } - protected function saveSettings() { /** diff --git a/Modules/OrgUnit/classes/Settings/class.ilOrgUnitObjectPositionSetting.php b/Modules/OrgUnit/classes/Settings/class.ilOrgUnitObjectPositionSetting.php index 6420e418bd4b..e281c08be968 100644 --- a/Modules/OrgUnit/classes/Settings/class.ilOrgUnitObjectPositionSetting.php +++ b/Modules/OrgUnit/classes/Settings/class.ilOrgUnitObjectPositionSetting.php @@ -4,9 +4,7 @@ /** * Stores object activation status of orgunit position settings. - * * @author Stefan Meyer - * */ class ilOrgUnitObjectPositionSetting { @@ -24,10 +22,8 @@ class ilOrgUnitObjectPositionSetting */ private $active; - /** * Constructor - * * @param int $a_obj_id */ public function __construct($a_obj_id) @@ -37,12 +33,9 @@ public function __construct($a_obj_id) $this->readSettings(); } - /** * Lookup activation status - * * @param int $a_obj_id - * * @return bool active status */ public function lookupActive($a_obj_id) @@ -57,10 +50,8 @@ public function lookupActive($a_obj_id) } } - /** * Check if position access is active. This returns true or false if it is object specific or null if the object has no setting. - * * @return null|bool */ public function isActive() @@ -68,10 +59,8 @@ public function isActive() return $this->active; } - /** * Set active for object - * * @param bool $a_status */ public function setActive($a_status) @@ -79,7 +68,6 @@ public function setActive($a_status) $this->active = $a_status; } - /** * Update object entry */ @@ -92,7 +80,6 @@ public function update() ]); } - /** * Delete record */ @@ -103,7 +90,6 @@ public function delete() $this->db->manipulate($query); } - /** * @return bool Returns true if the object has a specific setting false if there is no object specific setting, take the global setting in this * case. @@ -113,7 +99,6 @@ public function hasObjectSpecificActivation() return $this->active !== null; } - /** * Read from db */ diff --git a/Modules/OrgUnit/classes/Settings/class.ilOrgUnitObjectTypePositionSetting.php b/Modules/OrgUnit/classes/Settings/class.ilOrgUnitObjectTypePositionSetting.php index 2880f754dbd0..abb955ea9d04 100644 --- a/Modules/OrgUnit/classes/Settings/class.ilOrgUnitObjectTypePositionSetting.php +++ b/Modules/OrgUnit/classes/Settings/class.ilOrgUnitObjectTypePositionSetting.php @@ -3,9 +3,7 @@ /** * Object settings regarding position permissions - * * @author Stefan Meyer - * */ class ilOrgUnitObjectTypePositionSetting { @@ -32,10 +30,8 @@ class ilOrgUnitObjectTypePositionSetting */ private $default = self::DEFAULT_OFF; - /** * Constructor - * * @param string $a_obj_type */ public function __construct($a_obj_type) @@ -45,7 +41,6 @@ public function __construct($a_obj_type) $this->read(); } - /** * set active for object type */ @@ -54,7 +49,6 @@ public function setActive($a_active) $this->active = $a_active; } - /** * @param int $a_default */ @@ -63,7 +57,6 @@ public function setActivationDefault($a_default) $this->default = $a_default; } - /** * @param bool $a_status */ @@ -72,10 +65,8 @@ public function setChangeableForObject($a_status) $this->changeable = $a_status; } - /** * Check if active - * * @return bool */ public function isActive() @@ -83,10 +74,8 @@ public function isActive() return $this->active; } - /** * Get activation default - * * @return int */ public function getActivationDefault() @@ -94,7 +83,6 @@ public function getActivationDefault() return $this->default; } - /** * return bool */ @@ -103,7 +91,6 @@ public function isChangeableForObject() return $this->changeable; } - /** * Update type entry */ @@ -118,7 +105,6 @@ public function update() ]); } - /** * Read from db */ @@ -135,7 +121,6 @@ protected function read() } } - /** * @return string */ diff --git a/Modules/OrgUnit/classes/SimpleImport/class.ilOrgUnitSimpleImport.php b/Modules/OrgUnit/classes/SimpleImport/class.ilOrgUnitSimpleImport.php index 6bcd126d5c1c..9a2f9c6ba0ac 100644 --- a/Modules/OrgUnit/classes/SimpleImport/class.ilOrgUnitSimpleImport.php +++ b/Modules/OrgUnit/classes/SimpleImport/class.ilOrgUnitSimpleImport.php @@ -3,10 +3,8 @@ /** * Class ilOrgUnitSimpleImport - * * @author: Oskar Truffer * @author: Martin Studer - * */ class ilOrgUnitSimpleImport extends ilOrgUnitImporter { @@ -29,7 +27,6 @@ public function simpleImport($file_path) } } - public function simpleImportElement(SimpleXMLElement $o) { global $DIC; @@ -144,7 +141,6 @@ public function simpleImportElement(SimpleXMLElement $o) } } - /** * @param $ref_id int * @param $parent_ref_id int diff --git a/Modules/OrgUnit/classes/SimpleImport/class.ilOrgUnitSimpleImportGUI.php b/Modules/OrgUnit/classes/SimpleImport/class.ilOrgUnitSimpleImportGUI.php index 42e54ce686bd..d79aff368a91 100644 --- a/Modules/OrgUnit/classes/SimpleImport/class.ilOrgUnitSimpleImportGUI.php +++ b/Modules/OrgUnit/classes/SimpleImport/class.ilOrgUnitSimpleImportGUI.php @@ -3,7 +3,6 @@ /** * Class ilOrgUnitSimpleImportGUI - * * @author Oskar Truffer * @author Martin Studer */ @@ -39,7 +38,6 @@ class ilOrgUnitSimpleImportGUI */ protected $ilAccess; - /** * @param $parent_gui */ @@ -69,7 +67,6 @@ public function __construct($parent_gui) } } - /** * @return bool */ @@ -83,12 +80,14 @@ public function executeCommand() break; case 'importScreen': $this->tabs_gui->clearTargets(); - $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, 'chooseImport')); + $this->tabs_gui->setBackTarget($this->lng->txt("back"), + $this->ctrl->getLinkTarget($this, 'chooseImport')); $this->importScreen(); break; case 'startImport': $this->tabs_gui->clearTargets(); - $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this, 'chooseImport')); + $this->tabs_gui->setBackTarget($this->lng->txt("back"), + $this->ctrl->getLinkTarget($this, 'chooseImport')); $this->startImport(); break; } @@ -96,10 +95,10 @@ public function executeCommand() return true; } - public function chooseImport() { - if (!$this->ilAccess->checkAccess("write", "", $_GET["ref_id"]) or !$this->parent_object->getRefId() == ilObjOrgUnit::getRootOrgRefId()) { + if (!$this->ilAccess->checkAccess("write", "", + $_GET["ref_id"]) or !$this->parent_object->getRefId() == ilObjOrgUnit::getRootOrgRefId()) { $this->tpl->setOnScreenMessage('failure', $this->lng->txt("msg_no_perm_edit")); $this->ctrl->redirectByClass('ilinfoscreengui', ''); } @@ -108,20 +107,21 @@ public function chooseImport() $this->tabs_gui->removeSubTab("page_editor"); $this->tabs_gui->removeSubTab("ordering"); // Mantis 0014728 - if ($this->ilAccess->checkAccess("write", "", $_GET["ref_id"]) and $this->parent_object->getRefId() == ilObjOrgUnit::getRootOrgRefId()) { - $this->toolbar->addButton($this->lng->txt("simple_import"), $this->ctrl->getLinkTargetByClass("ilOrgUnitSimpleImportGUI", "importScreen")); - $this->toolbar->addButton($this->lng->txt("simple_user_import"), $this->ctrl->getLinkTargetByClass("ilOrgUnitSimpleUserImportGUI", "userImportScreen")); + if ($this->ilAccess->checkAccess("write", "", + $_GET["ref_id"]) and $this->parent_object->getRefId() == ilObjOrgUnit::getRootOrgRefId()) { + $this->toolbar->addButton($this->lng->txt("simple_import"), + $this->ctrl->getLinkTargetByClass("ilOrgUnitSimpleImportGUI", "importScreen")); + $this->toolbar->addButton($this->lng->txt("simple_user_import"), + $this->ctrl->getLinkTargetByClass("ilOrgUnitSimpleUserImportGUI", "userImportScreen")); } } - public function importScreen() { $form = $this->initForm("startImport"); $this->tpl->setContent($form->getHTML()); } - protected function initForm($submit_action) { $form = new ilPropertyFormGUI(); @@ -135,7 +135,6 @@ protected function initForm($submit_action) return $form; } - public function startImport() { $form = $this->initForm("startImport"); @@ -175,7 +174,6 @@ public function startImport() } } - /** * @param $importer ilOrgUnitImporter */ @@ -183,7 +181,9 @@ public function displayImportResults($importer) { if (!$importer->hasErrors() && !$importer->hasWarnings()) { $stats = $importer->getStats(); - $this->tpl->setOnScreenMessage('success', sprintf($this->lng->txt("import_successful"), $stats["created"], $stats["updated"], $stats["deleted"]), true); + $this->tpl->setOnScreenMessage('success', + sprintf($this->lng->txt("import_successful"), $stats["created"], $stats["updated"], $stats["deleted"]), + true); } if ($importer->hasWarnings()) { $msg = $this->lng->txt("import_terminated_with_warnings") . "
"; diff --git a/Modules/OrgUnit/classes/SimpleUserImport/class.ilOrgUnitSimpleUserImport.php b/Modules/OrgUnit/classes/SimpleUserImport/class.ilOrgUnitSimpleUserImport.php index 26230434afa6..0fb32c1e2ad7 100644 --- a/Modules/OrgUnit/classes/SimpleUserImport/class.ilOrgUnitSimpleUserImport.php +++ b/Modules/OrgUnit/classes/SimpleUserImport/class.ilOrgUnitSimpleUserImport.php @@ -3,11 +3,9 @@ /** * Class ilOrgUnitSimpleUserImport - * * @author : Oskar Truffer * @author : Martin Studer * @author Fabian Schmid - * */ class ilOrgUnitSimpleUserImport extends ilOrgUnitImporter { @@ -32,7 +30,6 @@ public function simpleUserImport($file_path) } } - /** * @param SimpleXMLElement $a */ @@ -86,11 +83,9 @@ public function simpleUserImportElement(SimpleXMLElement $a) } } - /** * @param $id * @param $type - * * @return bool */ private function buildUserId($id, $type) diff --git a/Modules/OrgUnit/classes/SimpleUserImport/class.ilOrgUnitSimpleUserImportGUI.php b/Modules/OrgUnit/classes/SimpleUserImport/class.ilOrgUnitSimpleUserImportGUI.php index 8b2f350b42eb..4c5229568b1e 100644 --- a/Modules/OrgUnit/classes/SimpleUserImport/class.ilOrgUnitSimpleUserImportGUI.php +++ b/Modules/OrgUnit/classes/SimpleUserImport/class.ilOrgUnitSimpleUserImportGUI.php @@ -3,7 +3,6 @@ /** * Class ilOrgUnitSimpleUserImportGUI - * * @author Oskar Truffer * @author Martin Studer * @author Fabian Schmid @@ -40,7 +39,6 @@ class ilOrgUnitSimpleUserImportGUI */ protected $ilAccess; - /** * @param $parent_gui */ @@ -69,7 +67,6 @@ public function __construct($parent_gui) } } - /** * @return bool */ @@ -78,7 +75,8 @@ public function executeCommand() $cmd = $this->ctrl->getCmd(); $this->tabs_gui->clearTargets(); - $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass('ilOrgUnitSimpleImportGUI', 'chooseImport')); + $this->tabs_gui->setBackTarget($this->lng->txt("back"), + $this->ctrl->getLinkTargetByClass('ilOrgUnitSimpleImportGUI', 'chooseImport')); switch ($cmd) { case 'userImportScreen': @@ -92,14 +90,12 @@ public function executeCommand() return true; } - public function userImportScreen() { $form = $this->initForm(); $this->tpl->setContent($form->getHTML()); } - /** * @description FSX Can be deleted; Just for a single Test of a UserImport */ @@ -118,7 +114,6 @@ protected function testImport() $this->tpl->setOnScreenMessage('info', '
' . print_r($importer->getErrors(), 1) . '
'); } - protected function initForm() { $form = new ilPropertyFormGUI(); @@ -131,7 +126,6 @@ protected function initForm() return $form; } - public function startImport() { $form = $this->initForm(); @@ -151,7 +145,6 @@ public function startImport() } } - /** * @param $importer ilOrgUnitImporter */ @@ -159,7 +152,8 @@ public function displayImportResults($importer) { if (!$importer->hasErrors() and !$importer->hasWarnings()) { $stats = $importer->getStats(); - $this->tpl->setOnScreenMessage('success', sprintf($this->lng->txt('user_import_successful'), $stats['created'], $stats['removed']), true); + $this->tpl->setOnScreenMessage('success', + sprintf($this->lng->txt('user_import_successful'), $stats['created'], $stats['removed']), true); } if ($importer->hasWarnings()) { $msg = $this->lng->txt('import_terminated_with_warnings') . '
'; diff --git a/Modules/OrgUnit/classes/Staff/class.ilOrgUnitOtherRolesTableGUI.php b/Modules/OrgUnit/classes/Staff/class.ilOrgUnitOtherRolesTableGUI.php index 41deb189adeb..286486cb19c3 100644 --- a/Modules/OrgUnit/classes/Staff/class.ilOrgUnitOtherRolesTableGUI.php +++ b/Modules/OrgUnit/classes/Staff/class.ilOrgUnitOtherRolesTableGUI.php @@ -3,7 +3,6 @@ /** * Class ilOrgUnitOtherRolesTableGUI - * * @author Oskar Truffer * @author Martin Studer */ @@ -54,13 +53,11 @@ protected function setTableHeaders() $this->addColumn($this->lng->txt("action")); } - public function readData() { $this->parseData(); } - public function parseData() { global $DIC; @@ -71,7 +68,6 @@ public function parseData() $this->setData($data); } - protected function parseRows($user_ids) { $data = array(); @@ -84,7 +80,6 @@ protected function parseRows($user_ids) return $data; } - /** * @param $role_id integer */ @@ -93,7 +88,6 @@ public function setRoleId($role_id) $this->role_id = $role_id; } - /** * @return integer */ @@ -102,7 +96,6 @@ public function getRoleId() return $this->role_id; } - protected function setRowForUser(&$set, $user_id) { $user = new ilObjUser($user_id); @@ -112,7 +105,6 @@ protected function setRowForUser(&$set, $user_id) $set["user_id"] = $user_id; } - public function fillRow(array $a_set) : void { global $DIC; @@ -130,7 +122,8 @@ public function fillRow(array $a_set) : void $selection = new ilAdvancedSelectionListGUI(); $selection->setListTitle($lng->txt("Actions")); $selection->setId("selection_list_user_other_roles_" . $a_set["user_id"]); - $selection->addItem($this->lng->txt("remove"), "delete_from_role", $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", "confirmRemoveFromRole")); + $selection->addItem($this->lng->txt("remove"), "delete_from_role", + $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", "confirmRemoveFromRole")); } $this->tpl->setVariable("ACTIONS", $selection->getHTML()); } diff --git a/Modules/OrgUnit/classes/Staff/class.ilOrgUnitStaffGUI.php b/Modules/OrgUnit/classes/Staff/class.ilOrgUnitStaffGUI.php index bb3590771a1d..550aa8426c94 100644 --- a/Modules/OrgUnit/classes/Staff/class.ilOrgUnitStaffGUI.php +++ b/Modules/OrgUnit/classes/Staff/class.ilOrgUnitStaffGUI.php @@ -3,12 +3,10 @@ /** * Class ilOrgUnitStaffGUI - * * @author Oskar Truffer * @author Martin Studer * Date: 4/07/13 * Time: 1:09 PM - * * @ilCtrl_Calls ilOrgUnitStaffGUI: ilRepositorySearchGUI */ class ilOrgUnitStaffGUI @@ -51,7 +49,6 @@ class ilOrgUnitStaffGUI */ protected $rbacreview; - /** * @param ilObjOrgUnitGUI $parent_gui */ @@ -81,7 +78,6 @@ public function __construct(ilObjOrgUnitGUI $parent_gui) $this->setTabs(); } - /** * @return bool * @throws Exception @@ -136,7 +132,6 @@ public function executeCommand() return true; } - public function showStaff() { if (!ilObjOrgUnitAccess::_checkAccessStaff($this->parent_object->getRefId())) { @@ -150,7 +145,6 @@ public function showStaff() $this->tpl->setContent($this->getStaffTableHTML(false, "showStaff")); } - public function showOtherRoles() { if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) { @@ -163,7 +157,6 @@ public function showOtherRoles() $this->tpl->setContent($this->getOtherRolesTableHTML()); } - public function showStaffRec() { if (!ilObjOrgUnitAccess::_checkAccessStaffRec($this->parent_object->getRefId())) { @@ -174,7 +167,6 @@ public function showStaffRec() $this->tpl->setContent($this->getStaffTableHTML(true, "showStaffRec")); } - protected function addStaffToolbar() { $types = array( @@ -189,7 +181,6 @@ protected function addStaffToolbar() )); } - protected function addOtherRolesToolbar() { $arrLocalRoles = $this->rbacreview->getLocalRoles($this->parent_object->getRefId()); @@ -208,7 +199,6 @@ protected function addOtherRolesToolbar() )); } - public function addStaff() { if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) { @@ -243,7 +233,6 @@ public function addStaff() $this->ctrl->redirect($this, "showStaff"); } - public function addOtherRoles() { if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) { @@ -267,11 +256,9 @@ public function addOtherRoles() $this->ctrl->redirect($this, "showOtherRoles"); } - /** * @param bool $recursive * @param string $table_cmd - * * @return string the tables html. */ public function getStaffTableHTML($recursive = false, $table_cmd = "showStaff") @@ -289,7 +276,6 @@ public function getStaffTableHTML($recursive = false, $table_cmd = "showStaff") return $superior_table->getHTML() . $employee_table->getHTML(); } - public function getOtherRolesTableHTML() { global $DIC; @@ -312,7 +298,6 @@ public function getOtherRolesTableHTML() return $html; } - public function fromSuperiorToEmployee() { if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) { @@ -325,7 +310,6 @@ public function fromSuperiorToEmployee() $this->ctrl->redirect($this, "showStaff"); } - public function fromEmployeeToSuperior() { if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) { @@ -338,7 +322,6 @@ public function fromEmployeeToSuperior() $this->ctrl->redirect($this, "showStaff"); } - public function confirmRemoveUser($cmd) { if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) { @@ -381,7 +364,6 @@ public function confirmRemoveUser($cmd) $this->tpl->setContent($confirm->getHTML()); } - public function removeFromSuperiors() { if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) { @@ -397,7 +379,6 @@ public function removeFromSuperiors() $this->ctrl->redirect($this, "showStaff"); } - public function removeFromEmployees() { if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) { @@ -413,7 +394,6 @@ public function removeFromEmployees() $this->ctrl->redirect($this, "showStaff"); } - public function removeFromRole() { if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) { @@ -426,15 +406,20 @@ public function removeFromRole() $this->ctrl->redirect($this, "showOtherRoles"); } - public function setTabs() { - $this->tabs_gui->addSubTab("show_staff", sprintf($this->lng->txt("local_staff"), $this->parent_object->getTitle()), $this->ctrl->getLinkTarget($this, "showStaff")); + $this->tabs_gui->addSubTab("show_staff", + sprintf($this->lng->txt("local_staff"), $this->parent_object->getTitle()), + $this->ctrl->getLinkTarget($this, "showStaff")); if ($this->ilAccess->checkAccess("view_learning_progress_rec", "", $this->parent_object->getRefId())) { - $this->tabs_gui->addSubTab("show_staff_rec", sprintf($this->lng->txt("rec_staff"), $this->parent_object->getTitle()), $this->ctrl->getLinkTarget($this, "showStaffRec")); + $this->tabs_gui->addSubTab("show_staff_rec", + sprintf($this->lng->txt("rec_staff"), $this->parent_object->getTitle()), + $this->ctrl->getLinkTarget($this, "showStaffRec")); } if ($this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) { - $this->tabs_gui->addSubTab("show_other_roles", sprintf($this->lng->txt("local_other_roles"), $this->parent_object->getTitle()), $this->ctrl->getLinkTarget($this, "showOtherRoles")); + $this->tabs_gui->addSubTab("show_other_roles", + sprintf($this->lng->txt("local_other_roles"), $this->parent_object->getTitle()), + $this->ctrl->getLinkTarget($this, "showOtherRoles")); } } } diff --git a/Modules/OrgUnit/classes/Staff/class.ilOrgUnitStaffTableGUI.php b/Modules/OrgUnit/classes/Staff/class.ilOrgUnitStaffTableGUI.php index f73ff17df961..1adba2920b99 100644 --- a/Modules/OrgUnit/classes/Staff/class.ilOrgUnitStaffTableGUI.php +++ b/Modules/OrgUnit/classes/Staff/class.ilOrgUnitStaffTableGUI.php @@ -3,10 +3,8 @@ /** * Class ilOrgUnitStaffTableGUI - * * @author Oskar Truffer * @author Martin Studer - * */ class ilOrgUnitStaffTableGUI extends ilTable2GUI { @@ -16,9 +14,13 @@ class ilOrgUnitStaffTableGUI extends ilTable2GUI /** @var string "employee" | "superior" */ private $staff = "employee"; - - public function __construct($parent_obj, $parent_cmd, $staff = "employee", $recursive = false, $template_context = "") - { + public function __construct( + $parent_obj, + $parent_cmd, + $staff = "employee", + $recursive = false, + $template_context = "" + ) { global $DIC; $lng = $DIC['lng']; $ilCtrl = $DIC['ilCtrl']; @@ -52,7 +54,6 @@ public function __construct($parent_obj, $parent_cmd, $staff = "employee", $recu $this->setRowTemplate("tpl.staff_row.html", "Modules/OrgUnit"); } - protected function setTableHeaders() { $this->addColumn($this->lng->txt("firstname"), "first_name"); @@ -63,7 +64,6 @@ protected function setTableHeaders() $this->addColumn($this->lng->txt("action")); } - public function parseData() { if ($this->staff == "employee") { @@ -77,7 +77,6 @@ public function parseData() $this->setData($data); } - protected function parseRows($user_ids) { $data = array(); @@ -90,7 +89,6 @@ protected function parseRows($user_ids) return $data; } - /** * @param string $staff Set this variable either to "employee" or "superior". It's employee by default. */ @@ -99,7 +97,6 @@ public function setStaff($staff) $this->staff = $staff; } - /** * @return string */ @@ -108,7 +105,6 @@ public function getStaff() return $this->staff; } - protected function setRowForUser(&$set, $user_id) { $user = new ilObjUser($user_id); @@ -121,7 +117,6 @@ protected function setRowForUser(&$set, $user_id) } } - public function fillRow(array $a_set) : void { global $DIC; @@ -141,13 +136,17 @@ public function fillRow(array $a_set) : void $selection->setListTitle($lng->txt("Actions")); $selection->setId("selection_list_user_lp_" . $a_set["user_id"]); - if ($ilAccess->checkAccess("view_learning_progress", "", $_GET["ref_id"]) and ilObjUserTracking::_enabledLearningProgress() and + if ($ilAccess->checkAccess("view_learning_progress", "", + $_GET["ref_id"]) and ilObjUserTracking::_enabledLearningProgress() and ilObjUserTracking::_enabledUserRelatedData() ) { $selection->addItem( $lng->txt("show_learning_progress"), "show_learning_progress", - $this->ctrl->getLinkTargetByClass(array("ilAdministrationGUI", "ilObjOrgUnitGUI", "ilLearningProgressGUI"), "") + $this->ctrl->getLinkTargetByClass(array("ilAdministrationGUI", + "ilObjOrgUnitGUI", + "ilLearningProgressGUI" + ), "") ); } if ($ilAccess->checkAccess("write", "", $_GET["ref_id"]) && !$this->recursive) { @@ -161,27 +160,28 @@ public function fillRow(array $a_set) : void $this->tpl->setVariable("ACTIONS", $selection->getHTML()); } - /** * @param $selection ilAdvancedSelectionListGUI */ protected function addEmployeeActions(&$selection) { - $selection->addItem($this->lng->txt("remove"), "delete_from_employees", $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", "confirmRemoveFromEmployees")); - $selection->addItem($this->lng->txt("change_to_superior"), "change_to_superior", $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", "fromEmployeeToSuperior")); + $selection->addItem($this->lng->txt("remove"), "delete_from_employees", + $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", "confirmRemoveFromEmployees")); + $selection->addItem($this->lng->txt("change_to_superior"), "change_to_superior", + $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", "fromEmployeeToSuperior")); } - /** * @param $selection ilAdvancedSelectionListGUI */ protected function addSuperiorActions(&$selection) { - $selection->addItem($this->lng->txt("remove"), "delete_from_superiors", $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", "confirmRemoveFromSuperiors")); - $selection->addItem($this->lng->txt("change_to_employee"), "change_to_employee", $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", "fromSuperiorToEmployee")); + $selection->addItem($this->lng->txt("remove"), "delete_from_superiors", + $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", "confirmRemoveFromSuperiors")); + $selection->addItem($this->lng->txt("change_to_employee"), "change_to_employee", + $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", "fromSuperiorToEmployee")); } - /** * @param $recursive bool show direct members of this org unit or the sub-units as well? */ diff --git a/Modules/OrgUnit/classes/Translation/class.ilTranslationGUI.php b/Modules/OrgUnit/classes/Translation/class.ilTranslationGUI.php index b4b8defc92ef..02e382204838 100644 --- a/Modules/OrgUnit/classes/Translation/class.ilTranslationGUI.php +++ b/Modules/OrgUnit/classes/Translation/class.ilTranslationGUI.php @@ -3,12 +3,9 @@ /** * Class ilTranslationGUI - * * Based on methods of ilObjCategoryGUI - * * @author Oskar Truffer * @author Martin Studer - * */ class ilTranslationGUI { @@ -38,7 +35,6 @@ class ilTranslationGUI */ protected $ilObjectOrgUnit; - public function __construct(ilObjOrgUnitGUI $ilObjOrgUnitGUI) { global $DIC; @@ -66,14 +62,12 @@ public function __construct(ilObjOrgUnitGUI $ilObjOrgUnitGUI) } } - public function executeCommand() { $cmd = $this->ctrl->getCmd(); $this->$cmd(); } - public function editTranslations($a_get_post_values = false, $a_add = false) { $this->lng->loadLanguageModule($this->ilObjectOrgUnit->getType()); @@ -105,7 +99,6 @@ public function editTranslations($a_get_post_values = false, $a_add = false) $this->tpl->setContent($table->getHTML()); } - /** * Save title and translations */ @@ -142,14 +135,14 @@ public function saveTranslations() ilUtil::stripSlashes($v), ilUtil::stripSlashes($_POST["desc"][$k]), ilUtil::stripSlashes($_POST["lang"][$k]), - ($_POST["default"] == $k)?1:0 + ($_POST["default"] == $k) ? 1 : 0 ); } else { $this->ilObjectOrgUnit->addTranslation( ilUtil::stripSlashes($v), ilUtil::stripSlashes($_POST["desc"][$k]), ilUtil::stripSlashes($_POST["lang"][$k]), - ($_POST["default"] == $k)?1:0 + ($_POST["default"] == $k) ? 1 : 0 ); } } @@ -158,7 +151,6 @@ public function saveTranslations() $this->ctrl->redirect($this, "editTranslations"); } - /** * Add a translation */ @@ -174,7 +166,6 @@ public function addTranslation() } } - /** * Remove translation */ diff --git a/Modules/OrgUnit/classes/Types/class.ilOrgUnitType.php b/Modules/OrgUnit/classes/Types/class.ilOrgUnitType.php index 89722f591913..31f540645f77 100644 --- a/Modules/OrgUnit/classes/Types/class.ilOrgUnitType.php +++ b/Modules/OrgUnit/classes/Types/class.ilOrgUnitType.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitType - * * @author : Stefan Wanzenried * @author Fabian Schmid */ @@ -79,17 +78,14 @@ class ilOrgUnitType protected $lng; /** * Object cache - * * @var array */ protected static $instances = array(); protected ilComponentFactory $component_factory; - /** * @param int $a_id - * * @throws ilOrgUnitTypeException */ public function __construct($a_id = 0) @@ -117,9 +113,7 @@ public function __construct($a_id = 0) /** * Get instance of an ilOrgUnitType object * Returns object from cache or from database, returns null if no object was found - * * @param int $a_id ID of the OrgUnit type - * * @return ilOrgUnitType|null */ public static function getInstance($a_id) @@ -141,10 +135,8 @@ public static function getInstance($a_id) } } - /** * Get array of all instances of ilOrgUnitType objects - * * @return array */ public static function getAllTypes() @@ -163,10 +155,8 @@ public static function getAllTypes() return $types; } - /** * Create object in database. Also invokes creating of translation objects. - * * @throws ilOrgUnitTypeException */ public function create() @@ -195,10 +185,8 @@ public function create() } } - /** * Update changes to database - * * @throws ilOrgUnitTypePluginException * @throws ilOrgUnitTypeException */ @@ -239,10 +227,8 @@ public function update() } } - /** * Wrapper around create() and update() methods. - * * @throws ilOrgUnitTypePluginException */ public function save() @@ -254,11 +240,9 @@ public function save() } } - /** * Delete object by removing all database entries. * Deletion is only possible if this type is not assigned to any OrgUnit and if no plugin disallowed deletion process. - * * @throws ilOrgUnitTypeException */ public function delete() @@ -270,7 +254,8 @@ public function delete() foreach ($orgus as $orgu) { $titles[] = $orgu->getTitle(); } - throw new ilOrgUnitTypeException(sprintf($this->lng->txt('orgu_type_msg_unable_delete'), implode(', ', $titles))); + throw new ilOrgUnitTypeException(sprintf($this->lng->txt('orgu_type_msg_unable_delete'), + implode(', ', $titles))); } $disallowed = array(); @@ -313,14 +298,11 @@ public function delete() $this->db->manipulate($sql); } - /** * Get the title of an OrgUnit type. If no language code is given, a translation in the user-language is * returned. If no such translation exists, the translation of the default language is substituted. * If a language code is provided, returns title for the given language or null. - * * @param string $a_lang_code - * * @return null|string */ public function getTitle($a_lang_code = '') @@ -328,11 +310,9 @@ public function getTitle($a_lang_code = '') return $this->getTranslation('title', $a_lang_code); } - /** * Set title of OrgUnit type. * If no lang code is given, sets title for default language. - * * @param $a_title * @param string $a_lang_code */ @@ -342,14 +322,11 @@ public function setTitle($a_title, $a_lang_code = '') $this->setTranslation('title', $a_title, $lang); } - /** * Get the description of an OrgUnit type. If no language code is given, a translation in the user-language is * returned. If no such translation exists, the description of the default language is substituted. * If a language code is provided, returns description for the given language or null. - * * @param string $a_lang_code - * * @return null|string */ public function getDescription($a_lang_code = '') @@ -357,11 +334,9 @@ public function getDescription($a_lang_code = '') return $this->getTranslation('description', $a_lang_code); } - /** * Set description of OrgUnit type. * If no lang code is given, sets description for default language. - * * @param $a_description * @param string $a_lang_code */ @@ -371,12 +346,9 @@ public function setDescription($a_description, $a_lang_code = '') $this->setTranslation('description', $a_description, $lang); } - /** * Get an array of IDs of ilObjOrgUnit objects using this type - * * @param bool $include_deleted - * * @return array */ public function getOrgUnitIds($include_deleted = true) @@ -401,12 +373,9 @@ public function getOrgUnitIds($include_deleted = true) return $this->orgus_ids[$cache_key]; } - /** * Get an array of ilObjOrgUnit objects using this type - * * @param bool $include_deleted True if also deleted OrgUnits are returned - * * @return array */ public function getOrgUnits($include_deleted = true) @@ -434,12 +403,9 @@ public function getOrgUnits($include_deleted = true) return $this->orgus[$cache_key]; } - /** * Get assigned AdvancedMDRecord objects - * * @param bool $a_only_active True if only active AMDRecords are returned - * * @return array */ public function getAssignedAdvancedMDRecords($a_only_active = false) @@ -465,12 +431,9 @@ public function getAssignedAdvancedMDRecords($a_only_active = false) return $this->amd_records_assigned[$active]; } - /** * Get IDs of assigned AdvancedMDRecord objects - * * @param bool $a_only_active True if only IDs of active AMDRecords are returned - * * @return array */ public function getAssignedAdvancedMDRecordIds($a_only_active = false) @@ -484,10 +447,8 @@ public function getAssignedAdvancedMDRecordIds($a_only_active = false) return $ids; } - /** * Get all available AdvancedMDRecord objects for OrgUnits/Types - * * @return array */ public static function getAvailableAdvancedMDRecords() @@ -500,10 +461,8 @@ public static function getAvailableAdvancedMDRecords() return self::$amd_records_available; } - /** * Get IDs of all available AdvancedMDRecord objects for OrgUnit/Types - * * @return array */ public static function getAvailableAdvancedMDRecordIds() @@ -517,14 +476,11 @@ public static function getAvailableAdvancedMDRecordIds() return $ids; } - /** * Assign a given AdvancedMDRecord to this type. * If the AMDRecord is already assigned, nothing is done. If the AMDRecord cannot be assigned to OrgUnits/Types, * an Exception is thrown. Otherwise the AMDRecord is assigned (relation gets stored in DB). - * * @param int $a_record_id - * * @throws ilOrgUnitTypePluginException * @throws ilOrgUnitTypeException */ @@ -561,12 +517,9 @@ public function assignAdvancedMDRecord($a_record_id) } } - /** * Deassign a given AdvancedMD record from this type. - * * @param int $a_record_id - * * @throws ilOrgUnitTypePluginException */ public function deassignAdvancedMdRecord($a_record_id) @@ -600,12 +553,9 @@ public function deassignAdvancedMdRecord($a_record_id) } } - /** * Resize and store an icon file for this object - * * @param array $file_data The array containing file information from the icon from PHPs $_FILES array - * * @return bool */ public function processAndStoreIconFile(array $file_data) @@ -626,7 +576,6 @@ public function processAndStoreIconFile(array $file_data) return $return; } - /** * Remove the icon file on disk */ @@ -648,10 +597,8 @@ public function removeIconFile() /** * Helper method to return a translation for a given member and language - * * @param $a_member * @param $a_lang_code - * * @return null|string */ protected function getTranslation($a_member, $a_lang_code) @@ -681,14 +628,11 @@ protected function getTranslation($a_member, $a_lang_code) } } - /** * Helper method to set a translation for a given member and language - * * @param string $a_member * @param string $a_value * @param string $a_lang_code - * * @throws ilOrgUnitTypePluginException */ protected function setTranslation($a_member, $a_value, $a_lang_code) @@ -743,10 +687,8 @@ protected function setTranslation($a_member, $a_value, $a_lang_code) } } - /** * Get array of all acitve plugins for the ilOrgUnitTypeHook plugin slot - * * @return array */ protected function getActivePlugins() @@ -754,13 +696,10 @@ protected function getActivePlugins() return $this->component_factory->getActivePluginsForSlot("orgutypehk"); } - /** * Helper function to load a translation. * Returns translation object from cache or null, if no translation exists for the given code. - * * @param string $a_lang_code A language code - * * @return ilOrgUnitTypeTranslation|null */ protected function loadTranslation($a_lang_code) @@ -779,10 +718,8 @@ protected function loadTranslation($a_lang_code) return null; } - /** * Read object data from database - * * @throws ilOrgUnitTypeException */ protected function read() @@ -800,10 +737,8 @@ protected function read() $this->setIcon($rec->icon); } - /** * Helper function to check if this type can be updated - * * @return bool */ protected function updateable() @@ -830,10 +765,8 @@ public function setTranslations($translations) $this->translations = $translations; } - /** * Returns the loaded translation objects - * * @return array */ public function getTranslations() @@ -841,10 +774,8 @@ public function getTranslations() return $this->translations; } - /** * Returns all existing translation objects - * * @return array */ public function getAllTranslations() @@ -858,7 +789,6 @@ public function getAllTranslations() return $this->translations; } - /** * @param int $owner */ @@ -867,7 +797,6 @@ public function setOwner($owner) $this->owner = $owner; } - /** * @return int */ @@ -876,7 +805,6 @@ public function getOwner() return $this->owner; } - /** * @param string $last_update */ @@ -885,7 +813,6 @@ public function setLastUpdate($last_update) $this->last_update = $last_update; } - /** * @return string */ @@ -894,7 +821,6 @@ public function getLastUpdate() return $this->last_update; } - /** * @return int */ @@ -903,17 +829,12 @@ public function getId() return $this->id; } - /** * Set new Icon filename. - * * Note that if you did also send a new icon image file with a form, make sure to call * ilOrgUnitType::processAndStoreIconFile() to store the file additionally on disk. - * * If you want to delete the icon, set call ilOrgUnitType::removeIconFile() first and set an empty string here. - * * @param string $icon - * * @throws ilOrgUnitTypeException */ public function setIcon($icon) @@ -924,7 +845,6 @@ public function setIcon($icon) $this->icon = $icon; } - /** * @return string */ @@ -933,12 +853,9 @@ public function getIcon() return $this->icon; } - /** * Return the path to the icon - * * @param bool $append_filename If true, append filename of icon - * * @return string */ public function getIconPath($append_filename = false) @@ -951,10 +868,8 @@ public function getIconPath($append_filename = false) return $path; } - /** * @param string $default_lang - * * @throws ilOrgUnitTypePluginException */ public function setDefaultLang($default_lang) @@ -975,14 +890,14 @@ public function setDefaultLang($default_lang) } } if (count($disallowed)) { - $msg = sprintf($this->lng->txt('orgu_type_msg_setting_default_lang_prevented'), $default_lang, implode(', ', $titles)); + $msg = sprintf($this->lng->txt('orgu_type_msg_setting_default_lang_prevented'), $default_lang, + implode(', ', $titles)); throw new ilOrgUnitTypePluginException($msg, $disallowed); } $this->default_lang = $default_lang; } - /** * @return string */ @@ -991,7 +906,6 @@ public function getDefaultLang() return $this->default_lang; } - /** * @param string $create_date */ @@ -1000,7 +914,6 @@ public function setCreateDate($create_date) $this->create_date = $create_date; } - /** * @return string */ diff --git a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeAdvancedMetaDataFormGUI.php b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeAdvancedMetaDataFormGUI.php index 0ec7456acd0a..616bc2cfdd9d 100644 --- a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeAdvancedMetaDataFormGUI.php +++ b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeAdvancedMetaDataFormGUI.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitTypeAdvancedMetaDataFormGUI - * * @author Stefan Wanzenried */ class ilOrgUnitTypeAdvancedMetaDataFormGUI extends ilPropertyFormGUI @@ -17,7 +16,6 @@ class ilOrgUnitTypeAdvancedMetaDataFormGUI extends ilPropertyFormGUI */ protected $parent_gui; - public function __construct($parent_gui, ilOrgUnitType $type) { global $DIC; @@ -33,10 +31,8 @@ public function __construct($parent_gui, ilOrgUnitType $type) $this->initForm(); } - /** * Save object (create or update) - * * @return bool */ public function saveObject() @@ -48,7 +44,6 @@ public function saveObject() return true; } - /** * Add all fields to the form */ @@ -74,10 +69,8 @@ protected function initForm() $this->addCommandButton('updateAMD', $this->lng->txt('save')); } - /** * Check validity of form and pass values from form to object - * * @return bool */ protected function fillObject() diff --git a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeCustomIconsFormGUI.php b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeCustomIconsFormGUI.php index 0c16f325c2a6..03014abef491 100644 --- a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeCustomIconsFormGUI.php +++ b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeCustomIconsFormGUI.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitTypeFormGUI - * * @author Stefan Wanzenried * @author Fabian Schmid */ @@ -18,7 +17,6 @@ class ilOrgUnitTypeCustomIconsFormGUI extends ilPropertyFormGUI */ protected $parent_gui; - /** * @param $parent_gui * @param ilOrgUnitType $type @@ -39,10 +37,8 @@ public function __construct($parent_gui, ilOrgUnitType $type) $this->initForm(); } - /** * Save object (create or update) - * * @return bool */ public function saveObject() @@ -61,7 +57,6 @@ public function saveObject() } } - /** * Add all fields to the form */ @@ -79,10 +74,8 @@ protected function initForm() $this->addCommandButton('updateCustomIcons', $this->lng->txt('save')); } - /** * Check validity of form and pass values from form to object - * * @return bool */ protected function fillObject() diff --git a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeFormGUI.php b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeFormGUI.php index cadd51e86463..3a5329b07f65 100644 --- a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeFormGUI.php +++ b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeFormGUI.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitTypeFormGUI - * * @author Stefan Wanzenried */ class ilOrgUnitTypeFormGUI extends ilPropertyFormGUI @@ -17,7 +16,6 @@ class ilOrgUnitTypeFormGUI extends ilPropertyFormGUI */ protected $parent_gui; - public function __construct($parent_gui, ilOrgUnitType $type) { global $DIC; @@ -33,10 +31,8 @@ public function __construct($parent_gui, ilOrgUnitType $type) $this->initForm(); } - /** * Save object (create or update) - * * @return bool */ public function saveObject() @@ -55,7 +51,6 @@ public function saveObject() } } - /** * Add all fields to the form */ @@ -86,10 +81,8 @@ protected function initForm() } } - /** * Check validity of form and pass values from form to object - * * @return bool */ protected function fillObject() @@ -116,10 +109,8 @@ protected function fillObject() return $success; } - /** * Add a text and textarea input per language - * * @param $a_lang_code */ protected function addTranslationInputs($a_lang_code) diff --git a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeGUI.php b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeGUI.php index 864e5706c47f..2dd8bfe03cb7 100644 --- a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeGUI.php +++ b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeGUI.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitTypeGUI - * * @author Stefan Wanzenried * @author Fabian Schmid */ @@ -50,7 +49,6 @@ class ilOrgUnitTypeGUI */ protected $parent_gui; - /** * @param ilObjOrgUnitGUI $parent_gui */ @@ -83,7 +81,6 @@ public function __construct(ilObjOrgUnitGUI $parent_gui) $this->checkAccess(); } - public function executeCommand() { $cmd = $this->ctrl->getCmd(); @@ -133,7 +130,6 @@ public function executeCommand() } } - /** * Check if user can edit types */ @@ -145,7 +141,6 @@ protected function checkAccess() } } - /** * Add subtabs for editing type */ @@ -153,7 +148,8 @@ protected function setSubTabsEdit($active_tab_id) { $this->tabs->addSubTab('general', $this->lng->txt('meta_general'), $this->ctrl->getLinkTarget($this, 'edit')); if ($this->ilias->getSetting('custom_icons')) { - $this->tabs->addSubTab('custom_icons', $this->lng->txt('icon_settings'), $this->ctrl->getLinkTarget($this, 'editCustomIcons')); + $this->tabs->addSubTab('custom_icons', $this->lng->txt('icon_settings'), + $this->ctrl->getLinkTarget($this, 'editCustomIcons')); } if (count(ilOrgUnitType::getAvailableAdvancedMDRecordIds())) { $this->tabs->addSubTab('amd', $this->lng->txt('md_advanced'), $this->ctrl->getLinkTarget($this, 'editAMD')); @@ -161,7 +157,6 @@ protected function setSubTabsEdit($active_tab_id) $this->tabs->setSubTabActive($active_tab_id); } - /** * Display form for editing custom icons */ @@ -171,7 +166,6 @@ protected function editCustomIcons() $this->tpl->setContent($form->getHTML()); } - /** * Save icon */ @@ -186,14 +180,12 @@ protected function updateCustomIcons() } } - protected function editAMD() { $form = new ilOrgUnitTypeAdvancedMetaDataFormGUI($this, new ilOrgUnitType((int) $_GET['type_id'])); $this->tpl->setContent($form->getHTML()); } - protected function updateAMD() { $form = new ilOrgUnitTypeAdvancedMetaDataFormGUI($this, new ilOrgUnitType((int) $_GET['type_id'])); @@ -205,7 +197,6 @@ protected function updateAMD() } } - /** * Display all types in a table with actions to edit/delete */ @@ -220,7 +211,6 @@ protected function listTypes() $this->tpl->setContent($table->getHTML()); } - /** * Display form to create a new OrgUnit type */ @@ -230,7 +220,6 @@ protected function add() $this->tpl->setContent($form->getHTML()); } - /** * Display form to edit an existing OrgUnit type */ @@ -241,7 +230,6 @@ protected function edit() $this->tpl->setContent($form->getHTML()); } - /** * Create (save) type */ @@ -256,7 +244,6 @@ protected function create() } } - /** * Update (save) type */ @@ -271,7 +258,6 @@ protected function update() } } - /** * Delete a type */ diff --git a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeHookPlugin.php b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeHookPlugin.php index 182027edb9fa..61a6edb71f26 100644 --- a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeHookPlugin.php +++ b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeHookPlugin.php @@ -2,10 +2,8 @@ /** * Abstract parent class for all OrgUnitTypeHook plugin classes. - * * @author Stefan Wanzenried * @version $Id$ - * * @ingroup ServicesEventHandling */ abstract class ilOrgUnitTypeHookPlugin extends ilPlugin @@ -16,11 +14,9 @@ abstract class ilOrgUnitTypeHookPlugin extends ilPlugin /** * Return false if setting a title is not allowed - * * @param int $a_type_id * @param string $a_lang_code * @param string $a_title - * * @return bool */ public function allowSetTitle($a_type_id, $a_lang_code, $a_title) @@ -28,14 +24,11 @@ public function allowSetTitle($a_type_id, $a_lang_code, $a_title) return true; } - /** * Return false if setting a description is not allowed - * * @param int $a_type_id * @param string $a_lang_code * @param string $a_description - * * @return bool */ public function allowSetDescription($a_type_id, $a_lang_code, $a_description) @@ -43,13 +36,10 @@ public function allowSetDescription($a_type_id, $a_lang_code, $a_description) return true; } - /** * Return false if setting a default language is not allowed - * * @param int $a_type_id * @param string $a_lang_code - * * @return bool */ public function allowSetDefaultLanguage($a_type_id, $a_lang_code) @@ -57,12 +47,9 @@ public function allowSetDefaultLanguage($a_type_id, $a_lang_code) return true; } - /** * Return false if OrgUnit type cannot be deleted - * * @param int $a_type_id - * * @return bool */ public function allowDelete($a_type_id) @@ -70,12 +57,9 @@ public function allowDelete($a_type_id) return true; } - /** * Return false if OrgUnit type is locked and no updates are possible - * * @param int $a_type_id - * * @return bool */ public function allowUpdate($a_type_id) @@ -83,13 +67,10 @@ public function allowUpdate($a_type_id) return true; } - /** * Return false if an AdvancedMDRecord cannot be assigned to an OrgUnit type - * * @param int $a_type_id * @param int $a_record_id - * * @return bool */ public function allowAssignAdvancedMDRecord($a_type_id, $a_record_id) @@ -97,13 +78,10 @@ public function allowAssignAdvancedMDRecord($a_type_id, $a_record_id) return true; } - /** * Return false if an AdvancedMDRecord cannot be deassigned from an OrgUnit type - * * @param int $a_type_id * @param int $a_record_id - * * @return bool */ public function allowDeassignAdvancedMDRecord($a_type_id, $a_record_id) diff --git a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeTableGUI.php b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeTableGUI.php index b584a06f687e..ae045ee424dd 100644 --- a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeTableGUI.php +++ b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeTableGUI.php @@ -18,7 +18,6 @@ class ilOrgUnitTypeTableGUI extends ilTable2GUI 'icon', ); - public function __construct($parent_obj, $parent_cmd) { global $DIC; @@ -38,7 +37,6 @@ public function __construct($parent_obj, $parent_cmd) $this->setFormAction($this->ctrl->getFormAction($this->parent_obj)); } - /** * Pass data to row template * @param array $a_set @@ -53,12 +51,13 @@ public function fillRow(array $a_set) : void $selection = new ilAdvancedSelectionListGUI(); $selection->setListTitle($this->lng->txt('Actions')); $selection->setId('action_orgu_type' . $a_set['id']); - $selection->addItem($this->lng->txt('edit'), 'edit', $this->ctrl->getLinkTargetByClass('ilorgunittypegui', 'edit')); - $selection->addItem($this->lng->txt('delete'), 'delete', $this->ctrl->getLinkTargetByClass('ilorgunittypegui', 'delete')); + $selection->addItem($this->lng->txt('edit'), 'edit', + $this->ctrl->getLinkTargetByClass('ilorgunittypegui', 'edit')); + $selection->addItem($this->lng->txt('delete'), 'delete', + $this->ctrl->getLinkTargetByClass('ilorgunittypegui', 'delete')); $this->tpl->setVariable('ACTIONS', $selection->getHTML()); } - /** * Add columns */ @@ -69,7 +68,6 @@ protected function initColumns() } } - /** * Build and set data for table. */ diff --git a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeTranslation.php b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeTranslation.php index e3c1d2d04c89..7d56ecc4d023 100644 --- a/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeTranslation.php +++ b/Modules/OrgUnit/classes/Types/class.ilOrgUnitTypeTranslation.php @@ -3,7 +3,6 @@ /** * Class ilOrgUnitTypeTranslation * This class represents a translation for a given ilOrgUnit object and language. - * * @author: Stefan Wanzenried */ class ilOrgUnitTypeTranslation @@ -42,7 +41,6 @@ class ilOrgUnitTypeTranslation */ protected static $instances = array(); - public function __construct($a_org_type_id = 0, $a_lang_code = '') { global $DIC; @@ -65,10 +63,8 @@ public function __construct($a_org_type_id = 0, $a_lang_code = '') /** * Get instance of an ilOrgUnitType object * Returns object from cache or from database, returns null if no object was found - * * @param int $a_orgu_type_id ID of an ilOrgUnitType object * @param string $a_lang_code Language code - * * @return ilOrgUnitTypeTranslation|null */ public static function getInstance($a_orgu_type_id, $a_lang_code) @@ -91,12 +87,9 @@ public static function getInstance($a_orgu_type_id, $a_lang_code) } } - /** * Get all translation objects for a given OrgUnit type ID - * * @param int $a_orgu_type_id - * * @return array */ public static function getAllTranslations($a_orgu_type_id) @@ -104,7 +97,8 @@ public static function getAllTranslations($a_orgu_type_id) global $DIC; $ilDB = $DIC['ilDB']; /** @var ilDB $ilDB */ - $sql = 'SELECT DISTINCT lang FROM ' . self::TABLE_NAME . ' WHERE orgu_type_id = ' . $ilDB->quote($a_orgu_type_id, 'integer'); + $sql = 'SELECT DISTINCT lang FROM ' . self::TABLE_NAME . ' WHERE orgu_type_id = ' . $ilDB->quote($a_orgu_type_id, + 'integer'); $set = $ilDB->query($sql); $objects = array(); while ($rec = $ilDB->fetchObject($set)) { @@ -117,16 +111,13 @@ public static function getAllTranslations($a_orgu_type_id) return $objects; } - /** * Checks if there exists a translation for a given member/value/lang triple * for any other OrgUnit than the OrgUnit ID provided. - * * @param int $a_orgu_type_id * @param string $a_member * @param string $a_value * @param string $a_lang - * * @return bool */ public static function exists($a_orgu_type_id, $a_member, $a_lang, $a_value) @@ -144,12 +135,9 @@ public static function exists($a_orgu_type_id, $a_member, $a_lang, $a_value) return ($ilDB->numRows($set)) ? true : false; } - /** * Get translated value for a member, returns null if no translation exists. - * * @param string $a_member Name of the variable, e.g. title,description - * * @return string|null */ public function getMember($a_member) @@ -157,10 +145,8 @@ public function getMember($a_member) return (isset($this->members[$a_member])) ? (string) $this->members[$a_member] : null; } - /** * Set translation value for a member, either update or add value - * * @param string $a_member Name of the variable, e.g. title,description * @param string $a_value Value of the translation */ @@ -171,7 +157,6 @@ public function setMember($a_member, $a_value) $this->trackChange($a_member, $is_new); } - /** * Insert all translated member into database */ @@ -183,7 +168,6 @@ public function create() $this->resetTrackChanges(); } - /** * Update translations in database. Newly added members are inserted. */ @@ -200,21 +184,19 @@ public function update() $this->resetTrackChanges(); } - /** * Delete object */ public function delete() { - $sql = 'DELETE FROM ' . self::TABLE_NAME . ' WHERE orgu_type_id = ' . $this->db->quote($this->getOrguTypeId(), 'integer') . + $sql = 'DELETE FROM ' . self::TABLE_NAME . ' WHERE orgu_type_id = ' . $this->db->quote($this->getOrguTypeId(), + 'integer') . ' AND lang = ' . $this->db->quote($this->getLang(), 'text'); $this->db->manipulate($sql); } - /** * Delete every translation existing for a given OrgUnit type id - * * @param $a_orgu_type_id */ public static function deleteAllTranslations($a_orgu_type_id) @@ -233,7 +215,6 @@ public static function deleteAllTranslations($a_orgu_type_id) /** * Insert a (member,value) pair in database - * * @param $member * @param $value */ @@ -247,10 +228,8 @@ protected function insertMember($member, $value) )); } - /** * Update a (member,value) pair in database - * * @param $member * @param $value */ @@ -265,10 +244,8 @@ protected function updateMember($member, $value) )); } - /** * Track a member that was either updated or added - * * @param string $a_member Name of a variable, e.g. title,description * @param bool $is_new True if the member did not exist before */ @@ -282,7 +259,6 @@ protected function trackChange($a_member, $is_new) } } - /** * Reset tracked members */ @@ -292,15 +268,14 @@ protected function resetTrackChanges() $this->members_new = array(); } - /** * Read object data from database - * * @throws ilOrgUnitTypeException */ protected function read() { - $sql = 'SELECT * FROM ' . self::TABLE_NAME . ' WHERE orgu_type_id = ' . $this->db->quote($this->orgu_type_id, 'integer') . + $sql = 'SELECT * FROM ' . self::TABLE_NAME . ' WHERE orgu_type_id = ' . $this->db->quote($this->orgu_type_id, + 'integer') . ' AND lang = ' . $this->db->quote($this->lang, 'text'); $set = $this->db->query($sql); if (!$this->db->numRows($set)) { @@ -324,7 +299,6 @@ public function setLang($lang) $this->lang = $lang; } - /** * @return string */ @@ -333,7 +307,6 @@ public function getLang() return $this->lang; } - /** * @return array */ @@ -342,7 +315,6 @@ public function getMembers() return $this->members; } - /** * @return int */ @@ -351,7 +323,6 @@ public function getOrguTypeId() return $this->orgu_type_id; } - /** * @param int $id */ diff --git a/Modules/OrgUnit/classes/User/class.ilOrgUnitUser.php b/Modules/OrgUnit/classes/User/class.ilOrgUnitUser.php index f78fb21f1488..e91275f47b53 100644 --- a/Modules/OrgUnit/classes/User/class.ilOrgUnitUser.php +++ b/Modules/OrgUnit/classes/User/class.ilOrgUnitUser.php @@ -36,10 +36,8 @@ class ilOrgUnitUser */ protected $superiors = []; - /** * @param int $user_id - * * @return ilOrgUnitUser */ public static function getInstanceById(int $user_id) : self @@ -52,12 +50,10 @@ public static function getInstanceById(int $user_id) : self return static::$instances[$user_id]; } - /** * @param int $user_id * @param string $login * @param string $email - * * @return ilOrgUnitUser */ public static function getInstance(int $user_id, string $login, string $email, string $second_email) : self @@ -69,7 +65,6 @@ public static function getInstance(int $user_id, string $login, string $email, s return static::$instances[$user_id]; } - private function __construct(int $user_id, string $login, string $email, string $second_email) { $this->user_id = $user_id; @@ -78,7 +73,6 @@ private function __construct(int $user_id, string $login, string $email, string $this->second_email = $second_email; } - /** * @param ilOrgUnitUser $org_unit_user */ @@ -87,7 +81,6 @@ public function addSuperior(ilOrgUnitUser $org_unit_user) $this->superiors[] = $org_unit_user; } - /** * @param ilOrgUnitPosition $org_unit_position */ @@ -96,10 +89,8 @@ public function addPositions(ilOrgUnitPosition $org_unit_position) $this->org_unit_positions[] = $org_unit_position; } - /** * @return ilOrgUnitUser[] - * * eager loading * @var array ilOrgUnitUser */ @@ -112,17 +103,14 @@ public function getSuperiors() : array return $this->superiors; } - public function loadSuperiors() : void { $org_unit_user_repository = new ilOrgUnitUserRepository(); $org_unit_user_repository->loadSuperiors([$this->user_id]); } - /** * @return ilOrgUnitPosition[] - * * eager loading */ public function getOrgUnitPositions() : array @@ -134,10 +122,8 @@ public function getOrgUnitPositions() : array return $this->org_unit_positions; } - /** * @return ilOrgUnitPosition[] - * * eager loading */ protected function loadOrgUnitPositions() : array @@ -146,7 +132,6 @@ protected function loadOrgUnitPositions() : array $org_unit_user_repository->loadPositions([$this->user_id]); } - /** * @return int */ @@ -155,7 +140,6 @@ public function getUserId() : int return $this->user_id; } - /** * @return string */ @@ -164,7 +148,6 @@ public function getLogin() : string return $this->login; } - /** * @return string */ @@ -173,7 +156,6 @@ public function getEmail() : string return $this->email; } - /** * @return string */ @@ -182,7 +164,6 @@ public function getSecondEmail() : string return $this->second_email; } - /** * @param string $second_email */ diff --git a/Modules/OrgUnit/classes/User/class.ilOrgUnitUserQueries.php b/Modules/OrgUnit/classes/User/class.ilOrgUnitUserQueries.php index 7080263b2289..7fdc847eaac6 100644 --- a/Modules/OrgUnit/classes/User/class.ilOrgUnitUserQueries.php +++ b/Modules/OrgUnit/classes/User/class.ilOrgUnitUserQueries.php @@ -1,7 +1,6 @@ */ @@ -13,7 +12,6 @@ class ilOrgUnitUserQueries implements ilOrgUnitUserQueriesInterface */ protected $dic; - /** * ilOrgUnitUserQueries constructor. */ @@ -23,7 +21,6 @@ public function __construct() $this->dic = $DIC; } - /** * @inheritdoc */ @@ -39,7 +36,6 @@ public function findAllUsersByUserIds($user_ids) return $users; } - /** * @inheritdoc */ diff --git a/Modules/OrgUnit/classes/User/class.ilOrgUnitUserRepository.php b/Modules/OrgUnit/classes/User/class.ilOrgUnitUserRepository.php index c1ff1c8a3caa..b4605a21953d 100644 --- a/Modules/OrgUnit/classes/User/class.ilOrgUnitUserRepository.php +++ b/Modules/OrgUnit/classes/User/class.ilOrgUnitUserRepository.php @@ -7,7 +7,6 @@ /** * Class ilOrgUnitUserRepository - * * @author: Martin Studer */ class ilOrgUnitUserRepository @@ -34,10 +33,8 @@ class ilOrgUnitUserRepository */ protected $with_positions = false; - /** * ilOrgUnitUserRepository constructor. - * */ public function __construct() { @@ -45,7 +42,6 @@ public function __construct() $this->dic = $DIC; } - /** * @return ilOrgUnitUserRepository */ @@ -56,7 +52,6 @@ public function withSuperiors() : ilOrgUnitUserRepository return $this; } - /** * @return ilOrgUnitUserRepository */ @@ -67,10 +62,8 @@ public function withPositions() : ilOrgUnitUserRepository return $this; } - /** * @param array $arr_user_id - * * @return array */ public function getOrgUnitUsers(array $arr_user_id) : array @@ -88,10 +81,8 @@ public function getOrgUnitUsers(array $arr_user_id) : array return $this->orgu_users; } - /** * @param int $user_id - * * @return ilOrgUnitUser|null */ public function getOrgUnitUser(int $user_id) : ?ilOrgUnitUser @@ -109,7 +100,6 @@ public function getOrgUnitUser(int $user_id) : ?ilOrgUnitUser return $this->orgu_users[0]; } - /** * @param array $user_ids */ @@ -122,15 +112,14 @@ public function loadSuperiors(array $user_ids) : void $empl_id_sup_ids = []; while ($data = $DIC->database()->fetchAssoc($st)) { $org_unit_user = ilOrgUnitUser::getInstanceById($data['empl_usr_id']); - $superior = ilOrgUnitUser::getInstance($data['sup_usr_id'], (string) $data['sup_login'], (string) $data['sup_email'], (string) $data['sup_second_email']); + $superior = ilOrgUnitUser::getInstance($data['sup_usr_id'], (string) $data['sup_login'], + (string) $data['sup_email'], (string) $data['sup_second_email']); $org_unit_user->addSuperior($superior); } } - /** * @param array $user_ids - * * @return array */ public function getEmailAdressesOfSuperiors(array $user_ids) : array @@ -147,10 +136,8 @@ public function getEmailAdressesOfSuperiors(array $user_ids) : array return $arr_email_sup; } - /** * @param array $user_ids - * * @return string */ protected function getSuperiorsSql(array $user_ids) : string @@ -178,10 +165,8 @@ protected function getSuperiorsSql(array $user_ids) : string return $sql; } - /** * @param array $user_ids - * * @return array */ public function loadPositions(array $user_ids) : array @@ -202,10 +187,8 @@ public function loadPositions(array $user_ids) : array return $positions; } - /** * @param $user_ids - * * @return array */ private function loadUsersByUserIds(array $user_ids) : array @@ -217,7 +200,8 @@ private function loadUsersByUserIds(array $user_ids) : array $set = $this->dic->database()->query($q); while ($row = $this->dic->database()->fetchAssoc($set)) { - $users[] = ilOrgUnitUser::getInstance($row['usr_id'], (string) $row['login'], (string) $row['email'], (string) $row['second_email']); + $users[] = ilOrgUnitUser::getInstance($row['usr_id'], (string) $row['login'], (string) $row['email'], + (string) $row['second_email']); } return $users; diff --git a/Modules/OrgUnit/classes/Webservices/SOAP/AddUserIdToPositionInOrgUnit.php b/Modules/OrgUnit/classes/Webservices/SOAP/AddUserIdToPositionInOrgUnit.php index 2b57a290b757..05aa37e23e03 100644 --- a/Modules/OrgUnit/classes/Webservices/SOAP/AddUserIdToPositionInOrgUnit.php +++ b/Modules/OrgUnit/classes/Webservices/SOAP/AddUserIdToPositionInOrgUnit.php @@ -8,7 +8,6 @@ /** * Class AddUserIdToPositionInOrgUnit - * * @author Fabian Schmid */ class AddUserIdToPositionInOrgUnit extends Base @@ -16,7 +15,6 @@ class AddUserIdToPositionInOrgUnit extends Base /** * @param array $params - * * @return mixed|void * @throws \ilSoapPluginException */ @@ -37,7 +35,6 @@ protected function run(array $params) } } - /** * @return string */ @@ -46,16 +43,17 @@ public function getName() : string return "addUserToPositionInOrgUnit"; } - /** * @return array */ protected function getAdditionalInputParams() { - return array(self::POSITION_ID => Base::TYPE_INT, self::USR_ID => Base::TYPE_INT, self::ORGU_REF_ID => Base::TYPE_INT); + return array(self::POSITION_ID => Base::TYPE_INT, + self::USR_ID => Base::TYPE_INT, + self::ORGU_REF_ID => Base::TYPE_INT + ); } - /** * @inheritdoc */ @@ -64,7 +62,6 @@ public function getOutputParams() : array return []; } - /** * @inheritdoc */ diff --git a/Modules/OrgUnit/classes/Webservices/SOAP/Base.php b/Modules/OrgUnit/classes/Webservices/SOAP/Base.php index 81f24b2fb4b7..b8670431743f 100644 --- a/Modules/OrgUnit/classes/Webservices/SOAP/Base.php +++ b/Modules/OrgUnit/classes/Webservices/SOAP/Base.php @@ -12,7 +12,6 @@ /** * Class Base - * * @author Fabian Schmid */ abstract class Base extends ilSoapAdministration implements ilSoapMethod @@ -31,7 +30,6 @@ abstract class Base extends ilSoapAdministration implements ilSoapMethod const USR_IDS = 'usr_ids'; const USR_ID = 'usr_id'; - /** * @inheritdoc */ @@ -40,7 +38,6 @@ public function getServiceStyle() : string return 'rpc'; } - /** * @inheritdoc */ @@ -49,14 +46,11 @@ public function getServiceUse() : string return 'encoded'; } - /** * Use this method at the beginning of your execute() method to check if the provided session ID is valid. * This method wraps around ilSoapAdministration::initAuth() and ilSoapAdministration::initILIAS() * which are both required in order to handle the request. - * * @param string $session_id - * * @throws ilSoapPluginException */ protected function initIliasAndCheckSession($session_id) @@ -68,12 +62,9 @@ protected function initIliasAndCheckSession($session_id) } } - /** * Check that all input parameters are present when executing the soap method - * * @param array $params - * * @throws ilSoapPluginException */ protected function checkParameters(array $params) @@ -86,7 +77,6 @@ protected function checkParameters(array $params) } } - /** * @inheritdoc */ @@ -95,13 +85,11 @@ public function getServiceNamespace() : string return 'urn:' . ilOrgUnitSOAPServicesPlugin::PLUGIN_NAME; } - /** * @return array */ abstract protected function getAdditionalInputParams(); - /** * @inheritdoc */ @@ -115,18 +103,14 @@ final public function getInputParams() : array ); } - /** * @param array $params - * * @return mixed */ abstract protected function run(array $params); - /** * @param array $params - * * @return mixed * @throws ilSoapPluginException */ @@ -152,10 +136,8 @@ public function execute(array $params) return $this->run($clean_params); } - /** * @param $message - * * @throws \SoapFault */ protected function error($message) @@ -163,10 +145,8 @@ protected function error($message) throw $this->__raiseError($message, 'ERROR'); } - /** * @param $session_id - * * @throws ilSoapPluginException */ private function init($session_id) diff --git a/Modules/OrgUnit/classes/Webservices/SOAP/EmployeePositionId.php b/Modules/OrgUnit/classes/Webservices/SOAP/EmployeePositionId.php index ee83b5ee0fa3..e144c9b00ce7 100644 --- a/Modules/OrgUnit/classes/Webservices/SOAP/EmployeePositionId.php +++ b/Modules/OrgUnit/classes/Webservices/SOAP/EmployeePositionId.php @@ -6,7 +6,6 @@ /** * Class EmployeePositionId - * * @author Fabian Schmid */ class EmployeePositionId extends Base @@ -14,7 +13,6 @@ class EmployeePositionId extends Base /** * @param array $params - * * @return int */ protected function run(array $params) @@ -22,7 +20,6 @@ protected function run(array $params) return ilOrgUnitPosition::getCorePositionId(ilOrgUnitPosition::CORE_POSITION_EMPLOYEE); } - /** * @return string */ @@ -31,7 +28,6 @@ public function getName() : string return "getEmployeePositionId"; } - /** * @return array */ @@ -40,7 +36,6 @@ protected function getAdditionalInputParams() return array(); } - /** * @inheritdoc */ @@ -49,7 +44,6 @@ public function getOutputParams() : array return array('position_id' => Base::TYPE_INT); } - /** * @inheritdoc */ diff --git a/Modules/OrgUnit/classes/Webservices/SOAP/ImportOrgUnitTree.php b/Modules/OrgUnit/classes/Webservices/SOAP/ImportOrgUnitTree.php index c2e2a83e88a7..d346403768f1 100644 --- a/Modules/OrgUnit/classes/Webservices/SOAP/ImportOrgUnitTree.php +++ b/Modules/OrgUnit/classes/Webservices/SOAP/ImportOrgUnitTree.php @@ -6,17 +6,14 @@ /** * Class ImportOrgUnitTree - * * @author Martin Studer ms@studer-raimann.ch */ class ImportOrgUnitTree extends Base { const ORG_UNIT_TREE = 'OrgUnitTree'; - /** * @param array $params - * * @return void * @throws \ilSoapPluginException */ @@ -56,7 +53,6 @@ protected function run(array $params) : void } } - /** * @return string */ @@ -65,7 +61,6 @@ public function getName() : string return "importOrgUnitsSimpleXML"; } - /** * @return array */ @@ -74,7 +69,6 @@ protected function getAdditionalInputParams() return array(self::ORG_UNIT_TREE => Base::TYPE_STRING); } - /** * @inheritdoc */ @@ -83,7 +77,6 @@ public function getOutputParams() : array return []; } - /** * @inheritdoc */ diff --git a/Modules/OrgUnit/classes/Webservices/SOAP/OrgUnitTree.php b/Modules/OrgUnit/classes/Webservices/SOAP/OrgUnitTree.php index f45a14070847..546d69e3bb5a 100644 --- a/Modules/OrgUnit/classes/Webservices/SOAP/OrgUnitTree.php +++ b/Modules/OrgUnit/classes/Webservices/SOAP/OrgUnitTree.php @@ -6,7 +6,6 @@ /** * Class OrgUnitTree - * * @author Martin Studer ms@studer-raimann.ch */ class OrgUnitTree extends Base @@ -14,10 +13,8 @@ class OrgUnitTree extends Base const ORGU_REF_ID = 'orgu_ref_id'; const ORG_UNIT_TREE = 'OrgUnitTree'; - /** * @param array $params - * * @return mixed|string */ protected function run(array $params) @@ -31,7 +28,6 @@ protected function run(array $params) return $writer->xmlFormatData($writer->xmlStr); } - /** * @return string */ @@ -40,7 +36,6 @@ public function getName() : string return "getOrgUnitsSimpleXML"; } - /** * @return array */ @@ -51,7 +46,6 @@ protected function getAdditionalInputParams() ); } - /** * @inheritdoc */ @@ -60,7 +54,6 @@ public function getOutputParams() : array return array(self::ORG_UNIT_TREE => Base::TYPE_STRING); } - /** * @inheritdoc */ diff --git a/Modules/OrgUnit/classes/Webservices/SOAP/PositionIds.php b/Modules/OrgUnit/classes/Webservices/SOAP/PositionIds.php index 61538c1785c6..99d6f0445d73 100644 --- a/Modules/OrgUnit/classes/Webservices/SOAP/PositionIds.php +++ b/Modules/OrgUnit/classes/Webservices/SOAP/PositionIds.php @@ -6,7 +6,6 @@ /** * Class PositionIds - * * @author Fabian Schmid */ class PositionIds extends Base @@ -14,7 +13,6 @@ class PositionIds extends Base /** * @param array $params - * * @return array */ protected function run(array $params) @@ -22,7 +20,6 @@ protected function run(array $params) return ilOrgUnitPosition::getArray(null, 'id'); } - /** * @return string */ @@ -31,7 +28,6 @@ public function getName() : string return "getPositionIds"; } - /** * @return array */ @@ -40,7 +36,6 @@ protected function getAdditionalInputParams() return array(); } - /** * @inheritdoc */ @@ -49,7 +44,6 @@ public function getOutputParams() : array return array('position_ids' => Base::TYPE_INT_ARRAY); } - /** * @inheritdoc */ diff --git a/Modules/OrgUnit/classes/Webservices/SOAP/PositionTitle.php b/Modules/OrgUnit/classes/Webservices/SOAP/PositionTitle.php index 3320345f666e..cda81131bd2c 100644 --- a/Modules/OrgUnit/classes/Webservices/SOAP/PositionTitle.php +++ b/Modules/OrgUnit/classes/Webservices/SOAP/PositionTitle.php @@ -6,7 +6,6 @@ /** * Class PositionTitle - * * @author Fabian Schmid */ class PositionTitle extends Base @@ -14,12 +13,10 @@ class PositionTitle extends Base /** * @param array $params - * * @return array */ const POSITION_ID = 'position_id'; - protected function run(array $params) { $position_id = $params[self::POSITION_ID]; @@ -32,7 +29,6 @@ protected function run(array $params) } } - /** * @return string */ @@ -41,7 +37,6 @@ public function getName() : string return "getPositionTitle"; } - /** * @return array */ @@ -50,7 +45,6 @@ protected function getAdditionalInputParams() return array(self::POSITION_ID => Base::TYPE_INT); } - /** * @inheritdoc */ @@ -59,7 +53,6 @@ public function getOutputParams() : array return array('title' => Base::TYPE_STRING); } - /** * @inheritdoc */ diff --git a/Modules/OrgUnit/classes/Webservices/SOAP/RemoveUserIdFromPositionInOrgUnit.php b/Modules/OrgUnit/classes/Webservices/SOAP/RemoveUserIdFromPositionInOrgUnit.php index 061b004d00a9..33ea39ed37bb 100644 --- a/Modules/OrgUnit/classes/Webservices/SOAP/RemoveUserIdFromPositionInOrgUnit.php +++ b/Modules/OrgUnit/classes/Webservices/SOAP/RemoveUserIdFromPositionInOrgUnit.php @@ -9,7 +9,6 @@ /** * Class AddUserIdToPositionInOrgUnit - * * @author Fabian Schmid */ class RemoveUserIdFromPositionInOrgUnit extends Base @@ -17,7 +16,6 @@ class RemoveUserIdFromPositionInOrgUnit extends Base /** * @param array $params - * * @return mixed|void * @throws \ilSoapPluginException */ @@ -51,7 +49,6 @@ protected function run(array $params) } } - /** * @return string */ @@ -60,16 +57,17 @@ public function getName() : string return "removeUserFromPositionInOrgUnit"; } - /** * @return array */ protected function getAdditionalInputParams() { - return array(self::POSITION_ID => Base::TYPE_INT, self::USR_ID => Base::TYPE_INT, self::ORGU_REF_ID => Base::TYPE_INT); + return array(self::POSITION_ID => Base::TYPE_INT, + self::USR_ID => Base::TYPE_INT, + self::ORGU_REF_ID => Base::TYPE_INT + ); } - /** * @inheritdoc */ @@ -78,7 +76,6 @@ public function getOutputParams() : array return []; } - /** * @inheritdoc */ diff --git a/Modules/OrgUnit/classes/Webservices/SOAP/SuperiorPositionId.php b/Modules/OrgUnit/classes/Webservices/SOAP/SuperiorPositionId.php index 464d3a1c8cd6..f43a87e24793 100644 --- a/Modules/OrgUnit/classes/Webservices/SOAP/SuperiorPositionId.php +++ b/Modules/OrgUnit/classes/Webservices/SOAP/SuperiorPositionId.php @@ -6,7 +6,6 @@ /** * Class SuperiorPositionId - * * @author Fabian Schmid */ class SuperiorPositionId extends Base @@ -14,7 +13,6 @@ class SuperiorPositionId extends Base /** * @param array $params - * * @return int */ protected function run(array $params) @@ -22,7 +20,6 @@ protected function run(array $params) return ilOrgUnitPosition::getCorePositionId(ilOrgUnitPosition::CORE_POSITION_SUPERIOR); } - /** * @return string */ @@ -31,7 +28,6 @@ public function getName() : string return "getSuperiorPositionId"; } - /** * @return array */ @@ -40,7 +36,6 @@ protected function getAdditionalInputParams() return array(); } - /** * @inheritdoc */ @@ -49,7 +44,6 @@ public function getOutputParams() : array return array('position_id' => Base::TYPE_INT); } - /** * @inheritdoc */ diff --git a/Modules/OrgUnit/classes/Webservices/SOAP/UserIdsOfPosition.php b/Modules/OrgUnit/classes/Webservices/SOAP/UserIdsOfPosition.php index da46bf72906e..c1a925ca7a00 100644 --- a/Modules/OrgUnit/classes/Webservices/SOAP/UserIdsOfPosition.php +++ b/Modules/OrgUnit/classes/Webservices/SOAP/UserIdsOfPosition.php @@ -6,7 +6,6 @@ /** * Class UserIdsOfPosition - * * @author Fabian Schmid */ class UserIdsOfPosition extends Base @@ -14,7 +13,6 @@ class UserIdsOfPosition extends Base /** * @param array $params - * * @return array */ protected function run(array $params) @@ -31,7 +29,6 @@ protected function run(array $params) return $usr_ids; } - /** * @return string */ @@ -40,7 +37,6 @@ public function getName() : string return "getUserIdsOfPosition"; } - /** * @return array */ @@ -49,7 +45,6 @@ protected function getAdditionalInputParams() return array(self::POSITION_ID => Base::TYPE_INT); } - /** * @inheritdoc */ @@ -58,7 +53,6 @@ public function getOutputParams() : array return array(self::USR_IDS => Base::TYPE_INT_ARRAY); } - /** * @inheritdoc */ diff --git a/Modules/OrgUnit/classes/Webservices/SOAP/UserIdsOfPositionAndOrgUnit.php b/Modules/OrgUnit/classes/Webservices/SOAP/UserIdsOfPositionAndOrgUnit.php index 0eb33b29bb50..f1891c8dc0c1 100644 --- a/Modules/OrgUnit/classes/Webservices/SOAP/UserIdsOfPositionAndOrgUnit.php +++ b/Modules/OrgUnit/classes/Webservices/SOAP/UserIdsOfPositionAndOrgUnit.php @@ -6,7 +6,6 @@ /** * Class UserIdsOfPositionAndOrgUnit - * * @author Fabian Schmid */ class UserIdsOfPositionAndOrgUnit extends Base @@ -14,7 +13,6 @@ class UserIdsOfPositionAndOrgUnit extends Base /** * @param array $params - * * @return array */ protected function run(array $params) @@ -22,10 +20,10 @@ protected function run(array $params) $position_id = $params[self::POSITION_ID]; $orgu_id = $params[self::ORGU_REF_ID]; - return ilOrgUnitUserAssignmentQueries::getInstance()->getUserIdsOfOrgUnitsInPosition(array($orgu_id), $position_id); + return ilOrgUnitUserAssignmentQueries::getInstance()->getUserIdsOfOrgUnitsInPosition(array($orgu_id), + $position_id); } - /** * @return string */ @@ -34,7 +32,6 @@ public function getName() : string return "getUserIdsOfPositionAndOrgUnit"; } - /** * @return array */ @@ -46,7 +43,6 @@ protected function getAdditionalInputParams() ); } - /** * @inheritdoc */ @@ -55,7 +51,6 @@ public function getOutputParams() : array return array('usr_ids' => Base::TYPE_INT_ARRAY); } - /** * @inheritdoc */ diff --git a/Modules/OrgUnit/classes/class.ilCronUpdateOrgUnitPaths.php b/Modules/OrgUnit/classes/class.ilCronUpdateOrgUnitPaths.php index 7a40e0bff9af..a94f077c4fe5 100644 --- a/Modules/OrgUnit/classes/class.ilCronUpdateOrgUnitPaths.php +++ b/Modules/OrgUnit/classes/class.ilCronUpdateOrgUnitPaths.php @@ -2,7 +2,6 @@ /** * Class ilCronUpdateOrgUnitPaths - * * @author Theodor Truffer * @author Fabian Schmid */ @@ -22,7 +21,6 @@ class ilCronUpdateOrgUnitPaths extends ilCronJob */ protected $tree; - public function getId() : string { return self::ID; diff --git a/Modules/OrgUnit/classes/class.ilObjOrgUnit.php b/Modules/OrgUnit/classes/class.ilObjOrgUnit.php index 32096c6d50e3..e064c153bdda 100644 --- a/Modules/OrgUnit/classes/class.ilObjOrgUnit.php +++ b/Modules/OrgUnit/classes/class.ilObjOrgUnit.php @@ -3,14 +3,11 @@ /** * Class ilObjOrgUnit - * * Based on methods of ilObjCategoryGUI - * * @author : Oskar Truffer * @author : Martin Studer * @author : Stefan Wanzenried * @author : Fabian Schmid - * */ class ilObjOrgUnit extends ilContainer { @@ -25,24 +22,20 @@ class ilObjOrgUnit extends ilContainer protected static $root_id; /** * Cache storing OrgUnit objects that have OrgUnit types with custom icons assigned - * * @var array */ protected static $icons_cache; /** * ID of assigned OrgUnit type - * * @var int */ protected $orgu_type_id = 0; /** * Advanced Metadata Values for this OrgUnit - * * @var array */ protected $amd_data; - /** * @param int $a_id * @param bool $a_call_by_reference @@ -53,7 +46,6 @@ public function __construct($a_id = 0, $a_call_by_reference = true) parent::__construct($a_id, $a_call_by_reference); } - public function read() : void { global $DIC; @@ -81,7 +73,6 @@ public function create() : int return $id; } - public function update() : bool { global $DIC; @@ -103,7 +94,8 @@ public function update() : bool } // Update selection for advanced meta data of the type if ($this->getOrgUnitTypeId()) { - ilAdvancedMDRecord::saveObjRecSelection($this->getId(), 'orgu_type', $this->getOrgUnitType()->getAssignedAdvancedMDRecordIds()); + ilAdvancedMDRecord::saveObjRecSelection($this->getId(), 'orgu_type', + $this->getOrgUnitType()->getAssignedAdvancedMDRecordIds()); } else { // If no type is assigned, delete relations by passing an empty array ilAdvancedMDRecord::saveObjRecSelection($this->getId(), 'orgu_type', array()); @@ -112,7 +104,6 @@ public function update() : bool return true; } - /** * @return int */ @@ -121,7 +112,6 @@ public function getOrgUnitTypeId() return $this->orgu_type_id; } - /** * @return ilOrgUnitType|null */ @@ -130,7 +120,6 @@ public function getOrgUnitType() return ilOrgUnitType::getInstance($this->getOrgUnitTypeId()); } - /** * @param $a_id */ @@ -139,15 +128,12 @@ public function setOrgUnitTypeId($a_id) $this->orgu_type_id = $a_id; } - /** * Get the assigned AMD Values. * If a record_id is given, returns an array with all Elements (instances of ilADT objects) * belonging to this record. If no record_id is given, returns an associative array with * record-IDs as keys and ilADT objects as values - * * @param int $a_record_id - * * @return array */ public function getAdvancedMDValues($a_record_id = 0) @@ -176,12 +162,10 @@ public function getAdvancedMDValues($a_record_id = 0) } } - /** * Returns an array that maps from OrgUnit object IDs to its icon defined by the assigned * OrgUnit type. Keys = OrgUnit object IDs, values = Path to the icon This allows to get the * Icons of OrgUnits without loading the object (e.g. used in the tree explorer) - * * @return array */ public static function getIconsCache() @@ -208,7 +192,6 @@ public static function getIconsCache() return $icons_cache; } - /** * @return int */ @@ -219,7 +202,6 @@ public static function getRootOrgRefId() : int return self::$root_ref_id; } - /** * @return int */ @@ -230,7 +212,6 @@ public static function getRootOrgId() : int return self::$root_id; } - private static function loadRootOrgRefIdAndId() : void { if (self::$root_ref_id === null || self::$root_id === null) { @@ -246,10 +227,8 @@ private static function loadRootOrgRefIdAndId() : void } } - /** * Adds the user ids to the position employee. - * * @param $user_ids */ public function assignUsersToEmployeeRole($user_ids) @@ -271,10 +250,8 @@ public function assignUsersToEmployeeRole($user_ids) } } - /** * Adds the user ids to the position superior. - * * @param $user_ids */ public function assignUsersToSuperiorRole($user_ids) @@ -296,7 +273,6 @@ public function assignUsersToSuperiorRole($user_ids) } } - public function deassignUserFromEmployeeRole($user_id) { global $DIC; @@ -314,7 +290,6 @@ public function deassignUserFromEmployeeRole($user_id) )); } - public function deassignUserFromSuperiorRole($user_id) { global $DIC; @@ -332,13 +307,10 @@ public function deassignUserFromSuperiorRole($user_id) )); } - /** * Assign a given user to a given local role - * * @param int $role_id * @param int $user_id - * * @return bool */ public function assignUserToLocalRole($role_id, $user_id) @@ -366,13 +338,10 @@ public function assignUserToLocalRole($role_id, $user_id) return $return; } - /** * Deassign a given user to a given local role - * * @param int $role_id * @param int $user_id - * * @return bool */ public function deassignUserFromLocalRole($role_id, $user_id) @@ -400,25 +369,11 @@ public function deassignUserFromLocalRole($role_id, $user_id) return $return; } - - /** - * @param $a_id - * @param bool $a_reference - * @param string|null $type - * - * @return bool - */ public static function _exists(int $a_id, bool $a_reference = false, ?string $type = "orgu") : bool { return parent::_exists($a_id, $a_reference, "orgu"); } - - /** - * Return title - * - * @return string - */ public function getTitle() : string { if (parent::getTitle() != "__OrgUnitAdministration") { @@ -428,10 +383,8 @@ public function getTitle() : string } } - /** * get object long description (stored in object_description) - * * @access public * @return string object description */ @@ -444,7 +397,6 @@ public function getLongDescription() : string } } - /** * @return array This catches if by some means there is no translation. */ @@ -454,10 +406,10 @@ public function getTranslations() $lng = $DIC['lng']; $ilDB = $DIC['ilDB']; - $q = "SELECT * FROM object_translation WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . " ORDER BY lang_default DESC"; + $q = "SELECT * FROM object_translation WHERE obj_id = " . $ilDB->quote($this->getId(), + 'integer') . " ORDER BY lang_default DESC"; $r = $this->db->query($q); - $data = []; while ($row = $r->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) { $data[$row->lang_code] = array( @@ -482,10 +434,8 @@ public function getTranslations() return $translations; } - /** * delete orgunit, childs and all related data - * * @return boolean true if all object data were removed; false if only a references were * removed */ @@ -530,7 +480,6 @@ public function delete() : bool return true; } - /** * remove all Translations of current OrgUnit */ @@ -543,7 +492,6 @@ public function removeTranslations() : void $res = $ilDB->manipulate($query); } - /** * remove translations of current OrgUnit * @param $a_lang string en|de|... @@ -553,12 +501,12 @@ public function deleteTranslation(string $a_lang) : void global $DIC; $ilDB = $DIC['ilDB']; - $query = "DELETE FROM object_translation WHERE obj_id= " . $ilDB->quote($this->getId(), 'integer') . " AND lang_code = " + $query = "DELETE FROM object_translation WHERE obj_id= " . $ilDB->quote($this->getId(), + 'integer') . " AND lang_code = " . $ilDB->quote($a_lang, 'text'); $res = $ilDB->manipulate($query); } - /** * add a new translation to current OrgUnit * @param string $a_title @@ -577,20 +525,18 @@ public function addTranslation(string $a_title, string $a_desc, string $a_lang, } $query = "INSERT INTO object_translation " . "(obj_id,title,description,lang_code,lang_default) " . "VALUES " . "(" - . $ilDB->quote($this->getId(), 'integer') . "," . $ilDB->quote($a_title, 'text') . "," . $ilDB->quote($a_desc, 'text') . "," + . $ilDB->quote($this->getId(), 'integer') . "," . $ilDB->quote($a_title, + 'text') . "," . $ilDB->quote($a_desc, 'text') . "," . $ilDB->quote($a_lang, 'text') . "," . $ilDB->quote($a_lang_default, 'integer') . ")"; $ilDB->manipulate($query); } - /** * update a translation to current OrgUnit - * * @param $a_title * @param $a_desc * @param $a_lang * @param $a_lang_default - * * @return bool */ public function updateTranslation($a_title, $a_desc, $a_lang, $a_lang_default) @@ -610,17 +556,15 @@ public function updateTranslation($a_title, $a_desc, $a_lang, $a_lang_default) $query .= ", description = " . $ilDB->quote($a_desc, 'text') . " "; } - $query .= ", lang_default = " . $ilDB->quote($a_lang_default, 'integer') . " "; - - $query .= " WHERE obj_id = " . $ilDB->quote($this->getId(), 'integer') . " AND lang_code = " . $ilDB->quote($a_lang, 'text'); + $query .= " WHERE obj_id = " . $ilDB->quote($this->getId(), + 'integer') . " AND lang_code = " . $ilDB->quote($a_lang, 'text'); $ilDB->manipulate($query); return true; } - public function writePath() { if ($this->getRefId()) { diff --git a/Modules/OrgUnit/classes/class.ilObjOrgUnitAccess.php b/Modules/OrgUnit/classes/class.ilObjOrgUnitAccess.php index 54a64eeabb79..0afda0725f02 100644 --- a/Modules/OrgUnit/classes/class.ilObjOrgUnitAccess.php +++ b/Modules/OrgUnit/classes/class.ilObjOrgUnitAccess.php @@ -3,19 +3,15 @@ /** * Class ilObjOrgUnitAccess - * * @author: Oskar Truffer * @author: Martin Studer - * */ class ilObjOrgUnitAccess extends ilObjectAccess { /** * get commands - * * this method returns an array of all possible commands/permission combinations - * * example: * $commands = array * ( @@ -37,10 +33,8 @@ public static function _getCommands() : array return $commands; } - /** * @param integer $ref_id - * * @return bool */ public static function _checkAccessStaff($ref_id) : bool @@ -54,7 +48,6 @@ public static function _checkAccessStaff($ref_id) : bool /** * @param int $ref_id - * * @return bool */ public static function _checkAccessSettings(int $ref_id) : bool @@ -66,7 +59,6 @@ public static function _checkAccessSettings(int $ref_id) : bool /** * @param int $ref_id - * * @return bool */ public static function _checkAccessExport(int $ref_id) : bool @@ -78,7 +70,6 @@ public static function _checkAccessExport(int $ref_id) : bool /** * @param int $ref_id - * * @return bool */ public static function _checkAccessTypes(int $ref_id) : bool @@ -90,7 +81,6 @@ public static function _checkAccessTypes(int $ref_id) : bool /** * @param int $ref_id - * * @return bool */ public static function _checkAccessPositions(int $ref_id) : bool @@ -100,10 +90,8 @@ public static function _checkAccessPositions(int $ref_id) : bool return $DIC->access()->checkAccess('write', '', $ref_id); } - /** * @param integer $ref_id - * * @return bool */ public static function _checkAccessStaffRec($ref_id) : bool @@ -115,10 +103,8 @@ public static function _checkAccessStaffRec($ref_id) : bool && $DIC->access()->checkAccess('read', '', $ref_id); } - /** * @param integer $ref_id - * * @return bool */ public static function _checkAccessAdministrateUsers($ref_id) : bool @@ -129,11 +115,9 @@ public static function _checkAccessAdministrateUsers($ref_id) : bool && $DIC->access()->checkAccess('cat_administrate_users', '', $ref_id); } - /** * @param integer $ref_id * @param integer $usr_id - * * @return bool */ public static function _checkAccessToUserLearningProgress($ref_id, $usr_id) : bool @@ -170,10 +154,8 @@ public static function _checkAccessToUserLearningProgress($ref_id, $usr_id) : bo return false; } - /** * @param string $a_target check whether goto script will succeed - * * @return bool */ public static function _checkGoto($a_target) : bool diff --git a/Modules/OrgUnit/classes/class.ilObjOrgUnitGUI.php b/Modules/OrgUnit/classes/class.ilObjOrgUnitGUI.php index 703e7a2ad1c8..e565e97ddc8f 100644 --- a/Modules/OrgUnit/classes/class.ilObjOrgUnitGUI.php +++ b/Modules/OrgUnit/classes/class.ilObjOrgUnitGUI.php @@ -180,10 +180,10 @@ public function executeCommand() : void case "ilinfoscreengui": $this->tabs_gui->activateTab("info_short"); if (!$this->ilAccess->checkAccess( - "read", - "", - $this->ref_id - ) and !$this->ilAccess->checkAccess("visible", "", $this->ref_id)) { + "read", + "", + $this->ref_id + ) and !$this->ilAccess->checkAccess("visible", "", $this->ref_id)) { $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE); } $info = new ilInfoScreenGUI($this); @@ -586,9 +586,9 @@ public function setContentSubTabs() : void $this->addStandardContainerSubTabs(); //only display the import tab at the first level if ($this->rbacsystem->checkAccess( - "visible, read", - $_GET["ref_id"] - ) and $this->object->getRefId() == ilObjOrgUnit::getRootOrgRefId()) { + "visible, read", + $_GET["ref_id"] + ) and $this->object->getRefId() == ilObjOrgUnit::getRootOrgRefId()) { $this->tabs_gui->addSubTab( "import", $this->lng->txt("import"), diff --git a/Modules/OrgUnit/classes/class.ilObjOrgUnitListGUI.php b/Modules/OrgUnit/classes/class.ilObjOrgUnitListGUI.php index f9b3921c46e6..19f691896ee2 100644 --- a/Modules/OrgUnit/classes/class.ilObjOrgUnitListGUI.php +++ b/Modules/OrgUnit/classes/class.ilObjOrgUnitListGUI.php @@ -3,11 +3,8 @@ /** * Class ilObjOrgUnitListGUI - * - * * @author: Oskar Truffer * @author: Martin Studer - * */ class ilObjOrgUnitListGUI extends ilObjectListGUI { @@ -17,7 +14,6 @@ class ilObjOrgUnitListGUI extends ilObjectListGUI */ protected $tpl; - public function __construct() { global $DIC; @@ -27,7 +23,6 @@ public function __construct() //$this->enableComments(false, false); } - /** * initialisation */ @@ -48,7 +43,6 @@ public function init() $this->commands = ilObjOrgUnitAccess::_getCommands(); } - /** * no timing commands needed in orgunits. */ @@ -57,7 +51,6 @@ public function insertTimingsCommand() return; } - /** * no social commands needed in orgunits. */ @@ -66,7 +59,6 @@ public function insertCommonSocialCommands($a_header_actions = false) return; } - /** * insert info screen command */ @@ -78,13 +70,12 @@ public function insertInfoScreenCommand() $cmd_link = $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"); $cmd_frame = $this->getCommandFrame("infoScreen"); - $this->insertCommand($cmd_link, $this->lng->txt("info_short"), $cmd_frame, ilUtil::getImagePath("icon_info.svg")); + $this->insertCommand($cmd_link, $this->lng->txt("info_short"), $cmd_frame, + ilUtil::getImagePath("icon_info.svg")); } - /** * @param string $a_cmd - * * @return string */ public function getCommandLink($a_cmd) @@ -94,7 +85,6 @@ public function getCommandLink($a_cmd) return $this->ctrl->getLinkTargetByClass("ilobjorgunitgui", $a_cmd); } - public function insertIconsAndCheckboxes() { global $DIC; @@ -132,7 +122,8 @@ public function insertIconsAndCheckboxes() parent::insertIconsAndCheckboxes(); $this->tpl->setCurrentBlock("icon"); - $this->tpl->setVariable("ALT_ICON", $lng->txt("icon") . " " . $lng->txt("obj_" . $this->getIconImageType())); + $this->tpl->setVariable("ALT_ICON", + $lng->txt("icon") . " " . $lng->txt("obj_" . $this->getIconImageType())); $this->tpl->setVariable("SRC_ICON", $icon_file); $this->tpl->parseCurrentBlock(); $this->enableIcon(true); diff --git a/Modules/OrgUnit/classes/class.ilObjOrgUnitTree.php b/Modules/OrgUnit/classes/class.ilObjOrgUnitTree.php index 443722dee8de..9e6d0cd2296f 100644 --- a/Modules/OrgUnit/classes/class.ilObjOrgUnitTree.php +++ b/Modules/OrgUnit/classes/class.ilObjOrgUnitTree.php @@ -4,10 +4,8 @@ /** * Class ilObjOrgUnitTree * Implements a singleton pattern for caching. - * * @author: Oskar Truffer * @author: Martin Studer - * */ class ilObjOrgUnitTree { @@ -49,7 +47,6 @@ class ilObjOrgUnitTree */ private $db; - private function __construct() { global $DIC; @@ -61,7 +58,6 @@ private function __construct() $this->staff = array(); } - /** * @return \ilObjOrgUnitTree */ @@ -74,11 +70,9 @@ public static function _getInstance() return self::$instance; } - /** * @param $ref_id int the reference id of the organisational unit. * @param $recursive bool if true you get the ids of the subsequent orgunits employees too - * * @return int[] array of user ids. */ public function getEmployees($ref_id, $recursive = false) @@ -87,22 +81,22 @@ public function getEmployees($ref_id, $recursive = false) switch ($recursive) { case false: - $arr_usr_ids = $this->getAssignements($ref_id, ilOrgUnitPosition::getCorePosition(ilOrgUnitPosition::CORE_POSITION_EMPLOYEE)); + $arr_usr_ids = $this->getAssignements($ref_id, + ilOrgUnitPosition::getCorePosition(ilOrgUnitPosition::CORE_POSITION_EMPLOYEE)); break; case true: $assignment_query = ilOrgUnitUserAssignmentQueries::getInstance(); - $arr_usr_ids = $assignment_query->getUserIdsOfOrgUnitsInPosition($this->getAllChildren($ref_id), ilOrgUnitPosition::CORE_POSITION_EMPLOYEE); + $arr_usr_ids = $assignment_query->getUserIdsOfOrgUnitsInPosition($this->getAllChildren($ref_id), + ilOrgUnitPosition::CORE_POSITION_EMPLOYEE); break; } return $arr_usr_ids; } - /** * @param int $ref_id * @param \ilOrgUnitPosition $ilOrgUnitPosition - * * @return array */ public function getAssignements($ref_id, ilOrgUnitPosition $ilOrgUnitPosition) @@ -113,11 +107,9 @@ public function getAssignements($ref_id, ilOrgUnitPosition $ilOrgUnitPosition) ))->getArray('id', 'user_id'); } - /** * @param $ref_id int the reference id of the organisational unit. * @param $recursive bool if true you get the ids of the subsequent orgunits superiors too - * * @return int[] array of user ids. */ public function getSuperiors($ref_id, $recursive = false) @@ -126,12 +118,14 @@ public function getSuperiors($ref_id, $recursive = false) switch ($recursive) { case false: - $arr_usr_ids = $this->getAssignements($ref_id, ilOrgUnitPosition::getCorePosition(ilOrgUnitPosition::CORE_POSITION_SUPERIOR)); + $arr_usr_ids = $this->getAssignements($ref_id, + ilOrgUnitPosition::getCorePosition(ilOrgUnitPosition::CORE_POSITION_SUPERIOR)); break; case true: foreach ($this->getAllChildren($ref_id) as $ref_id) { $arr_usr_ids = $arr_usr_ids - + $this->getAssignements($ref_id, ilOrgUnitPosition::getCorePosition(ilOrgUnitPosition::CORE_POSITION_SUPERIOR)); + + $this->getAssignements($ref_id, + ilOrgUnitPosition::getCorePosition(ilOrgUnitPosition::CORE_POSITION_SUPERIOR)); } break; } @@ -139,11 +133,9 @@ public function getSuperiors($ref_id, $recursive = false) return $arr_usr_ids; } - /** * @param $title "employee" or "superior" * @param $ref_ids int[] array of orgu object ref ids. - * * @return int[] user_ids */ private function loadArrayOfStaff($title, $ref_ids) @@ -179,10 +171,8 @@ private function loadArrayOfStaff($title, $ref_ids) return $all_users; } - /** * @param $ref_id - * * @return array */ public function getAllChildren($ref_id) @@ -202,13 +192,10 @@ public function getAllChildren($ref_id) return $closed; } - /** * If you want to have all orgunits where the current user has the write permission: use this * with the parameter "write". - * * @param $operation string - * * @return int[] ids of the org units. */ public function getOrgusWhereUserHasPermissionForOperation($operation) @@ -246,13 +233,10 @@ public function getOrgusWhereUserHasPermissionForOperation($operation) return $orgus; } - /** * If you want to have all orgunits where the current user has the write permission: use this * with the parameter 3 (3 is the "write" permission as in rbac_operations). - * * @param $operation_id - * * @return int[] ids of the org units. */ public function getOrgusWhereUserHasPermissionForOperationId($operation_id) @@ -261,7 +245,8 @@ public function getOrgusWhereUserHasPermissionForOperationId($operation_id) $ilUser = $DIC['ilUser']; $q = "SELECT object_data.obj_id, object_data.title, object_data.type, rbac_pa.ops_id FROM object_data INNER JOIN rbac_ua ON rbac_ua.usr_id = " . $this->db->quote($ilUser->getId(), "integer") . " - INNER JOIN rbac_pa ON rbac_pa.rol_id = rbac_ua.rol_id AND rbac_pa.ops_id LIKE CONCAT('%', " . $this->db->quote($operation_id, "integer") . ", '%') + INNER JOIN rbac_pa ON rbac_pa.rol_id = rbac_ua.rol_id AND rbac_pa.ops_id LIKE CONCAT('%', " . $this->db->quote($operation_id, + "integer") . ", '%') INNER JOIN rbac_fa ON rbac_fa.rol_id = rbac_ua.rol_id INNER JOIN tree ON tree.child = rbac_fa.parent INNER JOIN object_reference ON object_reference.ref_id = tree.parent @@ -282,10 +267,8 @@ public function getOrgusWhereUserHasPermissionForOperationId($operation_id) return $orgus; } - /** * @param $ref_id - * * @return int[] */ private function getChildren($ref_id) @@ -295,7 +278,6 @@ private function getChildren($ref_id) return $this->tree_childs[$ref_id]; } - /** * @param $ref_id */ @@ -312,10 +294,8 @@ private function loadChildren($ref_id) }; } - /** * @param $level - * * @return array */ public function getAllOrgunitsOnLevelX($level) @@ -335,14 +315,12 @@ public function getAllOrgunitsOnLevelX($level) return $levels[$level]; } - /** * @param $user_id int * @param $recursive bool if this is true subsequent orgunits of this users superior role get * searched as well. - * * @return int[] returns an array of user_ids of the users which have an employee role in an - * orgunit of which this user's id has a superior role. + * orgunit of which this user's id has a superior role. */ public function getEmployeesUnderUser($user_id, $recursive = true) { @@ -361,24 +339,24 @@ public function getEmployeesUnderUser($user_id, $recursive = true) $orgu_ref_id_with_children = array_merge($orgu_ref_ids, $this->getAllChildren($orgu_ref_id)); } - return $assignment_query->getUserIdsOfOrgUnitsInPosition($orgu_ref_id_with_children, ilOrgUnitPosition::CORE_POSITION_EMPLOYEE); - break; + return $assignment_query->getUserIdsOfOrgUnitsInPosition($orgu_ref_id_with_children, + ilOrgUnitPosition::CORE_POSITION_EMPLOYEE); + break; default: - return $assignment_query->getUserIdsOfOrgUnitsInPosition($orgu_ref_ids, ilOrgUnitPosition::CORE_POSITION_EMPLOYEE); + return $assignment_query->getUserIdsOfOrgUnitsInPosition($orgu_ref_ids, + ilOrgUnitPosition::CORE_POSITION_EMPLOYEE); break; } return []; } - /** * @param $user_id int * @param $recursive bool if this is true subsequent orgunits of this users superior role get * searched as well. - * * @return int[] returns an array of user_ids of the users which have an employee role in an - * orgunit of which this user's id has a superior role. + * orgunit of which this user's id has a superior role. */ public function getSuperiorsOfUser($user_id, $recursive = true) { @@ -401,13 +379,10 @@ public function getSuperiorsOfUser($user_id, $recursive = true) return $superiors; } - /** * for additional info see the other getLevelX method. - * * @param $user_id * @param $level - * * @return int[] */ public function getLevelXOfUser($user_id, $level) @@ -435,13 +410,10 @@ public function getLevelXOfUser($user_id, $level) return array_unique($orgus_on_level_x); } - /** * getOrgUnitOfUser - * * @param $user_id * @param int $ref_id if given, only OrgUnits under this ID are returned (including $ref_id) - * * @return int[] */ public function getOrgUnitOfUser($user_id) @@ -456,22 +428,17 @@ public function getOrgUnitOfUser($user_id) return $orgu_ref_ids; } - /** * Creates a temporary table with all orgu/user assignements. there will be three columns in * the table orgu_usr_assignements (or specified table-name): ref_id: Reference-IDs of OrgUnits * user_id: Assigned User-IDs path: Path-representation of the OrgUnit - * * Usage: * 1. Run ilObjOrgUnitTree::getInstance()->buildTempTableWithUsrAssignements(); in your code * 2. use the table orgu_usr_assignements for your JOINS ans SELECTS * 3. Run ilObjOrgUnitTree::getInstance()->dropTempTable(); to throw away the table - * * @param string $temporary_table_name - * * @return bool * @throws ilException - * */ public function buildTempTableWithUsrAssignements($temporary_table_name = 'orgu_usr_assignements') { @@ -498,10 +465,8 @@ public function buildTempTableWithUsrAssignements($temporary_table_name = 'orgu_ return true; } - /** * @param $temporary_table_name - * * @return bool */ public function dropTempTable($temporary_table_name) @@ -519,10 +484,8 @@ public function dropTempTable($temporary_table_name) return true; } - /** * @param $org_refs - * * @return array */ public function getTitles($org_refs) @@ -535,7 +498,6 @@ public function getTitles($org_refs) return $names; } - /** * @return int[] returns an array of role_ids. orgu_ref => role_id */ @@ -546,7 +508,6 @@ public function getEmployeeRoles() return $this->roles["employee"]; } - /** * @return \int[] */ @@ -557,7 +518,6 @@ public function getSuperiorRoles() return $this->roles["superior"]; } - /** * @param $role */ @@ -568,13 +528,11 @@ private function loadRoles($role) } } - public function flushCache() { $this->roles = null; } - /** * @param $role */ @@ -590,10 +548,8 @@ private function loadRolesQuery($role) } } - /** * @param $role_title - * * @return int */ private function getRefIdFromRoleTitle($role_title) @@ -603,7 +559,6 @@ private function getRefIdFromRoleTitle($role_title) return $array[count($array) - 1]; } - /** * Specify eg. level 1 and it will return on which orgunit on the first level after the root * node the specified orgu_ref is a subunit of. eg: @@ -614,11 +569,9 @@ private function getRefIdFromRoleTitle($role_title) * 3 4 5 * - * 6 - * * (6, 1) = 1; (4, 1) = 2; (6, 2) = 3; * @param $orgu_ref * @param $level - * * @return int|bool ref_id of the orgu or false if not found. * @throws Exception in case there's a thread of an infinite loop or if you try to fetch the * third level but there are only two (e.g. you want to fetch lvl 1 but give @@ -648,10 +601,8 @@ public function getLevelXOfTreenode($orgu_ref, $level) } } - /** * @param $orgu_ref int - * * @return int */ public function getParent($orgu_ref) diff --git a/Modules/OrgUnit/classes/class.ilOrgUnitAppEventListener.php b/Modules/OrgUnit/classes/class.ilOrgUnitAppEventListener.php index 5f9b0cf1d094..4a1d5df490db 100644 --- a/Modules/OrgUnit/classes/class.ilOrgUnitAppEventListener.php +++ b/Modules/OrgUnit/classes/class.ilOrgUnitAppEventListener.php @@ -2,17 +2,14 @@ /** * Class ilOrgUnitAppEventListener - * * @author Fabian Schmid */ class ilOrgUnitAppEventListener { protected static $ref_ids = array(); - /** * Handle an event in a listener. - * * @param string $a_component component, e.g. "Modules/Forum" or "Services/User" * @param string $a_event event e.g. "createUser", "updateUser", "deleteUser", ... * @param array $a_parameter parameter array (assoc), array("name" => ..., "phone_office" => ...) @@ -34,7 +31,6 @@ public static function handleEvent($a_component, $a_event, $a_parameter) } } - /** * @param $ref_id */ diff --git a/Modules/OrgUnit/classes/class.ilOrgUnitExplorerGUI.php b/Modules/OrgUnit/classes/class.ilOrgUnitExplorerGUI.php index 5f76e6dae7cb..d36997b7f612 100644 --- a/Modules/OrgUnit/classes/class.ilOrgUnitExplorerGUI.php +++ b/Modules/OrgUnit/classes/class.ilOrgUnitExplorerGUI.php @@ -5,10 +5,8 @@ /** * Class ilOrgUnitExplorerGUI - * * @author: Oskar Truffer * @author: Martin Studer - * */ class ilOrgUnitExplorerGUI extends ilTreeExplorerGUI implements TreeRecursion { @@ -18,7 +16,6 @@ class ilOrgUnitExplorerGUI extends ilTreeExplorerGUI implements TreeRecursion */ protected $stay_with_command = array('', 'render', 'view', 'infoScreen', 'showStaff', 'performPaste', 'cut'); - /** * @param $a_expl_id * @param $a_parent_obj @@ -33,7 +30,6 @@ public function __construct($a_expl_id, $a_parent_obj, $a_parent_cmd, $a_tree) $this->tree->initLangCode(); } - /** * @param mixed $a_node * @return string @@ -51,7 +47,6 @@ public function getNodeContent($a_node) : string return $a_node['title']; } - /** * @return array */ @@ -60,7 +55,6 @@ public function getRootNode() : array return $this->getTree()->getNodeData(ilObjOrgUnit::getRootOrgRefId()); } - /** * Get node icon * Return custom icon of OrgUnit type if existing @@ -83,7 +77,6 @@ public function getNodeIcon($a_node) : string return ilObject::_getIcon($obj_id, "tiny", $a_node["type"]); } - /** * @param array $a_node * @return string @@ -111,21 +104,21 @@ public function getNodeHref($a_node) : string return $link_target; } - /** * @return string */ protected function getLinkTarget() : string { global $DIC; - if ($DIC->ctrl()->getCmdClass() === strtolower(ilObjOrgUnitGUI::class) && in_array($DIC->ctrl()->getCmd(), $this->stay_with_command, true)) { - return $DIC->ctrl()->getLinkTargetByClass(array(ilAdministrationGUI::class, $DIC->ctrl()->getCmdClass()), $DIC->ctrl()->getCmd()); + if ($DIC->ctrl()->getCmdClass() === strtolower(ilObjOrgUnitGUI::class) && in_array($DIC->ctrl()->getCmd(), + $this->stay_with_command, true)) { + return $DIC->ctrl()->getLinkTargetByClass(array(ilAdministrationGUI::class, $DIC->ctrl()->getCmdClass()), + $DIC->ctrl()->getCmd()); } return $DIC->ctrl()->getLinkTargetByClass(array(ilAdministrationGUI::class, ilObjOrgUnitGUI::class), 'view'); } - /** * @return string */ @@ -136,7 +129,6 @@ protected function getPluginLinkTarget() : string return $DIC->ctrl()->getLinkTargetByClass(ilObjPluginDispatchGUI::class, 'forward'); } - /** * @param array $a_node * @return bool @@ -153,7 +145,6 @@ public function isNodeClickable($a_node) : bool return false; } - /** * @param array $a_node * @return bool diff --git a/Modules/OrgUnit/classes/class.ilOrgUnitExportGUI.php b/Modules/OrgUnit/classes/class.ilOrgUnitExportGUI.php index b59407a7bf7a..986ca81fc9e4 100644 --- a/Modules/OrgUnit/classes/class.ilOrgUnitExportGUI.php +++ b/Modules/OrgUnit/classes/class.ilOrgUnitExportGUI.php @@ -3,10 +3,8 @@ /** * Class ilOrgUnitExportGUI - * * @author: Oskar Truffer * @author: Martin Studer - * */ class ilOrgUnitExportGUI extends ilExportGUI { @@ -28,7 +26,6 @@ class ilOrgUnitExportGUI extends ilExportGUI */ protected $ilObjOrgUnit; - /** * @param ilObjOrgUnitGUI $a_parent_gui * @param null $a_main_obj @@ -53,7 +50,6 @@ public function __construct(ilObjOrgUnitGUI $a_parent_gui, $a_main_obj = null) } } - public function listExportFiles() : void { if ($this->ilObjOrgUnit->getRefId() != ilObjOrgUnit::getRootOrgRefId()) { @@ -61,21 +57,19 @@ public function listExportFiles() : void } } - private function extendExportGUI() { $this->toolbar->addButton($this->lng->txt("simple_xml"), $this->ctrl->getLinkTarget($this, "simpleExport")); - $this->toolbar->addButton($this->lng->txt("simple_xls"), $this->ctrl->getLinkTarget($this, "simpleExportExcel")); + $this->toolbar->addButton($this->lng->txt("simple_xls"), + $this->ctrl->getLinkTarget($this, "simpleExportExcel")); } - public function simpleExport() { $ilOrgUnitExporter = new ilOrgUnitExporter(); $ilOrgUnitExporter->sendAndCreateSimpleExportFile(); } - public function simpleExportExcel() { $ilOrgUnitExporter = new ilOrgUnitExporter(); diff --git a/Modules/OrgUnit/classes/class.ilOrgUnitExporter.php b/Modules/OrgUnit/classes/class.ilOrgUnitExporter.php index 12cb398668d4..9cca6ee33767 100644 --- a/Modules/OrgUnit/classes/class.ilOrgUnitExporter.php +++ b/Modules/OrgUnit/classes/class.ilOrgUnitExporter.php @@ -3,10 +3,8 @@ /** * Class ilOrgUnitExporter - * * @author: Oskar Truffer * @author: Martin Studer - * */ class ilOrgUnitExporter extends ilCategoryExporter { @@ -33,10 +31,8 @@ public function simpleExport($orgu_ref_id) return $writer; } - /** * @param $orgu_ref_id - * * @return string */ protected function getExternalId($orgu_ref_id) @@ -46,10 +42,8 @@ protected function getExternalId($orgu_ref_id) return $import_id ?: $this->buildExternalId($orgu_ref_id); } - /** * @param $orgu_ref_id int - * * @return string */ protected function buildExternalId($orgu_ref_id) @@ -57,7 +51,6 @@ protected function buildExternalId($orgu_ref_id) return "orgu_" . CLIENT_ID . "_" . $orgu_ref_id; } - /** * @param $orgu_ref_id */ @@ -101,7 +94,6 @@ public function simpleExportExcel($orgu_ref_id) $worksheet->sendToClient($file_name); } - public function sendAndCreateSimpleExportFile() { $orgu_id = ilObjOrgUnit::getRootOrgId(); @@ -145,7 +137,6 @@ public function sendAndCreateSimpleExportFile() ); } - private function getStructure($root_node_ref) { global $DIC; @@ -165,10 +156,8 @@ private function getStructure($root_node_ref) return $closed; } - /** * @param $orgu ilObjOrgUnit - * * @return array */ private function getAttributesForOrgu($orgu) @@ -183,7 +172,12 @@ private function getAttributesForOrgu($orgu) } // Only the ref id is guaranteed to be unique. $ref_id = $orgu->getRefId(); - $attr = array("ou_id" => $this->getExternalId($ref_id), "ou_id_type" => "external_id", "ou_parent_id" => $ou_parent_id, "ou_parent_id_type" => "external_id", "action" => "create"); + $attr = array("ou_id" => $this->getExternalId($ref_id), + "ou_id_type" => "external_id", + "ou_parent_id" => $ou_parent_id, + "ou_parent_id_type" => "external_id", + "action" => "create" + ); return $attr; } diff --git a/Modules/OrgUnit/classes/class.ilOrgUnitImporter.php b/Modules/OrgUnit/classes/class.ilOrgUnitImporter.php index 49f628090487..9256f94bc7c6 100644 --- a/Modules/OrgUnit/classes/class.ilOrgUnitImporter.php +++ b/Modules/OrgUnit/classes/class.ilOrgUnitImporter.php @@ -3,7 +3,6 @@ /** * Class ilOrgUnitImporter - * * @author Oskar Truffer * @author Martin Studer * @author Fabian Schmid @@ -24,11 +23,9 @@ class ilOrgUnitImporter extends ilXmlImporter */ public $stats; - /** * @param $id * @param $type - * * @return bool|int */ protected function buildRef($id, $type) @@ -68,10 +65,8 @@ protected function buildRef($id, $type) } } - /** * @param string $external_id - * * @return bool */ public function hasMoreThanOneMatch($external_id) @@ -94,7 +89,6 @@ public function hasMoreThanOneMatch($external_id) } } - /** * @return bool */ @@ -103,7 +97,6 @@ public function hasErrors() return count($this->errors) != 0; } - /** * @return bool */ @@ -112,7 +105,6 @@ public function hasWarnings() return count($this->warnings) != 0; } - /** * @param $lang_var * @param $import_id @@ -123,7 +115,6 @@ public function addWarning($lang_var, $import_id, $action = null) $this->warnings[] = array('lang_var' => $lang_var, 'import_id' => $import_id, 'action' => $action); } - /** * @param $lang_var * @param $import_id @@ -134,7 +125,6 @@ public function addError($lang_var, $import_id, $action = null) $this->errors[] = array('lang_var' => $lang_var, 'import_id' => $import_id, 'action' => $action); } - /** * @return array */ @@ -143,7 +133,6 @@ public function getErrors() return $this->errors; } - /** * @return array */ @@ -152,7 +141,6 @@ public function getWarnings() return $this->warnings; } - /** * @return array */ @@ -161,17 +149,20 @@ public function getStats() return $this->stats; } - /** * @param string $a_entity * @param string $a_id * @param string $a_xml - * @param $a_mapping ilImportMapping + * @param $a_mapping ilImportMapping * @return void * @deprecated */ - public function importXmlRepresentation(string $a_entity, string $a_id, string $a_xml, ilImportMapping $a_mapping) : void - { + public function importXmlRepresentation( + string $a_entity, + string $a_id, + string $a_xml, + ilImportMapping $a_mapping + ) : void { $container_mappings = $a_mapping->getMappingsOfEntity("Services/Container", "objs"); foreach ($container_mappings as $old => $new) { if (ilObject2::_lookupType($new) === 'orgu') { diff --git a/Modules/OrgUnit/classes/class.ilOrgUnitPositionAccess.php b/Modules/OrgUnit/classes/class.ilOrgUnitPositionAccess.php index 7ac134abbbf4..4f85c1797810 100644 --- a/Modules/OrgUnit/classes/class.ilOrgUnitPositionAccess.php +++ b/Modules/OrgUnit/classes/class.ilOrgUnitPositionAccess.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitPositionAccess - * * @author Fabian Schmid */ class ilOrgUnitPositionAccess implements ilOrgUnitPositionAccessHandler, ilOrgUnitPositionAndRBACAccessHandler @@ -21,7 +20,6 @@ class ilOrgUnitPositionAccess implements ilOrgUnitPositionAccessHandler, ilOrgUn */ protected static $ref_id_obj_type_map = array(); - /** * ilOrgUnitPositionAccess constructor. */ @@ -31,7 +29,6 @@ public function __construct() $this->ua = ilOrgUnitUserAssignmentQueries::getInstance(); } - /** * @inheritdoc */ @@ -42,7 +39,6 @@ public function filterUserIdsForCurrentUsersPositionsAndPermission(array $user_i return $this->filterUserIdsForUsersPositionsAndPermission($user_ids, $current_user_id, $permission); } - /** * @inheritdoc */ @@ -58,7 +54,6 @@ public function filterUserIdsForUsersPositionsAndPermission(array $user_ids, $fo return array_intersect($user_ids, $other_users_in_same_org_units); } - /** * @inheritdoc */ @@ -69,19 +64,18 @@ public function isCurrentUserBasedOnPositionsAllowedTo($permission, array $on_us return $this->isUserBasedOnPositionsAllowedTo($current_user_id, $permission, $on_user_ids); } - /** * @inheritdoc */ public function isUserBasedOnPositionsAllowedTo($which_user_id, $permission, array $on_user_ids) { - $filtered_user_ids = $this->filterUserIdsForUsersPositionsAndPermission($on_user_ids, $which_user_id, $permission); + $filtered_user_ids = $this->filterUserIdsForUsersPositionsAndPermission($on_user_ids, $which_user_id, + $permission); return ($on_user_ids === array_intersect($on_user_ids, $filtered_user_ids) && $filtered_user_ids === array_intersect($filtered_user_ids, $on_user_ids)); } - /** * @inheritdoc */ @@ -97,7 +91,6 @@ public function filterUserIdsByPositionOfCurrentUser($pos_perm, $ref_id, array $ return $this->filterUserIdsByPositionOfUser($current_user_id, $pos_perm, $ref_id, $user_ids); } - /** * @inheritdoc */ @@ -130,7 +123,8 @@ public function filterUserIdsByPositionOfUser($user_id, $pos_perm, $ref_id, arra $allowed_user_ids = array_merge($allowed_user_ids, $allowed); break; case ilOrgUnitAuthority::SCOPE_SUBSEQUENT_ORGUS: - $allowed = $this->ua->getUserIdsOfOrgUnitsOfUsersPosition($position->getId(), $user_id, true); + $allowed = $this->ua->getUserIdsOfOrgUnitsOfUsersPosition($position->getId(), $user_id, + true); $allowed_user_ids = array_merge($allowed_user_ids, $allowed); break; } @@ -138,11 +132,13 @@ public function filterUserIdsByPositionOfUser($user_id, $pos_perm, $ref_id, arra default: switch ($authority->getScope()) { case ilOrgUnitAuthority::SCOPE_SAME_ORGU: - $allowed = $this->ua->getUserIdsOfUsersOrgUnitsInPosition($user_id, $position->getId(), $authority->getOver()); + $allowed = $this->ua->getUserIdsOfUsersOrgUnitsInPosition($user_id, $position->getId(), + $authority->getOver()); $allowed_user_ids = array_merge($allowed_user_ids, $allowed); break; case ilOrgUnitAuthority::SCOPE_SUBSEQUENT_ORGUS: - $allowed = $this->ua->getUserIdsOfUsersOrgUnitsInPosition($user_id, $position->getId(), $authority->getOver(), true); + $allowed = $this->ua->getUserIdsOfUsersOrgUnitsInPosition($user_id, $position->getId(), + $authority->getOver(), true); $allowed_user_ids = array_merge($allowed_user_ids, $allowed); break; } @@ -154,7 +150,6 @@ public function filterUserIdsByPositionOfUser($user_id, $pos_perm, $ref_id, arra return array_intersect($user_ids, $allowed_user_ids); } - /** * @inheritdoc */ @@ -181,7 +176,6 @@ public function checkPositionAccess($pos_perm, $ref_id) return false; } - /** * @inheritdoc */ @@ -204,7 +198,6 @@ public function hasCurrentUserAnyPositionAccess($ref_id) return false; } - /** * @inheritdoc */ @@ -224,7 +217,6 @@ public function checkRbacOrPositionPermissionAccess($rbac_perm, $pos_perm, $ref_ return $this->checkPositionAccess($pos_perm, $ref_id); } - /** * @inheritdoc */ @@ -243,7 +235,6 @@ public function filterUserIdsByRbacOrPositionOfCurrentUser($rbac_perm, $pos_perm return $this->filterUserIdsByPositionOfCurrentUser($pos_perm, $ref_id, $user_ids); } - /** * @inheritdoc */ @@ -270,7 +261,6 @@ private function dic() return $GLOBALS['DIC']; } - /** * @return int */ @@ -279,10 +269,8 @@ private function getCurrentUsersId() return $this->dic()->user()->getId(); } - /** * @param $ref_id - * * @return mixed */ private function getTypeForRefId($ref_id) @@ -294,10 +282,8 @@ private function getTypeForRefId($ref_id) return self::$ref_id_obj_type_map[$ref_id]; } - /** * @param $ref_id - * * @return int */ private function getObjIdForRefId($ref_id) @@ -305,10 +291,8 @@ private function getObjIdForRefId($ref_id) return ilObject2::_lookupObjectId($ref_id); } - /** * @param $ref_id - * * @return bool */ private function isPositionActiveForRefId($ref_id) diff --git a/Modules/OrgUnit/exceptions/class.ilOrgUnitAccessException.php b/Modules/OrgUnit/exceptions/class.ilOrgUnitAccessException.php index 261f2bfee4bd..daf0f457aa09 100644 --- a/Modules/OrgUnit/exceptions/class.ilOrgUnitAccessException.php +++ b/Modules/OrgUnit/exceptions/class.ilOrgUnitAccessException.php @@ -2,7 +2,6 @@ /** * Class ilOrgUnitAccessException - * * @author Fabian Schmid */ class ilOrgUnitAccessException extends ilException diff --git a/Modules/OrgUnit/exceptions/class.ilOrgUnitTypeException.php b/Modules/OrgUnit/exceptions/class.ilOrgUnitTypeException.php index 350e4aea4430..f620489c67b9 100644 --- a/Modules/OrgUnit/exceptions/class.ilOrgUnitTypeException.php +++ b/Modules/OrgUnit/exceptions/class.ilOrgUnitTypeException.php @@ -3,7 +3,6 @@ /** * Class ilOrgUnitTypeException - * * @author Stefan Wanzenried */ class ilOrgUnitTypeException extends ilObjOrgUnitException diff --git a/Modules/OrgUnit/exceptions/class.ilOrgUnitTypePluginException.php b/Modules/OrgUnit/exceptions/class.ilOrgUnitTypePluginException.php index 6683920fbabb..d173b988af10 100644 --- a/Modules/OrgUnit/exceptions/class.ilOrgUnitTypePluginException.php +++ b/Modules/OrgUnit/exceptions/class.ilOrgUnitTypePluginException.php @@ -6,7 +6,6 @@ * This exception is thrown whenever one or multiple ilOrgUnitTypeHook plugin(s) did not allow an action on a ilOrgUnitType object, * e.g. updating, deleting or setting title. * It stores additionally the plugin objects which did not allow the action. - * * @author Stefan Wanzenried */ class ilOrgUnitTypePluginException extends ilObjOrgUnitException @@ -18,7 +17,6 @@ class ilOrgUnitTypePluginException extends ilObjOrgUnitException */ protected $plugins = array(); - public function __construct($a_message, $plugins = array()) { parent::__construct($a_message); diff --git a/Modules/OrgUnit/interfaces/class.ilOrgUnitPositionAccessHandler.php b/Modules/OrgUnit/interfaces/class.ilOrgUnitPositionAccessHandler.php index 5fba14229710..d128ba2557ca 100644 --- a/Modules/OrgUnit/interfaces/class.ilOrgUnitPositionAccessHandler.php +++ b/Modules/OrgUnit/interfaces/class.ilOrgUnitPositionAccessHandler.php @@ -2,84 +2,62 @@ /** * Interface ilOrgUnitPositionAccessHandler - * * Provides access checks due to a users OrgUnit-Positions - * * @author Fabian Schmid */ interface ilOrgUnitPositionAccessHandler { /** - * @param int[] $user_ids List of ILIAS-User-IDs which shall be filtered - * + * @param int[] $user_ids List of ILIAS-User-IDs which shall be filtered * @param string $permission - * - * @see getAvailablePositionRelatedPermissions for available permissions - * + * @return int[] Filtered List of ILIAS-User-IDs * @throws \ilOrgUnitAccessException when a unknown permission is used. See the list of * available permissions in interface * ilOrgUnitPositionAccessHandler - * - * - * @return int[] Filtered List of ILIAS-User-IDs + * @see getAvailablePositionRelatedPermissions for available permissions */ public function filterUserIdsForCurrentUsersPositionsAndPermission(array $user_ids, $permission); - /** - * @param int[] $user_ids List of ILIAS-User-IDs which shall be filtered + * @param int[] $user_ids List of ILIAS-User-IDs which shall be filtered * @param int $for_user_id * @param string $permission - * - * @see getAvailablePositionRelatedPermissions for available permissions - * + * @return int[] Filtered List of ILIAS-User-IDs * @throws \ilOrgUnitAccessException when a unknown permission is used. See the list of * available permissions in interface * ilOrgUnitPositionAccessHandler - * - * @return int[] Filtered List of ILIAS-User-IDs + * @see getAvailablePositionRelatedPermissions for available permissions */ public function filterUserIdsForUsersPositionsAndPermission(array $user_ids, $for_user_id, $permission); - /** * @param string $permission * @param int[] $on_user_ids List of ILIAS-User-IDs - * - * @see getAvailablePositionRelatedPermissions for available permissions - * * @return bool + * @see getAvailablePositionRelatedPermissions for available permissions */ public function isCurrentUserBasedOnPositionsAllowedTo($permission, array $on_user_ids); - /** * @param int $which_user_id Permission check for this ILIAS-User-ID * @param string $permission * @param int[] $on_user_ids List of ILIAS-User-IDs - * - * @see getAvailablePositionRelatedPermissions for available permissions - * * @return bool + * @see getAvailablePositionRelatedPermissions for available permissions */ public function isUserBasedOnPositionsAllowedTo($which_user_id, $permission, array $on_user_ids); - /** * @param string $pos_perm * @param int $ref_id Reference-ID of the desired Object in the tree - * - * @see getAvailablePositionRelatedPermissions for available permissions - * * @return bool + * @see getAvailablePositionRelatedPermissions for available permissions */ public function checkPositionAccess($pos_perm, $ref_id); - /** * @param int $ref_id - * * @return bool */ public function hasCurrentUserAnyPositionAccess($ref_id); @@ -88,23 +66,18 @@ public function hasCurrentUserAnyPositionAccess($ref_id); * @param string $pos_perm * @param int $ref_id * @param int[] $user_ids - * - * @see getAvailablePositionRelatedPermissions for available permissions - * * @return int[] + * @see getAvailablePositionRelatedPermissions for available permissions */ public function filterUserIdsByPositionOfCurrentUser($pos_perm, $ref_id, array $user_ids); - /** * @param int $user_id * @param string $pos_perm * @param int $ref_id * @param int[] $user_ids - * - * @see getAvailablePositionRelatedPermissions for available permissions - * * @return int[] + * @see getAvailablePositionRelatedPermissions for available permissions */ public function filterUserIdsByPositionOfUser($user_id, $pos_perm, $ref_id, array $user_ids); } diff --git a/Modules/OrgUnit/interfaces/class.ilOrgUnitPositionAndRBACAccessHandler.php b/Modules/OrgUnit/interfaces/class.ilOrgUnitPositionAndRBACAccessHandler.php index df0a228ea9dc..e683626fd281 100644 --- a/Modules/OrgUnit/interfaces/class.ilOrgUnitPositionAndRBACAccessHandler.php +++ b/Modules/OrgUnit/interfaces/class.ilOrgUnitPositionAndRBACAccessHandler.php @@ -2,9 +2,7 @@ /** * Interface ilOrgUnitPositionAndRBACAccessHandler - * * Provides access checks due to a users OrgUnit-Positions in Combination with RBAC - * * @author Fabian Schmid */ interface ilOrgUnitPositionAndRBACAccessHandler @@ -16,12 +14,10 @@ interface ilOrgUnitPositionAndRBACAccessHandler * available permissions in interface * ilOrgUnitPositionAccessHandler * @param int $ref_id Reference-ID of the desired Object in the tree - * * @return bool */ public function checkRbacOrPositionPermissionAccess($rbac_perm, $pos_perm, $ref_id); - /** * @param string $rbac_perm * @param string $pos_perm See the list of @@ -29,17 +25,13 @@ public function checkRbacOrPositionPermissionAccess($rbac_perm, $pos_perm, $ref_ * ilOrgUnitPositionAccessHandler * @param int $ref_id Reference-ID of the desired Object in the tree * @param int[] $user_ids - * * @return int[] */ public function filterUserIdsByRbacOrPositionOfCurrentUser($rbac_perm, $pos_perm, $ref_id, array $user_ids); - /** * @param string $rbac_perm - * - * @param int $ref_id - * + * @param int $ref_id * @return bool */ public function hasUserRBACorAnyPositionAccess($rbac_perm, $ref_id); diff --git a/Modules/OrgUnit/interfaces/class.ilOrgUnitUserQueriesInterface.php b/Modules/OrgUnit/interfaces/class.ilOrgUnitUserQueriesInterface.php index 20acae78a53c..f7adf6e5434b 100644 --- a/Modules/OrgUnit/interfaces/class.ilOrgUnitUserQueriesInterface.php +++ b/Modules/OrgUnit/interfaces/class.ilOrgUnitUserQueriesInterface.php @@ -1,7 +1,6 @@ */ @@ -10,15 +9,12 @@ interface ilOrgUnitUserQueriesInterface /** * @param array $user_ids - * * @return array $users */ public function findAllUsersByUserIds($user_ids); - /** * @param array $users - * * @return array $user_names */ public function getAllUserNames($users); diff --git a/Modules/OrgUnit/js/generic_multi_line_input.js b/Modules/OrgUnit/js/generic_multi_line_input.js index e995465c4128..9d8f309e4ac4 100755 --- a/Modules/OrgUnit/js/generic_multi_line_input.js +++ b/Modules/OrgUnit/js/generic_multi_line_input.js @@ -1,116 +1,122 @@ (function ($) { - $.fn.extend({ - multi_line_input: function (element_config, options) { - var settings = $.extend({ - unique_values: false - }, options); + $.fn.extend({ + multi_line_input: function (element_config, options) { + var settings = $.extend({ + unique_values: false + }, options); - var element_config = element_config; - var element = this; - var self = this; - var counter = 0; - var clone_line = $(this).find('.multi_input_line').first(); - var calc_width = function (clone_line) { - var calced_width = clone_line.find('.multi_icons_wrapper').last().width(); - clone_line.find('.ml-input').each(function () { - calced_width = calced_width + $(this).width(); - }); - calced_width = calced_width - clone_line.find('.ml-input').last().width(); - clone_line.find('.ml-input').last().width(clone_line.width() - calced_width - 100); - }; - $(this).find('.multi_input_line').each(function () { - calc_width($(this)); - }); + var element_config = element_config; + var element = this; + var self = this; + var counter = 0; + var clone_line = $(this).find('.multi_input_line').first(); + var calc_width = function (clone_line) { + var calced_width = clone_line.find('.multi_icons_wrapper').last().width(); + clone_line.find('.ml-input').each(function () { + calced_width = calced_width + $(this).width(); + }); + calced_width = calced_width - clone_line.find('.ml-input').last().width(); + clone_line.find('.ml-input').last().width(clone_line.width() - calced_width - 100); + }; + $(this).find('.multi_input_line').each(function () { + calc_width($(this)); + }); - var empty_id = "empty"; + var empty_id = "empty"; - var setup_clone_line = function (clone_line) { - clone_line.hide(); - clone_line.removeClass('multi_input_line'); + var setup_clone_line = function (clone_line) { + clone_line.hide(); + clone_line.removeClass('multi_input_line'); - clone_line.find("textarea[name^='" + element.attr('id') + "'], input[name^='" + element.attr('id') + "'], select[name^='" + element.attr('id') + "']").each(function () { - var name = $(this).attr('name'); - var id = element.attr('id'); - var regex = new RegExp('^' + id + '\[[0-9]+\](.*)$', 'g'); - var matches = regex.exec(name); - name = empty_id + '[' + counter + ']' + matches[1]; - $(this).attr('name', name); - }); - }; + clone_line.find("textarea[name^='" + element.attr('id') + "'], input[name^='" + element.attr( + 'id') + "'], select[name^='" + element.attr('id') + "']").each(function () { + var name = $(this).attr('name'); + var id = element.attr('id'); + var regex = new RegExp('^' + id + '\[[0-9]+\](.*)$', 'g'); + var matches = regex.exec(name); + name = empty_id + '[' + counter + ']' + matches[1]; + $(this).attr('name', name); + }); + }; - setup_clone_line(clone_line); - /** - * - * @param line - * @param init - */ - var setup_line = function (line, init) { - var init = init || false; - var $line = line; + setup_clone_line(clone_line); + /** + * + * @param line + * @param init + */ + var setup_line = function (line, init) { + var init = init || false; + var $line = line; - $(line).find('.add_button').on('click', function (e) { - var new_line = clone_line.clone(); - new_line.show(); - $(new_line).addClass("multi_input_line"); - setup_line(new_line); - $(element).append(new_line); - $(element).change(); - $(document).trigger('multi_line_add_button', [$line, new_line]); - $(element).find("textarea, input[type='text']").last().focus(); - return false; - }); + $(line).find('.add_button').on('click', function (e) { + var new_line = clone_line.clone(); + new_line.show(); + $(new_line).addClass("multi_input_line"); + setup_line(new_line); + $(element).append(new_line); + $(element).change(); + $(document).trigger('multi_line_add_button', [$line, new_line]); + $(element).find("textarea, input[type='text']").last().focus(); + return false; + }); - $(line).find('.up_button').on('click', function (e) { - $(this).parents('.multi_input_line').insertBefore($(this).parents('.multi_input_line').prev()); - return false; - }); + $(line).find('.up_button').on('click', function (e) { + $(this).parents('.multi_input_line').insertBefore($(this) + .parents('.multi_input_line') + .prev()); + return false; + }); - $(line).find('.down_button').on('click', function (e) { - $(this).parents('.multi_input_line').insertAfter($(this).parents('.multi_input_line').next()); - return false; - }); + $(line).find('.down_button').on('click', function (e) { + $(this).parents('.multi_input_line').insertAfter($(this) + .parents('.multi_input_line') + .next()); + return false; + }); - $(line).find('.remove_button').on('click', function (e) { - $line.remove(); - $(element).change(); - $(document).trigger('multi_line_remove_button', $line); - return false; - }); + $(line).find('.remove_button').on('click', function (e) { + $line.remove(); + $(element).change(); + $(document).trigger('multi_line_remove_button', $line); + return false; + }); - // If element is added by plus button - if (!init) { - $line.find("textarea[name^='" + empty_id + "'], input[name^='" + empty_id + "'], select[name^='" + empty_id + "']").each(function () { - var name = $(this).attr('name'); - var id = element.attr('id'); - $(this).val(''); - var regex = new RegExp('^' + empty_id + '\[[0-9]+\](.*)$', 'g'); - var matches = regex.exec(name); - name = id + '[' + counter + ']' + matches[1]; - $(this).attr('name', name); - }); - } - counter++; - }; + // If element is added by plus button + if (!init) { + $line.find("textarea[name^='" + empty_id + "'], input[name^='" + empty_id + "'], select[name^='" + empty_id + "']") + .each(function () { + var name = $(this).attr('name'); + var id = element.attr('id'); + $(this).val(''); + var regex = new RegExp('^' + empty_id + '\[[0-9]+\](.*)$', 'g'); + var matches = regex.exec(name); + name = id + '[' + counter + ']' + matches[1]; + $(this).attr('name', name); + }); + } + counter++; + }; - // hide/show delete icons - //$(element).on('change', function (e) { - // var remove_buttons = $(element).find('.multi_input_line .remove_button'); - // - // if (remove_buttons.length > 1) { - // remove_buttons.show().first().hide(); - // } else { - // remove_buttons.hide(); - // } - //}); + // hide/show delete icons + //$(element).on('change', function (e) { + // var remove_buttons = $(element).find('.multi_input_line .remove_button'); + // + // if (remove_buttons.length > 1) { + // remove_buttons.show().first().hide(); + // } else { + // remove_buttons.hide(); + // } + //}); - $(this).find('.multi_input_line').each(function () { - setup_line($(this), true); - }); - $(element).change(); + $(this).find('.multi_input_line').each(function () { + setup_line($(this), true); + }); + $(element).change(); - return element; - } - }); + return element; + } + }); }(jQuery)); \ No newline at end of file diff --git a/Modules/OrgUnit/maintenance.json b/Modules/OrgUnit/maintenance.json index d51c743cecc4..caa04e7ccbfa 100644 --- a/Modules/OrgUnit/maintenance.json +++ b/Modules/OrgUnit/maintenance.json @@ -1,16 +1,16 @@ { - "maintenance_model": "Classic", - "first_maintainer": "mstuder(8473)", - "second_maintainer": "bheyser(14300)", - "implicit_maintainers": [ - "ttruffer(42894)" - ], - "coordinator": [ - "" - ], - "tester": "wischniak(21896)", - "testcase_writer": "wischniak(21896)", - "path": "Modules/OrgUnit", - "belong_to_component": "Organisational Units", - "used_in_components": [] + "maintenance_model": "Classic", + "first_maintainer": "mstuder(8473)", + "second_maintainer": "bheyser(14300)", + "implicit_maintainers": [ + "ttruffer(42894)" + ], + "coordinator": [ + "" + ], + "tester": "wischniak(21896)", + "testcase_writer": "wischniak(21896)", + "path": "Modules/OrgUnit", + "belong_to_component": "Organisational Units", + "used_in_components": [] } \ No newline at end of file diff --git a/Modules/OrgUnit/module.xml b/Modules/OrgUnit/module.xml index a73c4ce66e96..470e0af93f34 100755 --- a/Modules/OrgUnit/module.xml +++ b/Modules/OrgUnit/module.xml @@ -1,27 +1,29 @@ - - - - - - - orgu - adm - - - - - - - - - - - - - - - - + + + + + + + orgu + adm + + + + + + + + + + + + + + + + diff --git a/Modules/OrgUnit/templates/default/authority.js b/Modules/OrgUnit/templates/default/authority.js index 1392935708bb..c3828507a5ea 100644 --- a/Modules/OrgUnit/templates/default/authority.js +++ b/Modules/OrgUnit/templates/default/authority.js @@ -1,19 +1,19 @@ var ilOrgUnitAuthorityInput = { - settings: {}, - data: {}, - init: function (settings, data) { - // console.log(settings); - console.log(data); - console.log(JSON.parse(data)); - } + settings: {}, + data: {}, + init: function (settings, data) { + // console.log(settings); + console.log(data); + console.log(JSON.parse(data)); + } }; (function ($) { - $.fn.ilOrgUnitAuthorityInput = function (options) { - var settings = $.extend({ - // These are the defaults. - color: "#556b2f", - backgroundColor: "white" - }, options); - ilOrgUnitAuthorityInput.init(settings); - }; + $.fn.ilOrgUnitAuthorityInput = function (options) { + var settings = $.extend({ + // These are the defaults. + color: "#556b2f", + backgroundColor: "white" + }, options); + ilOrgUnitAuthorityInput.init(settings); + }; }(jQuery)); \ No newline at end of file diff --git a/Modules/OrgUnit/templates/default/tpl.authority_input.html b/Modules/OrgUnit/templates/default/tpl.authority_input.html index 07bab57b1a3b..83fdeb7c9ade 100644 --- a/Modules/OrgUnit/templates/default/tpl.authority_input.html +++ b/Modules/OrgUnit/templates/default/tpl.authority_input.html @@ -1,16 +1,16 @@
- -
- - - - - - - - {MULTI_ICONS} -
+ +
+ + + + + + + + {MULTI_ICONS} +
\ No newline at end of file diff --git a/Modules/OrgUnit/templates/default/tpl.obj_position_perm_row.html b/Modules/OrgUnit/templates/default/tpl.obj_position_perm_row.html index 19413d2a81f9..e9374f50bb5a 100644 --- a/Modules/OrgUnit/templates/default/tpl.obj_position_perm_row.html +++ b/Modules/OrgUnit/templates/default/tpl.obj_position_perm_row.html @@ -1,26 +1,30 @@ - - -

- - -

- - - - -

- - -

- - - - -

- - -

- - + + +

+ + +

+ + + + +

+ + +

+ + + + +

+ + +

+ + diff --git a/Modules/OrgUnit/templates/default/tpl.obj_role_template_perm_row.html b/Modules/OrgUnit/templates/default/tpl.obj_role_template_perm_row.html index ea49f218faf7..cbdfeb856369 100644 --- a/Modules/OrgUnit/templates/default/tpl.obj_role_template_perm_row.html +++ b/Modules/OrgUnit/templates/default/tpl.obj_role_template_perm_row.html @@ -1,22 +1,23 @@ - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/Modules/OrgUnit/templates/default/tpl.permissions.html b/Modules/OrgUnit/templates/default/tpl.permissions.html index 48b7a71d18b8..60606a67b359 100644 --- a/Modules/OrgUnit/templates/default/tpl.permissions.html +++ b/Modules/OrgUnit/templates/default/tpl.permissions.html @@ -1,109 +1,122 @@
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
- - - -
-
-
- - -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+
+
+ + +
\ No newline at end of file diff --git a/Modules/OrgUnit/templates/default/tpl.position_row.html b/Modules/OrgUnit/templates/default/tpl.position_row.html index 994dd83e8d02..17ada12bfade 100644 --- a/Modules/OrgUnit/templates/default/tpl.position_row.html +++ b/Modules/OrgUnit/templates/default/tpl.position_row.html @@ -1,14 +1,14 @@ - - {TITLE} - - - {DESCRIPTION} - - - {AUTHORITIES} - - - {ACTIONS} - + + {TITLE} + + + {DESCRIPTION} + + + {AUTHORITIES} + + + {ACTIONS} + \ No newline at end of file diff --git a/Modules/OrgUnit/templates/default/tpl.prop_generic_multi_line.html b/Modules/OrgUnit/templates/default/tpl.prop_generic_multi_line.html index f203c1d5d4ba..43a581a61c8a 100755 --- a/Modules/OrgUnit/templates/default/tpl.prop_generic_multi_line.html +++ b/Modules/OrgUnit/templates/default/tpl.prop_generic_multi_line.html @@ -1,33 +1,33 @@
{CUSTOM_ATTR_KEY} = "{CUSTOM_ATTR_VALUE}">
- {CONTENT} - -
{INFO}
- + {CONTENT} + +
{INFO}
+
- {CONTENT} - -
{INFO_LABEL}
- + {CONTENT} + +
{INFO_LABEL}
+
\ No newline at end of file