Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOIA-453: New field field_webform_submission_website in foia_request … #594

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies:
- field.field.foia_request.foia_request.field_submission_time
- field.field.foia_request.foia_request.field_tracking_number
- field.field.foia_request.foia_request.field_webform_submission_id
- field.field.foia_request.foia_request.field_webform_submission_website
module:
- foia_request
_core:
Expand Down Expand Up @@ -106,6 +107,13 @@ content:
settings:
placeholder: ''
third_party_settings: { }
field_webform_submission_website:
type: boolean_checkbox
weight: 16
region: content
settings:
display_label: true
third_party_settings: { }
request_status:
type: options_select
weight: -1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies:
- field.field.foia_request.foia_request.field_submission_time
- field.field.foia_request.foia_request.field_tracking_number
- field.field.foia_request.foia_request.field_webform_submission_id
- field.field.foia_request.foia_request.field_webform_submission_website
module:
- foia_request
- options
Expand Down Expand Up @@ -123,6 +124,16 @@ content:
third_party_settings: { }
weight: 10
region: content
field_webform_submission_website:
type: boolean
label: above
settings:
format: default
format_custom_false: ''
format_custom_true: ''
third_party_settings: { }
weight: 13
region: content
request_status:
type: list_default
label: inline
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
uuid: 87e9b2c7-77fc-4f35-9590-92b844584b72
langcode: en
status: true
dependencies:
config:
- field.storage.foia_request.field_webform_submission_website
module:
- foia_request
id: foia_request.foia_request.field_webform_submission_website
field_name: field_webform_submission_website
entity_type: foia_request
bundle: foia_request
label: 'Submitted from Website'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
on_label: 'Yes'
off_label: 'No'
field_type: boolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
uuid: 5e6f7949-4d28-4284-a78b-69ed9a60abda
langcode: en
status: true
dependencies:
module:
- field_permissions
- foia_request
third_party_settings:
field_permissions:
permission_type: public
id: foia_request.field_webform_submission_website
field_name: field_webform_submission_website
entity_type: foia_request
type: boolean
settings: { }
module: core
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ protected function getComponentAssociatedToWebform(WebformSubmissionInterface $w
protected function createFoiaRequest(WebformSubmissionInterface $webformSubmission, NodeInterface $agencyComponent) {
$foiaRequest = FoiaRequest::create([
'field_webform_submission_id' => $webformSubmission->id(),
'field_webform_submission_website' => isset($_SERVER["HTTP_X_API_USER_ID"]) && $_SERVER["HTTP_X_API_USER_ID"] === \Drupal::config('foia.secrets')->get('api_user_id') ? TRUE : FALSE,
'field_agency_component' => [
'target_id' => $agencyComponent->id(),
],
Expand Down