Skip to content

Commit

Permalink
Workflow Extend Bundle
Browse files Browse the repository at this point in the history
- Check if PimcoreWorkflowDesignerBundle is present and add javascript only if it is.
  • Loading branch information
Lars77 committed Mar 21, 2023
1 parent 169153c commit a34a453
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,5 +2,8 @@

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

## [1.0.1] - 2023-01-20
- Check if PimcoreWorkflowDesignerBundle is present and add javascript only if it is.

## [1.0.0] - 2023-01-13
- initial release
9 changes: 1 addition & 8 deletions README.md
Expand Up @@ -102,13 +102,6 @@ Can be found in `var/log/workflow-extend-bundle.log`.
- A patch file is needed, since there is no other way to extend the dependency injection configuration of the
workflow bundle

## Todos

- Adapt the bundle to work with the Pimcore community edition
- Remove dependency to enterprise bundles
- Check existence of enterprise bundles at runtime
- Support for documents

---

Last Modified: 2023-01-13
Last Modified: 2023-01-20
22 changes: 20 additions & 2 deletions src/WorkflowExtendBundle.php
Expand Up @@ -16,11 +16,24 @@

class WorkflowExtendBundle extends AbstractPimcoreBundle
{
/**
* Check if PimcoreWorkflowDesignerBundle is installed
* @return bool
*/
private function isWorkflowDesignerBundleInstalled(): bool
{
$bundles = $this->container->getParameter('kernel.bundles');
return isset($bundles['PimcoreWorkflowDesignerBundle']);
}

/**
* @return array|\Pimcore\Routing\RouteReferenceInterface[]|string[]
*/
public function getJsPaths()
{
if (!$this->isWorkflowDesignerBundleInstalled()) {
return [];
}
return [
'/bundles/workflowextend/js/pimcore/configuration/item/transitionSettings.js'
];
Expand All @@ -31,7 +44,12 @@ public function getJsPaths()
*/
public function getDescription()
{
return 'This bundles extends pimcores workflow engine and workflow designer with additional features.';
$description = 'This bundles extends pimcores workflow engine ';
if ($this->isWorkflowDesignerBundleInstalled()) {
$description .= 'and workflow designer ';
}
$description .= 'with additional features.';
return $description;
}

/**
Expand All @@ -47,6 +65,6 @@ public function getNiceName()
*/
public function getVersion()
{
return '1.0.0';
return '1.0.1';
}
}

0 comments on commit a34a453

Please sign in to comment.