diff --git a/public/modules/custom/grants_budget_components/src/GrantsBudgetComponentService.php b/public/modules/custom/grants_budget_components/src/GrantsBudgetComponentService.php index c851f9c253..66f30b19b6 100644 --- a/public/modules/custom/grants_budget_components/src/GrantsBudgetComponentService.php +++ b/public/modules/custom/grants_budget_components/src/GrantsBudgetComponentService.php @@ -5,8 +5,8 @@ use Drupal\Component\Utility\NestedArray; use Drupal\Core\TypedData\ListInterface; use Drupal\Core\TypedData\Plugin\DataType\Map; -use Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler; use Drupal\grants_metadata\AtvSchema; +use Drupal\grants_metadata\ConvertHelper; use Drupal\grants_metadata\InputmaskHandler; /** @@ -54,7 +54,7 @@ public static function processBudgetStaticValues(Map $property): array { $value = ''; } else { - $value = (string) GrantsHandler::convertToFloat($value); + $value = (string) ConvertHelper::convertToFloat($value); } $items[] = [ @@ -97,7 +97,7 @@ public static function processBudgetOtherValues(ListInterface $property): array $valueToSave = NULL; } else { - $valueToSave = (string) GrantsHandler::convertToFloat($value); + $valueToSave = (string) ConvertHelper::convertToFloat($value); } $itemValues = [ @@ -143,7 +143,7 @@ public static function getBudgetOtherValues(array $documentData, array $jsonPath $groupName = $parent['costGroupName'] ?? $parent['incomeGroupName']; if (!empty($parent) && isset($parent[$pathLast])) { $retVal[$groupName] = array_map(function ($e) { - $value = GrantsHandler::convertToFloat($e['value']); + $value = ConvertHelper::convertToFloat($e['value']); if ($value !== NULL) { $value = number_format( @@ -219,7 +219,7 @@ private static function getPrintValue($value) { return $value; } - $floatValue = (float) GrantsHandler::convertToFloat($value); + $floatValue = (float) ConvertHelper::convertToFloat($value); return number_format( $floatValue, 2, diff --git a/public/modules/custom/grants_handler/src/Plugin/WebformHandler/GrantsHandler.php b/public/modules/custom/grants_handler/src/Plugin/WebformHandler/GrantsHandler.php index 92363fc13e..2bfb748669 100644 --- a/public/modules/custom/grants_handler/src/Plugin/WebformHandler/GrantsHandler.php +++ b/public/modules/custom/grants_handler/src/Plugin/WebformHandler/GrantsHandler.php @@ -30,6 +30,7 @@ use Drupal\grants_handler\WebformSubmissionNotesHelper; use Drupal\grants_mandate\CompanySelectException; use Drupal\grants_metadata\ApplicationDataService; +use Drupal\grants_metadata\ConvertHelper; use Drupal\grants_profile\GrantsProfileService; use Drupal\helfi_atv\AtvDocumentNotFoundException; use Drupal\helfi_atv\AtvFailedToConnectException; @@ -257,51 +258,6 @@ public static function create( ); } - /** - * Convert EUR format value to float. - * - * @param string|null $value - * Value to be converted. - * - * @return float|null - * Floated value. - */ - public static function convertToFloat(?string $value = ''): ?float { - if (is_null($value)) { - return NULL; - } - - if ($value === '') { - return NULL; - } - - $value = str_replace(['€', ',', ' '], ['', '.', ''], $value); - return (float) $value; - } - - /** - * Convert EUR format value to "int" . - * - * @param string|null $value - * Value to be converted. - * - * @return int|null - * Int value. - */ - public static function convertToInt(?string $value = ''): ?int { - if (is_null($value)) { - return NULL; - } - - if ($value === '') { - return NULL; - } - - $value = str_replace(['€', ',', ' ', '_'], ['', '.', '', ''], $value); - $value = (int) $value; - return $value; - } - /** * {@inheritdoc} */ @@ -343,7 +299,7 @@ protected function setTotals(): void { is_array($this->submittedFormData['myonnetty_avustus'])) { $tempTotal = 0; foreach ($this->submittedFormData['myonnetty_avustus'] as $item) { - $amount = self::convertToFloat($item['amount']); + $amount = ConvertHelper::convertToFloat($item['amount']); $tempTotal += $amount; } $this->submittedFormData['myonnetty_avustus_total'] = $tempTotal; @@ -353,7 +309,7 @@ protected function setTotals(): void { is_array($this->submittedFormData['haettu_avustus_tieto'])) { $tempTotal = 0; foreach ($this->submittedFormData['haettu_avustus_tieto'] as $item) { - $amount = self::convertToFloat($item['amount']); + $amount = ConvertHelper::convertToFloat($item['amount']); $tempTotal += $amount; } $this->submittedFormData['haettu_avustus_tieto_total'] = $tempTotal; @@ -679,7 +635,7 @@ public function alterForm(array &$form, FormStateInterface $form_state, WebformS $subventionsTotalAmount = 0; if (isset($submissionData["subventions"]) && is_array($submissionData["subventions"])) { foreach ($submissionData["subventions"] as $sub) { - $subventionsTotalAmount += self::convertToFloat($sub['amount']); + $subventionsTotalAmount += ConvertHelper::convertToFloat($sub['amount']); } } @@ -711,7 +667,7 @@ public function alterForm(array &$form, FormStateInterface $form_state, WebformS if (isset($submissionData["subventions"]) && is_array($submissionData["subventions"])) { foreach ($submissionData["subventions"] as $sub) { if ($sub['subventionType'] == $subventionType) { - $elementTotal = self::convertToFloat($sub['amount']); + $elementTotal = ConvertHelper::convertToFloat($sub['amount']); break; } } @@ -1620,30 +1576,6 @@ public function submitConfigurationForm(array &$form, FormStateInterface $form_s $this->configuration['debug'] = (bool) $form_state->getValue('debug'); } - /** - * Cleans up non-array values from array structure. - * - * This is due to some configuration error with messages/statuses/events - * that I'm not able to find. - * - * @param array|null $value - * Array we need to flatten. - * - * @return array - * Fixed array - */ - public static function cleanUpArrayValues(mixed $value): array { - $retval = []; - if (is_array($value)) { - foreach ($value as $v) { - if (is_array($v)) { - $retval[] = $v; - } - } - } - return $retval; - } - /** * Parse things from form 3rd party settings to this application. * diff --git a/public/modules/custom/grants_metadata/src/CompensationService.php b/public/modules/custom/grants_metadata/src/CompensationService.php index 76ceb1ae56..2f31c28d9e 100644 --- a/public/modules/custom/grants_metadata/src/CompensationService.php +++ b/public/modules/custom/grants_metadata/src/CompensationService.php @@ -4,7 +4,6 @@ use Drupal\Core\TypedData\ListDataDefinition; use Drupal\Core\TypedData\ListInterface; -use Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler; /** * Service for getting & setting data values from & to JSON structure. @@ -75,7 +74,7 @@ private function processToimintaAvustus($arguments) { 'ID' => 'amount', 'label' => 'Euroa', 'valueType' => 'double', - 'value' => (string) GrantsHandler::convertToFloat($toimintaAvustus), + 'value' => (string) ConvertHelper::convertToFloat($toimintaAvustus), ]; $this->processFieldMeta($elementArray, $elements['yhdistyksen_kuluvan_vuoden_toiminta_avustus'], $page, $section); @@ -86,7 +85,7 @@ private function processToimintaAvustus($arguments) { 'ID' => 'usedAmount', 'label' => 'Euroa', 'valueType' => 'double', - 'value' => (string) GrantsHandler::convertToFloat($usedToimintaAvustus), + 'value' => (string) ConvertHelper::convertToFloat($usedToimintaAvustus), ]; $this->processFieldMeta($elementArray, $elements['yhdistyksen_kuluvan_vuoden_toiminta_avustus'], $page, $section); @@ -132,7 +131,7 @@ private function processPalkkausAvustus($arguments) { 'ID' => 'amount', 'label' => 'Euroa', 'valueType' => 'double', - 'value' => (string) GrantsHandler::convertToFloat($palkkausAvustus), + 'value' => (string) ConvertHelper::convertToFloat($palkkausAvustus), ]; $this->processFieldMeta($elementArray, $elements['yhdistyksen_kuluvan_vuoden_palkkausavustus_'], $page, $section); @@ -143,7 +142,7 @@ private function processPalkkausAvustus($arguments) { 'ID' => 'usedAmount', 'label' => 'Euroa', 'valueType' => 'double', - 'value' => (string) GrantsHandler::convertToFloat($usedPalkkausAvustus), + 'value' => (string) ConvertHelper::convertToFloat($usedPalkkausAvustus), ]; $this->processFieldMeta($elementArray, $elements['selvitys_kuluvan_vuoden_palkkausavustuksen_kaytosta'], $page, $section); diff --git a/public/modules/custom/grants_metadata/src/ConvertHelper.php b/public/modules/custom/grants_metadata/src/ConvertHelper.php new file mode 100644 index 0000000000..e002204f4e --- /dev/null +++ b/public/modules/custom/grants_metadata/src/ConvertHelper.php @@ -0,0 +1,81 @@ +values['amount'])) { - $this->values['amount'] = GrantsHandler::convertToFloat($this->values['amount']); + $this->values['amount'] = ConvertHelper::convertToFloat($this->values['amount']); } // We need to make sure amount is valid float to get validation working. if (isset($this->values['usedAmount'])) { - $this->values['usedAmount'] = GrantsHandler::convertToFloat($this->values['usedAmount']); + $this->values['usedAmount'] = ConvertHelper::convertToFloat($this->values['usedAmount']); } return $this->values; diff --git a/public/modules/custom/grants_metadata/src/Plugin/DataType/CompensationTypeData.php b/public/modules/custom/grants_metadata/src/Plugin/DataType/CompensationTypeData.php index e4111ef701..6f9e98b462 100644 --- a/public/modules/custom/grants_metadata/src/Plugin/DataType/CompensationTypeData.php +++ b/public/modules/custom/grants_metadata/src/Plugin/DataType/CompensationTypeData.php @@ -3,7 +3,7 @@ namespace Drupal\grants_metadata\Plugin\DataType; use Drupal\Core\TypedData\Plugin\DataType\Map; -use Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler; +use Drupal\grants_metadata\ConvertHelper; /** * Address DataType. @@ -35,7 +35,7 @@ public function getValue() { } // We need to make sure amount is valid float to get validation working. if (isset($this->values['amount'])) { - $this->values['amount'] = GrantsHandler::convertToFloat($this->values['amount']) ?? 0; + $this->values['amount'] = ConvertHelper::convertToFloat($this->values['amount']) ?? 0; } return $this->values; diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/ApplicationDefinitionTrait.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/ApplicationDefinitionTrait.php index 5114ebc1dc..4645aeef59 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/ApplicationDefinitionTrait.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/ApplicationDefinitionTrait.php @@ -280,7 +280,7 @@ public function getBaseProperties(): array { 'jsonType' => 'double', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('jsonPath', [ @@ -304,7 +304,7 @@ public function getBaseProperties(): array { 'otherAppliedCompensationsTotal', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->addConstraint('NotBlank'); @@ -406,7 +406,7 @@ public function getBaseProperties(): array { $info['status_updates'] = MapDataDefinition::create() ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'cleanUpArrayValues', ]) ->setPropertyDefinition( @@ -450,7 +450,7 @@ public function getBaseProperties(): array { $info['events'] = MapDataDefinition::create() ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'cleanUpArrayValues', ]) ->setPropertyDefinition( @@ -488,7 +488,7 @@ public function getBaseProperties(): array { $info['messages'] = MapDataDefinition::create() ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'cleanUpArrayValues', ]) ->setPropertyDefinition( diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/AsukaPienaDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/AsukaPienaDefinition.php index 035883e718..d4b476f602 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/AsukaPienaDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/AsukaPienaDefinition.php @@ -30,7 +30,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_person_local'] = DataDefinition::create('string') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -41,7 +41,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_person_global'] = DataDefinition::create('string') ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -53,7 +53,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_community_local'] = DataDefinition::create('string') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -64,7 +64,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_community_global'] = DataDefinition::create('string') ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -97,7 +97,7 @@ public function getPropertyDefinitions(): array { 'feePerson', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ @@ -113,7 +113,7 @@ public function getPropertyDefinitions(): array { 'feeCommunity', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/AsukasYleisToimDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/AsukasYleisToimDefinition.php index 21b2eae1f0..c672356cc9 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/AsukasYleisToimDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/AsukasYleisToimDefinition.php @@ -31,7 +31,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_person_local'] = DataDefinition::create('integer') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -47,7 +47,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_person_global'] = DataDefinition::create('integer') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -59,7 +59,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_community_local'] = DataDefinition::create('integer') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -70,7 +70,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_community_global'] = DataDefinition::create('integer') ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -123,7 +123,7 @@ public function getPropertyDefinitions(): array { 'feePerson', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ @@ -138,7 +138,7 @@ public function getPropertyDefinitions(): array { 'feeCommunity', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/CompensationTypeDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/CompensationTypeDefinition.php index f07d18ebc1..e61a7683b1 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/CompensationTypeDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/CompensationTypeDefinition.php @@ -37,7 +37,7 @@ public function getPropertyDefinitions(): array { 'amount', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('webformValueExtracter', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/HyteedyleisDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/HyteedyleisDefinition.php index 8ece6187d5..0c80b60938 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/HyteedyleisDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/HyteedyleisDefinition.php @@ -29,7 +29,7 @@ public function getPropertyDefinitions() { $info['members_applicant_person_local'] = DataDefinition::create('integer') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -45,7 +45,7 @@ public function getPropertyDefinitions() { $info['members_applicant_person_global'] = DataDefinition::create('integer') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -57,7 +57,7 @@ public function getPropertyDefinitions() { $info['members_applicant_community_local'] = DataDefinition::create('integer') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -68,7 +68,7 @@ public function getPropertyDefinitions() { $info['members_applicant_community_global'] = DataDefinition::create('integer') ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -145,7 +145,7 @@ public function getPropertyDefinitions() { 'feePerson', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ @@ -160,7 +160,7 @@ public function getPropertyDefinitions() { 'feeCommunity', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/HyvinYleisDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/HyvinYleisDefinition.php index 52a1c06fde..501e92e8b4 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/HyvinYleisDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/HyvinYleisDefinition.php @@ -29,7 +29,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_person_local'] = DataDefinition::create('string') ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -40,7 +40,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_person_global'] = DataDefinition::create('string') ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -51,7 +51,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_community_local'] = DataDefinition::create('string') ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -62,7 +62,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_community_global'] = DataDefinition::create('string') ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -122,7 +122,7 @@ public function getPropertyDefinitions(): array { 'feePerson', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ @@ -141,7 +141,7 @@ public function getPropertyDefinitions(): array { 'feeCommunity', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/KaskoYleisavustusDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/KaskoYleisavustusDefinition.php index c739090f70..c0bc6331bc 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/KaskoYleisavustusDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/KaskoYleisavustusDefinition.php @@ -30,7 +30,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_person_local'] = DataDefinition::create('string') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -42,7 +42,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_person_global'] = DataDefinition::create('string') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -54,7 +54,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_community_local'] = DataDefinition::create('string') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -65,7 +65,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_community_global'] = DataDefinition::create('string') ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -125,7 +125,7 @@ public function getPropertyDefinitions(): array { 'feePerson', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ @@ -140,7 +140,7 @@ public function getPropertyDefinitions(): array { 'feeCommunity', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaKehaDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaKehaDefinition.php index a4f47f07e6..82b389f3c4 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaKehaDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaKehaDefinition.php @@ -60,7 +60,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffPeopleFulltime', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -75,7 +75,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffPeopleParttime', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -90,7 +90,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffPeopleVoluntary', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -105,7 +105,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffManyearsFulltime', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('webformValueExtracter', [ @@ -124,7 +124,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffManyearsParttime', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('webformValueExtracter', [ @@ -374,7 +374,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersPersonGlobal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -389,7 +389,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersPersonLocal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -404,7 +404,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersCommunityGlobal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -419,7 +419,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersCommunityLocal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaPerusDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaPerusDefinition.php index 3c16068417..2f43e53d25 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaPerusDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaPerusDefinition.php @@ -53,7 +53,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersPersonGlobal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -68,7 +68,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersPersonLocal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -83,7 +83,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersCommunityGlobal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -98,7 +98,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersCommunityLocal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -150,7 +150,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'pupilsChildhoodAll', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -165,7 +165,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'wideBasicStudiesAll', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -180,7 +180,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'wideAdvancedStudiesAll', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -195,7 +195,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'generalStudiesAll', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -210,7 +210,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'pupilsChildhoodGirls', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -225,7 +225,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'wideBasicStudiesGirls', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -240,7 +240,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'wideAdvancedStudiesGirls', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -255,7 +255,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'generalStudiesGirls', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -270,7 +270,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'pupilsChildhoodBoys', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -285,7 +285,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'wideBasicStudiesBoys', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -300,7 +300,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'wideAdvancedStudiesBoys', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -315,7 +315,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'generalStudiesBoys', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -330,7 +330,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'teachingPersonnel', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -369,7 +369,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'lessonsChildhood', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -384,7 +384,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'lessonsWideBasicStudies', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -399,7 +399,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'lessonsWideAdvancedStudies', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -414,7 +414,7 @@ public function getPropertyDefinitions(): array { 'realizedActivityInfoArray', 'lessonsGeneralStudies', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaProjektiDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaProjektiDefinition.php index e137ccc689..45937f6656 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaProjektiDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaProjektiDefinition.php @@ -7,7 +7,7 @@ use Drupal\Core\TypedData\DataDefinitionInterface; use Drupal\Core\TypedData\ListDataDefinition; use Drupal\grants_budget_components\TypedData\Definition\GrantsBudgetInfoDefinition; -use Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler; +use Drupal\grants_metadata\ConvertHelper; /** * Define Yleisavustushakemus data. @@ -89,7 +89,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffPeopleFulltime', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('formSettings', [ @@ -116,7 +116,7 @@ public function getPropertyDefinitions(): array { 'formElement' => 'osa_aikainen_henkilosto', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]); @@ -128,7 +128,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffPeopleVoluntary', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -144,7 +144,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffManyearsFulltime', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('webformValueExtracter', [ @@ -164,7 +164,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffManyearsParttime', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('webformValueExtracter', [ @@ -281,7 +281,7 @@ public function getPropertyDefinitions(): array { 'eventDaysCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -299,7 +299,7 @@ public function getPropertyDefinitions(): array { 'performanceCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -315,7 +315,7 @@ public function getPropertyDefinitions(): array { 'performanceCountAll', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -333,7 +333,7 @@ public function getPropertyDefinitions(): array { 'exhibitionCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -349,7 +349,7 @@ public function getPropertyDefinitions(): array { 'exhibitionCountAll', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -367,7 +367,7 @@ public function getPropertyDefinitions(): array { 'workshopCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -383,7 +383,7 @@ public function getPropertyDefinitions(): array { 'workshopCountAll', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -400,7 +400,7 @@ public function getPropertyDefinitions(): array { 'firstPublicPerformancesCount', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -417,7 +417,7 @@ public function getPropertyDefinitions(): array { 'premiereCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -465,7 +465,7 @@ public function getPropertyDefinitions(): array { 'eventsVisitorsHkiTotal', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -482,7 +482,7 @@ public function getPropertyDefinitions(): array { 'eventsVisitorsTotal', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -608,7 +608,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersPersonLocal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -624,7 +624,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersPersonGlobal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -640,7 +640,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersCommunityLocal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -656,7 +656,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersCommunityGlobal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -727,7 +727,7 @@ public static function activityConditionCheck(DataDefinitionInterface $definitio foreach ($subventions as $subventionData) { if (isset($subventionData['amount'])) { - $subventionsTotalAmount += GrantsHandler::convertToFloat($subventionData['amount']); + $subventionsTotalAmount += ConvertHelper::convertToFloat($subventionData['amount']); } } diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaToimintaDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaToimintaDefinition.php index c157b34838..0473de2459 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaToimintaDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/KuvaToimintaDefinition.php @@ -92,7 +92,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffPeopleFulltime', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -107,7 +107,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffPeopleParttime', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -122,7 +122,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffPeopleVoluntary', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -175,7 +175,7 @@ public function getPropertyDefinitions(): array { 'eventDaysCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -191,7 +191,7 @@ public function getPropertyDefinitions(): array { 'firstPublicPerformancesCount', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -207,7 +207,7 @@ public function getPropertyDefinitions(): array { 'premiereCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -240,7 +240,7 @@ public function getPropertyDefinitions(): array { 'performanceCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -255,7 +255,7 @@ public function getPropertyDefinitions(): array { 'performanceCountAll', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -271,7 +271,7 @@ public function getPropertyDefinitions(): array { 'exhibitionCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -286,7 +286,7 @@ public function getPropertyDefinitions(): array { 'exhibitionCountAll', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -303,7 +303,7 @@ public function getPropertyDefinitions(): array { 'workshopCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -318,7 +318,7 @@ public function getPropertyDefinitions(): array { 'workshopCountAll', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -341,7 +341,7 @@ public function getPropertyDefinitions(): array { 'eventDaysCount', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -370,7 +370,7 @@ public function getPropertyDefinitions(): array { 'performanceCountAll', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -385,7 +385,7 @@ public function getPropertyDefinitions(): array { 'performanceCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -402,7 +402,7 @@ public function getPropertyDefinitions(): array { 'exhibitionCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -417,7 +417,7 @@ public function getPropertyDefinitions(): array { 'exhibitionCountAll', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -434,7 +434,7 @@ public function getPropertyDefinitions(): array { 'workshopCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -449,7 +449,7 @@ public function getPropertyDefinitions(): array { 'workshopCountAll', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -465,7 +465,7 @@ public function getPropertyDefinitions(): array { 'firstPublicPerformancesCount', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -481,7 +481,7 @@ public function getPropertyDefinitions(): array { 'premiereCountHki', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -518,7 +518,7 @@ public function getPropertyDefinitions(): array { 'eventsVisitorsHkiTotal', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -534,7 +534,7 @@ public function getPropertyDefinitions(): array { 'eventsVisitorsTotal', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -697,7 +697,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersPersonLocal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -712,7 +712,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersPersonGlobal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -727,7 +727,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersCommunityLocal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -742,7 +742,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'membersCommunityGlobal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -757,7 +757,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffManyearsFulltime', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('webformValueExtracter', [ @@ -776,7 +776,7 @@ public function getPropertyDefinitions(): array { 'generalCommunityInfoArray', 'staffManyearsParttime', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('webformValueExtracter', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/LiikuntaTapahtumaDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/LiikuntaTapahtumaDefinition.php index 4ea11dcc67..8631551f22 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/LiikuntaTapahtumaDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/LiikuntaTapahtumaDefinition.php @@ -42,7 +42,7 @@ public function getPropertyDefinitions(): array { 'participantsArray', 'adultsMale', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -56,7 +56,7 @@ public function getPropertyDefinitions(): array { 'participantsArray', 'adultsFemale', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -70,7 +70,7 @@ public function getPropertyDefinitions(): array { 'participantsArray', 'adultsOther', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -84,7 +84,7 @@ public function getPropertyDefinitions(): array { 'participantsArray', 'juniorsMale', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -98,7 +98,7 @@ public function getPropertyDefinitions(): array { 'participantsArray', 'juniorsFemale', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -112,7 +112,7 @@ public function getPropertyDefinitions(): array { 'participantsArray', 'juniorsOther', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/LiikuntaTilankayttoDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/LiikuntaTilankayttoDefinition.php index 1ea0ce9b35..40ea38224b 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/LiikuntaTilankayttoDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/LiikuntaTilankayttoDefinition.php @@ -78,7 +78,7 @@ public function getPropertyDefinitions(): array { 'jsonType' => 'int', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -95,7 +95,7 @@ public function getPropertyDefinitions(): array { 'jsonType' => 'double', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('webformValueExtracter', [ @@ -184,7 +184,7 @@ private function createRepeatedMembershipDefinitions($key, $jsonPath, &$info) { 'membersInfoArray', $jsonPath, ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/NuorisoProjektiDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/NuorisoProjektiDefinition.php index 73de0ecf63..d2a76c51c9 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/NuorisoProjektiDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/NuorisoProjektiDefinition.php @@ -54,7 +54,7 @@ public function getPropertyDefinitions(): array { 'activitiesInfoArray', 'membersAge7to28YearsLocal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -68,7 +68,7 @@ public function getPropertyDefinitions(): array { 'activitiesInfoArray', 'membersSummaryGlobal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -139,7 +139,7 @@ public function getPropertyDefinitions(): array { 'projectInfoArray', 'age7to28yearsLocal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -153,7 +153,7 @@ public function getPropertyDefinitions(): array { 'projectInfoArray', 'all', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -190,7 +190,7 @@ public function getPropertyDefinitions(): array { 'budgetInfoArray', 'selfFinancingAmount', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('webformValueExtracter', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/NuorisoToimintaDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/NuorisoToimintaDefinition.php index b6bff729c8..50b0c4adf6 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/NuorisoToimintaDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/NuorisoToimintaDefinition.php @@ -46,7 +46,7 @@ public function getPropertyDefinitions(): array { 'activitiesInfoArray', 'membersAge0to6YearsGlobal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -60,7 +60,7 @@ public function getPropertyDefinitions(): array { 'activitiesInfoArray', 'membersAge0to6YearsLocal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -74,7 +74,7 @@ public function getPropertyDefinitions(): array { 'activitiesInfoArray', 'membersAge7to28YearsGlobal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -88,7 +88,7 @@ public function getPropertyDefinitions(): array { 'activitiesInfoArray', 'membersAge7to28YearsLocal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -102,7 +102,7 @@ public function getPropertyDefinitions(): array { 'activitiesInfoArray', 'membersOthersGlobal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -116,7 +116,7 @@ public function getPropertyDefinitions(): array { 'activitiesInfoArray', 'membersOthersLocal', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -130,7 +130,7 @@ public function getPropertyDefinitions(): array { 'activitiesInfoArray', 'lastYearYoungPeopleParticipation', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -144,7 +144,7 @@ public function getPropertyDefinitions(): array { 'activitiesInfoArray', 'lastYearYoungPeopleParticipationDigital', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -198,7 +198,7 @@ public function getPropertyDefinitions(): array { 'hiredOfficialsInfo', 'amountOfHiredOfficials', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -213,7 +213,7 @@ public function getPropertyDefinitions(): array { 'budgetInfoArray', 'employeeSalaries', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('webformValueExtracter', [ @@ -232,7 +232,7 @@ public function getPropertyDefinitions(): array { 'budgetInfoArray', 'mandatoryAndOptionalPersonelCosts', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('webformValueExtracter', [ @@ -251,7 +251,7 @@ public function getPropertyDefinitions(): array { 'budgetInfoArray', 'travelAndTrainingCosts', ])->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('webformValueExtracter', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/OtherCompensationDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/OtherCompensationDefinition.php index 493fb541e5..7ce91e6fb6 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/OtherCompensationDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/OtherCompensationDefinition.php @@ -42,7 +42,7 @@ public function getPropertyDefinitions(): array { 'jsonType' => 'float', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('webformValueExtracter', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/SotepeyleisDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/SotepeyleisDefinition.php index 2541e39ab7..5b553b6709 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/SotepeyleisDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/SotepeyleisDefinition.php @@ -29,7 +29,7 @@ public function getPropertyDefinitions() { $info['members_applicant_person_local'] = DataDefinition::create('integer') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('typeOverride', [ @@ -45,7 +45,7 @@ public function getPropertyDefinitions() { $info['members_applicant_person_global'] = DataDefinition::create('integer') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -57,7 +57,7 @@ public function getPropertyDefinitions() { $info['members_applicant_community_local'] = DataDefinition::create('integer') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -68,7 +68,7 @@ public function getPropertyDefinitions() { $info['members_applicant_community_global'] = DataDefinition::create('integer') ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -145,7 +145,7 @@ public function getPropertyDefinitions() { 'feePerson', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ @@ -160,7 +160,7 @@ public function getPropertyDefinitions() { 'feeCommunity', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/TyollisyysavustusHakemusDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/TyollisyysavustusHakemusDefinition.php index 66bd691c31..a870416b9f 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/TyollisyysavustusHakemusDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/TyollisyysavustusHakemusDefinition.php @@ -109,7 +109,7 @@ public function getPropertyDefinitions(): array { 'feePerson', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ @@ -124,7 +124,7 @@ public function getPropertyDefinitions(): array { 'feeCommunity', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/YleisavustusHakemusDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/YleisavustusHakemusDefinition.php index 1813995602..431ad25729 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/YleisavustusHakemusDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/YleisavustusHakemusDefinition.php @@ -30,7 +30,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_person_local'] = DataDefinition::create('string') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -42,7 +42,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_person_global'] = DataDefinition::create('string') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -54,7 +54,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_community_local'] = DataDefinition::create('string') ->setSetting('defaultValue', "") ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -65,7 +65,7 @@ public function getPropertyDefinitions(): array { $info['members_applicant_community_global'] = DataDefinition::create('string') ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]) ->setSetting('jsonPath', [ @@ -125,7 +125,7 @@ public function getPropertyDefinitions(): array { 'feePerson', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ @@ -140,7 +140,7 @@ public function getPropertyDefinitions(): array { 'feeCommunity', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ diff --git a/public/modules/custom/grants_metadata/src/TypedData/Definition/YmparistoYleisDefinition.php b/public/modules/custom/grants_metadata/src/TypedData/Definition/YmparistoYleisDefinition.php index c99f94fde8..f59e844e22 100644 --- a/public/modules/custom/grants_metadata/src/TypedData/Definition/YmparistoYleisDefinition.php +++ b/public/modules/custom/grants_metadata/src/TypedData/Definition/YmparistoYleisDefinition.php @@ -35,7 +35,7 @@ public function getPropertyDefinitions(): array { 'membersApplicantPersonLocal', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]); @@ -47,7 +47,7 @@ public function getPropertyDefinitions(): array { 'membersApplicantPersonGlobal', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]); @@ -59,7 +59,7 @@ public function getPropertyDefinitions(): array { 'membersApplicantCommunityLocal', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]); @@ -70,7 +70,7 @@ public function getPropertyDefinitions(): array { 'membersApplicantCommunityGlobal', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToInt', ]); @@ -125,7 +125,7 @@ public function getPropertyDefinitions(): array { 'feePerson', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ @@ -140,7 +140,7 @@ public function getPropertyDefinitions(): array { 'feeCommunity', ]) ->setSetting('valueCallback', [ - '\Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler', + '\Drupal\grants_metadata\ConvertHelper', 'convertToFloat', ]) ->setSetting('typeOverride', [ diff --git a/public/modules/custom/grants_orienteering_map/src/Element/OrienteeringMapComposite.php b/public/modules/custom/grants_orienteering_map/src/Element/OrienteeringMapComposite.php index 7946f1659a..fda9743660 100644 --- a/public/modules/custom/grants_orienteering_map/src/Element/OrienteeringMapComposite.php +++ b/public/modules/custom/grants_orienteering_map/src/Element/OrienteeringMapComposite.php @@ -3,7 +3,7 @@ namespace Drupal\grants_orienteering_map\Element; use Drupal\Core\Form\FormStateInterface; -use Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler; +use Drupal\grants_metadata\ConvertHelper; use Drupal\webform\Element\WebformCompositeBase; /** @@ -116,9 +116,9 @@ public static function validateOtherCompensation(array &$element, FormStateInter $otherCompensations = $elementValues['otherCompensations'] ?? 0; // Float conversion, just to be sure. - $voluntaryHours = GrantsHandler::convertToFloat($voluntaryHours); - $cost = GrantsHandler::convertToFloat($cost); - $otherCompensation = GrantsHandler::convertToFloat($otherCompensations); + $voluntaryHours = ConvertHelper::convertToFloat($voluntaryHours); + $cost = ConvertHelper::convertToFloat($cost); + $otherCompensation = ConvertHelper::convertToFloat($otherCompensations); // Hours + Cost cannot be lower than otherCompensation. $hoursAndCostSum = $voluntaryHours + $cost; diff --git a/public/modules/custom/grants_place_of_operation/src/Plugin/DataType/PlaceOfOperationData.php b/public/modules/custom/grants_place_of_operation/src/Plugin/DataType/PlaceOfOperationData.php index 9c12c85c82..d1ae705733 100644 --- a/public/modules/custom/grants_place_of_operation/src/Plugin/DataType/PlaceOfOperationData.php +++ b/public/modules/custom/grants_place_of_operation/src/Plugin/DataType/PlaceOfOperationData.php @@ -3,7 +3,7 @@ namespace Drupal\grants_place_of_operation\Plugin\DataType; use Drupal\Core\TypedData\Plugin\DataType\Map; -use Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler; +use Drupal\grants_metadata\ConvertHelper; use Drupal\grants_metadata\Plugin\DataType\DataFormatTrait; /** @@ -46,7 +46,7 @@ public function setValue($values, $notify = TRUE) { } if (isset($values["totalRent"])) { - $values["totalRent"] = GrantsHandler::convertToFloat($values["totalRent"]); + $values["totalRent"] = ConvertHelper::convertToFloat($values["totalRent"]); } parent::setValue($values, $notify); diff --git a/public/modules/custom/grants_webform_summation_field/grants_webform_summation_field.module b/public/modules/custom/grants_webform_summation_field/grants_webform_summation_field.module index 650ed61bdb..02400ef823 100644 --- a/public/modules/custom/grants_webform_summation_field/grants_webform_summation_field.module +++ b/public/modules/custom/grants_webform_summation_field/grants_webform_summation_field.module @@ -6,7 +6,7 @@ */ use Drupal\Core\Entity\Display\EntityViewDisplayInterface; -use Drupal\grants_handler\Plugin\WebformHandler\GrantsHandler; +use Drupal\grants_metadata\ConvertHelper; use Drupal\webform\Entity\Webform; use Drupal\webform\Entity\WebformSubmission; @@ -54,7 +54,7 @@ function grants_webform_summation_field_webform_submission_view_alter( foreach ($subventionsElementData as $subventionData) { if (isset($subventionData['amount'])) { - $subventionsTotalAmount += GrantsHandler::convertToFloat($subventionData['amount']); + $subventionsTotalAmount += ConvertHelper::convertToFloat($subventionData['amount']); } } @@ -97,7 +97,7 @@ function grants_webform_summation_field_process_custom_summation_fields( // Find linked subvention type from subvention data. foreach ($subventionsElementData as $subventionData) { if (isset($subventionData['amount']) && $subventionData['subventionType'] == $subventionType) { - $elementTotal = GrantsHandler::convertToFloat($subventionData['amount']); + $elementTotal = ConvertHelper::convertToFloat($subventionData['amount']); } }