From 3bb8c2f42abd2af46bc070fb619c7b8f71d0ef22 Mon Sep 17 00:00:00 2001 From: Patrick Iseke Date: Thu, 14 Sep 2023 12:48:09 +0200 Subject: [PATCH] WorkflowExtendBundle v2.0.0 - Add Pimcore 11 support --- CHANGELOG.md | 10 +- README.md | 23 +- composer.json | 14 +- patches/addDiConfiguration.patch | 10 +- patches/placeSettings.js.patch | 35 ++ patches/transitionSettings.js.patch | 78 +++++ .../WorkflowExtendExtension.php | 2 +- .../pimcore/{config.yml => config.yaml} | 0 .../config/{services.yml => services.yaml} | 0 .../configuration/item/placeSettings.js | 171 --------- .../configuration/item/transitionSettings.js | 329 ------------------ src/WorkflowExtendBundle.php | 18 +- 12 files changed, 155 insertions(+), 535 deletions(-) create mode 100644 patches/placeSettings.js.patch create mode 100644 patches/transitionSettings.js.patch rename src/Resources/config/pimcore/{config.yml => config.yaml} (100%) rename src/Resources/config/{services.yml => services.yaml} (100%) delete mode 100644 src/Resources/public/js/pimcore/configuration/item/placeSettings.js delete mode 100644 src/Resources/public/js/pimcore/configuration/item/transitionSettings.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f60311..36a8f86 100755 --- a/CHANGELOG.md +++ b/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 diff --git a/README.md b/README.md index 8b5b18f..de5436a 100755 --- a/README.md +++ b/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 @@ -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 @@ -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 @@ -93,7 +92,7 @@ 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 @@ -101,10 +100,6 @@ Can be found in `var/log/workflow-extend-bundle.log`. - 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 \ No newline at end of file diff --git a/composer.json b/composer.json index 251e1c4..f23b89b 100755 --- a/composer.json +++ b/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": { @@ -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" } } diff --git a/patches/addDiConfiguration.patch b/patches/addDiConfiguration.patch index 1b8a94b..1acf0b9 100644 --- a/patches/addDiConfiguration.patch +++ b/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() diff --git a/patches/placeSettings.js.patch b/patches/placeSettings.js.patch new file mode 100644 index 0000000..ddf8f23 --- /dev/null +++ b/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', diff --git a/patches/transitionSettings.js.patch b/patches/transitionSettings.js.patch new file mode 100644 index 0000000..6926b59 --- /dev/null +++ b/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 + } + ] + }); diff --git a/src/DependencyInjection/WorkflowExtendExtension.php b/src/DependencyInjection/WorkflowExtendExtension.php index 5dc0f34..61d282d 100755 --- a/src/DependencyInjection/WorkflowExtendExtension.php +++ b/src/DependencyInjection/WorkflowExtendExtension.php @@ -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'); } } diff --git a/src/Resources/config/pimcore/config.yml b/src/Resources/config/pimcore/config.yaml similarity index 100% rename from src/Resources/config/pimcore/config.yml rename to src/Resources/config/pimcore/config.yaml diff --git a/src/Resources/config/services.yml b/src/Resources/config/services.yaml similarity index 100% rename from src/Resources/config/services.yml rename to src/Resources/config/services.yaml diff --git a/src/Resources/public/js/pimcore/configuration/item/placeSettings.js b/src/Resources/public/js/pimcore/configuration/item/placeSettings.js deleted file mode 100644 index 25589dd..0000000 --- a/src/Resources/public/js/pimcore/configuration/item/placeSettings.js +++ /dev/null @@ -1,171 +0,0 @@ -/** - * Created by PhpStorm. - * User: akriebisch - * Date: 06.04.23 - * Time: 09:10 - */ - -/** - * Extend the original place settings panel - * @see workflow-designer/src/Resources/public/js/pimcore/configuration/item/placeSettings.js - * - * Most of the code is copied from the original file, due to the fact that the original file is not extendable. - * Changes are marked with "Studio1 start" and "Studio1 end". - */ - -pimcore.registerNS('pimcore.plugin.studio1.workflowDesigner.item.placeSettings'); -pimcore.bundle.workflowDesigner.item.placeSettings = Class.create(pimcore.bundle.workflowDesigner.item.placeSettings, { - - - initialize: function(placeId, placeData, callback) { - - // Studio1 start - placeData.id = placeId; - // Studio1 end - const data = placeData || {}; - placeData.permissions = placeData.permissions || []; - - this.window = new Ext.window.Window({ - title: t('bundle_wfdesigner_place_settings'), - modal: true, - resizeable: false, - layout: 'fit', - width: 800, - height: '90%', - autoScroll: true, - buttons: [ - { - text: t('apply'), - iconCls: 'pimcore_icon_apply', - handler: function(){ - const values = this.generalFormPanel.getValues(); - let permissions = []; - - if(this.permissionPanel) { - this.permissionPanel.items.items.forEach(function(item) { - permissions.push(item.getValues()); - }); - } else { - permissions = placeData.permissions; - } - - values.permissions = permissions; - - if(callback) { - callback(values); - } - - this.window.hide(); - this.window.destroy(); - - }.bind(this) - } - ], - items: [ - this.getFormPanel(data) - ] - }); - - const user = pimcore.globalmanager.get('user'); - if(user.isAllowed('permission_workflow_designer_place_permissions')) { - this.initPermissionPanel(placeData.permissions); - } - this.window.show(); - }, - - getFormPanel: function(placeData) { - this.generalFormPanel = Ext.create('Pimcore.WorkflowDesigner.StructuredValueForm', { - defaults: { - labelWidth: 180, - 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', - value: placeData.label, - width: 540, - tooltip: t('bundle_wfdesigner_tooltip_place_name') - },{ - xtype: 'textfield', - fieldLabel: t('title'), - name: 'title', - value: placeData.title, - width: 540, - tooltip: t('bundle_wfdesigner_tooltip_place_title') - },{ - xtype: 'checkbox', - name: 'visibleInHeader', - value: placeData.hasOwnProperty('visibleInHeader') ? placeData.visibleInHeader : true, - inputValue: true, - uncheckedValue: false, - fieldLabel: t('bundle_wfdesigner_place_visibleInHeader'), - tooltip: t('bundle_wfdesigner_tooltip_place_visibleInHeader') - },{ - xtype: 'colorfield', - name: 'color', - value: (placeData.color) ? placeData.color : '000000', - fieldLabel: t('color'), - tooltip: t('bundle_wfdesigner_tooltip_place_color') - },{ - xtype: 'checkbox', - name: 'colorInverted', - value: placeData.colorInverted, - inputValue: true, - uncheckedValue: false, - fieldLabel: t('bundle_wfdesigner_place_colorInverted'), - tooltip: t('bundle_wfdesigner_tooltip_place_colorInverted') - } - ] - }); - - const items = [{ - xtype: 'fieldset', - width: '100%', - title: t('bundle_wfdesigner_general'), - items: [ - this.generalFormPanel - ] - }]; - - const user = pimcore.globalmanager.get('user'); - if(user.isAllowed('permission_workflow_designer_place_permissions')) { - items.push({ - xtype: 'fieldset', - width: '100%', - collapsible: true, - title: t('bundle_wfdesigner_place_permissions'), - items: [ - { - xtype: 'displayfield', - value: t('bundle_wfdesigner_tooltip_place_permissions') - }, - this.buildPermissionPanel() - ] - }); - } - - this.mainPanel = Ext.create('Ext.panel.Panel', { - border: false, - frame:false, - bodyStyle: 'padding:10px', - items: items, - labelWidth: 130, - collapsible: false, - autoScroll: true - }); - - return this.mainPanel; - }, - -}); \ No newline at end of file diff --git a/src/Resources/public/js/pimcore/configuration/item/transitionSettings.js b/src/Resources/public/js/pimcore/configuration/item/transitionSettings.js deleted file mode 100644 index 051da0b..0000000 --- a/src/Resources/public/js/pimcore/configuration/item/transitionSettings.js +++ /dev/null @@ -1,329 +0,0 @@ -/** - * Created by PhpStorm. - * User: jkoch - * Date: 05.01.23 - * Time: 14:11 - */ - -/** - * Extend the original transition settings panel - * Source: workflow-designer/src/Resources/public/js/pimcore/configuration/item/transitionSettings.js - * - * Most of the code is copied from the original file, due to the fact that the original file is not extendable. - * Changes are marked with "Studio1 start" and "Studio1 end". - */ - -pimcore.registerNS("pimcore.plugin.studio1.workflowDesigner.item.transitionSettings"); -pimcore.bundle.workflowDesigner.item.transitionSettings = Class.create(pimcore.bundle.workflowDesigner.item.transitionSettings, { - - initialize: function (transitionId, transitionData, callback) { - - const data = transitionData || {}; - 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'), - modal: true, - resizeable: false, - layout: 'fit', - width: 800, - height: '90%', - buttons: [ - { - text: t('apply'), - iconCls: 'pimcore_icon_apply', - handler: function () { - const values = this.generalFormPanel.getValues(); - let notifications = []; - - if (this.notificationsPanel) { - this.notificationsPanel.items.items.forEach(function (item) { - notifications.push(item.getValues()); - }); - } else { - notifications = data.options.notificationSettings; - } - values.options.notificationSettings = notifications; - - - if (callback) { - callback(values); - } - - this.window.hide(); - this.window.destroy(); - - }.bind(this) - } - ], - items: [ - this.getFormPanel(data) - ] - }); - - this.userStore = new Ext.data.Store({ - autoLoad: true, - proxy: { - type: 'ajax', - url: Routing.generate('pimcore_wf_user_search'), - reader: { - type: 'json', - rootProperty: 'users' - } - }, - fields: ['id', 'name', 'email', 'firstname', 'lastname'] - }); - - this.rolesStore = new Ext.data.Store({ - autoLoad: true, - proxy: { - type: 'ajax', - url: Routing.generate('pimcore_wf_role_search'), - reader: { - type: 'json', - rootProperty: 'roles' - } - }, - fields: ['id', 'name'] - }); - - - const user = pimcore.globalmanager.get('user'); - if (user.isAllowed('permission_workflow_designer_trans_notifications')) { - this.initNotificationsPanel(data.options.notificationSettings); - } - this.window.show(); - - }, - - getFormPanel: function (transitionData) { - - const notesPanel = Ext.create('Ext.panel.Panel', { - defaults: { - labelWidth: 130, - listeners: pimcore.bundle.workflowDesigner.tooltipDefinition.definition.listeners - }, - hidden: !transitionData.options.notes.commentEnabled, - items: [ - { - xtype: 'checkbox', - name: 'options.notes.commentRequired', - value: transitionData.options.notes.commentRequired, - inputValue: true, - uncheckedValue: false, - tooltip: t('bundle_wfdesigner_tooltip_transition_notes_required'), - fieldLabel: t('bundle_wfdesigner_notes_comment_required'), - }, { - xtype: 'textfield', - fieldLabel: t('bundle_wfdesigner_notes_comment_type'), - name: 'options.notes.type', - value: transitionData.options.notes.type || 'Status update', - tooltip: t('bundle_wfdesigner_tooltip_transition_notes_type'), - width: 540 - }, { - xtype: 'textfield', - fieldLabel: t('bundle_wfdesigner_notes_comment_title'), - name: 'options.notes.title', - value: transitionData.options.notes.title, - tooltip: t('bundle_wfdesigner_tooltip_transition_notes_title'), - width: 540 - }, { - xtype: 'textfield', - fieldLabel: t('bundle_wfdesigner_notes_comment_setter_fn'), - name: 'options.notes.commentSetterFn', - tooltip: t('bundle_wfdesigner_tooltip_transition_notes_comment_setter'), - value: transitionData.options.notes.commentSetterFn, - width: 540 - }, { - xtype: 'textfield', - fieldLabel: t('bundle_wfdesigner_notes_comment_getter_fn'), - name: 'options.notes.commentGetterFn', - tooltip: t('bundle_wfdesigner_tooltip_transition_notes_comment_getter'), - value: transitionData.options.notes.commentGetterFn, - width: 540 - } - ] - - }); - - - this.generalFormPanel = Ext.create('Pimcore.WorkflowDesigner.StructuredValueForm', { - border: false, - frame: false, - items: [ - { - xtype: 'fieldset', - width: '100%', - title: t('bundle_wfdesigner_general'), - defaults: { - labelWidth: 130, - listeners: pimcore.bundle.workflowDesigner.tooltipDefinition.definition.listeners - }, - items: [ - { - xtype: 'textfield', - fieldLabel: t('label'), - name: 'options.label', - value: transitionData.options.label, - tooltip: t('bundle_wfdesigner_tooltip_transition_name'), - width: 540 - }, { - xtype: 'textfield', - fieldLabel: t('bundle_wfdesigner_transition_guard'), - name: 'guard', - value: transitionData.guard, - tooltip: t('bundle_wfdesigner_tooltip_transition_guard'), - width: 540 - }, { - xtype: 'textfield', - fieldLabel: t('bundle_wfdesigner_transition_icon_class'), - name: 'options.iconClass', - value: transitionData.options.iconClass, - tooltip: t('bundle_wfdesigner_tooltip_transition_icon_class'), - width: 540 - }, { - xtype: 'textfield', - fieldLabel: t('bundle_wfdesigner_transition_object_layout'), - name: 'options.objectLayout', - value: transitionData.options.objectLayout, - tooltip: t('bundle_wfdesigner_tooltip_transition_object_layout'), - width: 540 - }, { - xtype: 'combobox', - fieldLabel: t('bundle_wfdesigner_transition_change_published_state'), - name: 'options.changePublishedState', - tooltip: t('bundle_wfdesigner_tooltip_transition_change_published_state'), - width: 350, - store: [ - ['no_change', t('bundle_wfdesigner_transition_no_change')], - ['force_unpublished', t('bundle_wfdesigner_transition_force_unpublished')], - ['force_published', t('bundle_wfdesigner_transition_force_published')], - ['save_version', t('bundle_wfdesigner_transition_save_version')], - ], - value: transitionData.options.changePublishedState || 'no_change' - } - ] - }, { - xtype: 'fieldset', - width: '100%', - collapsible: false, - title: t('bundle_wfdesigner_notes'), - defaults: { - labelWidth: 130, - listeners: pimcore.bundle.workflowDesigner.tooltipDefinition.definition.listeners - }, - items: [ - { - xtype: 'checkbox', - name: 'options.notes.commentEnabled', - value: transitionData.options.notes.commentEnabled, - inputValue: true, - uncheckedValue: false, - tooltip: t('bundle_wfdesigner_tooltip_transition_notes_enabled'), - fieldLabel: t('bundle_wfdesigner_notes_comment_enabled'), - listeners: { - render: pimcore.bundle.workflowDesigner.tooltipDefinition.definition.listeners.render, - change: function (field, newValue) { - if (newValue === true) { - notesPanel.show(); - } else { - notesPanel.hide(); - } - this.mainPanel.updateLayout(); - }.bind(this) - } - }, - 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 - } - ] - }); - - const items = [ - this.generalFormPanel - ]; - - const user = pimcore.globalmanager.get('user'); - if (user.isAllowed('permission_workflow_designer_trans_notifications')) { - items.push({ - xtype: 'fieldset', - width: '100%', - collapsible: true, - title: t('bundle_wfdesigner_transition_notifications'), - items: [ - this.buildNotificationsPanel() - ] - }); - } - - this.mainPanel = Ext.create('Ext.panel.Panel', { - border: false, - frame: false, - bodyStyle: 'padding:10px', - items: items, - labelWidth: 130, - collapsible: false, - autoScroll: true - }); - - return this.mainPanel; - } -}); diff --git a/src/WorkflowExtendBundle.php b/src/WorkflowExtendBundle.php index b30d1be..a351221 100755 --- a/src/WorkflowExtendBundle.php +++ b/src/WorkflowExtendBundle.php @@ -31,7 +31,7 @@ private function isWorkflowDesignerBundleInstalled(): bool /** * @return array|\Pimcore\Routing\RouteReferenceInterface[]|string[] */ - public function getJsPaths() + public function getJsPaths(): array { if (!$this->isWorkflowDesignerBundleInstalled()) { return []; @@ -44,11 +44,11 @@ public function getJsPaths() } /** - * @return string + * @inheritDoc */ - public function getDescription() + public function getDescription(): string { - $description = 'This bundles extends pimcores workflow engine '; + $description = 'This bundles extends Pimcore\'s workflow engine '; if ($this->isWorkflowDesignerBundleInstalled()) { $description .= 'and workflow designer '; } @@ -58,18 +58,18 @@ public function getDescription() } /** - * @return string + * @inheritDoc */ - public function getNiceName() + public function getNiceName(): string { return 'Workflow Extend'; } /** - * @return string + * @inheritDoc */ - public function getVersion() + public function getVersion(): string { - return '1.1.0'; + return '2.0.0'; } }