Skip to content

Commit

Permalink
Now seems to work.
Browse files Browse the repository at this point in the history
  • Loading branch information
agger-magenta committed Oct 19, 2021
1 parent 99cc06d commit c267a01
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
36 changes: 20 additions & 16 deletions config/optional/webform.webform.move_many_externals.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
uuid: 1332ce5c-9126-4d4f-93dd-650b5de6d277
uuid: 69fb2bde-6383-4f71-a0ad-e4a310fddac0
langcode: en
status: open
dependencies:
Expand Down Expand Up @@ -81,7 +81,16 @@ elements: |
'#selection_settings':
include_anonymous: false
filter:
type: _none
type: role
role:
borger: borger
administrator: 0
flow_designer: 0
forloeb_designer: 0
sagsbehandler: 0
medarbejder: 0
leder: 0
virksomhed: 0
approval_information:
'#type': fieldset
'#title': 'Approval Information'
Expand Down Expand Up @@ -280,20 +289,6 @@ access:
users: { }
permissions: { }
handlers:
load_organization_unit:
id: org_unit
label: 'Load Organization Unit'
notes: ''
handler_id: load_organization_unit
status: true
conditions:
enabled:
':input[name="organizational_unit"]':
filled: true
':input[name="origin_unit"]':
empty: true
weight: 0
settings: { }
spawn_maestro_workflow:
id: maestro
label: 'Spawn Maestro Workflow'
Expand All @@ -306,4 +301,13 @@ handlers:
maestro_template: move_many_externals
maestro_message_success: ''
maestro_message_failure: ''
load_organization_unit:
id: org_unit
label: 'Load Organization Unit'
notes: ''
handler_id: load_organization_unit
status: true
conditions: { }
weight: 0
settings: { }
variants: { }
4 changes: 1 addition & 3 deletions src/Plugin/WebformHandler/OrgunitWebformHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public function alterForm(
WebformSubmissionInterface $webform_submission
) {

GIRUtils::formsLog()->notice('ALTER: ' . json_encode($form));
$values = $webform_submission->getData();

if (!array_key_exists('organizational_unit', $values)) {
Expand All @@ -57,8 +56,7 @@ public function alterForm(
$user = user_load_by_name($username);
$external_options[$user->id()] = $username;
}
$form['elements']['move-externals']['externals']['#options'] = $external_options;

$form['elements']['move_externals']['origin_and_destination_units']['externals']['#options'] = $external_options;
}
}
}
Expand Down

0 comments on commit c267a01

Please # to comment.