heimrichhannot / contao-entity-approval-bundle
本插件为Contao CMS提供可自定义的实体审批流程。
0.1.2
2021-11-22 14:52 UTC
Requires
- php: ^7.4||^8.0
- contao/core-bundle: ^4.9
- heimrichhannot/contao-utils-bundle: ^2.204
- symfony/config: ^4.4
- symfony/string: ^5.2
- symfony/workflow: ^4.4
- terminal42/notification_center: ^1.3
Requires (Dev)
- contao/manager-plugin: ^2.0
- contao/test-case: 1.1.*
- friendsofphp/php-cs-fixer: ^2.2
- php-http/guzzle6-adapter: ^1.1
- php-http/message-factory: ^1.0.2
- phpunit/php-token-stream: ^1.4|^2.0|^3.0
- phpunit/phpunit: >=6.0 <6.5
- phpunit/phpunit-mock-objects: ^4.0|^5.0
- satooshi/php-coveralls: ^2.0
- symfony/phpunit-bridge: ^3.2
README
需求
- PHP: ^7.4
- Contao: ^4.9
安装
composer require heimrichhannot/contao-entity-approval-bundle
特性
- 所有实体均可配置审批
- 只有审批通过后实体才可见
- 管理员可设置无需审批即可显示
- 实体状态变化或过渡时发送电子邮件
- 无限审批步骤
工作流
为自动创建工作流图,请使用以下命令
vendor/bin/contao-console workflow:dump entity_approval | dot -Tpng -o vendor/heimrichhannot/contao-entity-approval-bundle/docs/img/approval-process.jpg
外部组件
Symfony Workflow 组件: https://symfony.ac.cn/doc/current/components/workflow.html
Symfony String 组件: https://symfony.ac.cn/doc/current/components/string.html
配置
所有实体可以通过在config.yml中进行配置以使用审批工作流。以下示例显示了tl_submission实体的配置(有关更多信息,请参阅选项注释)
example config.yml
huh_entity_approval: # Entity name( table name ) tl_submission: # approval steps with options: # ['name'] will be used to field names # ['groups'] is array of usergroups for approval in each step # ['mode'] is used for choosing of a user from groups : possible values (random, all) auditor_levels: - { name: "primary", groups: [ 10 ], mode: 'random' } - { name: "secondary", groups: [ 11,12,13,14,17,18 ], mode: 'random' } # entity field where the author email address is saved (used for notifications) author_email_field: email # notifications to be sent on state change or transition emails: auditor_changed_former: true auditor_changed_new: true state_changed_author: true
Contao限制
某些实体在实体存档设置中设置可见字段后将在审批字段中显示(例如tl_submission)
需要在每个实体和审批字段上设置用户组权限,以便在后台显示。
事件
PHP事件
事件以symfony事件的形式触发。