Skip to content

Commit c34517b

Browse files
committed
Merge branch '6' into 7.0
# Conflicts: # docs/en/configuration.md
2 parents 7dc7fb3 + e3f58dc commit c34517b

15 files changed

+206
-168
lines changed

.doclintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docs/en/

composer.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"require-dev": {
3030
"phpunit/phpunit": "^11.3",
3131
"squizlabs/php_codesniffer": "^3",
32+
"silverstripe/documentation-lint": "^1",
3233
"silverstripe/standards": "^1",
3334
"phpstan/extension-installer": "^1.3"
3435
},
@@ -39,6 +40,11 @@
3940
"images"
4041
]
4142
},
43+
"config": {
44+
"allow-plugins": {
45+
"dealerdirect/phpcodesniffer-composer-installer": true
46+
}
47+
},
4248
"suggest": {
4349
"symbiote/silverstripe-queuedjobs": "Allow automated workflow transitions with queued system jobs"
4450
},

docs/en/01_adding-workflows.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: Adding Workflows to Other Content Objects
3+
summary: Applying workflows to custom models and their corresponding ModelAdmins
4+
icon: project-diagram
5+
---
6+
7+
# Adding workflows to other content objects
8+
9+
In order to apply workflow to other classes (e.g. `MyObject`), you need
10+
to apply it to both the model class and the controller
11+
which is used for editing it. Here's an example for `MyObject`
12+
which is managed through a `MyObjectAdmin` controller,
13+
extending from [`ModelAdmin`](api:SilverStripe\Admin\ModelAdmin).
14+
15+
```yml
16+
App\Models\MyObject:
17+
extensions:
18+
- 'Symbiote\AdvancedWorkflow\Extensions\WorkflowApplicable'
19+
App\ModelAdmins\MyObjectAdmin:
20+
extensions:
21+
- 'Symbiote\AdvancedWorkflow\Extensions\AdvancedWorkflowExtension'
22+
```
23+
24+
We strongly recommend also setting the [`NotifyUsersWorkflowAction`](api:Symbiote\AdvancedWorkflow\Actions\NotifyUsersWorkflowAction) configuration parameter [`NotifyUsersWorkflowAction.whitelist_template_variables`](api:Symbiote\AdvancedWorkflow\Actions\NotifyUsersWorkflowAction->whitelist_template_variables) to true on new projects. This configuration will achieve this:
25+
26+
```yml
27+
Symbiote\AdvancedWorkflow\Actions\NotifyUsersWorkflowAction:
28+
whitelist_template_variables: true
29+
```
30+
31+
See the [Security](./04_security.md) section for more details.

docs/en/02_embaro_expiry.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
title: Embargo and Expiry
3+
summary: Configure embargo and expiry functionality for content changes
4+
icon: calendar-alt
5+
---
6+
7+
# Embargo and expiry
8+
9+
This add-on functionality allows you to embargo some content changes to only appear as published at some future date. To enable it,
10+
add the [`WorkflowEmbargoExpiryExtension`](api:Symbiote\AdvancedWorkflow\Extensions\WorkflowEmbargoExpiryExtension).
11+
12+
```yml
13+
SilverStripe\CMS\Model\SiteTree:
14+
extensions:
15+
- 'Symbiote\AdvancedWorkflow\Extensions\WorkflowEmbargoExpiryExtension'
16+
```
17+
18+
Make sure the [Queued Jobs](https://docs.silverstripe.org/en/optional_features/queuedjobs/) module is installed and configured correctly.
19+
You should have a cronjob similar to the following in place, running as the webserver user.
20+
21+
```bash
22+
*/1 * * * * cd && sudo -u www php /var/www/vendor/bin/sake dev/tasks/ProcessJobQueueTask
23+
```
24+
25+
It also allows for an optional subsequent expiry date. Note: Changes to these dates also constitute modifications to the content and as such
26+
are subject to the same workflow approval processes, where a particular workflow instance is in effect. The embargo export functionality can also be used independently of any workflow.

docs/en/03_reminder-emails.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Sending Reminder Emails
3+
summary: Configuring automated email reminders for pending workflows
4+
icon: envelope
5+
---
6+
7+
# Sending reminder emails
8+
9+
The workflow engine can send out email reminders if a workflow has been open for longer
10+
than a couple of days (configurable in each "Workflow Definition" through the CMS).
11+
12+
Periodically run the Workflow Reminder Task by adding a task like this one to the crontab:
13+
14+
```bash
15+
# Check every minute if someone needs to be reminded about pending workflows
16+
*/1 * * * * cd /var/www && vendor/bin/sake dev/tasks/WorkflowReminderTask
17+
```
18+
19+
This is an example only. The key is to run the task as the same user as the web server.
20+
21+
You can run the task manually for testing by visiting the `/dev/tasks/WorkflowReminderTask` URL of your site.
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
1-
## Security
1+
---
2+
title: Security
3+
summary: Ehance security by restricting accessible parameters in email templates.
4+
icon: user-shield
5+
---
26

3-
### `whitelist_template_variables`
7+
# Security
48

5-
The `NotifyUsersWorkflowAction` workflow action has a configuration parameter, `whitelist_template_variables`.
9+
## `whitelist_template_variables`
10+
11+
The [`NotifyUsersWorkflowAction`](api:Symbiote\AdvancedWorkflow\Actions\NotifyUsersWorkflowAction) workflow action has a configuration parameter, `whitelist_template_variables`.
612
Currently this variable defaults to false in order to retain backwards compatibility. In a future major release it will
713
be changed to default to true.
814

915
Setting this configuration variable to true will limit template variables available in the email template sent as part
1016
of the notify users action to a known-safe whitelist. When it is false, the template may reference any accessible parameter.
1117
As this template is editable in the CMS, whitelisting these parameters ensures CMS admins can not bypass data access
12-
restrictions.
18+
restrictions.

docs/en/configuration.md

Lines changed: 0 additions & 67 deletions
This file was deleted.

docs/en/index.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
1-
# Advanced Workflow documentation
1+
---
2+
title: Advanced Workflow
3+
summary: Create and apply approval workflows to content, with features like embargo/expiry and notifications
4+
icon: project-diagram
5+
---
26

3-
## Developer documentation
4-
- [Configuration](configuration.md)
5-
- [Security](security.md)
6-
7-
## User guide
8-
- [What is a workflow?](userguide/about-workflows.md)
9-
- [Using workflows](userguide/using-workflows.md)
10-
- [Setting up workflows](userguide/setting-up-workflows.md)
11-
- [Workflow users and permissions](userguide/workflow-permissions.md)
12-
- [Advanced workflow setup](userguide/workflow-advanced-setup.md)
13-
- [Exporting and importing workflows](userguide/workflow-export-import.md)
7+
# Advanced workflow
148

9+
The Advanced Workflow module allows you to create and apply approval workflows to content objects. This includes features such as setting embargo and expiry dates, and sending email notifications and reminders.
1510

11+
## Installation
12+
13+
```bash
14+
composer require symbiote/silverstripe-advancedworkflow
15+
```
16+
17+
## GitHub repository
18+
19+
<https://github.com/symbiote/silverstripe-advancedworkflow>
20+
21+
[CHILDREN]

docs/en/userguide/about-workflows.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
title: What is a Workflow?
33
---
4-
# What is a Workflow?
4+
# What is a workflow?
5+
56
Workflows enforce content changes to go through approval processes before being published.
67
For example, you might have a team of staff who author content, but they are not allowed to publish that content publicly
78
until a manager or communications adviser has given approval. This works by limiting access to certain parts of the workflow
8-
process to certain users or groups of users set up in the SilverStripe CMS Security admin.
9+
process to certain users or groups of users set up in the Silverstripe CMS Security admin.
910

1011
The CMS can have an unlimited number of workflows created and running within it, but only one workflow can be
1112
attached to a content-object (e.g a "Page") at any one time. Each workflow comprises a number of definable "Actions"
@@ -26,7 +27,8 @@ If sitemap inheritance is not what you desire then you can stop inheritance on a
2627

2728
If you need pagetypes to be automatically assigned a specific workflow, we'd recommend adding an extension to the WorkflowDefinition to define the page type(s) it's meant to be used for, and then an onBeforeWrite on the page type, to find and assign that WorkflowDefinition.
2829

29-
## Workflow Terminology
30+
## Workflow terminology
31+
3032
- **Workflow Definition**: Description of all the "actions" and "transitions" that make up a single workflow process to publish a page. Definitions are applied to pages within the CMS and are managed through the "Workflows" section of the CMS.
3133
- **Workflow Instance**: When a user wants to publish a page, instead of selecting the 'publish' button, they instead start a workflow, or more specifically, an instance of the "Workflow Definition" applied to that page. This "Instance" contains all the relevant data (e.g. user choices, comments, etc) for the running workflow on that page's content.
3234
- **Workflow Action**: A workflow can have many actions. Actions describe a single process occurring at each workflow step. Each piece of workflow logic is encapsulated in an action, such as assigning users, publishing a page, or sending notifications.

docs/en/userguide/index.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ summary: Setting up and using a publishing workflow with the Advanced Workflow m
77

88
## Before we begin
99

10-
Make sure that your SilverStripe CMS installation has the [Advanced Workflow](https://addons.silverstripe.org/add-ons/symbiote/silverstripe-advancedworkflow/) module installed.
10+
Make sure that your Silverstripe CMS installation has the [Advanced Workflow](https://addons.silverstripe.org/add-ons/symbiote/silverstripe-advancedworkflow/) module installed.
1111

12-
## Advanced Workflow features
13-
- [What is a workflow?](about-workflows.md)
14-
- [Using workflows](using-workflows.md)
15-
- [Setting up workflows](setting-up-workflows.md)
16-
- [Workflow users and permissions](workflow-permissions.md)
17-
- [Advanced workflow setup](workflow-advanced-setup.md)
18-
- [Exporting and importing workflows](workflow-export-import.md)
12+
## Advanced workflow features
13+
14+
- [What is a workflow?](about-workflows.md)
15+
- [Using workflows](using-workflows.md)
16+
- [Setting up workflows](setting-up-workflows.md)
17+
- [Workflow users and permissions](workflow-permissions.md)
18+
- [Advanced workflow setup](workflow-advanced-setup.md)
19+
- [Exporting and importing workflows](workflow-export-import.md)

0 commit comments

Comments
 (0)