heimrichhannot/contao-entity-approval-bundle

本插件为Contao CMS提供可自定义的实体审批流程。

0.1.2 2021-11-22 14:52 UTC

This package is auto-updated.

Last update: 2024-09-22 20:36:10 UTC


README

需求

  • PHP: ^7.4
  • Contao: ^4.9

安装

composer require heimrichhannot/contao-entity-approval-bundle

特性

  • 所有实体均可配置审批
  • 只有审批通过后实体才可见
  • 管理员可设置无需审批即可显示
  • 实体状态变化或过渡时发送电子邮件
  • 无限审批步骤

工作流

workflow

为自动创建工作流图,请使用以下命令

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事件的形式触发。