Skip to content

Commit

Permalink
Merge pull request #3 from studio1gmbh/P22149-344-PXM-460-Pimcore-11-…
Browse files Browse the repository at this point in the history
…support

WorkflowExtendBundle v2.0.0
  • Loading branch information
isekep committed Sep 14, 2023
2 parents 74a11ca + 3bb8c2f commit cae7402
Show file tree
Hide file tree
Showing 12 changed files with 155 additions and 535 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
@@ -1,6 +1,14 @@
# Changelog

All notable changes to the Workflow Extend Bundle will be documented in this file.
All notable changes will be documented in this file.

| **Bundle Version** | **Pimcore Version** |
|--------------------|---------------------|
| 1.x.x | Pimcore 10 |
| 2.x.x | Pimcore 11 |

## [2.0.0] - 2023-09-14
- Add Pimcore 11 support

## [1.1.0] - 2023-04-06
- Added ID to place settings
Expand Down
23 changes: 9 additions & 14 deletions README.md
@@ -1,8 +1,11 @@
# Studio1® Pimcore Workflow Extend Bundle

This bundle extends the Pimcore Workflow Feature. It adds the possibility to change data during the workflow transition.
This bundles extends Pimcore's workflow engine and workflow designer with additional features.

> **Warning:** This bundle is completely untested with the Pimcore communitiy edition and will probably not work.
It adds the possibility to change data during the workflow transition.
It also adds a readonly field to place editor of the Pimcore workflow designer to display the state id.

> **Warning:** This bundle is completely untested with the Pimcore community edition and will probably not work.
> Further work is needed to make it work with the community edition.
## Dependencies
Expand Down Expand Up @@ -40,11 +43,7 @@ Please check if the patches were applied correctly. If not, you need to remove t

### Enable Bundle

Enable the bundle as with any other Pimcore bundle.

```bash
bin/console pimcore:bundle:enable WorkflowExtendBundle
```
Enable the bundle as with any other Pimcore bundle, add it `bundle.php`.

### Uninstall

Expand All @@ -69,7 +68,7 @@ For Pimcore Enterprise Projects, you can configure the workflow transitions in t

![Backend Configuration](docs/backend_configuration.png)

In Pimcore Community Edition, you need to populate the `data` option (implemnted by this bundle) in your workflow
In Pimcore Community Edition, you need to populate the `data` option (implemented by this bundle) in your workflow
configuration:

```yaml
Expand All @@ -93,18 +92,14 @@ Can be found in `var/log/workflow-extend-bundle.log`.

## Main components

- [transitionSettings.js](src/Resources/public/js/pimcore/configuration/item/transitionSettings.js)
- [transitionSettings.js.patch](patches/transitionSettings.js.patch)
- Extends the Pimcore Workflow Designer by additional fields for the transition settings popup
- [SetAttributeSubscriber.php](src/EventSubscriber/SetAttributeSubscriber.php)
- Listens to the `workflow.transition` event and changes the data
- [addDiConfiguration.patch](patches/addDiConfiguration.patch)
- Adds the `data` option to the workflow configuration
- A patch file is needed, since there is no other way to extend the dependency injection configuration of the
workflow bundle
- [placeSettings.js](src/Resources/public/js/pimcore/configuration/item/placeSettings.js)
- [placeSettings.js.patch](patches/placeSettings.js.patch)
- Extends the Pimcore Workflow Designer by additional field for the state id
- ![Backend Configuration](docs/place_settings.png)

---

Last modified: 2023-04-06
14 changes: 9 additions & 5 deletions composer.json
@@ -1,7 +1,7 @@
{
"name": "studio1/workflow-extend",
"type": "pimcore-bundle",
"description": "This bundles extends pimcores workflow engine and workflow designer with additional features.",
"description": "This bundles extends Pimcore's workflow engine and workflow designer with additional features.",
"license": "GPL-3.0-or-later",
"homepage": "https://github.com/studio1gmbh/pimcore-workflow-extend",
"config": {
Expand Down Expand Up @@ -30,15 +30,19 @@
},
"patches": {
"pimcore/pimcore": {
"WorkFlowExtendBundle extend dependency injection patch": "vendor/studio1/workflow-extend/patches/addDiConfiguration.patch"
"WorkflowExtendBundle extend dependency injection patch": "vendor/studio1/workflow-extend/patches/addDiConfiguration.patch"
},
"pimcore/workflow-designer": {
"WorkflowExtendBundle extend placeSettings.js": "vendor/studio1/workflow-extend/patches/placeSettings.js.patch",
"WorkflowExtendBundle extend transitionSettings.js": "vendor/studio1/workflow-extend/patches/transitionSettings.js.patch"
}
}
},
"require": {
"pimcore/pimcore": "^10.0",
"pimcore/pimcore": "^11.0",
"cweagans/composer-patches": "~1.0",
"pimcore/asset-metadata-class-definitions": "~1.2",
"pimcore/asset-metadata-class-definitions": "~2.0",
"pimcore/workflow-designer": "~1.0",
"php": "^8.0"
"php": "^8.2"
}
}
10 changes: 5 additions & 5 deletions patches/addDiConfiguration.patch
@@ -1,12 +1,12 @@
Index: bundles/CoreBundle/DependencyInjection/Configuration.php
Index: bundles/CoreBundle/src/DependencyInjection/Configuration.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/bundles/CoreBundle/DependencyInjection/Configuration.php b/bundles/CoreBundle/DependencyInjection/Configuration.php
--- a/bundles/CoreBundle/DependencyInjection/Configuration.php
+++ b/bundles/CoreBundle/DependencyInjection/Configuration.php (date 1673604646885)
@@ -1835,6 +1835,18 @@
diff --git a/bundles/CoreBundle/src/DependencyInjection/Configuration.php b/bundles/CoreBundle/src/DependencyInjection/Configuration.php
--- a/bundles/CoreBundle/src/DependencyInjection/Configuration.php
+++ b/bundles/CoreBundle/src/DependencyInjection/Configuration.php (date 1694679108847)
@@ -1463,6 +1463,18 @@
->arrayNode('options')
->children()
->scalarNode('label')->info('Nice name for the Pimcore backend.')->end()
Expand Down
35 changes: 35 additions & 0 deletions patches/placeSettings.js.patch
@@ -0,0 +1,35 @@
Index: src/Resources/public/js/pimcore/configuration/item/placeSettings.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Resources/public/js/pimcore/configuration/item/placeSettings.js b/src/Resources/public/js/pimcore/configuration/item/placeSettings.js
--- a/src/Resources/public/js/pimcore/configuration/item/placeSettings.js
+++ b/src/Resources/public/js/pimcore/configuration/item/placeSettings.js (date 1694008370166)
@@ -5,6 +5,9 @@

initialize: function(placeId, placeData, callback) {

+ // Studio1 start
+ placeData.id = placeId;
+ // Studio1 end
const data = placeData || {};
placeData.permissions = placeData.permissions || [];

@@ -63,7 +66,16 @@
listeners: pimcore.bundle.workflowDesigner.tooltipDefinition.definition.listeners
},
items: [
+ // Studio1 start
{
+ xtype: 'textfield',
+ fieldLabel: t('id'),
+ name: '__ignore_name',
+ value: placeData.id,
+ readOnly: true,
+ width: 540,
+ }, {
+ // Studio1 end
xtype: 'textfield',
fieldLabel: t('label'),
name: 'label',
78 changes: 78 additions & 0 deletions patches/transitionSettings.js.patch
@@ -0,0 +1,78 @@
Index: src/Resources/public/js/pimcore/configuration/item/transitionSettings.js
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/Resources/public/js/pimcore/configuration/item/transitionSettings.js b/src/Resources/public/js/pimcore/configuration/item/transitionSettings.js
--- a/src/Resources/public/js/pimcore/configuration/item/transitionSettings.js
+++ b/src/Resources/public/js/pimcore/configuration/item/transitionSettings.js (date 1694684644153)
@@ -9,6 +9,9 @@
data.options = data.options || {};
data.options.notes = data.options.notes || {};
data.options.notificationSettings = data.options.notificationSettings || [];
+ // Studio1 start
+ data.options.data = data.options.data || [];
+ // Studio1 end

this.window = new Ext.window.Window({
title: t('bundle_wfdesigner_transition_settings'),
@@ -224,6 +227,59 @@
},
notesPanel
]
+ }, {
+ // Studio1 Start
+ // Add data panel, to select configure data to set during transition
+ xtype: 'fieldset',
+ width: '100%',
+ collapsible: true,
+ title: t('bundle_workflow_extend_data_heading'),
+ defaults: {
+ labelWidth: 130,
+ listeners: pimcore.bundle.workflowDesigner.tooltipDefinition.definition.listeners
+ },
+ items: [
+ {
+ xtype: 'textfield',
+ fieldLabel: t('bundle_workflow_extend_data_class'),
+ name: 'options.data.class',
+ value: transitionData.options.data.class,
+ tooltip: t('bundle_workflow_extend_data_class_tooltip'),
+ allowBlank: false,
+ width: 540
+ }, {
+ xtype: 'textfield',
+ fieldLabel: t('bundle_workflow_extend_data_attribute'),
+ name: 'options.data.attribute',
+ value: transitionData.options.data.attribute,
+ tooltip: t('bundle_workflow_extend_data_attribute_tooltip'),
+ allowBlank: false,
+ width: 540
+ }, {
+ xtype: 'textfield',
+ fieldLabel: t('bundle_workflow_extend_data_value'),
+ name: 'options.data.value',
+ value: transitionData.options.data.value,
+ tooltip: t('bundle_workflow_extend_data_value_tooltip'),
+ width: 540
+ }, {
+ xtype: 'textfield',
+ fieldLabel: t('bundle_workflow_extend_data_languages'),
+ name: 'options.data.languages',
+ value: transitionData.options.data.languages,
+ tooltip: t('bundle_workflow_extend_data_languages_tooltip'),
+ width: 540
+ }, {
+ xtype: 'checkbox',
+ fieldLabel: t('bundle_workflow_extend_data_languages_set_all'),
+ name: 'options.data.languagesSetAll',
+ value: transitionData.options.data.languagesSetAll,
+ inputValue: true,
+ uncheckedValue: false,
+ tooltip: t('bundle_workflow_extend_data_languages_set_all_tooltip')
+ }
+ ]
+ // Studio1 End
}
]
});
2 changes: 1 addition & 1 deletion src/DependencyInjection/WorkflowExtendExtension.php
Expand Up @@ -33,6 +33,6 @@ public function load(array $configs, ContainerBuilder $container)
$config = $this->processConfiguration($configuration, $configs);

$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.yml');
$loader->load('services.yaml');
}
}
File renamed without changes.
File renamed without changes.

0 comments on commit cae7402

Please sign in to comment.