Skip to content
Snippets Groups Projects

3284919: Add configuration to Views field to show only user assigned sections

2 unresolved threads

Closes #3284919

Merge request reports

Members who can merge are allowed to add commits.
Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
52 53 ->setUserSectionStorage($container->get('workbench_access.user_section_storage'));
53 54 }
54 55
56 /**
57 * {@inheritdoc}
58 */
59 public function buildOptionsForm(&$form, FormStateInterface $form_state) {
60 parent::buildOptionsForm($form, $form_state);
61 $form['display_assigned'] = [
62 '#type' => 'checkbox',
63 '#title' => $this->t('Display user\'s assigned sections'),
64 '#default_value' => $this->options['display_assigned'],
65 ];
  • 101 if ($this->manager->userInAll($this->scheme, $user)) {
    102 $sections = $this->manager->getAllSections($this->scheme, TRUE);
    127
    128 if ($this->options['display_assigned']) {
    129 $sections = $this->userSectionStorage->getUserSections($this->scheme, $user);
    103 130 }
    104 131 else {
    105 $sections = $this->userSectionStorage->getUserSections($this->scheme, $user);
    132 if ($this->manager->userInAll($this->scheme, $user)) {
    133 $sections = $this->manager->getAllSections($this->scheme, TRUE);
    134 }
    135 else {
    136 $sections = $this->userSectionStorage->getUserSections($this->scheme, $user);
    137 }
    106 138 }
    139
    Please register or sign in to reply
    Loading