ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilOrgUnitPositionGUI Class Reference

Class ilOrgUnitPositionGUI. More...

+ Inheritance diagram for ilOrgUnitPositionGUI:
+ Collaboration diagram for ilOrgUnitPositionGUI:

Public Member Functions

 __construct ()
 
 getSinglePosLinkTarget (string $action, int $pos_id=null)
 
 addSubTabs ()
 
- Public Member Functions inherited from ILIAS\components\OrgUnit\ARHelper\BaseCommands
 getParentGui ()
 
 setParentGui (BaseCommands $parent_gui)
 
 executeCommand ()
 
 addSubTabs ()
 

Data Fields

const SUBTAB_SETTINGS = 'settings'
 
const SUBTAB_PERMISSIONS = 'obj_orgunit_positions'
 
const CMD_CONFIRM_DELETION = 'confirmDeletion'
 
const CMD_ASSIGN = 'assign'
 
- Data Fields inherited from ILIAS\components\OrgUnit\ARHelper\BaseCommands
const CMD_INDEX = "index"
 
const CMD_DEFAULT_PERMISSIONS = "defaultPermissions"
 
const CMD_ADD = "add"
 
const CMD_CREATE = "create"
 
const CMD_EDIT = "edit"
 
const CMD_UPDATE = "update"
 
const CMD_CONFIRM = "confirm"
 
const CMD_DELETE = "delete"
 
const CMD_CANCEL = "cancel"
 
const AR_ID = "arid"
 

Protected Member Functions

 getPossibleNextClasses ()
 
 getActiveTabId ()
 
 index ()
 
 add ()
 
 create ()
 
 edit ()
 
 update ()
 
 defaultPermissions ()
 
 updateDefaultPermissions ()
 
 getDefaultPermissionsForm (int $position_id)
 
 getTitleForFormHeaderByContext (string $context)
 
 redirectIfCancelled ()
 
 assign (int $position_id)
 
 confirmDeletion ()
 
 delete ()
 
 cancel ()
 
 getPositionFromRequest ()
 
 getTable ()
 
- Protected Member Functions inherited from ILIAS\components\OrgUnit\ARHelper\BaseCommands
 __construct (protected array $query_namespace=['orgu', 'posedit'])
 
 index ()
 
 getPossibleNextClasses ()
 
 getActiveTabId ()
 
 cancel ()
 
 setContent (string $html)
 
 pushSubTab (string $subtab_id, string $url)
 
 activeSubTab (string $subtab_id)
 
 getParentRefId ()
 
 getRowIdFromQuery ()
 

Protected Attributes

ilToolbarGUI $toolbar
 
ILIAS UI Component Link Factory $link_factory
 
ilOrgUnitPositionDBRepository $positionRepo
 
ilOrgUnitUserAssignmentDBRepository $assignmentRepo
 
ilOrgUnitPermissionDBRepository $permissionRepo
 
ilObjectDefinition $objectDefinition
 
ILIAS HTTP Wrapper ArrayBasedRequestWrapper $post
 
- Protected Attributes inherited from ILIAS\components\OrgUnit\ARHelper\BaseCommands
ilLanguage $lng
 
ilCtrl $ctrl
 
ilAccess $access
 
ILIAS HTTP Services $http
 
ilGlobalTemplateInterface $tpl
 
BaseCommands $parent_gui = null
 
URLBuilder $url_builder
 
URLBuilderToken $action_token = null
 
URLBuilderToken $row_id_token
 
DataFactory $data_factory
 
Refinery $refinery
 
ServerRequestInterface $request
 
ILIAS HTTP Wrapper ArrayBasedRequestWrapper $query
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 

Private Member Functions

 getAuthorityDescription (array $authorities)
 Returns descriptions for authorities as an array of strings. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitPositionGUI::__construct ( )

Definition at line 48 of file class.ilOrgUnitPositionGUI.php.

References $DIC, $dic, $ref_id, ILIAS\GlobalScreen\Provider\__construct(), ilObjOrgUnitAccess\_checkAccessPositions(), ILIAS\Repository\ctrl(), ilOrgUnitLocalDIC\dic(), ILIAS\Repository\initRequest(), ILIAS\Repository\lng(), ILIAS\Repository\objectDefinition(), and ILIAS\Repository\toolbar().

49  {
51  $this->positionRepo = $dic["repo.Positions"];
52  $this->assignmentRepo = $dic["repo.UserAssignments"];
53  $this->permissionRepo = $dic["repo.Permissions"];
54 
55  $to_int = $dic['refinery']->kindlyTo()->int();
56  $ref_id = $dic['query']->retrieve('ref_id', $to_int);
57  $this->link_factory = $dic['ui.factory']->link();
58 
60 
61  global $DIC;
62  $this->toolbar = $DIC->toolbar();
63  $this->objectDefinition = $DIC["objDefinition"];
64 
65  $this->initRequest(
66  $DIC->http(),
67  $dic['refinery']
68  );
69 
71  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"), true);
72  $this->ctrl->redirectByClass(ilObjOrgUnitGUI::class);
73  }
74 
75  $this->post = $DIC->http()->wrapper()->post();
76  }
initRequest(HTTP\Services $http, Refinery\Factory $refinery, ?array $passed_query_params=null, ?array $passed_post_data=null)
Query params and post data parameters are used for testing.
$ref_id
Definition: ltiauth.php:66
global $DIC
Definition: shib_login.php:25
static _checkAccessPositions(int $ref_id)
__construct(Container $dic, ilPlugin $plugin)
$dic
Definition: ltiresult.php:33
+ Here is the call graph for this function:

Member Function Documentation

◆ add()

ilOrgUnitPositionGUI::add ( )
protected

Definition at line 103 of file class.ilOrgUnitPositionGUI.php.

103  : void
104  {
105  $position = $this->positionRepo->create();
106  $form = new ilOrgUnitPositionFormGUI($this, $position);
107  $this->tpl->setContent($form->getHTML());
108  }
Class ilOrgUnitPositionFormGUI.

◆ addSubTabs()

ilOrgUnitPositionGUI::addSubTabs ( )

Definition at line 346 of file class.ilOrgUnitPositionGUI.php.

References getSinglePosLinkTarget(), and ILIAS\components\OrgUnit\ARHelper\BaseCommands\pushSubTab().

Referenced by defaultPermissions(), and edit().

346  : void
347  {
348  $this->pushSubTab(
349  self::SUBTAB_SETTINGS,
350  $this->getSinglePosLinkTarget(self::CMD_EDIT)
351  );
352  $this->pushSubTab(
353  self::SUBTAB_PERMISSIONS,
354  $this->getSinglePosLinkTarget(self::CMD_DEFAULT_PERMISSIONS)
355  );
356  }
pushSubTab(string $subtab_id, string $url)
getSinglePosLinkTarget(string $action, int $pos_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ assign()

ilOrgUnitPositionGUI::assign ( int  $position_id)
protected

Definition at line 240 of file class.ilOrgUnitPositionGUI.php.

References cancel(), ilOrgUnitPosition\CORE_POSITION_EMPLOYEE, and ILIAS\Repository\lng().

Referenced by delete().

240  : void
241  {
242  $position = $this->positionRepo->getSingle($position_id, 'id');
243  if ($position->isCorePosition()) {
244  $this->cancel();
245  }
246 
247  $employee_position = $this->positionRepo->getSingle(ilOrgUnitPosition::CORE_POSITION_EMPLOYEE, 'core_identifier');
248  $assignments = $this->assignmentRepo->getByPosition($position->getId());
249  foreach ($assignments as $assignment) {
250  $this->assignmentRepo->store($assignment->withPositionId($employee_position->getId()));
251  }
252 
253  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_assignment_to_employee_done'), true);
254  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ cancel()

ilOrgUnitPositionGUI::cancel ( )
protected

Definition at line 326 of file class.ilOrgUnitPositionGUI.php.

References ILIAS\Repository\ctrl().

Referenced by assign(), and confirmDeletion().

326  : void
327  {
328  $this->ctrl->redirect($this, self::CMD_INDEX);
329  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDeletion()

ilOrgUnitPositionGUI::confirmDeletion ( )
protected

Definition at line 256 of file class.ilOrgUnitPositionGUI.php.

References cancel(), ILIAS\Repository\ctrl(), getAuthorityDescription(), getPositionFromRequest(), and ILIAS\Repository\lng().

256  : void
257  {
258  $position = $this->getPositionFromRequest();
259  if ($position->isCorePosition()) {
260  $this->cancel();
261  }
262  $this->lng->loadLanguageModule('orgu');
263  $position_string = $this->lng->txt("position") . ": ";
264  $authority_string = $this->lng->txt("authorities") . ": ";
265  $user_string = $this->lng->txt("user_assignments") . ": ";
266 
267  $confirmation = new ilConfirmationGUI();
268  $confirmation->setFormAction($this->ctrl->getFormAction($this));
269  $confirmation->setCancel($this->lng->txt(self::CMD_CANCEL), self::CMD_CANCEL);
270  $confirmation->setConfirm($this->lng->txt(self::CMD_DELETE), self::CMD_DELETE);
271  $confirmation->setHeaderText($this->lng->txt('msg_confirm_deletion'));
272  $confirmation->addItem(self::AR_ID, (string) $position->getId(), $position_string
273  . $position->getTitle());
274  // Authorities
275  $authority_string .= implode(", ", $this->getAuthorityDescription($position->getAuthorities()));
276  $confirmation->addItem('authorities', '', $authority_string);
277 
278  // Amount uf user-assignments
279  $userIdsOfPosition = $this->assignmentRepo->getUsersByPosition($position->getId());
280  $ilOrgUnitUserQueries = new ilOrgUnitUserQueries();
281  $usersOfPosition = $ilOrgUnitUserQueries->findAllUsersByUserIds($userIdsOfPosition);
282  $userNames = $ilOrgUnitUserQueries->getAllUserNames($usersOfPosition);
283 
284  $confirmation->addItem('users', '', $user_string . implode(', ', $userNames));
285 
286  $checkbox_assign_users = new ilCheckboxInputGUI('', 'assign_users');
287  $checkbox_assign_users->setChecked(true);
288  $checkbox_assign_users->setValue('1');
289  $checkbox_assign_users->setOptionTitle('Assign affected users to employee role');
290  $confirmation->addItem('assign_users', '', $checkbox_assign_users->render());
291 
292  $this->tpl->setContent($confirmation->getHTML());
293  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getAuthorityDescription(array $authorities)
Returns descriptions for authorities as an array of strings.
+ Here is the call graph for this function:

◆ create()

ilOrgUnitPositionGUI::create ( )
protected

Definition at line 110 of file class.ilOrgUnitPositionGUI.php.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and redirectIfCancelled().

110  : void
111  {
112  $this->redirectIfCancelled();
113  $form = new ilOrgUnitPositionFormGUI($this, $this->positionRepo->create());
114  if ($form->saveObject() === true) {
115  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_position_created'), true);
116  $this->ctrl->redirect($this, self::CMD_INDEX);
117  }
118 
119  $this->tpl->setContent($form->getHTML());
120  }
Class ilOrgUnitPositionFormGUI.
+ Here is the call graph for this function:

◆ defaultPermissions()

ilOrgUnitPositionGUI::defaultPermissions ( )
protected

Definition at line 146 of file class.ilOrgUnitPositionGUI.php.

References ILIAS\components\OrgUnit\ARHelper\BaseCommands\activeSubTab(), addSubTabs(), getDefaultPermissionsForm(), and ILIAS\components\OrgUnit\ARHelper\BaseCommands\getRowIdFromQuery().

Referenced by updateDefaultPermissions().

146  : void
147  {
148  $this->addSubTabs();
149  $this->activeSubTab(self::SUBTAB_PERMISSIONS);
150  $form = $this->getDefaultPermissionsForm($this->getRowIdFromQuery());
151  $this->tpl->setContent($this->ui_renderer->render($form));
152  }
getDefaultPermissionsForm(int $position_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilOrgUnitPositionGUI::delete ( )
protected

Definition at line 295 of file class.ilOrgUnitPositionGUI.php.

References assign(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

295  : void
296  {
297  $position_id = $this->post->retrieve(
298  self::AR_ID,
299  $this->refinery->byTrying([
300  $this->refinery->kindlyTo()->int(),
301  $this->refinery->always(null)
302  ])
303  );
304 
305  if ($position_id === null) {
306  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_position_delete_fail'), true);
307  $this->ctrl->redirect($this, self::CMD_INDEX);
308  }
309 
310  if ($this->post->has('assign_users')
311  && $this->post->retrieve(
312  'assign_users',
313  $this->refinery->byTrying([
314  $this->refinery->kindlyTo()->bool(),
315  $this->refinery->always(false)
316  ])
317  )
318  ) {
319  $this->assign($position_id);
320  }
321  $this->positionRepo->delete($position_id);
322  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_deleted'), true);
323  $this->ctrl->redirect($this, self::CMD_INDEX);
324  }
+ Here is the call graph for this function:

◆ edit()

ilOrgUnitPositionGUI::edit ( )
protected

Definition at line 122 of file class.ilOrgUnitPositionGUI.php.

References ILIAS\components\OrgUnit\ARHelper\BaseCommands\activeSubTab(), addSubTabs(), and getPositionFromRequest().

122  : void
123  {
124  $this->addSubTabs();
125  $this->activeSubTab(self::SUBTAB_SETTINGS);
126  $position = $this->getPositionFromRequest();
127  $form = new ilOrgUnitPositionFormGUI($this, $position);
128  $form->fillForm();
129  $this->tpl->setContent($form->getHTML());
130  }
Class ilOrgUnitPositionFormGUI.
+ Here is the call graph for this function:

◆ getActiveTabId()

ilOrgUnitPositionGUI::getActiveTabId ( )
protected

Definition at line 85 of file class.ilOrgUnitPositionGUI.php.

References ilObjOrgUnitGUI\TAB_POSITIONS.

85  : string
86  {
88  }

◆ getAuthorityDescription()

ilOrgUnitPositionGUI::getAuthorityDescription ( array  $authorities)
private

Returns descriptions for authorities as an array of strings.

Parameters
ilOrgUnitAuthority[]$authorities

Definition at line 391 of file class.ilOrgUnitPositionGUI.php.

References ILIAS\components\OrgUnit\ARHelper\BaseCommands\$lng, ILIAS\GlobalScreen\Scope\Footer\Factory\getTitle(), ilLanguage\loadLanguageModule(), ilOrgUnitAuthority\OVER_EVERYONE, ilOrgUnitAuthority\SCOPE_SAME_ORGU, and ilOrgUnitAuthority\SCOPE_SUBSEQUENT_ORGUS.

Referenced by confirmDeletion().

391  : array
392  {
393  $lang = $this->lng;
394  $lang->loadLanguageModule('orgu');
395  $lang_keys = array(
396  'in',
397  'over',
401  );
402  $t = [];
403  foreach ($lang_keys as $key) {
404  $t[$key] = $lang->txt($key);
405  }
406 
407  $authority_description = [];
408  foreach ($authorities as $authority) {
409  switch ($authority->getOver()) {
411  $over_txt = $t["over_" . $authority->getOver()];
412  break;
413  default:
414  $over_txt = $this->positionRepo
415  ->getSingle($authority->getOver(), 'id')
416  ->getTitle();
417  break;
418  }
419 
420  $authority_description[] = " " . $t["over"] . " " . $over_txt . " " . $t["in"] . " " . $t["scope_" . $authority->getScope()];
421  }
422 
423  return $authority_description;
424  }
loadLanguageModule(string $a_module)
Load language module.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDefaultPermissionsForm()

ilOrgUnitPositionGUI::getDefaultPermissionsForm ( int  $position_id)
protected

Definition at line 167 of file class.ilOrgUnitPositionGUI.php.

References $context, $permissionRepo, getSinglePosLinkTarget(), getTitleForFormHeaderByContext(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ILIAS\UI\Implementation\Component\Input\withValue().

Referenced by defaultPermissions(), and updateDefaultPermissions().

167  : StandardForm
168  {
169  $sections = [];
170  $sections[] = $this->ui_factory->input()->field()->section(
171  [],
172  $this->lng->txt("form_title_org_default_permissions_update")
173  );
174 
175  $form_action = $this->getSinglePosLinkTarget('updateDefaultPermissions', $position_id);
176  $permissions = $this->permissionRepo->getDefaultsForActiveContexts($position_id);
177  $permission_repo = $this->permissionRepo;
178  foreach ($permissions as $perm) {
179  $fields = [];
180  $operations = $perm->getPossibleOperations();
181  foreach ($operations as $operation) {
182  $fields[$operation->getOperationId()] = $this->ui_factory->input()->field()
183  ->checkbox($this->lng->txt("org_op_{$operation->getOperationString()}"))
184  ->withValue(
185  $perm->isOperationIdSelected($operation->getOperationId())
186  );
187  }
188 
189  $context = $perm->getContext()->getContext();
190  $sections[$perm->getId()] = $this->ui_factory->input()->field()
191  ->section($fields, $this->getTitleForFormHeaderByContext($context))
192  ->withAdditionalTransformation(
193  $this->refinery->custom()->transformation(
194  function ($v) use ($operations, $perm, $permission_repo) {
195  $v = array_filter($v);
196  $nu_ops = array_filter($operations, fn($o) => array_key_exists($o->getOperationId(), $v));
197  $protected = $perm->isProtected();
198  //$perm = $permission_repo->update($perm);
199  $perm = $perm->withOperations($nu_ops)->withProtected(false);
200  $permission_repo->store($perm);
201  //$perm=$perm->withProtected($protected);
202  //$permission_repo->store($perm);
203  return true;
204  }
205  )
206  );
207  }
208 
209  return $this->ui_factory->input()->container()->form()->standard($form_action, $sections);
210  }
$context
Definition: webdav.php:31
ilOrgUnitPermissionDBRepository $permissionRepo
getSinglePosLinkTarget(string $action, int $pos_id=null)
withValue($value)
Get an input like this with another value displayed on the client side.
Definition: Group.php:59
getTitleForFormHeaderByContext(string $context)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPositionFromRequest()

ilOrgUnitPositionGUI::getPositionFromRequest ( )
protected

Definition at line 331 of file class.ilOrgUnitPositionGUI.php.

References $id, and ILIAS\components\OrgUnit\ARHelper\BaseCommands\getRowIdFromQuery().

Referenced by confirmDeletion(), edit(), and update().

332  {
333  $id = $this->getRowIdFromQuery();
334  return $this->positionRepo->getSingle($id, 'id');
335  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPossibleNextClasses()

ilOrgUnitPositionGUI::getPossibleNextClasses ( )
protected

Definition at line 78 of file class.ilOrgUnitPositionGUI.php.

78  : array
79  {
80  return array(
81  ilOrgUnitUserAssignmentGUI::class,
82  );
83  }

◆ getSinglePosLinkTarget()

ilOrgUnitPositionGUI::getSinglePosLinkTarget ( string  $action,
int  $pos_id = null 
)

Definition at line 337 of file class.ilOrgUnitPositionGUI.php.

References ILIAS\components\OrgUnit\ARHelper\BaseCommands\getRowIdFromQuery().

Referenced by addSubTabs(), getDefaultPermissionsForm(), and index().

337  : string
338  {
339  $target_id = $pos_id !== null ? [$pos_id] : [$this->getRowIdFromQuery()];
340  return $this->url_builder
341  ->withParameter($this->row_id_token, $target_id)
342  ->withParameter($this->action_token, $action)
343  ->buildURI()->__toString();
344  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTable()

ilOrgUnitPositionGUI::getTable ( )
protected

Definition at line 358 of file class.ilOrgUnitPositionGUI.php.

References ILIAS\components\OrgUnit\ARHelper\BaseCommands\$row_id_token, and ILIAS\Repository\lng().

Referenced by index().

358  : Table\Data
359  {
360  $columns = [
361  'title' => $this->ui_factory->table()->column()->text($this->lng->txt("title")),
362  'description' => $this->ui_factory->table()->column()->text($this->lng->txt("description")),
363  'authorities' => $this->ui_factory->table()->column()->status($this->lng->txt("authorities"))
364  ->withIsSortable(false),
365  ];
366 
367  $actions = [
368  'edit' => $this->ui_factory->table()->action()->single(
369  $this->lng->txt('edit'),
370  $this->url_builder->withParameter($this->action_token, "edit"),
372  ),
373  'delete' => $this->ui_factory->table()->action()->single(
374  $this->lng->txt('delete'),
375  $this->url_builder->withParameter($this->action_token, "confirmDeletion"),
377  ),
378  ];
379 
380  return $this->ui_factory->table()
381  ->data('', $columns, $this->positionRepo)
382  ->withId('orgu_positions')
383  ->withActions($actions);
384  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTitleForFormHeaderByContext()

ilOrgUnitPositionGUI::getTitleForFormHeaderByContext ( string  $context)
protected

Definition at line 212 of file class.ilOrgUnitPositionGUI.php.

References ILIAS\Repository\lng(), ilObjectPlugin\lookupTxtById(), and ILIAS\Repository\objectDefinition().

Referenced by getDefaultPermissionsForm().

213  {
214  $lang_code = "obj_{$context}";
215  if ($this->objectDefinition->isPlugin($context)) {
216  return ilObjectPlugin::lookupTxtById($context, $lang_code);
217  }
218  return $this->lng->txt($lang_code);
219  }
$context
Definition: webdav.php:31
static lookupTxtById(string $plugin_id, string $lang_var)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ index()

ilOrgUnitPositionGUI::index ( )
protected

Definition at line 90 of file class.ilOrgUnitPositionGUI.php.

References $url, getSinglePosLinkTarget(), getTable(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

90  : void
91  {
92  $url = $this->getSinglePosLinkTarget(self::CMD_ADD, 0);
93  $link = $this->link_factory->standard(
94  $this->lng->txt('add_position'),
95  $url
96  );
97  $this->toolbar->addComponent($link);
98 
99  $table = $this->getTable()->withRequest($this->request);
100  $this->tpl->setContent($this->ui_renderer->render($table));
101  }
$url
Definition: shib_logout.php:63
getSinglePosLinkTarget(string $action, int $pos_id=null)
+ Here is the call graph for this function:

◆ redirectIfCancelled()

ilOrgUnitPositionGUI::redirectIfCancelled ( )
protected

Definition at line 221 of file class.ilOrgUnitPositionGUI.php.

References $url, ILIAS\Repository\ctrl(), and ILIAS\Repository\refinery().

Referenced by create(), and update().

222  {
223  if ($this->post->has('cmd')) {
224  $cmd = $this->post->retrieve(
225  'cmd',
226  $this->refinery->custom()->transformation(
227  fn($v) => array_key_first($v)
228  )
229  );
230  if ($cmd === self::CMD_CANCEL) {
231  $url = $this->url_builder
232  ->withParameter($this->action_token, self::CMD_INDEX)
233  ->buildURI()
234  ->__toString();
235  $this->ctrl->redirectToURL($url);
236  }
237  }
238  }
$url
Definition: shib_logout.php:63
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilOrgUnitPositionGUI::update ( )
protected

Definition at line 132 of file class.ilOrgUnitPositionGUI.php.

References ILIAS\Repository\ctrl(), getPositionFromRequest(), ILIAS\Repository\lng(), and redirectIfCancelled().

132  : void
133  {
134  $this->redirectIfCancelled();
135  $position = $this->getPositionFromRequest();
136  $form = new ilOrgUnitPositionFormGUI($this, $position);
137  $form->setValuesByPost();
138  if ($form->saveObject() === true) {
139  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_position_updated'), true);
140  $this->ctrl->redirect($this, self::CMD_INDEX);
141  }
142 
143  $this->tpl->setContent($form->getHTML());
144  }
Class ilOrgUnitPositionFormGUI.
+ Here is the call graph for this function:

◆ updateDefaultPermissions()

ilOrgUnitPositionGUI::updateDefaultPermissions ( )
protected

Definition at line 154 of file class.ilOrgUnitPositionGUI.php.

References defaultPermissions(), getDefaultPermissionsForm(), ILIAS\components\OrgUnit\ARHelper\BaseCommands\getRowIdFromQuery(), and ILIAS\Repository\lng().

154  : void
155  {
156  $form = $this->getDefaultPermissionsForm($this->getRowIdFromQuery())
157  ->withRequest($this->request);
158  if ($form->getData()) {
159  $this->tpl->setOnScreenMessage('success', $this->lng->txt('msg_success_permission_saved'), true);
160  $this->defaultPermissions();
161  } else {
162  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('msg_success_permission_not_saved'), true);
163  $this->tpl->setContent($this->ui_renderer->render($form));
164  }
165  }
getDefaultPermissionsForm(int $position_id)
+ Here is the call graph for this function:

Field Documentation

◆ $assignmentRepo

ilOrgUnitUserAssignmentDBRepository ilOrgUnitPositionGUI::$assignmentRepo
protected

Definition at line 42 of file class.ilOrgUnitPositionGUI.php.

◆ $link_factory

ILIAS UI Component Link Factory ilOrgUnitPositionGUI::$link_factory
protected

Definition at line 40 of file class.ilOrgUnitPositionGUI.php.

◆ $objectDefinition

ilObjectDefinition ilOrgUnitPositionGUI::$objectDefinition
protected

Definition at line 44 of file class.ilOrgUnitPositionGUI.php.

◆ $permissionRepo

ilOrgUnitPermissionDBRepository ilOrgUnitPositionGUI::$permissionRepo
protected

Definition at line 43 of file class.ilOrgUnitPositionGUI.php.

Referenced by getDefaultPermissionsForm().

◆ $positionRepo

ilOrgUnitPositionDBRepository ilOrgUnitPositionGUI::$positionRepo
protected

Definition at line 41 of file class.ilOrgUnitPositionGUI.php.

◆ $post

ILIAS HTTP Wrapper ArrayBasedRequestWrapper ilOrgUnitPositionGUI::$post
protected

Definition at line 45 of file class.ilOrgUnitPositionGUI.php.

◆ $toolbar

ilToolbarGUI ilOrgUnitPositionGUI::$toolbar
protected

Definition at line 39 of file class.ilOrgUnitPositionGUI.php.

◆ CMD_ASSIGN

const ilOrgUnitPositionGUI::CMD_ASSIGN = 'assign'

Definition at line 37 of file class.ilOrgUnitPositionGUI.php.

◆ CMD_CONFIRM_DELETION

const ilOrgUnitPositionGUI::CMD_CONFIRM_DELETION = 'confirmDeletion'

Definition at line 36 of file class.ilOrgUnitPositionGUI.php.

◆ SUBTAB_PERMISSIONS

const ilOrgUnitPositionGUI::SUBTAB_PERMISSIONS = 'obj_orgunit_positions'

Definition at line 35 of file class.ilOrgUnitPositionGUI.php.

◆ SUBTAB_SETTINGS

const ilOrgUnitPositionGUI::SUBTAB_SETTINGS = 'settings'

Definition at line 34 of file class.ilOrgUnitPositionGUI.php.


The documentation for this class was generated from the following file: