diff --git a/CHANGELOG.md b/CHANGELOG.md index dcd7baa..7ba1a9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ before starting to add changes. Use example [placed in the end of the page](#exa ## [Unreleased] +## [3.7.0] 2023-06-22 + +- [S2FRMS-18] - Fixing PDF styles + ## [3.6.0] 2023-06-07 - [OSF-25] added modules/os2forms_forloeb diff --git a/modules/os2forms_attachment/os2forms_attachment.module b/modules/os2forms_attachment/os2forms_attachment.module index c122ba9..9f8892c 100644 --- a/modules/os2forms_attachment/os2forms_attachment.module +++ b/modules/os2forms_attachment/os2forms_attachment.module @@ -198,7 +198,7 @@ function _os2forms_attachment_print_form_add_template_override(array &$element, '#options' => $header_options, '#description' => t('Select default header that will be used on all forms (use standard for no override)'), '#empty_option' => t('Use standard'), - '#default_value' => $template_settings['os2forms_header'] ?? '', + '#default_value' => $template_settings['os2form_header'] ?? '', '#weight' => -1, ]; @@ -208,7 +208,7 @@ function _os2forms_attachment_print_form_add_template_override(array &$element, '#options' => $colophon_options, '#description' => t('Select default colophon that will be used on all forms (use standard for no override)'), '#empty_option' => t('Use standard'), - '#default_value' => $template_settings['os2forms_colophon'] ?? '', + '#default_value' => $template_settings['os2form_colophon'] ?? '', '#weight' => -1, ]; @@ -218,7 +218,7 @@ function _os2forms_attachment_print_form_add_template_override(array &$element, '#options' => $footer_options, '#description' => t('Select default footer that will be used on all forms (use standard for no override)'), '#empty_option' => t('Use standard'), - '#default_value' => $template_settings['os2forms_footer'] ?? '', + '#default_value' => $template_settings['os2form_footer'] ?? '', '#weight' => 0, ]; diff --git a/modules/os2forms_attachment/src/Form/AttachmentComponentDeleteForm.php b/modules/os2forms_attachment/src/Form/AttachmentComponentDeleteForm.php index e3db6d1..123dc3e 100644 --- a/modules/os2forms_attachment/src/Form/AttachmentComponentDeleteForm.php +++ b/modules/os2forms_attachment/src/Form/AttachmentComponentDeleteForm.php @@ -3,8 +3,8 @@ namespace Drupal\os2forms_attachment\Form; use Drupal\Core\Entity\EntityConfirmFormBase; -use Drupal\Core\Url; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Url; /** * Class AttachmentComponentDeleteForm. diff --git a/modules/os2forms_attachment/src/Form/AttachmentComponentForm.php b/modules/os2forms_attachment/src/Form/AttachmentComponentForm.php index b75010a..05dd93a 100644 --- a/modules/os2forms_attachment/src/Form/AttachmentComponentForm.php +++ b/modules/os2forms_attachment/src/Form/AttachmentComponentForm.php @@ -6,8 +6,8 @@ use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Session\AccountInterface; -use Symfony\Component\DependencyInjection\ContainerInterface; use Drupal\webform\WebformTokenManagerInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; /** * Form handler for the Attachment component add and edit forms. diff --git a/modules/os2forms_attachment/src/Os2formsAttachmentPrintBuilder.php b/modules/os2forms_attachment/src/Os2formsAttachmentPrintBuilder.php index 4ae09ee..67a0c99 100644 --- a/modules/os2forms_attachment/src/Os2formsAttachmentPrintBuilder.php +++ b/modules/os2forms_attachment/src/Os2formsAttachmentPrintBuilder.php @@ -46,7 +46,12 @@ protected function prepareRenderer(array $entities, PrintEngineInterface $print_ '#attached' => [], ]; - $print_engine->addPage($renderer->generateHtml($entities, $render, $use_default_css, TRUE)); + // Adding hardcoded negative margin to avoid margins in
+ // structure. That margin is automatically added in PDF and PDF only. + $generatedHtml = (string) $renderer->generateHtml($entities, $render, $use_default_css, TRUE); + $generatedHtml .= ""; + + $print_engine->addPage($generatedHtml); return $renderer; } diff --git a/modules/os2forms_attachment/templates/os2forms-attachment--webform-submission.html.twig b/modules/os2forms_attachment/templates/os2forms-attachment--webform-submission.html.twig index 817de37..1791710 100644 --- a/modules/os2forms_attachment/templates/os2forms-attachment--webform-submission.html.twig +++ b/modules/os2forms_attachment/templates/os2forms-attachment--webform-submission.html.twig @@ -68,6 +68,15 @@ .table { width: 100%; } + + legend, summary, .details-wrapper, fieldset { + padding: 0; + } + + fieldset { + margin: 0; + border: 0; + } diff --git a/modules/os2forms_consent/os2forms_consent.module b/modules/os2forms_consent/os2forms_consent.module index d48a505..71bcdd6 100644 --- a/modules/os2forms_consent/os2forms_consent.module +++ b/modules/os2forms_consent/os2forms_consent.module @@ -5,8 +5,8 @@ * OS2Forms Consent functionality module. */ -use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Plugin\MigrateSourceInterface; +use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Row; use Symfony\Component\Yaml\Yaml; diff --git a/modules/os2forms_consent/src/Element/WebformAttachmentConsentXml.php b/modules/os2forms_consent/src/Element/WebformAttachmentConsentXml.php index 43344aa..9f7eaa6 100644 --- a/modules/os2forms_consent/src/Element/WebformAttachmentConsentXml.php +++ b/modules/os2forms_consent/src/Element/WebformAttachmentConsentXml.php @@ -2,9 +2,9 @@ namespace Drupal\os2forms_consent\Element; -use Drupal\webform\WebformSubmissionInterface; use Drupal\os2forms\Element\WebformAttachmentXml; use Drupal\os2forms_consent\Plugin\WebformElement\WebformAttachmentConsentXml as WebformElementAttachmentConsentXml; +use Drupal\webform\WebformSubmissionInterface; /** * Provides a 'webform_attachment_os2forms_consent_xml' element. diff --git a/modules/os2forms_forloeb/os2forms_forloeb.module b/modules/os2forms_forloeb/os2forms_forloeb.module index 1d70c11..4c5fac0 100644 --- a/modules/os2forms_forloeb/os2forms_forloeb.module +++ b/modules/os2forms_forloeb/os2forms_forloeb.module @@ -5,17 +5,17 @@ * Install, update and uninstall functions for the os2forms_forloeb. */ -use Drupal\Core\Session\AccountInterface; -use Drupal\Core\Entity\EntityInterface; -use Drupal\webform\WebformInterface; use Drupal\Core\Access\AccessResult; +use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Render\BubbleableMetadata; +use Drupal\Core\Session\AccountInterface; use Drupal\Core\Url; use Drupal\maestro\Engine\MaestroEngine; use Drupal\os2forms_forloeb\Plugin\EngineTasks\MaestroWebformInheritTask; -use Drupal\webform\Entity\WebformSubmission; use Drupal\user\Entity\User; +use Drupal\webform\Entity\WebformSubmission; +use Drupal\webform\WebformInterface; use Drupal\webform\WebformSubmissionInterface; /** diff --git a/modules/os2forms_forloeb/src/Controller/ForloebTaskConsoleController.php b/modules/os2forms_forloeb/src/Controller/ForloebTaskConsoleController.php index 5866b48..8f2e95b 100644 --- a/modules/os2forms_forloeb/src/Controller/ForloebTaskConsoleController.php +++ b/modules/os2forms_forloeb/src/Controller/ForloebTaskConsoleController.php @@ -5,12 +5,12 @@ use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Controller\ControllerBase; use Drupal\Core\Entity\EntityTypeManagerInterface; +use Drupal\Core\StringTranslation\PluralTranslatableMarkup; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Url; use Drupal\maestro\Engine\MaestroEngine; use Drupal\maestro\Utility\TaskHandler; use Drupal\os2forms_forloeb\ForloebTaskConsole; -use Drupal\Core\StringTranslation\PluralTranslatableMarkup; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RequestStack; diff --git a/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroSelectContentTask.php b/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroSelectContentTask.php index e2affa3..6414112 100644 --- a/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroSelectContentTask.php +++ b/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroSelectContentTask.php @@ -2,15 +2,15 @@ namespace Drupal\os2forms_forloeb\Plugin\EngineTasks; -use Drupal\node\Entity\Node; -use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Form\FormState; +use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Plugin\PluginBase; -use Drupal\maestro\MaestroTaskTrait; +use Drupal\Core\Routing\TrustedRedirectResponse; +use Drupal\maestro\Engine\MaestroEngine; use Drupal\maestro\Form\MaestroExecuteInteractive; use Drupal\maestro\MaestroEngineTaskInterface; -use Drupal\maestro\Engine\MaestroEngine; -use Drupal\Core\Routing\TrustedRedirectResponse; +use Drupal\maestro\MaestroTaskTrait; +use Drupal\node\Entity\Node; /** * Maestro Select a Content Item. diff --git a/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformInheritTask.php b/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformInheritTask.php index 5d6642a..b33bf4b 100644 --- a/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformInheritTask.php +++ b/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformInheritTask.php @@ -2,13 +2,13 @@ namespace Drupal\os2forms_forloeb\Plugin\EngineTasks; +use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; +use Drupal\maestro\Engine\MaestroEngine; +use Drupal\maestro\Form\MaestroExecuteInteractive; +use Drupal\maestro_webform\Plugin\EngineTasks\MaestroWebformTask; use Drupal\webform\Entity\WebformSubmission; use Drupal\webform\WebformSubmissionForm; -use Drupal\maestro_webform\Plugin\EngineTasks\MaestroWebformTask; -use Drupal\maestro\Form\MaestroExecuteInteractive; -use Drupal\maestro\Engine\MaestroEngine; -use Drupal\Core\Form\FormStateInterface; use Drupal\webform\WebformSubmissionInterface; use Symfony\Component\HttpFoundation\RedirectResponse; diff --git a/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformMultipleTask.php b/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformMultipleTask.php index 6c33d25..22c26a7 100644 --- a/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformMultipleTask.php +++ b/modules/os2forms_forloeb/src/Plugin/EngineTasks/MaestroWebformMultipleTask.php @@ -2,11 +2,11 @@ namespace Drupal\os2forms_forloeb\Plugin\EngineTasks; +use Drupal\maestro\Engine\MaestroEngine; +use Drupal\maestro\Form\MaestroExecuteInteractive; +use Drupal\maestro_webform\Plugin\EngineTasks\MaestroWebformTask; use Drupal\webform\Entity\WebformSubmission; use Drupal\webform\WebformSubmissionForm; -use Drupal\maestro_webform\Plugin\EngineTasks\MaestroWebformTask; -use Drupal\maestro\Form\MaestroExecuteInteractive; -use Drupal\maestro\Engine\MaestroEngine; /** * Maestro Webform Task Plugin for Multiple Submissions. diff --git a/modules/os2forms_nemid/src/EventSubscriber/NemloginRedirectSubscriber.php b/modules/os2forms_nemid/src/EventSubscriber/NemloginRedirectSubscriber.php index 22cc78d..107cc31 100644 --- a/modules/os2forms_nemid/src/EventSubscriber/NemloginRedirectSubscriber.php +++ b/modules/os2forms_nemid/src/EventSubscriber/NemloginRedirectSubscriber.php @@ -9,13 +9,13 @@ use Drupal\Core\Session\AccountInterface; use Drupal\Core\StringTranslation\StringTranslationTrait; use Drupal\Core\Url; -use Drupal\os2web_nemlogin\Service\AuthProviderService; use Drupal\os2forms_nemid\Form\SettingsForm; +use Drupal\os2web_nemlogin\Service\AuthProviderService; use Drupal\webform\Entity\Webform; +use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\RedirectResponse; -use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; +use Symfony\Component\HttpKernel\KernelEvents; /** * Event subscriber subscribing to KernelEvents::REQUEST. diff --git a/modules/os2forms_permissions_by_term/os2forms_permissions_by_term.module b/modules/os2forms_permissions_by_term/os2forms_permissions_by_term.module index d63be5f..79185ac 100644 --- a/modules/os2forms_permissions_by_term/os2forms_permissions_by_term.module +++ b/modules/os2forms_permissions_by_term/os2forms_permissions_by_term.module @@ -7,11 +7,11 @@ use Drupal\Core\Config\Entity\ConfigEntityInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\Core\Session\AccountInterface; use Drupal\node\NodeInterface; use Drupal\views\Plugin\views\query\QueryPluginBase; use Drupal\views\ViewExecutable; use Drupal\webform\WebformInterface; -use Drupal\Core\Session\AccountInterface; /** * Implements hook_module_implements_alter(). diff --git a/modules/os2forms_sbsys/os2forms_sbsys.module b/modules/os2forms_sbsys/os2forms_sbsys.module index e2a66bd..6c16163 100644 --- a/modules/os2forms_sbsys/os2forms_sbsys.module +++ b/modules/os2forms_sbsys/os2forms_sbsys.module @@ -5,8 +5,8 @@ * OS2Forms SBSYS functionality module. */ -use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Plugin\MigrateSourceInterface; +use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Row; use Symfony\Component\Yaml\Yaml; diff --git a/modules/os2forms_sbsys/src/Element/WebformAttachmentSbsysXml.php b/modules/os2forms_sbsys/src/Element/WebformAttachmentSbsysXml.php index 3cf707f..9527976 100644 --- a/modules/os2forms_sbsys/src/Element/WebformAttachmentSbsysXml.php +++ b/modules/os2forms_sbsys/src/Element/WebformAttachmentSbsysXml.php @@ -2,9 +2,9 @@ namespace Drupal\os2forms_sbsys\Element; -use Drupal\webform\WebformSubmissionInterface; use Drupal\os2forms\Element\WebformAttachmentXml; use Drupal\os2forms_sbsys\Plugin\WebformElement\WebformAttachmentSbsysXml as WebformElementAttachmentSbsysXml; +use Drupal\webform\WebformSubmissionInterface; /** * Provides a 'webform_attachment_os2forms_sbsys_xml' element. diff --git a/os2forms.module b/os2forms.module index eb42f89..1357b45 100644 --- a/os2forms.module +++ b/os2forms.module @@ -5,10 +5,10 @@ * OS2Forms functionality module. */ -use Drupal\migrate\Plugin\MigrationInterface; +use Drupal\Core\Form\FormStateInterface; use Drupal\migrate\Plugin\MigrateSourceInterface; +use Drupal\migrate\Plugin\MigrationInterface; use Drupal\migrate\Row; -use Drupal\Core\Form\FormStateInterface; /** * Implements hook_entity_type_build(). diff --git a/src/Plugin/WebformHandler/SaveToFileWebformHandler.php b/src/Plugin/WebformHandler/SaveToFileWebformHandler.php index d2f1610..fcb783f 100644 --- a/src/Plugin/WebformHandler/SaveToFileWebformHandler.php +++ b/src/Plugin/WebformHandler/SaveToFileWebformHandler.php @@ -5,9 +5,9 @@ use Drupal\Component\Serialization\Json; use Drupal\Core\File\Exception\FileWriteException; use Drupal\Core\File\FileSystemInterface; +use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\TrustedRedirectResponse; use Drupal\Core\Serialization\Yaml; -use Drupal\Core\Form\FormStateInterface; use Drupal\file\Entity\File; use Drupal\webform\Element\WebformMessage; use Drupal\webform\Plugin\WebformElement\BooleanBase;