diff --git a/civiremote_funding.info.yml b/civiremote_funding.info.yml index 8b60cdd..2e0459a 100644 --- a/civiremote_funding.info.yml +++ b/civiremote_funding.info.yml @@ -8,6 +8,7 @@ dependencies: - cmrf_views - civiremote - json_forms + - views_current_path # Requires this patch: https://git.drupalcode.org/project/views_current_path/-/merge_requests/8.patch 'interface translation project': civiremote_funding 'interface translation server pattern': modules/custom/%project/translations/%language.po version: 0.3.x-dev diff --git a/civiremote_funding.routing.yml b/civiremote_funding.routing.yml index 90e2369..34f50cd 100644 --- a/civiremote_funding.routing.yml +++ b/civiremote_funding.routing.yml @@ -70,6 +70,19 @@ civiremote_funding.application_template_render: requirements: _permission: 'civiremote_funding: access' +civiremote_funding.application_clearing: + path: '/civiremote/funding/application/{applicationProcessId}/clearing' + defaults: + _controller: 'Drupal\civiremote_funding\Controller\ClearingController:formByApplicationProcessId' + _title_callback: 'Drupal\civiremote_funding\Controller\ClearingController:title' + options: + no_cache: TRUE + parameters: + applicationProcessId: + type: int + requirements: + _permission: 'civiremote_funding: access' + civiremote_funding.case: path: '/civiremote/funding/case/{fundingCaseId}' defaults: @@ -123,6 +136,21 @@ civiremote_funding.case_application_history: requirements: _permission: 'civiremote_funding: access' +civiremote_funding.case_application_clearing: + path: '/civiremote/funding/case/{fundingCaseId}/application/{applicationProcessId}/clearing' + defaults: + _controller: 'Drupal\civiremote_funding\Controller\ClearingController:formByApplicationProcessId' + _title_callback: 'Drupal\civiremote_funding\Controller\ClearingController:title' + options: + no_cache: TRUE + parameters: + fundingCaseId: + type: int + applicationProcessId: + type: int + requirements: + _permission: 'civiremote_funding: access' + civiremote_funding.token_file_download: path: '/civiremote/funding/file/{token}/{filename}' defaults: diff --git a/civiremote_funding.services.yml b/civiremote_funding.services.yml index 4310a90..7a17a5c 100644 --- a/civiremote_funding.services.yml +++ b/civiremote_funding.services.yml @@ -64,6 +64,10 @@ services: class: Drupal\civiremote_funding\Controller\NewApplicationController public: true + Drupal\civiremote_funding\Controller\ClearingController: + class: Drupal\civiremote_funding\Controller\ClearingController + public: true + Drupal\civiremote_funding\Controller\FundingCaseController: class: Drupal\civiremote_funding\Controller\FundingCaseController public: true @@ -84,6 +88,10 @@ services: class: Drupal\civiremote_funding\Form\RequestHandler\ApplicationFormRequestHandler public: true + Drupal\civiremote_funding\Form\RequestHandler\ClearingFormRequestHandler: + class: Drupal\civiremote_funding\Form\RequestHandler\ClearingFormRequestHandler + public: true + Drupal\civiremote_funding\Form\RequestHandler\NewFundingCaseFormRequestHandler: class: Drupal\civiremote_funding\Form\RequestHandler\NewFundingCaseFormRequestHandler public: true diff --git a/composer.json b/composer.json index 4e93a74..0ec1dcf 100644 --- a/composer.json +++ b/composer.json @@ -56,7 +56,8 @@ "beberlei/assert": "*", "custom/civiremote": "^1.0@beta", "drupal/cmrf_core": "^2.1@beta", - "drupal/json_forms": "~0.1" + "drupal/json_forms": "~0.1", + "drupal/views_current_path": "^3.0" }, "require-dev": { "drupal/core": "^9.5 || ^10", diff --git a/config/optional/views.view.civiremote_funding_application_list.yml b/config/optional/views.view.civiremote_funding_application_list.yml index 82aa5c9..eb921ca 100644 --- a/config/optional/views.view.civiremote_funding_application_list.yml +++ b/config/optional/views.view.civiremote_funding_application_list.yml @@ -4,6 +4,7 @@ dependencies: module: - cmrf_views - user + - views_current_path id: civiremote_funding_application_list label: 'CiviCRM Funding Application List (non-combined)' module: views @@ -411,6 +412,58 @@ display: delta_first_last: false multi_type: separator separator: ', ' + application_process_modification_date: + id: application_process_modification_date + table: cmrf_views_civiremote_funding_caseinfo + field: application_process_modification_date + relationship: none + group_type: group + admin_label: '' + plugin_id: cmrf_views_date + label: 'Modification Date' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + date_format: short + custom_date_format: '' + timezone: '' application_process_amount_requested: id: application_process_amount_requested table: cmrf_views_civiremote_funding_caseinfo @@ -422,8 +475,8 @@ display: label: 'Requested Funding' exclude: false alter: - alter_text: true - text: '{{ application_process_amount_requested }} {{ funding_program_currency }}' + alter_text: false + text: '' make_link: false path: '' absolute: false @@ -461,6 +514,66 @@ display: empty_zero: false hide_alter_empty: true set_precision: false + precision: 2 + decimal: . + separator: ',' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{funding_program_currency}}' + clearing_process_amount_cleared: + id: clearing_process_amount_cleared + table: cmrf_views_civiremote_funding_caseinfo + field: clearing_process_amount_cleared + relationship: none + group_type: group + admin_label: '' + plugin_id: numeric + label: 'Amount Cleared' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: true + empty_zero: false + hide_alter_empty: true + set_precision: false precision: 0 decimal: . separator: ',' @@ -468,15 +581,18 @@ display: format_plural_string: !!binary MQNAY291bnQ= prefix: '' suffix: '' - application_process_modification_date: - id: application_process_modification_date + format_language_aware: true + format_style: 2 + currency: '{{funding_program_currency}}' + clearing_process_amount_admitted: + id: clearing_process_amount_admitted table: cmrf_views_civiremote_funding_caseinfo - field: application_process_modification_date + field: clearing_process_amount_admitted relationship: none group_type: group admin_label: '' - plugin_id: cmrf_views_date - label: 'Modification Date' + plugin_id: numeric + label: 'Amount Admitted' exclude: false alter: alter_text: false @@ -514,12 +630,130 @@ display: element_wrapper_class: '' element_default_classes: true empty: '' + hide_empty: true + empty_zero: false + hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: ',' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{funding_program_currency}}' + current_path: + id: current_path + table: views + field: current_path + relationship: none + group_type: group + admin_label: '' + plugin_id: current_path + label: 'Current path' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' hide_empty: false empty_zero: false hide_alter_empty: true - date_format: short - custom_date_format: '' - timezone: '' + path_format: raw-relative + query_string_support: bypass-query-string + query_params_filter: { } + query_params_filter_with_value: { } + query_params_renaming: { } + query_params_trim: 0 + query_params_lower: 0 + cache_user: 0 + application_process_is_eligible_1: + id: application_process_is_eligible_1 + table: cmrf_views_civiremote_funding_caseinfo + field: application_process_is_eligible + relationship: none + group_type: group + admin_label: '' + plugin_id: boolean + label: 'Link to clearing form' + exclude: true + alter: + alter_text: false + text: '' + make_link: true + path: 'civiremote/funding/application/{{application_process_id}}/clearing?destination={{current_path}}' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: true + empty_zero: false + hide_alter_empty: true + type: custom + type_custom_true: 'Open clearing' + type_custom_false: '' + not: false nothing: id: nothing table: views @@ -534,7 +768,7 @@ display: alter_text: true text: 'Open application' make_link: true - path: 'civiremote/funding/application/{{ application_process_id }}' + path: 'civiremote/funding/application/{{ application_process_id }}?destination={{current_path}}' absolute: false external: false replace_spaces: false @@ -583,7 +817,7 @@ display: alter_text: true text: 'Show history' make_link: true - path: 'civiremote/funding/application/{{ application_process_id }}/history' + path: 'civiremote/funding/application/{{ application_process_id }}/history?destination={{current_path}}' absolute: false external: false replace_spaces: false @@ -667,8 +901,9 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - destination: true + destination: false fields: + application_process_is_eligible_1: application_process_is_eligible_1 nothing: nothing nothing_1: nothing_1 funding_program_currency: '0' @@ -678,11 +913,11 @@ display: funding_program_title: '0' application_process_title: '0' application_process_status: '0' - application_process_amount_requested: '0' - application_process_creation_date: '0' application_process_modification_date: '0' - application_process_start_date: '0' - application_process_end_date: '0' + application_process_amount_requested: '0' + clearing_process_amount_cleared: '0' + clearing_process_amount_admitted: '0' + current_path: '0' pager: type: full options: diff --git a/config/optional/views.view.civiremote_funding_combined_application_process_list.yml b/config/optional/views.view.civiremote_funding_combined_application_process_list.yml index 5f948ec..3310e0a 100644 --- a/config/optional/views.view.civiremote_funding_combined_application_process_list.yml +++ b/config/optional/views.view.civiremote_funding_combined_application_process_list.yml @@ -4,6 +4,7 @@ dependencies: module: - cmrf_views - user + - views_current_path id: civiremote_funding_combined_application_process_list label: 'CiviCRM Funding Combined Application Process List' module: views @@ -136,6 +137,61 @@ display: format_plural_string: !!binary MQNAY291bnQ= prefix: '' suffix: '' + currency: + id: currency + table: cmrf_views_civiremote_funding_application_process + field: currency + relationship: none + group_type: group + admin_label: '' + plugin_id: cmrf_views_standard + label: Currency + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + delta_limit: 0 + delta_offset: 0 + delta_reversed: false + delta_first_last: false + multi_type: separator + separator: ', ' title: id: title table: cmrf_views_civiremote_funding_application_process @@ -405,6 +461,243 @@ display: date_format: short custom_date_format: '' timezone: '' + amount_requested: + id: amount_requested + table: cmrf_views_civiremote_funding_application_process + field: amount_requested + relationship: none + group_type: group + admin_label: '' + plugin_id: numeric + label: 'Amount Requested' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: ',' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' + amount_cleared: + id: amount_cleared + table: cmrf_views_civiremote_funding_application_process + field: amount_cleared + relationship: none + group_type: group + admin_label: '' + plugin_id: numeric + label: 'Amount Cleared' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: true + empty_zero: false + hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: ',' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' + amount_admitted: + id: amount_admitted + table: cmrf_views_civiremote_funding_application_process + field: amount_admitted + relationship: none + group_type: group + admin_label: '' + plugin_id: numeric + label: 'Amount Admitted' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: true + empty_zero: false + hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: ',' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' + current_path: + id: current_path + table: views + field: current_path + relationship: none + group_type: group + admin_label: '' + plugin_id: current_path + label: 'Current path' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + path_format: alias-relative + query_string_support: bypass-query-string + query_params_filter: { } + query_params_filter_with_value: { } + query_params_renaming: { } + query_params_trim: 0 + query_params_lower: 0 + cache_user: 0 nothing_1: id: nothing_1 table: views @@ -419,7 +712,7 @@ display: alter_text: true text: 'Open {{arguments.null}}' make_link: true - path: 'civiremote/funding/case/{{funding_case_id}}/application/{{id}}' + path: 'civiremote/funding/case/{{funding_case_id}}/application/{{id}}?destination={{current_path}}' absolute: false external: false replace_spaces: false @@ -468,7 +761,7 @@ display: alter_text: true text: 'Show history' make_link: true - path: 'civiremote/funding/case/{{funding_case_id}}/application/{{id}}/history' + path: 'civiremote/funding/case/{{funding_case_id}}/application/{{id}}/history?destination={{current_path}}' absolute: false external: false replace_spaces: false @@ -503,6 +796,59 @@ display: hide_empty: false empty_zero: false hide_alter_empty: false + is_eligible: + id: is_eligible + table: cmrf_views_civiremote_funding_application_process + field: is_eligible + relationship: none + group_type: group + admin_label: '' + plugin_id: boolean + label: 'Link to clearing form' + exclude: true + alter: + alter_text: false + text: '' + make_link: true + path: 'civiremote/funding/case/{{funding_case_id}}/application/{{id}}/clearing?destination={{current_path}}' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: false + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: true + empty_zero: false + hide_alter_empty: true + type: custom + type_custom_true: 'Open clearing' + type_custom_false: '' + not: false dropbutton: id: dropbutton table: views @@ -552,10 +898,11 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - destination: true + destination: false fields: nothing_1: nothing_1 nothing: nothing + is_eligible: is_eligible id: '0' funding_case_id: '0' title: '0' diff --git a/config/optional/views.view.civiremote_funding_combined_case_list.yml b/config/optional/views.view.civiremote_funding_combined_case_list.yml index 8b2e86b..70069b5 100644 --- a/config/optional/views.view.civiremote_funding_combined_case_list.yml +++ b/config/optional/views.view.civiremote_funding_combined_case_list.yml @@ -4,6 +4,7 @@ dependencies: module: - cmrf_views - user + - views_current_path id: civiremote_funding_combined_case_list label: 'CiviCRM Funding Case List (combined application)' module: views @@ -79,15 +80,15 @@ display: format_plural_string: !!binary MQNAY291bnQ= prefix: '' suffix: '' - funding_program_id__currency: - id: funding_program_id__currency + currency: + id: currency table: cmrf_views_civiremote_fundingcase - field: funding_program_id__currency + field: currency relationship: none group_type: group admin_label: '' plugin_id: cmrf_views_standard - label: '' + label: Currency exclude: true alter: alter_text: false @@ -120,7 +121,7 @@ display: element_class: '' element_label_type: '' element_label_class: '' - element_label_colon: false + element_label_colon: true element_wrapper_type: '' element_wrapper_class: '' element_default_classes: true @@ -241,6 +242,66 @@ display: date_format: short custom_date_format: '' timezone: '' + amount_requested: + id: amount_requested + table: cmrf_views_civiremote_fundingcase + field: amount_requested + relationship: none + group_type: group + admin_label: '' + plugin_id: numeric + label: 'Beantragter Betrag' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: ',' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' amount_approved: id: amount_approved table: cmrf_views_civiremote_fundingcase @@ -252,8 +313,8 @@ display: label: Budget exclude: false alter: - alter_text: true - text: '{{amount_approved}} {{funding_program_id__currency}}' + alter_text: false + text: '' make_link: false path: '' absolute: false @@ -298,6 +359,129 @@ display: format_plural_string: !!binary MQNAY291bnQ= prefix: '' suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' + amount_cleared: + id: amount_cleared + table: cmrf_views_civiremote_fundingcase + field: amount_cleared + relationship: none + group_type: group + admin_label: '' + plugin_id: numeric + label: 'Amount Cleared' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: true + empty_zero: false + hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: ',' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' + amount_admitted: + id: amount_admitted + table: cmrf_views_civiremote_fundingcase + field: amount_admitted + relationship: none + group_type: group + admin_label: '' + plugin_id: numeric + label: 'Amount Admitted' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: true + empty_zero: false + hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: ',' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' status: id: status table: cmrf_views_civiremote_fundingcase @@ -353,6 +537,63 @@ display: delta_first_last: 0 multi_type: separator separator: ', ' + current_path: + id: current_path + table: views + field: current_path + relationship: none + group_type: group + admin_label: '' + plugin_id: current_path + label: 'Current path' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + path_format: raw-relative + query_string_support: bypass-query-string + query_params_filter: { } + query_params_filter_with_value: { } + query_params_renaming: { } + query_params_trim: 0 + query_params_lower: 0 + cache_user: 0 nothing: id: nothing table: views @@ -367,7 +608,7 @@ display: alter_text: true text: 'Open application' make_link: true - path: 'civiremote/funding/case/{{id}}' + path: 'civiremote/funding/case/{{id}}?destination={{current_path}}' absolute: false external: false replace_spaces: false @@ -451,15 +692,19 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - destination: true + destination: false fields: nothing: nothing id: '0' - funding_program_id__currency: '0' - title: '0' + currency: '0' + identifier: '0' creation_date: '0' + amount_requested: '0' amount_approved: '0' + amount_cleared: '0' + amount_admitted: '0' status: '0' + current_path: '0' pager: type: full options: diff --git a/config/optional/views.view.civiremote_funding_drawdown_list.yml b/config/optional/views.view.civiremote_funding_drawdown_list.yml index 93d4d87..050b8be 100644 --- a/config/optional/views.view.civiremote_funding_drawdown_list.yml +++ b/config/optional/views.view.civiremote_funding_drawdown_list.yml @@ -138,8 +138,8 @@ display: label: Amount exclude: false alter: - alter_text: true - text: '{{ amount }} {{currency}}' + alter_text: false + text: '' make_link: false path: '' absolute: false @@ -184,6 +184,9 @@ display: format_plural_string: !!binary MQNAY291bnQ= prefix: '' suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' status: id: status table: cmrf_views_civiremote_funding_drawdown diff --git a/config/optional/views.view.civiremote_funding_transfer_contract.yml b/config/optional/views.view.civiremote_funding_transfer_contract.yml index a9b73b0..d88c066 100644 --- a/config/optional/views.view.civiremote_funding_transfer_contract.yml +++ b/config/optional/views.view.civiremote_funding_transfer_contract.yml @@ -257,8 +257,8 @@ display: label: 'Amount Approved' exclude: false alter: - alter_text: true - text: '{{ amount_approved }} {{currency}}' + alter_text: false + text: '' make_link: false path: '' absolute: false @@ -303,6 +303,9 @@ display: format_plural_string: !!binary MQNAY291bnQ= prefix: '' suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' amount_available: id: amount_available table: cmrf_views_civiremote_funding_transfer_contract @@ -314,8 +317,8 @@ display: label: 'Amount Available' exclude: false alter: - alter_text: true - text: '{{amount_available}} {{currency}}' + alter_text: false + text: '' make_link: false path: '' absolute: false @@ -360,6 +363,9 @@ display: format_plural_string: !!binary MQNAY291bnQ= prefix: '' suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' amount_paid_out: id: amount_paid_out table: cmrf_views_civiremote_funding_transfer_contract @@ -371,8 +377,8 @@ display: label: 'Amount Paid Out' exclude: false alter: - alter_text: true - text: '{{amount_paid_out}} {{currency}}' + alter_text: false + text: '' make_link: false path: '' absolute: false @@ -417,6 +423,129 @@ display: format_plural_string: !!binary MQNAY291bnQ= prefix: '' suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' + amount_cleared: + id: amount_cleared + table: cmrf_views_civiremote_funding_transfer_contract + field: amount_cleared + relationship: none + group_type: group + admin_label: '' + plugin_id: numeric + label: 'Amount Cleared' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: true + empty_zero: false + hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: ',' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' + amount_admitted: + id: amount_admitted + table: cmrf_views_civiremote_funding_transfer_contract + field: amount_admitted + relationship: none + group_type: group + admin_label: '' + plugin_id: numeric + label: 'Amount Admitted' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: true + empty_zero: false + hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: ',' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' nothing: id: nothing table: views @@ -569,23 +698,9 @@ display: empty_zero: false hide_alter_empty: false pager: - type: mini + type: none options: offset: 0 - items_per_page: 10 - total_pages: null - id: 0 - tags: - next: ›› - previous: ‹‹ - expose: - items_per_page: false - items_per_page_label: 'Items per page' - items_per_page_options: '5, 10, 25, 50' - items_per_page_options_all: false - items_per_page_options_all_label: '- All -' - offset: false - offset_label: Offset exposed_form: type: basic options: @@ -685,7 +800,6 @@ display: contexts: - 'languages:language_interface' - url - - url.query_args - user.permissions tags: { } embed_1: @@ -700,6 +814,5 @@ display: contexts: - 'languages:language_interface' - url - - url.query_args - user.permissions tags: { } diff --git a/config/optional/views.view.civiremote_funding_transfer_contract_list.yml b/config/optional/views.view.civiremote_funding_transfer_contract_list.yml index 5dbcde0..b61775c 100644 --- a/config/optional/views.view.civiremote_funding_transfer_contract_list.yml +++ b/config/optional/views.view.civiremote_funding_transfer_contract_list.yml @@ -4,6 +4,7 @@ dependencies: module: - cmrf_views - user + - views_current_path id: civiremote_funding_transfer_contract_list label: 'CiviCRM Funding Transfer Contract List' module: views @@ -312,8 +313,8 @@ display: label: 'Amount Approved' exclude: false alter: - alter_text: true - text: '{{ amount_approved }} {{currency}}' + alter_text: false + text: '' make_link: false path: '' absolute: false @@ -358,6 +359,9 @@ display: format_plural_string: !!binary MQNAY291bnQ= prefix: '' suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' amount_available: id: amount_available table: cmrf_views_civiremote_funding_transfer_contract @@ -369,8 +373,8 @@ display: label: 'Amount Available' exclude: false alter: - alter_text: true - text: '{{amount_available}} {{currency}}' + alter_text: false + text: '' make_link: false path: '' absolute: false @@ -415,6 +419,9 @@ display: format_plural_string: !!binary MQNAY291bnQ= prefix: '' suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' amount_paid_out: id: amount_paid_out table: cmrf_views_civiremote_funding_transfer_contract @@ -426,8 +433,8 @@ display: label: 'Amount Paid Out' exclude: false alter: - alter_text: true - text: '{{amount_paid_out}} {{currency}}' + alter_text: false + text: '' make_link: false path: '' absolute: false @@ -472,6 +479,186 @@ display: format_plural_string: !!binary MQNAY291bnQ= prefix: '' suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' + amount_cleared: + id: amount_cleared + table: cmrf_views_civiremote_funding_transfer_contract + field: amount_cleared + relationship: none + group_type: group + admin_label: '' + plugin_id: numeric + label: 'Amount Cleared' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: true + empty_zero: false + hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: ',' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' + amount_admitted: + id: amount_admitted + table: cmrf_views_civiremote_funding_transfer_contract + field: amount_admitted + relationship: none + group_type: group + admin_label: '' + plugin_id: numeric + label: 'Amount Admitted' + exclude: false + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: true + empty_zero: false + hide_alter_empty: true + set_precision: false + precision: 0 + decimal: . + separator: ',' + format_plural: false + format_plural_string: !!binary MQNAY291bnQ= + prefix: '' + suffix: '' + format_language_aware: true + format_style: 2 + currency: '{{currency}}' + current_path: + id: current_path + table: views + field: current_path + relationship: none + group_type: group + admin_label: '' + plugin_id: current_path + label: 'Current path' + exclude: true + alter: + alter_text: false + text: '' + make_link: false + path: '' + absolute: false + external: false + replace_spaces: false + path_case: none + trim_whitespace: false + alt: '' + rel: '' + link_class: '' + prefix: '' + suffix: '' + target: '' + nl2br: false + max_length: 0 + word_boundary: true + ellipsis: true + more_link: false + more_link_text: '' + more_link_path: '' + strip_tags: false + trim: false + preserve_tags: '' + html: false + element_type: '' + element_class: '' + element_label_type: '' + element_label_class: '' + element_label_colon: true + element_wrapper_type: '' + element_wrapper_class: '' + element_default_classes: true + empty: '' + hide_empty: false + empty_zero: false + hide_alter_empty: true + path_format: raw-relative + query_string_support: bypass-query-string + query_params_filter: { } + query_params_filter_with_value: { } + query_params_renaming: { } + query_params_trim: 0 + query_params_lower: 0 + cache_user: 0 nothing: id: nothing table: views @@ -535,7 +722,7 @@ display: alter_text: true text: 'Create drawdown' make_link: true - path: 'civiremote/funding/transfer-contract/{{funding_case_id}}/payout-process/{{payout_process_id }}/drawdown/add' + path: 'civiremote/funding/transfer-contract/{{funding_case_id}}/payout-process/{{payout_process_id }}/drawdown/add?destination={{current_path}}' absolute: false external: false replace_spaces: false @@ -588,7 +775,7 @@ display: alter_text: true text: 'Show drawdowns' make_link: true - path: 'civiremote/funding/transfer-contract/{{funding_case_id}}/payout-process/{{payout_process_id}}/drawdown' + path: 'civiremote/funding/transfer-contract/{{funding_case_id}}/payout-process/{{payout_process_id}}/drawdown?destination={{current_path}}' absolute: false external: false replace_spaces: false @@ -672,7 +859,7 @@ display: hide_empty: false empty_zero: false hide_alter_empty: true - destination: true + destination: false fields: nothing: nothing CAN_create_drawdown: CAN_create_drawdown @@ -680,11 +867,14 @@ display: funding_case_id: '0' payout_process_id: '0' currency: '0' - title: '0' + identifier: '0' funding_program_title: '0' amount_approved: '0' amount_available: '0' amount_paid_out: '0' + amount_cleared: '0' + amount_admitted: '0' + current_path: '0' pager: type: full options: diff --git a/src/Api/DTO/ClearingProcess.php b/src/Api/DTO/ClearingProcess.php new file mode 100644 index 0000000..00f992f --- /dev/null +++ b/src/Api/DTO/ClearingProcess.php @@ -0,0 +1,66 @@ +. + */ + +declare(strict_types=1); + +namespace Drupal\civiremote_funding\Api\DTO; + +/** + * @phpstan-type payoutProcessT array{ + * id: int, + * funding_case_id: int, + * status: string, + * creation_date: string, + * modification_date: string, + * report_data: array, + * } + * + * @extends AbstractDTO + * + * @codeCoverageIgnore + */ +final class ClearingProcess extends AbstractDTO { + + public function getId(): int { + return $this->values['id']; + } + + public function getFundingCaseId(): int { + return $this->values['funding_case_id']; + } + + public function getStatus(): string { + return $this->values['status']; + } + + public function getCreationDate(): \DateTimeInterface { + return new \DateTime($this->values['creation_date']); + } + + public function getModificationDate(): \DateTimeInterface { + return new \DateTime($this->values['modification_date']); + } + + /** + * @phpstan-return array JSON serializable. + */ + public function getReportData(): array { + return $this->values['report_data']; + } + +} diff --git a/src/Api/FundingApi.php b/src/Api/FundingApi.php index 71fce45..25b0a65 100644 --- a/src/Api/FundingApi.php +++ b/src/Api/FundingApi.php @@ -23,6 +23,7 @@ use Drupal\civiremote_funding\Access\RemoteContactIdProviderInterface; use Drupal\civiremote_funding\Api\DTO\ApplicationProcessActivity; use Drupal\civiremote_funding\Api\DTO\ApplicationProcessTemplate; +use Drupal\civiremote_funding\Api\DTO\ClearingProcess; use Drupal\civiremote_funding\Api\DTO\FundingCase; use Drupal\civiremote_funding\Api\DTO\FundingCaseInfo; use Drupal\civiremote_funding\Api\DTO\FundingCaseType; @@ -441,4 +442,69 @@ public function submitFundingCaseUpdateForm(int $fundingCaseId, array $data): Fo return FormSubmitResponse::fromApiResultValue($result['values']); } + public function getOrCreateClearingProcess(int $applicationProcessId): ClearingProcess { + $result = $this->apiClient->executeV4('RemoteFundingClearingProcess', 'getOrCreate', [ + 'remoteContactId' => $this->remoteContactIdProvider->getRemoteContactId(), + 'applicationProcessId' => $applicationProcessId, + ]); + + // @phpstan-ignore-next-line + return ClearingProcess::fromArray($result['values']); + } + + /** + * @phpstan-return array + * Options with option ID as key. + * + * @throws \Drupal\civiremote_funding\Api\Exception\ApiCallFailedException + */ + public function getClearingStatusOptions(): array { + return FieldOptionsLoader::new($this->apiClient)->getOptions( + $this->remoteContactIdProvider->getRemoteContactId(), + 'RemoteFundingClearingProcess', + 'status' + ); + } + + public function getClearingForm(int $clearingProcessId): FundingForm { + $result = $this->apiClient->executeV4('RemoteFundingClearingProcess', 'getForm', [ + 'remoteContactId' => $this->remoteContactIdProvider->getRemoteContactId(), + 'id' => $clearingProcessId, + ]); + + return FundingForm::fromApiResultValue($result['values']); + } + + /** + * @phpstan-param array $data + * JSON serializable array. + * + * @throws \Drupal\civiremote_funding\Api\Exception\ApiCallFailedException + */ + public function validateClearingForm(int $clearingProcessId, array $data): FormValidationResponse { + $result = $this->apiClient->executeV4('RemoteFundingClearingProcess', 'validateForm', [ + 'remoteContactId' => $this->remoteContactIdProvider->getRemoteContactId(), + 'id' => $clearingProcessId, + 'data' => $data, + ]); + + return FormValidationResponse::fromApiResultValue($result['values']); + } + + /** + * @phpstan-param array $data + * JSON serializable array. + * + * @throws \Drupal\civiremote_funding\Api\Exception\ApiCallFailedException + */ + public function submitClearingForm(int $clearingProcessId, array $data): FormSubmitResponse { + $result = $this->apiClient->executeV4('RemoteFundingClearingProcess', 'submitForm', [ + 'remoteContactId' => $this->remoteContactIdProvider->getRemoteContactId(), + 'id' => $clearingProcessId, + 'data' => $data, + ]); + + return FormSubmitResponse::fromApiResultValue($result['values']); + } + } diff --git a/src/Controller/ApplicationHistoryController.php b/src/Controller/ApplicationHistoryController.php index f2328c1..3c28673 100644 --- a/src/Controller/ApplicationHistoryController.php +++ b/src/Controller/ApplicationHistoryController.php @@ -52,6 +52,7 @@ public function content(int $applicationProcessId, Request $request): array { '#back_link_destination' => DestinationUtil::getDestinationWithoutBasePath($request), '#activities' => $this->fundingApi->getApplicationActivities($applicationProcessId), '#status_options' => $this->fundingApi->getApplicationStatusOptions($applicationProcessId), + '#clearing_status_options' => $this->fundingApi->getClearingStatusOptions(), ]; } diff --git a/src/Controller/ClearingController.php b/src/Controller/ClearingController.php new file mode 100644 index 0000000..7742831 --- /dev/null +++ b/src/Controller/ClearingController.php @@ -0,0 +1,66 @@ +. + */ + +declare(strict_types=1); + +namespace Drupal\civiremote_funding\Controller; + +use Drupal\civiremote_funding\Api\FundingApi; +use Drupal\civiremote_funding\Form\ClearingForm; +use Drupal\Core\Controller\ControllerBase; +use Symfony\Component\HttpFoundation\Request; + +final class ClearingController extends ControllerBase { + + private FundingApi $fundingApi; + + public function __construct(FundingApi $fundingApi) { + $this->fundingApi = $fundingApi; + } + + /** + * @return array + */ + public function formByApplicationProcessId(Request $request, int $applicationProcessId): array { + $clearingProcess = $this->fundingApi->getOrCreateClearingProcess($applicationProcessId); + $request->attributes->set('clearingProcessId', $clearingProcess->getId()); + + $info = $this->fundingApi->getFundingCaseInfoByApplicationProcessId( + $applicationProcessId, + ); + + $form = $this->formBuilder()->getForm(ClearingForm::class); + + // Add identifier to beginning of the form if not already in the title. + if (NULL !== $info && !str_contains($form['#title'], $info->getApplicationProcesIdentifier())) { + $form = array_merge([ + '_identifier' => [ + '#plain_text' => $info->getApplicationProcesIdentifier(), + ], + ], $form); + } + + return $form; + } + + public function title(int $applicationProcessId): ?string { + // @todo Return appropriate title. + return NULL; + } + +} diff --git a/src/Controller/FundingCaseController.php b/src/Controller/FundingCaseController.php index 7237201..6e9ebdc 100644 --- a/src/Controller/FundingCaseController.php +++ b/src/Controller/FundingCaseController.php @@ -65,6 +65,14 @@ public function content(Request $request, int $fundingCaseId): array { '#type' => 'container', ]; + $content['apply_note'] = [ + '#markup' => '

' . $this->t( + 'Please do not forget to apply the combined application if everything is recorded or after additions.' + ) . '

', + ]; + + $content['form'] = $this->formBuilder()->getForm(FundingCaseForm::class); + if (in_array('application_create', $fundingCase->getPermissions(), TRUE)) { $content['add_link'] = [ '#type' => 'link', @@ -94,8 +102,6 @@ public function content(Request $request, int $fundingCaseId): array { '#embed' => TRUE, ]; - $content['form'] = $this->formBuilder()->getForm(FundingCaseForm::class); - return $content; } diff --git a/src/Element/CiviremoteFundingApplicationHistory.php b/src/Element/CiviremoteFundingApplicationHistory.php index 05250dc..d413db2 100644 --- a/src/Element/CiviremoteFundingApplicationHistory.php +++ b/src/Element/CiviremoteFundingApplicationHistory.php @@ -39,6 +39,8 @@ public function getInfo(): array { '#activities' => [], // Array mapping status to \Drupal\civiremote_funding\Api\DTO\Option. '#status_options' => [], + // Array mapping status to \Drupal\civiremote_funding\Api\DTO\Option. + '#clearing_status_options' => [], '#unknown_status_label' => $this->t('Unknown'), '#theme' => 'civiremote_funding_application_history', '#application_title' => '', @@ -97,7 +99,12 @@ public static function preRenderHistory(array $element): array { $withIcon = TRUE; foreach ($element['#activities'] as $activity) { $element['activities'][] = $activityArray = - self::createActivityArray($activity, $element['#status_options'], $withIcon); + self::createActivityArray( + $activity, + $element['#status_options'], + $element['#clearing_status_options'], + $withIcon + ); if ([] !== $activityArray) { // Only first entry shall have an icon. $withIcon = FALSE; @@ -109,12 +116,14 @@ public static function preRenderHistory(array $element): array { /** * @phpstan-param array $statusOptions + * @phpstan-param array $clearingStatusOptions * * @phpstan-return array */ private static function createActivityArray( ApplicationProcessActivity $activity, array $statusOptions, + array $clearingStatusOptions, bool $withIcon ): array { switch ($activity->getActivityTypeName()) { @@ -148,6 +157,29 @@ private static function createActivityArray( '#icon_color' => $statusOption->getColor(), ]; + case 'funding_clearing_status_change': + /** @var \Drupal\civiremote_funding\Api\DTO\Option $statusOption */ + $statusOption = $clearingStatusOptions[$activity->getToStatus()] ?? $statusOptions['unknown']; + + return [ + '#type' => 'civiremote_funding_clearing_history_status_change', + '#activity' => $activity, + '#status_label' => $statusOption->getLabel(), + '#icon' => $withIcon ? $statusOption->getIcon() : NULL, + '#icon_color' => $statusOption->getColor(), + ]; + + case 'funding_clearing_create': + /** @var \Drupal\civiremote_funding\Api\DTO\Option $statusOption */ + $statusOption = $clearingStatusOptions[$activity->getToStatus()] ?? $statusOptions['draft']; + + return [ + '#type' => 'civiremote_funding_clearing_history_create', + '#activity' => $activity, + '#icon' => $withIcon ? $statusOption->getIcon() : NULL, + '#icon_color' => $statusOption->getColor(), + ]; + default: // Ignore unknown activity types. return []; diff --git a/src/Element/CiviremoteFundingClearingHistoryCreate.php b/src/Element/CiviremoteFundingClearingHistoryCreate.php new file mode 100644 index 0000000..ee2ad2b --- /dev/null +++ b/src/Element/CiviremoteFundingClearingHistoryCreate.php @@ -0,0 +1,77 @@ +. + */ + +declare(strict_types=1); + +namespace Drupal\civiremote_funding\Element; + +use Assert\Assertion; +use Drupal\civiremote_funding\Api\DTO\ApplicationProcessActivity; +use Drupal\Core\Render\Element\RenderElement; + +/** + * @RenderElement("civiremote_funding_clearing_history_create") + */ +final class CiviremoteFundingClearingHistoryCreate extends RenderElement { + + /** + * {@inheritDoc} + */ + public function getInfo(): array { + return [ + // Instance of ApplicationProcessActivity. + '#activity' => NULL, + '#title' => $this->t('Clearing Started'), + '#source_contact_title' => $this->t('Performed by'), + '#icon' => NULL, + '#icon_color' => NULL, + '#pre_render' => [ + [__CLASS__, 'preRenderActivity'], + ], + ]; + } + + public static function preRenderActivity(array $element): array { + /** @var \Drupal\Core\Datetime\DateFormatterInterface $dateFormatter */ + $dateFormatter = \Drupal::service('date.formatter'); + + Assertion::isInstanceOf($element['#activity'], ApplicationProcessActivity::class); + /** @var \Drupal\civiremote_funding\Api\DTO\ApplicationProcessActivity $activity */ + $activity = $element['#activity']; + + $element['activity'] = [ + '#type' => 'civiremote_funding_application_history_entry', + '#attributes' => ['data-activity-kind' => 'workflow'], + '#icon' => $element['#icon'], + '#icon_color' => $element['#icon_color'], + '#title' => $element['#title'], + '#date' => $dateFormatter->format($activity->getCreatedDate()->getTimestamp()), + '#content' => [ + '#type' => 'container', + 'source_contact' => [ + '#type' => 'item', + '#title' => $element['#source_contact_title'], + '#markup' => htmlentities($activity->getSourceContactName()), + ], + ], + ]; + + return $element; + } + +} diff --git a/src/Element/CiviremoteFundingClearingHistoryStatusChange.php b/src/Element/CiviremoteFundingClearingHistoryStatusChange.php new file mode 100644 index 0000000..617c46a --- /dev/null +++ b/src/Element/CiviremoteFundingClearingHistoryStatusChange.php @@ -0,0 +1,86 @@ +. + */ + +declare(strict_types=1); + +namespace Drupal\civiremote_funding\Element; + +use Assert\Assertion; +use Drupal\civiremote_funding\Api\DTO\ApplicationProcessActivity; +use Drupal\Core\Render\Element\RenderElement; + +/** + * @RenderElement("civiremote_funding_clearing_history_status_change") + */ +final class CiviremoteFundingClearingHistoryStatusChange extends RenderElement { + + /** + * {@inheritDoc} + */ + public function getInfo(): array { + return [ + // Instance of ApplicationProcessActivity. + '#activity' => NULL, + // Array mapping status to \Drupal\civiremote_funding\Api\DTO\Option. + // Instance of \Drupal\civiremote_funding\Api\DTO\Option. + '#status_option' => NULL, + '#title' => 'Clearing Status: @status', + '#status_label' => NULL, + '#source_contact_title' => $this->t('Performed by'), + '#pre_render' => [ + [__CLASS__, 'preRenderActivity'], + ], + ]; + } + + /** + * @phpstan-param array $element + * + * @phpstan-return array + */ + public static function preRenderActivity(array $element): array { + /** @var \Drupal\Core\Datetime\DateFormatterInterface $dateFormatter */ + $dateFormatter = \Drupal::service('date.formatter'); + + Assertion::string($element['#title']); + Assertion::isInstanceOf($element['#activity'], ApplicationProcessActivity::class); + $activity = $element['#activity']; + + $element['activity'] = [ + '#type' => 'civiremote_funding_application_history_entry', + '#attributes' => ['data-activity-kind' => 'workflow'], + '#icon' => $element['#icon'], + '#icon_color' => $element['#icon_color'], + '#title' => \Drupal::translation()->translate($element['#title'], [ + '@status' => $element['#status_label'], + ]), + '#date' => $dateFormatter->format($activity->getCreatedDate()->getTimestamp()), + '#content' => [ + '#type' => 'container', + 'source_contact' => [ + '#type' => 'item', + '#title' => $element['#source_contact_title'], + '#markup' => htmlentities($activity->getSourceContactName()), + ], + ], + ]; + + return $element; + } + +} diff --git a/src/Form/ClearingForm.php b/src/Form/ClearingForm.php new file mode 100644 index 0000000..111a61f --- /dev/null +++ b/src/Form/ClearingForm.php @@ -0,0 +1,47 @@ +. + */ + +declare(strict_types=1); + +namespace Drupal\civiremote_funding\Form; + +use Drupal\civiremote_funding\Form\RequestHandler\ClearingFormRequestHandler; +use Drupal\civiremote_funding\Form\ResponseHandler\FormResponseHandlerInterface; +use Drupal\json_forms\Form\FormArrayFactoryInterface; +use Drupal\json_forms\Form\Validation\FormValidationMapperInterface; +use Drupal\json_forms\Form\Validation\FormValidatorInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; + +final class ClearingForm extends AbstractFundingJsonFormsForm { + + /** + * {@inheritDoc} + * + * @return static + */ + public static function create(ContainerInterface $container) { + return new static( + $container->get(FormArrayFactoryInterface::class), + $container->get(FormValidatorInterface::class), + $container->get(FormValidationMapperInterface::class), + $container->get(ClearingFormRequestHandler::class), + $container->get(FormResponseHandlerInterface::class), + ); + } + +} diff --git a/src/Form/RequestHandler/ClearingFormRequestHandler.php b/src/Form/RequestHandler/ClearingFormRequestHandler.php new file mode 100644 index 0000000..bd96f15 --- /dev/null +++ b/src/Form/RequestHandler/ClearingFormRequestHandler.php @@ -0,0 +1,62 @@ +. + */ + +declare(strict_types=1); + +namespace Drupal\civiremote_funding\Form\RequestHandler; + +use Assert\Assertion; +use Drupal\civiremote_funding\Api\Form\FormSubmitResponse; +use Drupal\civiremote_funding\Api\Form\FormValidationResponse; +use Drupal\civiremote_funding\Api\Form\FundingForm; +use Drupal\civiremote_funding\Api\FundingApi; +use Drupal\Core\Routing\RouteMatch; +use Symfony\Component\HttpFoundation\Request; + +final class ClearingFormRequestHandler implements FormRequestHandlerInterface { + + private FundingApi $fundingApi; + + public function __construct(FundingApi $fundingApi) { + $this->fundingApi = $fundingApi; + } + + public function getForm(Request $request): FundingForm { + return $this->fundingApi->getClearingForm($this->getClearingProcessId($request)); + } + + public function validateForm(Request $request, array $data): FormValidationResponse { + return $this->fundingApi->validateClearingForm($this->getClearingProcessId($request), $data); + } + + public function submitForm(Request $request, array $data): FormSubmitResponse { + return $this->fundingApi->submitClearingForm($this->getClearingProcessId($request), $data); + } + + private function getClearingProcessId(Request $request): int { + $routeMatch = RouteMatch::createFromRequest($request); + $clearingProcessId = $routeMatch->getParameter('clearingProcessId'); + if (NULL === $clearingProcessId) { + $clearingProcessId = $request->attributes->get('clearingProcessId'); + } + Assertion::integerish($clearingProcessId); + + return (int) $clearingProcessId; + } + +} diff --git a/src/ViewTranslator.php b/src/ViewTranslator.php index 23dc0b2..3257677 100644 --- a/src/ViewTranslator.php +++ b/src/ViewTranslator.php @@ -33,6 +33,8 @@ final class ViewTranslator { 'description', 'text', 'submit_button', + 'type_custom_true', + 'type_custom_false', ]; private ConfigFactoryInterface $configFactory; diff --git a/translations/civiremote_funding.pot b/translations/civiremote_funding.pot index 5f2f740..53126fc 100644 --- a/translations/civiremote_funding.pot +++ b/translations/civiremote_funding.pot @@ -1,17 +1,17 @@ #, fuzzy msgid "" msgstr "" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Project-Id-Version: civiremote_funding\n" "POT-Creation-Date: \n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" -"X-Generator: Poedit 2.3\n" -"X-Poedit-KeywordsList: t;title;label;description\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0.1\n" +"X-Poedit-KeywordsList: t;title;label;description;text;submit_button;type_custom_true\n" "X-Poedit-Basepath: ..\n" "X-Poedit-SearchPath-0: config\n" "X-Poedit-SearchPath-1: src\n" @@ -19,121 +19,490 @@ msgstr "" "X-Poedit-SearchPath-3: civiremote_funding.module\n" "X-Poedit-SearchPath-4: civiremote_funding.permissions.yml\n" "X-Poedit-SearchPath-5: civiremote_funding.routing.yml\n" +"X-Poedit-SearchPathExcluded-0: config/optional/cmrf_views.cmrf_dataset.*.yml\n" -#: config/optional/views.view.civiremote_funding_case_list.yml -msgid "Modification date" +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Amount Paid Out" msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml msgid "Title" msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml -msgid "Funding Cases" +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +#: config/optional/views.view.civiremote_funding_drawdown_list.yml +msgid "Status" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Create drawdown" +msgstr "" + +#: config/optional/views.view.civiremote_funding_drawdown_list.yml +msgid "Drawdowns" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Amount Approved" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Link to download transfer contract" +msgstr "" + +#: config/optional/views.view.civiremote_funding_application_list.yml +msgid "Link to application form" +msgstr "" + +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Identifier" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Download" msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +msgid "Open clearing" +msgstr "" + +#: config/optional/views.view.civiremote_funding_application_list.yml +#: src/Plugin/Block/CiviremoteFundingDashboardGroupApplications.php:42 +msgid "Funding Applications" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "payout_process_id" +msgstr "" + +#: config/optional/views.view.civiremote_funding_application_list.yml msgid "funding_case_id" msgstr "" -#: civiremote_funding.permissions.yml -msgid "Grants access to CiviCRM Funding via CiviRemote." +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +msgid "Link to clearing form" msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml -msgid "End date" +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +msgid "Open application" msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml -#: src/Form/ChooseFundingProgramForm.php:73 -msgid "Funding program" +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Link to drawdown list" msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml -msgid "Start date" +#: config/schema/civiremote_funding.schema.yml +msgid "File clean up delay (seconds)" msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml -msgid "Creation date" +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +msgid "Beantragter Betrag" msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml -msgid "Identifier" +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +msgid "CiviCRM Funding Case List (combined application)" +msgstr "" + +#: config/optional/views.view.civiremote_funding_application_list.yml +msgid "CiviCRM Funding Application List (non-combined)" msgstr "" #: civiremote_funding.info.yml msgid "Drupal frontend for funding applications of CiviCRM Funding Manager." msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml -msgid "List of CiviCRM funding cases via remote API" +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Actions" msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml -msgid "Application process link" +#: civiremote_funding.permissions.yml +msgid "Access CiviCRM Funding" msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml -msgid "Status" +#: config/optional/views.view.civiremote_funding_application_list.yml +msgid "Requested Funding" msgstr "" -#: config/optional/cmrf_views.cmrf_dataset.civiremote_funding_caseinfo.yml -msgid "CiviRemote FundingCaseInfo" +#: config/optional/views.view.civiremote_funding_drawdown_list.yml +msgid "Acception Date" msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml -msgid "Requested funding" +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +msgid "Amount Requested" msgstr "" -#: config/optional/system.menu.civiremote-funding.yml -msgid "CiviRemote Funding" +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +msgid "ID" msgstr "" -#: config/optional/system.menu.civiremote-funding.yml -msgid "Funding" +#: config/optional/views.view.civiremote_funding_drawdown_list.yml +msgid "CiviCRM Funding Drawdown List" msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml -msgid "CiviCRM Funding Case List" +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +#: config/optional/views.view.civiremote_funding_drawdown_list.yml +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Apply" msgstr "" -#: config/optional/views.view.civiremote_funding_case_list.yml -msgid "Actions" +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +msgid "title" +msgstr "" + +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +msgid "Show history" +msgstr "" + +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +#: config/optional/views.view.civiremote_funding_drawdown_list.yml +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +msgid "All" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +msgid "CiviCRM Funding Transfer Contract" +msgstr "" + +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +msgid "Open {{arguments.null}}" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +msgid "CiviCRM funding transfer contract via remote API" +msgstr "" + +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Amount Admitted" +msgstr "" + +#: config/optional/views.view.civiremote_funding_drawdown_list.yml +#: src/Form/NewDrawdownForm.php:96 +msgid "Amount" +msgstr "" + +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Amount Cleared" +msgstr "" + +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +msgid "CiviCRM Funding Combined Applications" +msgstr "" + +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +msgid "Combined Applications" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "List of CiviCRM funding transfer contracts via remote API" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Amount Available" +msgstr "" + +#: config/optional/views.view.civiremote_funding_application_list.yml +msgid "List of CiviCRM funding applications (non-combined) via remote API" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: src/Form/NewDrawdownForm.php:91 +msgid "Transfer Contract" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +msgid "{{title}}" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Show drawdowns" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "CiviCRM Funding Transfer Contract List" +msgstr "" + +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +msgid "Budget" +msgstr "" + +#: config/schema/civiremote_funding.schema.yml +msgid "Allowed file extensions for uploaded files, separated by space. Leave empty to allow all file extensions." +msgstr "" + +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +#: config/optional/views.view.civiremote_funding_drawdown_list.yml +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +#: src/Plugin/views/field/LanguageAwareNumericField.php:114 +#: src/Plugin/views/field/LanguageAwareNumericField.php:127 +msgid "Currency" +msgstr "" + +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +#: src/Form/ChooseFundingProgramForm.php:68 +msgid "Funding Program" +msgstr "" + +#: config/optional/views.view.civiremote_funding_application_list.yml +msgid "Link to application history" msgstr "" #: civiremote_funding.permissions.yml -msgid "Access CiviCRM Funding" +msgid "Grants access to CiviCRM Funding via CiviRemote." msgstr "" -#: src/Form/AbstractFundingJsonFormsForm.php:62 -msgid "Loading form failed: @error" +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +msgid "Modification Date" msgstr "" -#: src/Form/AbstractFundingJsonFormsForm.php:93 -msgid "Error validating form: @error" +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +msgid "CiviCRM Funding Combined Application Process List" msgstr "" -#: src/Form/AbstractFundingJsonFormsForm.php:117 -msgid "Submitting form failed: @error" +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +#: config/optional/views.view.civiremote_funding_drawdown_list.yml +msgid "Creation Date" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +#: src/Plugin/Block/CiviremoteFundingDashboardGroupApprovements.php:47 +msgid "Transfer Contracts" +msgstr "" + +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +msgid "Funding Case ID" +msgstr "" + +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Link to create drawdown form" +msgstr "" + +#: src/Controller/ApplicationHistoryController.php:50 +msgid "Application History" +msgstr "" + +#: src/Controller/DashboardController.php:34 +msgid "Dashboard" +msgstr "" + +#: src/Controller/DashboardController.php:39 +msgid "CiviRemote Funding" +msgstr "" + +#: src/Controller/FundingCaseController.php:69 +msgid "Please do not forget to apply the combined application if everything is recorded or after additions." +msgstr "" + +#: src/Controller/FundingCaseController.php:79 +msgid "Add @type" +msgstr "" + +#: src/Controller/TransferContractController.php:45 +msgid "Transfer Contract: @identifier" +msgstr "" + +#: src/Element/CiviremoteFundingApplicationHistory.php:44 +msgid "Unknown" +msgstr "" + +#: src/Element/CiviremoteFundingApplicationHistory.php:50 +msgid "Back" +msgstr "" + +#: src/Element/CiviremoteFundingApplicationHistory.php:51 +msgid "Filter" +msgstr "" + +#: src/Element/CiviremoteFundingApplicationHistory.php:52 +msgid "Hide workflow actions" +msgstr "" + +#: src/Element/CiviremoteFundingApplicationHistory.php:53 +msgid "Hide comments" +msgstr "" + +#: src/Element/CiviremoteFundingApplicationHistoryComment.php:41 +msgid "Comment" +msgstr "" + +#: src/Element/CiviremoteFundingApplicationHistoryComment.php:42 +#: src/Element/CiviremoteFundingApplicationHistoryCreate.php:40 +#: src/Element/CiviremoteFundingApplicationHistoryStatusChange.php:44 +#: src/Element/CiviremoteFundingClearingHistoryCreate.php:40 +#: src/Element/CiviremoteFundingClearingHistoryStatusChange.php:44 +msgid "Performed by" +msgstr "" + +#: src/Element/CiviremoteFundingApplicationHistoryCreate.php:39 +#: src/Entity/FundingFile.php:81 +msgid "Created" +msgstr "" + +#: src/Element/CiviremoteFundingClearingHistoryCreate.php:39 +msgid "Clearing Started" +msgstr "" + +#: src/Entity/FundingFile.php:54 +msgid "Referenced file" +msgstr "" + +#: src/Entity/FundingFile.php:55 +msgid "Referenced File entity" +msgstr "" + +#: src/Entity/FundingFile.php:82 +msgid "The time that the entity was created." +msgstr "" + +#: src/Entity/FundingFile.php:85 +msgid "Changed" +msgstr "" + +#: src/Entity/FundingFile.php:86 +msgid "The time that the entity was last edited." +msgstr "" + +#: src/Form/AbstractFundingJsonFormsForm.php:67 +msgid "Loading form failed: @error" +msgstr "" + +#: src/Form/AbstractFundingJsonFormsForm.php:105 +msgid "Error validating form: @error" msgstr "" #: src/Form/AbstractFundingJsonFormsForm.php:129 -msgid "Validation failed." +msgid "Submitting form failed: @error" msgstr "" -#: src/Form/ChooseFundingProgramForm.php:64 +#: src/Form/ChooseFundingProgramForm.php:59 msgid "Failed to load available funding programs: @error" msgstr "" -#: src/Form/ChooseFundingProgramForm.php:80 +#: src/Form/ChooseFundingProgramForm.php:75 msgid "Next" msgstr "" -#: src/Form/ChooseFundingProgramForm.php:98 +#: src/Form/ChooseFundingProgramForm.php:92 msgid "Failed to load funding case types: @error" msgstr "" -#: src/Form/ChooseFundingProgramForm.php:105 +#: src/Form/ChooseFundingProgramForm.php:99 msgid "No funding case type available in the selected funding program." msgstr "" +#: src/Form/NewDrawdownForm.php:80 +msgid "API request failed: @error" +msgstr "" + +#: src/Form/NewDrawdownForm.php:88 +msgid "Create Drawdown" +msgstr "" + +#: src/Form/NewDrawdownForm.php:106 +msgid "Submit" +msgstr "" + +#: src/Form/NewDrawdownForm.php:119 +msgid "Drawdown created." +msgstr "" + +#: src/Form/NewDrawdownForm.php:126 +msgid "Failed to create drawdown: @error" +msgstr "" + +#: src/Form/ResponseHandler/FormResponseHandlerAction.php:48 +msgid "Validation failed." +msgstr "" + +#: src/Plugin/Block/CiviremoteFundingDashboardGroupApplications.php:47 +msgid "My Applications" +msgstr "" + +#: src/Plugin/Block/CiviremoteFundingDashboardGroupApplications.php:50 +msgid "Manage current funding processes" +msgstr "" + +#: src/Plugin/Block/CiviremoteFundingDashboardGroupApplications.php:55 +msgid "My Combined Applications" +msgstr "" + +#: src/Plugin/Block/CiviremoteFundingDashboardGroupApplications.php:58 +msgid "Manage current combined applications" +msgstr "" + +#: src/Plugin/Block/CiviremoteFundingDashboardGroupApplications.php:63 +msgid "New Application" +msgstr "" + +#: src/Plugin/Block/CiviremoteFundingDashboardGroupApplications.php:66 +msgid "Place a new application" +msgstr "" + +#: src/Plugin/Block/CiviremoteFundingDashboardGroupApprovements.php:42 +msgid "Approvements" +msgstr "" + +#: src/Plugin/Block/CiviremoteFundingDashboardGroupApprovements.php:50 +msgid "Download transfer contracts and manage drawdowns" +msgstr "" + +#: src/Plugin/views/field/LanguageAwareNumericField.php:103 +msgid "Format language aware" +msgstr "" + +#: src/Plugin/views/field/LanguageAwareNumericField.php:105 +msgid "If checked, the current language will be used to format the value." +msgstr "" + +#: src/Plugin/views/field/LanguageAwareNumericField.php:110 +msgid "Style" +msgstr "" + +#: src/Plugin/views/field/LanguageAwareNumericField.php:113 +msgid "Decimal" +msgstr "" + +#: src/Plugin/views/field/LanguageAwareNumericField.php:129 +msgid "3-letter ISO 4217 currency code. (Replacement patterns are allowed.)" +msgstr "" + +#: src/Views/ApplicationProcessDropButton.php:89 +msgid "Create: @label" +msgstr "" diff --git a/translations/de.po b/translations/de.po index 56a2962..2a09258 100644 --- a/translations/de.po +++ b/translations/de.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: civiremote_funding\n" -"POT-Creation-Date: 2024-03-05 12:16+0100\n" +"POT-Creation-Date: \n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -11,7 +11,8 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 3.0.1\n" -"X-Poedit-KeywordsList: t;title;label;description;text;submit_button\n" +"X-Poedit-KeywordsList: t;title;label;description;text;submit_button;" +"type_custom_true\n" "X-Poedit-Basepath: ..\n" "X-Poedit-SearchPath-0: config\n" "X-Poedit-SearchPath-1: src\n" @@ -73,6 +74,11 @@ msgstr "Nummer" msgid "Download" msgstr "Herunterladen" +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +msgid "Open clearing" +msgstr "Verwendungsnachweis öffnen" + #: config/optional/views.view.civiremote_funding_application_list.yml #: src/Plugin/Block/CiviremoteFundingDashboardGroupApplications.php:42 msgid "Funding Applications" @@ -87,8 +93,9 @@ msgstr "" msgid "funding_case_id" msgstr "" -#: config/optional/views.view.civiremote_funding_drawdown_list.yml -msgid "{{ amount }} {{currency}}" +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +msgid "Link to clearing form" msgstr "" #: config/optional/views.view.civiremote_funding_application_list.yml @@ -104,6 +111,10 @@ msgstr "" msgid "File clean up delay (seconds)" msgstr "" +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +msgid "Beantragter Betrag" +msgstr "" + #: config/optional/views.view.civiremote_funding_combined_case_list.yml msgid "CiviCRM Funding Case List (combined application)" msgstr "CiviCRM Förderfallliste (Sammelantrag)" @@ -116,10 +127,6 @@ msgstr "CiviCRM Förderantragsliste (kein Sammelantrag)" msgid "Drupal frontend for funding applications of CiviCRM Funding Manager." msgstr "" -#: config/optional/views.view.civiremote_funding_combined_case_list.yml -msgid "{{amount_approved}} {{funding_program_id__currency}}" -msgstr "" - #: config/optional/views.view.civiremote_funding_application_list.yml #: config/optional/views.view.civiremote_funding_combined_application_process_list.yml #: config/optional/views.view.civiremote_funding_combined_case_list.yml @@ -135,19 +142,13 @@ msgstr "" msgid "Requested Funding" msgstr "Beantragte Förderung" -#: config/optional/views.view.civiremote_funding_transfer_contract.yml -#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml -msgid "{{amount_paid_out}} {{currency}}" -msgstr "" - #: config/optional/views.view.civiremote_funding_drawdown_list.yml msgid "Acception Date" msgstr "Annahmedatum" -#: config/optional/views.view.civiremote_funding_transfer_contract.yml -#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml -msgid "{{ amount_approved }} {{currency}}" -msgstr "" +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +msgid "Amount Requested" +msgstr "Beantragter Betrag" #: config/optional/views.view.civiremote_funding_combined_application_process_list.yml msgid "ID" @@ -194,11 +195,27 @@ msgstr "{{arguments.null}} öffnen" msgid "CiviCRM funding transfer contract via remote API" msgstr "" +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Amount Admitted" +msgstr "Anerkannter Betrag" + #: config/optional/views.view.civiremote_funding_drawdown_list.yml #: src/Form/NewDrawdownForm.php:96 msgid "Amount" msgstr "Betrag" +#: config/optional/views.view.civiremote_funding_application_list.yml +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +#: config/optional/views.view.civiremote_funding_combined_case_list.yml +#: config/optional/views.view.civiremote_funding_transfer_contract.yml +#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +msgid "Amount Cleared" +msgstr "Abgerechneter Betrag" + #: config/optional/views.view.civiremote_funding_combined_application_process_list.yml msgid "CiviCRM Funding Combined Applications" msgstr "CiviCRM Sammelanträge" @@ -229,11 +246,6 @@ msgstr "Weiterleitungsvertrag" msgid "{{title}}" msgstr "" -#: config/optional/views.view.civiremote_funding_transfer_contract.yml -#: config/optional/views.view.civiremote_funding_transfer_contract_list.yml -msgid "{{amount_available}} {{currency}}" -msgstr "" - #: config/optional/views.view.civiremote_funding_transfer_contract.yml #: config/optional/views.view.civiremote_funding_transfer_contract_list.yml msgid "Show drawdowns" @@ -253,9 +265,13 @@ msgid "" "to allow all file extensions." msgstr "" +#: config/optional/views.view.civiremote_funding_combined_application_process_list.yml +#: config/optional/views.view.civiremote_funding_combined_case_list.yml #: config/optional/views.view.civiremote_funding_drawdown_list.yml #: config/optional/views.view.civiremote_funding_transfer_contract.yml #: config/optional/views.view.civiremote_funding_transfer_contract_list.yml +#: src/Plugin/views/field/LanguageAwareNumericField.php:114 +#: src/Plugin/views/field/LanguageAwareNumericField.php:127 msgid "Currency" msgstr "Währung" @@ -302,11 +318,6 @@ msgstr "Förderfall ID" msgid "Link to create drawdown form" msgstr "" -#: config/optional/views.view.civiremote_funding_application_list.yml -msgid "" -"{{ application_process_amount_requested }} {{ funding_program_currency }}" -msgstr "" - #: src/Controller/ApplicationHistoryController.php:50 msgid "Application History" msgstr "Antragsverlauf" @@ -319,7 +330,15 @@ msgstr "Übersicht" msgid "CiviRemote Funding" msgstr "" -#: src/Controller/FundingCaseController.php:73 +#: src/Controller/FundingCaseController.php:69 +msgid "" +"Please do not forget to apply the combined application if everything is " +"recorded or after additions." +msgstr "" +"Bitte nicht vergessen, den Sammelantrag zu beantragen, wenn alles erfasst " +"wurde oder nach Ergänzungen." + +#: src/Controller/FundingCaseController.php:79 msgid "Add @type" msgstr "@type hinzufügen" @@ -327,23 +346,23 @@ msgstr "@type hinzufügen" msgid "Transfer Contract: @identifier" msgstr "Weiterleitungsvertrag: @identifier" -#: src/Element/CiviremoteFundingApplicationHistory.php:42 +#: src/Element/CiviremoteFundingApplicationHistory.php:44 msgid "Unknown" msgstr "Unbekannt" -#: src/Element/CiviremoteFundingApplicationHistory.php:48 +#: src/Element/CiviremoteFundingApplicationHistory.php:50 msgid "Back" msgstr "Zurück" -#: src/Element/CiviremoteFundingApplicationHistory.php:49 +#: src/Element/CiviremoteFundingApplicationHistory.php:51 msgid "Filter" msgstr "Filter" -#: src/Element/CiviremoteFundingApplicationHistory.php:50 +#: src/Element/CiviremoteFundingApplicationHistory.php:52 msgid "Hide workflow actions" msgstr "Ablaufaktivitäten ausblenden" -#: src/Element/CiviremoteFundingApplicationHistory.php:51 +#: src/Element/CiviremoteFundingApplicationHistory.php:53 msgid "Hide comments" msgstr "Kommentare ausblenden" @@ -354,6 +373,8 @@ msgstr "Kommentar" #: src/Element/CiviremoteFundingApplicationHistoryComment.php:42 #: src/Element/CiviremoteFundingApplicationHistoryCreate.php:40 #: src/Element/CiviremoteFundingApplicationHistoryStatusChange.php:44 +#: src/Element/CiviremoteFundingClearingHistoryCreate.php:40 +#: src/Element/CiviremoteFundingClearingHistoryStatusChange.php:44 msgid "Performed by" msgstr "Durchgeführt von" @@ -362,6 +383,10 @@ msgstr "Durchgeführt von" msgid "Created" msgstr "Erstellt" +#: src/Element/CiviremoteFundingClearingHistoryCreate.php:39 +msgid "Clearing Started" +msgstr "Verwendungsnachweis gestartet" + #: src/Entity/FundingFile.php:54 msgid "Referenced file" msgstr "" @@ -418,15 +443,15 @@ msgstr "API-Anfrage fehlgeschlagen: @error" msgid "Create Drawdown" msgstr "Mittelabruf erstellen" -#: src/Form/NewDrawdownForm.php:105 +#: src/Form/NewDrawdownForm.php:106 msgid "Submit" msgstr "Absenden" -#: src/Form/NewDrawdownForm.php:118 +#: src/Form/NewDrawdownForm.php:119 msgid "Drawdown created." msgstr "Mittelabruf erstellt." -#: src/Form/NewDrawdownForm.php:125 +#: src/Form/NewDrawdownForm.php:126 msgid "Failed to create drawdown: @error" msgstr "Erstellung des Mittelabrufs fehlgeschlagen: @error" @@ -466,6 +491,26 @@ msgstr "Bewilligungen" msgid "Download transfer contracts and manage drawdowns" msgstr "Weiterleitungsverträge herunterladen und Mittelabrufe verwalten" +#: src/Plugin/views/field/LanguageAwareNumericField.php:103 +msgid "Format language aware" +msgstr "" + +#: src/Plugin/views/field/LanguageAwareNumericField.php:105 +msgid "If checked, the current language will be used to format the value." +msgstr "" + +#: src/Plugin/views/field/LanguageAwareNumericField.php:110 +msgid "Style" +msgstr "" + +#: src/Plugin/views/field/LanguageAwareNumericField.php:113 +msgid "Decimal" +msgstr "" + +#: src/Plugin/views/field/LanguageAwareNumericField.php:129 +msgid "3-letter ISO 4217 currency code. (Replacement patterns are allowed.)" +msgstr "" + #: src/Views/ApplicationProcessDropButton.php:89 msgid "Create: @label" msgstr "Erstellen: @label"