Skip to content

Commit

Permalink
Output Workflow (#217)
Browse files Browse the repository at this point in the history
* use doctrine entity for forms
* implement workflow stream, see #114
* split form data and form definition
* fix typo in honeypot class name
* implement output channel worker and fallback generator
* implement mail layout editor, add fallback workflow
* add object mapper
* implement ow object worker types (fieldcollections)
* fix object resolver call
* implement php object output worker
* restructure abstract object resolver
* update migration
* add output workflow to area brick
* various fixes
* implement workflow guard listener
* add export nag
* add missing translations
* improve validation
* add some docs
* phpstan fixes
* ecs fixes
* add some allowed class types
* adjust tests, fix ux validation
* fix S3.4 compatibility
* fix pimcores forced dnd occluded behaviour
* improve output transformer
* improve runtime data and introduce dynamic object resolver
* ecs & phpstan fixes
* add runtime data docs, fix form data assignment
* small fixes
* implement fieldcollection validation constraints
* clean up request process
* add upgrade notes
* add pimcore 6.6 compatibility
* add html2text library support, resolves #218
* add some docs
* deprecated FormManger service
* code review: fix some ux
* fix layout scroll
  • Loading branch information
solverat authored Apr 8, 2020
1 parent 6114c2a commit e7dc4a6
Show file tree
Hide file tree
Showing 323 changed files with 15,067 additions and 4,666 deletions.
27 changes: 16 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@ env:
- PIMCORE_PHP_ERROR_REPORTING=32767 # E_ALL
matrix:
include:
- name: "PHPStan Static Analysis (Pimcore 6.5.x, Symfony ^4.0, PHP 7.4)"
- name: "PHPStan Static Analysis (Pimcore 6.6.x, Symfony ^4.0, PHP 7.3)"
sudo: required
php: 7.4
php: 7.3
env:
- PIMCORE_SKELETON_BRANCH="tags/v2.5.0"
- PIMCORE_SKELETON_BRANCH="tags/v2.6.0"
- DACHCOM_TEST_SECTION=phpstan
- name: "PHP ECS (Pimcore 6.5.x, Symfony ^4.0, PHP 7.4)"
- name: "PHP ECS (Pimcore 6.6.x, Symfony ^4.0, PHP 7.3)"
sudo: required
php: 7.4
php: 7.3
env:
- PIMCORE_SKELETON_BRANCH="tags/v2.5.0"
- PIMCORE_SKELETON_BRANCH="tags/v2.6.0"
- DACHCOM_TEST_SECTION=ecs
- name: "Codeception Tests (Pimcore 6.0.x, Symfony ^4.3, PHP 7.3)"
sudo: required
Expand Down Expand Up @@ -70,20 +70,25 @@ matrix:
php: 7.3
env:
- PIMCORE_SKELETON_BRANCH="tags/v2.5.0"
- name: "Codeception Tests (Pimcore 6.5.x, Symfony ^3.4, PHP 7.3)"
- name: "Codeception Tests (Pimcore 6.6.x, Symfony ^4.0, PHP 7.3)"
sudo: required
php: 7.3
env:
- PIMCORE_SKELETON_BRANCH="tags/v2.6.0"
- name: "Codeception Tests (Pimcore 6.6.x, Symfony ^3.4, PHP 7.3)"
sudo: required
php: 7.3
env:
- SYMFONY_VERSION=^3.4
- PIMCORE_SKELETON_BRANCH="tags/v2.5.0"
- name: "Codeception Tests (Pimcore 6.5.x, Symfony ^4.0, PHP 7.4)"
- PIMCORE_SKELETON_BRANCH="tags/v2.6.0"
- name: "Codeception Tests (Pimcore 6.6.x, Symfony ^4.0, PHP 7.4)"
sudo: required
php: 7.4
env:
- PIMCORE_SKELETON_BRANCH="tags/v2.5.0"
- PIMCORE_SKELETON_BRANCH="tags/v2.6.0"
allow_failures:
- env:
- PIMCORE_SKELETON_BRANCH="tags/v2.5.0"
- PIMCORE_SKELETON_BRANCH="tags/v2.6.0"
- DACHCOM_TEST_SECTION=ecs
fast_finish: true

Expand Down
32 changes: 20 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@

| Release | Supported Pimcore Versions | Supported Symfony Versions | Release Date | Maintained | Branch |
|---------|-----------------------------------|----------------------------|--------------|----------------|------------|
| **3.x** | `6.0` - `6.5` | `3.4`, `^4.0` | 17.07.2019 | Feature Branch | dev-master |
| **3.x** | `6.0` - `6.6` | `3.4`, `^4.0` | 17.07.2019 | Feature Branch | dev-master |
| **2.7** | `5.4`, `5.5`, `5.6`, `5.7`, `5.8` | `3.4` | 27.06.2019 | Bugfix only | 2.7 |
| **1.5** | `4.0` | -- | 18.03.2017 | Unsupported | pimcore4 |

## Installation

```json
"require" : {
"dachcom-digital/formbuilder" : "~3.2.0"
"dachcom-digital/formbuilder" : "~3.3.0"
}
```

Expand Down Expand Up @@ -51,11 +51,11 @@ Does actually the same as the update command and preferred in CI-Workflow:

## Usage
![](http://g.recordit.co/39nEX5OhQK.gif)
1. Go to `Settings` => `Form Builder Settings` and create your form (Be sure your [spam protection](docs/03_SpamProtection.md) is covered!).
1. Go to `Settings` => `Form Builder Settings` and create your form (Make sure your [spam protection](docs/03_SpamProtection.md) is covered!).
2. Open a document and place the form area brick like any other bricks via drag and drop.
3. Use the edit button at the right top corner to configure your form.

Also make sure you've included the [flash template](docs/11_SuccessMessage.md#flash-messages-implementation) if you want to have some success messages after a redirect.
Also make sure you've included the [flash template](docs/Deprecated/11_SuccessMessage.md#flash-messages-implementation) if you want to have some success messages after a redirect.
It's also possible to render a form via Twig or even within a controller method. [Click here](docs/0_Usage.md) to learn more about the form rendering types.

## Overriding Templates
Expand All @@ -64,30 +64,38 @@ Nothing to tell here, it's just [Symfony](https://symfony.com/doc/current/templa
## Further Information
- [SPAM Protection (Honeypot, reCAPTCHA)](docs/03_SpamProtection.md)
- [Usage (Rendering Types, Configuration)](docs/0_Usage.md)
- [Output Workflows (New!)](docs/OutputWorkflow/0_Usage.md) 🔥
- [Email Channel](docs/OutputWorkflow/10_EmailChannel.md)
- [Object Channel](docs/OutputWorkflow/11_ObjectChannel.md)
- [Custom Channel](docs/OutputWorkflow/12_CustomChannel.md)
- [Output Transformer](docs/OutputWorkflow/15_OutputTransformer.md)
- [Success Management](docs/OutputWorkflow/20_SuccessManagement.md)
- [Backend Administration of Forms](docs/01_BackendUsage.md)
- [Export Forms](docs/02_ExportForms.md)
- [Mail Template Configuration](docs/10_MailTemplates.md)
- [Mail Editor (new!)](docs/11_1_MailEditor.md)
- [Success Messages](docs/11_SuccessMessage.md)
- [Mail Submission Types (html/plain-text)](docs/12_MailSubmissionTypes.md)
- [Output Transformer (new!)](docs/13_OutputTransformer.md)
- [Dynamic Fields](docs/20_AjaxForms.md)
- [Ajax Forms](docs/20_AjaxForms.md)
- [Dynamic Fields (Add form elements via events)](docs/71_DynamicFields.md)
- [Dynamic Fields with Ajax Forms](docs/72_DynamicFieldsWithAjax.md)
- [Available Form Types](docs/30_FormTypes.md)
- [Dynamic Choice Type](docs/82_DynamicChoice.md)
- [Dynamic Multi File Type](docs/80_FileUpload.md)
- [Container Type](docs/83_ContainerType.md)
- [Container Type](docs/84_ContainerType.md)
- [Create Custom Form Type](docs/40_CustomFormType.md)
- [Custom Form Type Backend Layout](docs/50_CustomFormTypeBackendLayout.md)
- [Form Presets](docs/60_Presets.md)
- [Events](docs/70_Events.md)
- [Custom Fields with Events](docs/71_CustomFields.md)
- [Mastering File Uploads](docs/80_FileUpload.md)
- [Conditional Logic](docs/81_ConditionalLogic.md)
- [Form & Field Attributes](docs/83_Attributes.md)
- [Frontend Tips](docs/90_FrontendTips.md)
- [FormBuilder Javascript Plugins](docs/91_Javascript.md)
- [Configuration Flags](docs/100_ConfigurationFlags.md)

## Deprecated
- [Mail Template Configuration](docs/Deprecated/MailTemplates.md)
- [Global Mail Editor](docs/Deprecated/MailEditor.md)
- [Mail Template Success Messages Properties](docs/Deprecated/SuccessMessage.md)
- [Mail Template Submission Types (html/plain-text)](docs/Deprecated/MailSubmissionTypes.md)

## Upgrade Info
Before updating, please [check our upgrade notes!](UPGRADE.md)

Expand Down
13 changes: 13 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
After every update you should check the pimcore extension manager.
Just click the "update" button or execute the migration command to finish the bundle update.

#### Update from Version 3.2.0 to Version 3.3.0
- **[IMPROVEMENT]**: Pimcore 6.6 ready
- **[IMPROVEMENT]**: Use doctrine ORM instead of DAO for Form Data
- **[IMPROVEMENT]**: Improve request management: Allow true `GET`, `HEAD`, `TRACE` submissions
- **[IMPROVEMENT]**: Introduced FormDataInterface and FormDefinitionInterface to split submitted data from the definition itself.
- **[IMPROVEMENT]**: RuntimeData Resolver added (The session based form configuration has been removed)
- **[IMPROVEMENT]**: Huge code base refactoring to improve symfony standards
- **[IMPROVEMENT]**: Implement Output Workflows [#114](https://github.com/dachcom-digital/pimcore-formbuilder/issues/114)
- **[DEPRECATION]**: Calling `\FormBuilderBundle\Assembler\FormAssembler::setFormOptionsResolver($optionBuilder);` has been marked as deprecated and will be removed with version 4.0. Pass the `$optionBuilder` directly via `\FormBuilderBundle\Assembler\FormAssembler::assembleViewVars($optionBuilder)`.
- **[DEPRECATION]**: `\Formbuilder\Storage\Form` and `\Formbuilder\Storage\FormInterface` has been marked as deprecated and will be removed with version 4.0. Use `\Formbuilder\Model\Form` and `\Formbuilder\Model\FormInterface` instead.
- **[DEPRECATION]**: `\Formbuilder\Manager\FormManager` has been marked as deprecated and will be removed with version 4.0. Use `\Formbuilder\Manager\FormDefinitionManager` instead.

#### Update from Version 3.2.0 to Version 3.2.1
- **[NEW FEATURE]**: Pimcore 6.5 ready

Expand All @@ -16,6 +28,7 @@ Just click the "update" button or execute the migration command to finish the bu
- **[NEW FEATURE]**: Allow specific honeypot config [#212](https://github.com/dachcom-digital/pimcore-formbuilder/issues/212)
- **[NEW FEATURE]**: Implement reCAPTCHA v3 Field [#165](https://github.com/dachcom-digital/pimcore-formbuilder/issues/165)
- **[NEW FEATURE]**: Allow passing custom options in Twig- or Controller-Forms [#208](https://github.com/dachcom-digital/pimcore-formbuilder/issues/208)
- **[IMPROVEMENT]** html2text binary is not required anymore in pimcore >= 6.6 [#218](https://github.com/dachcom-digital/pimcore-formbuilder/issues/218)
- **[BUGFIX]**: Fix (multiple) dynamic choice data mapping [#205](https://github.com/dachcom-digital/pimcore-formbuilder/issues/205)

#### Update from Version 3.0.x to Version 3.1.0
Expand Down
8 changes: 7 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
}
},
"extra": {
"phpstan": {
"includes": [
"extension.neon"
]
},
"pimcore": {
"bundles": [
"FormBuilderBundle\\FormBuilderBundle"
Expand All @@ -29,7 +34,8 @@
}
},
"require": {
"pimcore/pimcore": "^6.0.0"
"pimcore/pimcore": "^6.0.0",
"doctrine/orm": "^2.7"
},
"require-dev": {
"codeception/codeception": "~2.4.0",
Expand Down
25 changes: 10 additions & 15 deletions docs/0_Usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ Those are (only) needed for the twig and controller rendering type.
| `form_id` | Can you guess it? It's the Form Id, right. |
| `form_template` | Form Template, for example: `bootstrap_4_layout.html.twig` |
| `main_layout` | This option is only needed if you render a form via a controller. By default, FormBuilder extends a empty default layout. If you want do extend your custom layout, define it: `layout.html.twig` |
| `send_copy` | If you want to submit a copy, set this to `true` |
| `mail_template` | The Mail Template or Mail Template Id |
| `copy_mail_template` | The Copy Mail Template or Copy Mail Template Id |
| `preset` | Optional: set a custom preset |
| `custom_options` | Optional (array): Add some custom options as array here to pass them through the whole submission process (available in SubmissionEvent for example |
| `output_workflow` | Define, which output workflow should get dispatched after a form has been successfully submitted. You could use the ID or Name of a output workflow |
| **Deprecated since V3.3** | |
| ~`send_copy`~ | If you want to submit a copy, set this to `true` |
| ~`mail_template`~ | The Mail Template or Mail Template Id |
| ~`copy_mail_template`~ | The Copy Mail Template or Copy Mail Template Id |

## Usage II. Twig
Create a Form using the Twig Extension.
Expand All @@ -32,9 +34,7 @@ Create a Form using the Twig Extension.
{% set config = {
'form_id': 3,
'form_template': 'bootstrap_4_layout.html.twig',
'mail_template': 178,
'copy_mail_template': 179,
'send_copy': true,
'output_workflow': 'my_output_workflow'
'custom_options': { foo: bar }
} %}
Expand Down Expand Up @@ -64,10 +64,8 @@ class DefaultController extends FrontendController
$options = [
'form_id' => 3,
'form_template' => 'bootstrap_4_layout.html.twig',
'main_layout' => 'layout_form.html.twig', //app/Resources/views/layout.html.twig
'send_copy' => false,
'mail_template' => 178,
'copy_mail_template' => null,
'main_layout' => 'layout_form.html.twig', // app/Resources/views/layout.html.twig
'output_workflow' => 'my_workflow', // or ID of output workflow
'preset' => null,
'custom_options' => ['foo' => 'bar']
];
Expand All @@ -76,19 +74,16 @@ class DefaultController extends FrontendController
$optionBuilder->setFormId($options['form_id']);
$optionBuilder->setMainLayout($options['main_layout']);
$optionBuilder->setFormTemplate($options['form_template']);
$optionBuilder->setSendCopy($options['send_copy']);
$optionBuilder->setMailTemplate($options['mail_template']);
$optionBuilder->setCopyMailTemplate($options['copy_mail_template']);
$optionBuilder->setOutputWorkflow($options['output_workflow']);
$optionBuilder->setFormPreset($options['preset']);
$optionBuilder->setCustomOptions($options['custom_options']);

/** @var FormAssembler $assembler */
$assembler = $this->container->get(FormAssembler::class);
$assembler->setFormOptionsResolver($optionBuilder);

return $this->renderTemplate(
'@FormBuilder/Form/form.html.twig',
$assembler->assembleViewVars()
$assembler->assembleViewVars($optionBuilder)
);
}
}
Expand Down
80 changes: 0 additions & 80 deletions docs/13_OutputTransformer.md

This file was deleted.

Loading

0 comments on commit e7dc4a6

Please sign in to comment.