Class ilOrgUnitUserAssignmentGUI.
More...
◆ __construct()
| ilOrgUnitUserAssignmentGUI::__construct |
( |
| ) |
|
◆ addStaff()
| ilOrgUnitUserAssignmentGUI::addStaff |
( |
| ) |
|
Definition at line 222 of file class.ilOrgUnitUserAssignmentGUI.php.
References ilObjUser\_lookupId(), ILIAS\Repository\access(), ilOrgUnitPosition\CORE_POSITION_EMPLOYEE, ILIAS\Repository\ctrl(), ILIAS\Modules\OrgUnit\ARHelper\BaseCommands\getParentRefId(), ILIAS\Repository\int(), and ILIAS\UI\examples\Symbol\Glyph\Language\language().
Referenced by executeCommand().
224 if (!$this->
access->checkAccess(
"write",
"", $this->getParentRefId())) {
225 $this->main_tpl->setOnScreenMessage(
'failure', $this->
language->txt(
"permission_denied"),
true);
226 $this->
ctrl->redirect($this, self::CMD_INDEX);
229 $users = explode(
',', $_POST[
'user_login']);
231 foreach ($users as $user) {
234 $user_ids[] = $user_id;
238 if (!count($user_ids)) {
239 $this->main_tpl->setOnScreenMessage(
'failure', $this->
language->txt(
"user_not_found"),
true);
240 $this->
ctrl->redirect($this, self::CMD_INDEX);
245 if ($position_id === 0 || !$this->positionRepo->getSingle($position_id,
'id')) {
246 $this->main_tpl->setOnScreenMessage(
'failure', $this->
language->txt(
"user_not_found"),
true);
247 $this->
ctrl->redirect($this, self::CMD_INDEX);
249 foreach ($user_ids as $user_id) {
250 $assignment = $this->assignmentRepo->get($user_id, $position_id, $this->
getParentRefId());
253 $this->main_tpl->setOnScreenMessage(
'success', $this->
language->txt(
"users_successfuly_added"),
true);
254 $this->
ctrl->redirect($this, self::CMD_INDEX);
const CORE_POSITION_EMPLOYEE
static _lookupId($a_user_str)
◆ addStaffFromSearch()
| ilOrgUnitUserAssignmentGUI::addStaffFromSearch |
( |
array |
$user_ids, |
|
|
?string |
$user_type = null |
|
) |
| |
- Parameters
-
Definition at line 260 of file class.ilOrgUnitUserAssignmentGUI.php.
References ILIAS\Repository\access(), ilOrgUnitPosition\CORE_POSITION_EMPLOYEE, ILIAS\Repository\ctrl(), ILIAS\Modules\OrgUnit\ARHelper\BaseCommands\getParentRefId(), ILIAS\Repository\int(), and ILIAS\UI\examples\Symbol\Glyph\Language\language().
262 if (!$this->
access->checkAccess(
"write",
"", $this->getParentRefId())) {
263 $this->main_tpl->setOnScreenMessage(
'failure', $this->
language->txt(
"permission_denied"),
true);
264 $this->
ctrl->redirect($this, self::CMD_INDEX);
267 if (!count($user_ids)) {
268 $this->main_tpl->setOnScreenMessage(
'failure', $this->
language->txt(
"user_not_found"),
true);
269 $this->
ctrl->redirect($this, self::CMD_INDEX);
274 if ($position_id === 0 || !$this->positionRepo->getSingle($position_id,
'id')) {
275 $this->main_tpl->setOnScreenMessage(
'failure', $this->
language->txt(
"user_not_found"),
true);
276 $this->
ctrl->redirect($this, self::CMD_INDEX);
278 foreach ($user_ids as $user_id) {
279 $assignment = $this->assignmentRepo->get($user_id, $position_id, $this->
getParentRefId());
282 $this->main_tpl->setOnScreenMessage(
'success', $this->
language->txt(
"users_successfuly_added"),
true);
283 $this->
ctrl->redirect($this, self::CMD_INDEX);
const CORE_POSITION_EMPLOYEE
◆ addSubTabs()
| ilOrgUnitUserAssignmentGUI::addSubTabs |
( |
| ) |
|
◆ assignmentsRecursive()
| ilOrgUnitUserAssignmentGUI::assignmentsRecursive |
( |
| ) |
|
|
protected |
◆ cancel()
| ilOrgUnitUserAssignmentGUI::cancel |
( |
| ) |
|
|
protected |
◆ confirm()
| ilOrgUnitUserAssignmentGUI::confirm |
( |
| ) |
|
|
protected |
◆ confirmRecursive()
| ilOrgUnitUserAssignmentGUI::confirmRecursive |
( |
| ) |
|
|
protected |
◆ delete()
| ilOrgUnitUserAssignmentGUI::delete |
( |
| ) |
|
|
protected |
Definition at line 183 of file class.ilOrgUnitUserAssignmentGUI.php.
References $params, cancel(), ILIAS\Repository\ctrl(), ILIAS\Modules\OrgUnit\ARHelper\BaseCommands\getParentRefId(), ILIAS\FileDelivery\http(), ILIAS\Repository\int(), and ILIAS\UI\examples\Symbol\Glyph\Language\language().
185 $params = $this->
http->request()->getQueryParams();
186 $usr_id = (
int) $_POST[
'usr_id'];
189 $assignment = $this->assignmentRepo->find(
195 $this->main_tpl->setOnScreenMessage(
'failure', $this->
language->txt(
"user_not_found_to_delete"),
true);
196 $this->
ctrl->redirect($this, self::CMD_INDEX);
198 $this->assignmentRepo->delete($assignment);
200 $this->main_tpl->setOnScreenMessage(
'success', $this->
language->txt(
'remove_successful'),
true);
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
static http()
Fetches the global http state from ILIAS.
◆ deleteRecursive()
| ilOrgUnitUserAssignmentGUI::deleteRecursive |
( |
| ) |
|
|
protected |
◆ executeCommand()
| ilOrgUnitUserAssignmentGUI::executeCommand |
( |
| ) |
|
Definition at line 63 of file class.ilOrgUnitUserAssignmentGUI.php.
References $r, ilObjOrgUnitAccess\_checkAccessPositions(), ilObjOrgUnitAccess\_checkAccessStaff(), addStaff(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), and ILIAS\UI\examples\Symbol\Glyph\Language\language().
67 (
int) filter_input(INPUT_GET,
"ref_id", FILTER_SANITIZE_NUMBER_INT)
71 (
int) filter_input(INPUT_GET,
"ref_id", FILTER_SANITIZE_NUMBER_INT)
74 $this->main_tpl->setOnScreenMessage(
'failure', $this->
language->txt(
"permission_denied"),
true);
75 $this->
ctrl->redirectByClass(ilObjOrgUnitGUI::class);
78 $r = $this->
http->request();
79 switch ($this->
ctrl->getNextClass()) {
80 case strtolower(ilRepositorySearchGUI::class):
81 switch ($this->
ctrl->getCmd()) {
82 case 'addUserFromAutoComplete':
83 if (
$r->getQueryParams()[
'addusertype'] ==
"staff") {
89 $repo->setCallback($this,
'addStaffFromSearch');
90 $this->
ctrl->forwardCommand($repo);
96 parent::executeCommand();
static http()
Fetches the global http state from ILIAS.
static _checkAccessStaff(int $ref_id)
static _checkAccessPositions(int $ref_id)
◆ getConfirmationGUI()
| ilOrgUnitUserAssignmentGUI::getConfirmationGUI |
( |
| ) |
|
|
protected |
◆ index()
| ilOrgUnitUserAssignmentGUI::index |
( |
| ) |
|
|
protected |
Definition at line 101 of file class.ilOrgUnitUserAssignmentGUI.php.
References ILIAS\Modules\OrgUnit\ARHelper\BaseCommands\activeSubTab(), addSubTabs(), ILIAS\Repository\ctrl(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), ILIAS\Modules\OrgUnit\ARHelper\BaseCommands\setContent(), and ILIAS\Repository\toolbar().
107 $types = $this->positionRepo->getArray(
'id',
'title');
109 $this->
ctrl->setParameterByClass(ilRepositorySearchGUI::class,
'addusertype',
'staff');
111 'auto_complete_name' => $this->
language->txt(
'user'),
112 'user_type' => $types,
113 'submit_name' => $this->
language->txt(
'add'),
118 foreach ($this->positionRepo->getPositionsForOrgUnit($this->getParentRefId()) as $ilOrgUnitPosition) {
124 $html .= $ilOrgUnitUserAssignmentTableGUI->getHTML();
activeSubTab(string $subtab_id)
static fillAutoCompleteToolbar(object $parent_object, ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
array( auto_complete_name = $lng->txt('user'), auto_complete_size = 15, user_type = array(ilCoursePar...
Class ilOrgUnitUserAssignmentTableGUI.
◆ $access
◆ $assignmentRepo
◆ $ctrl
| ilCtrl ilOrgUnitUserAssignmentGUI::$ctrl |
|
private |
◆ $http
| Services ilOrgUnitUserAssignmentGUI::$http |
|
private |
◆ $language
◆ $main_tpl
◆ $positionRepo
◆ $toolbar
◆ CMD_ASSIGNMENTS_RECURSIVE
◆ SUBTAB_ASSIGNMENTS
| const ilOrgUnitUserAssignmentGUI::SUBTAB_ASSIGNMENTS = 'user_assignments' |
◆ SUBTAB_ASSIGNMENTS_RECURSIVE
| const ilOrgUnitUserAssignmentGUI::SUBTAB_ASSIGNMENTS_RECURSIVE = 'user_assignments_recursive' |
The documentation for this class was generated from the following file: