@@ -279,14 +279,34 @@ private function buildConfigurationFormDistributionObject(): array {
279279 ],
280280 ];
281281
282+ $ section [DistributionObjectSettings::FILES ][DistributionObjectFilesSettings::RECIPIENT_AUTHORITY_OVERRIDE ] = [
283+ '#title ' => $ this ->t ('Set %recipient_authority ' , [
284+ '%recipient_authority ' => $ this ->t ('Recipient authority ' ),
285+ ]),
286+ '#type ' => 'checkbox ' ,
287+ '#default_value ' => $ settings ->files ->recipientAuthorityOverride ,
288+ '#description ' => $ this ->t ('If %recipient_authority is not set here, the global %routing_myndighed_label value (@routing_myndighed_value) will be used. ' , [
289+ '%recipient_authority ' => $ this ->t ('Recipient authority ' ),
290+ '%routing_myndighed_label ' => $ this ->t ('Routing myndighed ' ),
291+ '@routing_myndighed_value ' => $ this ->settingsService ->getSenderSettings ()->routingMyndighed ,
292+ ]),
293+ ];
282294 $ section [DistributionObjectSettings::FILES ][DistributionObjectFilesSettings::RECIPIENT_AUTHORITY ] = [
283295 '#title ' => $ this ->t ('Recipient authority ' ),
284296 '#type ' => 'textfield ' ,
285297 '#attributes ' => [
286298 'pattern ' => DistributionObjectFilesSettings::RECIPIENT_AUTHORITY_PATTERN ,
287299 ],
288300 '#default_value ' => $ settings ->files ->recipientAuthority ,
289- '#description ' => $ this ->t ('CVR for recipient ' ),
301+ '#description ' => $ this ->t ('CVR for recipient. ' ),
302+ '#states ' => [
303+ 'visible ' => [
304+ ':input[name="settings[ ' . DistributionObjectSettings::NAME . '][ ' . DistributionObjectSettings::FILES . '][ ' . DistributionObjectFilesSettings::RECIPIENT_AUTHORITY_OVERRIDE . ']"] ' => ['checked ' => TRUE ],
305+ ],
306+ 'required ' => [
307+ ':input[name="settings[ ' . DistributionObjectSettings::NAME . '][ ' . DistributionObjectSettings::FILES . '][ ' . DistributionObjectFilesSettings::RECIPIENT_AUTHORITY_OVERRIDE . ']"] ' => ['checked ' => TRUE ],
308+ ],
309+ ],
290310 ];
291311 $ setStates ($ section [DistributionObjectSettings::FILES ][DistributionObjectFilesSettings::RECIPIENT_AUTHORITY ], [
292312 DistributionObjectSettings::DISTRIBUTION_TYPE_FORMULAR ,
0 commit comments