diff --git a/CHANGELOG.md b/CHANGELOG.md index 3df67288..ca989385 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ before starting to add changes. Use example [placed in the end of the page](#exa ## [Unreleased] +- [OS-58] New company address fields + ## [3.10.0] 2023-08-23 - [OSF-55] DAWA Address-Matrikula (autocomplete) (required) diff --git a/modules/os2forms_nemid/src/Element/NemidCompanyApartmentNr.php b/modules/os2forms_nemid/src/Element/NemidCompanyApartmentNr.php new file mode 100644 index 00000000..830f68ad --- /dev/null +++ b/modules/os2forms_nemid/src/Element/NemidCompanyApartmentNr.php @@ -0,0 +1,67 @@ + [ + [$class, 'processNemidCompanyApartmentNr'], + [$class, 'processAjaxForm'], + ], + '#element_validate' => [ + [$class, 'validateNemidCompanyApartmentNr'], + ], + '#pre_render' => [ + [$class, 'preRenderNemidCompanyApartmentNr'], + ], + '#theme' => 'input__os2forms_nemid_company_apartment_nr', + ]; + } + + /** + * Processes a 'os2forms_nemid_company_apartment_nr' element. + */ + public static function processNemidCompanyApartmentNr(&$element, FormStateInterface $form_state, &$complete_form) { + // Here you can add and manipulate your element's properties and callbacks. + return $element; + } + + /** + * Webform element validation for 'os2forms_nemid_company_apartment_nr'. + */ + public static function validateNemidCompanyApartmentNr(&$element, FormStateInterface $form_state, &$complete_form) { + // Here you can add custom validation logic. + } + + /** + * {@inheritdoc} + */ + public static function preRenderNemidCompanyApartmentNr(array $element) { + $element = parent::prerenderNemidElementBase($element); + static::setAttributes($element, [ + 'form-text', + 'os2forms-nemid-company-apartment-nr', + ]); + return $element; + } + +} diff --git a/modules/os2forms_nemid/src/Element/NemidCompanyFloor.php b/modules/os2forms_nemid/src/Element/NemidCompanyFloor.php new file mode 100644 index 00000000..5b69c140 --- /dev/null +++ b/modules/os2forms_nemid/src/Element/NemidCompanyFloor.php @@ -0,0 +1,67 @@ + [ + [$class, 'processNemidCompanyFloor'], + [$class, 'processAjaxForm'], + ], + '#element_validate' => [ + [$class, 'validateNemidCompanyFloor'], + ], + '#pre_render' => [ + [$class, 'preRenderNemidCompanyFloor'], + ], + '#theme' => 'input__os2forms_nemid_company_floor', + ]; + } + + /** + * Processes a 'os2forms_nemid_company_floor' element. + */ + public static function processNemidCompanyFloor(&$element, FormStateInterface $form_state, &$complete_form) { + // Here you can add and manipulate your element's properties and callbacks. + return $element; + } + + /** + * Webform element validation handler for 'os2forms_nemid_company_floor'. + */ + public static function validateNemidCompanyFloor(&$element, FormStateInterface $form_state, &$complete_form) { + // Here you can add custom validation logic. + } + + /** + * {@inheritdoc} + */ + public static function preRenderNemidCompanyFloor(array $element) { + $element = parent::prerenderNemidElementBase($element); + static::setAttributes($element, [ + 'form-text', + 'os2forms-nemid-company-floor', + ]); + return $element; + } + +} diff --git a/modules/os2forms_nemid/src/Element/NemidCompanyHouseNr.php b/modules/os2forms_nemid/src/Element/NemidCompanyHouseNr.php new file mode 100644 index 00000000..7122441f --- /dev/null +++ b/modules/os2forms_nemid/src/Element/NemidCompanyHouseNr.php @@ -0,0 +1,67 @@ + [ + [$class, 'processNemidCompanyHouseNr'], + [$class, 'processAjaxForm'], + ], + '#element_validate' => [ + [$class, 'validateNemidCompanyHouseNr'], + ], + '#pre_render' => [ + [$class, 'preRenderNemidCompanyHouseNr'], + ], + '#theme' => 'input__os2forms_nemid_company_house_nr', + ]; + } + + /** + * Processes a 'os2forms_nemid_company_house_nr' element. + */ + public static function processNemidCompanyHouseNr(&$element, FormStateInterface $form_state, &$complete_form) { + // Here you can add and manipulate your element's properties and callbacks. + return $element; + } + + /** + * Webform element validation handler for 'os2forms_nemid_company_house_nr'. + */ + public static function validateNemidCompanyHouseNr(&$element, FormStateInterface $form_state, &$complete_form) { + // Here you can add custom validation logic. + } + + /** + * {@inheritdoc} + */ + public static function preRenderNemidCompanyHouseNr(array $element) { + $element = parent::prerenderNemidElementBase($element); + static::setAttributes($element, [ + 'form-text', + 'os2forms-nemid-company-house-nr', + ]); + return $element; + } + +} diff --git a/modules/os2forms_nemid/src/Element/NemidCompanyKommunekode.php b/modules/os2forms_nemid/src/Element/NemidCompanyKommunekode.php new file mode 100644 index 00000000..3a763478 --- /dev/null +++ b/modules/os2forms_nemid/src/Element/NemidCompanyKommunekode.php @@ -0,0 +1,67 @@ + [ + [$class, 'processNemidCompanyKommunekode'], + [$class, 'processAjaxForm'], + ], + '#element_validate' => [ + [$class, 'validateNemidCompanyKommunekode'], + ], + '#pre_render' => [ + [$class, 'preRenderNemidCompanyKommunekode'], + ], + '#theme' => 'input__os2forms_nemid_company_kommunekode', + ]; + } + + /** + * Processes a 'os2forms_nemid_company_kommunekode' element. + */ + public static function processNemidCompanyKommunekode(&$element, FormStateInterface $form_state, &$complete_form) { + // Here you can add and manipulate your element's properties and callbacks. + return $element; + } + + /** + * Webform element validation for 'os2forms_nemid_company_kommunekode'. + */ + public static function validateNemidCompanyKommunekode(&$element, FormStateInterface $form_state, &$complete_form) { + // Here you can add custom validation logic. + } + + /** + * {@inheritdoc} + */ + public static function preRenderNemidCompanyKommunekode(array $element) { + $element = parent::prerenderNemidElementBase($element); + static::setAttributes($element, [ + 'form-text', + 'os2forms-nemid-company-kommunekode', + ]); + return $element; + } + +} diff --git a/modules/os2forms_nemid/src/Element/NemidCompanyPostalCode.php b/modules/os2forms_nemid/src/Element/NemidCompanyPostalCode.php new file mode 100644 index 00000000..bfe34437 --- /dev/null +++ b/modules/os2forms_nemid/src/Element/NemidCompanyPostalCode.php @@ -0,0 +1,67 @@ + [ + [$class, 'processNemidCompanyPostalCode'], + [$class, 'processAjaxForm'], + ], + '#element_validate' => [ + [$class, 'validateNemidCompanyPostalCode'], + ], + '#pre_render' => [ + [$class, 'preRenderNemidCompanyPostalCode'], + ], + '#theme' => 'input__os2forms_nemid_company_postal_code', + ]; + } + + /** + * Processes a 'os2forms_nemid_company_postal_code' element. + */ + public static function processNemidCompanyPostalCode(&$element, FormStateInterface $form_state, &$complete_form) { + // Here you can add and manipulate your element's properties and callbacks. + return $element; + } + + /** + * Webform element validation for 'os2forms_nemid_company_postal_code'. + */ + public static function validateNemidCompanyPostalCode(&$element, FormStateInterface $form_state, &$complete_form) { + // Here you can add custom validation logic. + } + + /** + * {@inheritdoc} + */ + public static function preRenderNemidCompanyPostalCode(array $element) { + $element = parent::prerenderNemidElementBase($element); + static::setAttributes($element, [ + 'form-text', + 'os2forms-nemid-company-postal-code', + ]); + return $element; + } + +} diff --git a/modules/os2forms_nemid/src/Element/NemidCompanyStreet.php b/modules/os2forms_nemid/src/Element/NemidCompanyStreet.php new file mode 100644 index 00000000..ae995a17 --- /dev/null +++ b/modules/os2forms_nemid/src/Element/NemidCompanyStreet.php @@ -0,0 +1,67 @@ + [ + [$class, 'processNemidCompanyStreet'], + [$class, 'processAjaxForm'], + ], + '#element_validate' => [ + [$class, 'validateNemidCompanyStreet'], + ], + '#pre_render' => [ + [$class, 'preRenderNemidCompanyStreet'], + ], + '#theme' => 'input__os2forms_nemid_company_street', + ]; + } + + /** + * Processes a 'os2forms_nemid_company_street' element. + */ + public static function processNemidCompanyStreet(&$element, FormStateInterface $form_state, &$complete_form) { + // Here you can add and manipulate your element's properties and callbacks. + return $element; + } + + /** + * Webform element validation handler for 'os2forms_nemid_company_street'. + */ + public static function validateNemidCompanyStreet(&$element, FormStateInterface $form_state, &$complete_form) { + // Here you can add custom validation logic. + } + + /** + * {@inheritdoc} + */ + public static function preRenderNemidCompanyStreet(array $element) { + $element = parent::prerenderNemidElementBase($element); + static::setAttributes($element, [ + 'form-text', + 'os2forms-nemid-company-street', + ]); + return $element; + } + +} diff --git a/modules/os2forms_nemid/src/Plugin/WebformElement/NemidCompanyApartmentNr.php b/modules/os2forms_nemid/src/Plugin/WebformElement/NemidCompanyApartmentNr.php new file mode 100644 index 00000000..c8da2fb7 --- /dev/null +++ b/modules/os2forms_nemid/src/Plugin/WebformElement/NemidCompanyApartmentNr.php @@ -0,0 +1,29 @@ +