Creating an Editorial Review Workflow
Follow these steps to create an editorial review workflow with Draft, Editor Review, and Approved/ Published states. Please note that at the time of writing the workflow module was not updated for Drupal 7. This chapter describes the process for Drupal 6, which should be similar to that for Drupal 7.
1. Ensure that the Trigger module is enabled.
2. Download, install, and enable the Workflow module (http://drupal.org/project/workflow).
3. Create two new roles: Writers and Editors.
4. Create two user accounts: Writer and Editor.
5. Add the Editor account into the Editors role and the Writer account into the Writers role.
6. Assign the following permissions to the Editors role:
> Node: Access content
> Node: Administer nodes
> Node: Edit any story content
^ Workflow: Access workflow summary views ^ Workflow: Schedule workflow transitions
7. Assign the following permissions to the Writers role:
> Node: Create story nodes
> Node: Edit own story nodes
^ Workflow: Access workflow summary views ^ Workflow: Schedule workflow transitions
Create the Actions
Before you create the workflow, you need to create the actions that will be used within the workflow. In this example, you will be sending e-mails to the authors and editors to notify them of a new post, a rejected post, and an approved post. Follow these steps to create the new Send E-mail actions:
1. Navigate to Administer O Site Configuration O Actions.
2. Create a new Send E-mail action with the following information, as shown in Figure 10-6: ^ Description: Notify editor of a story pending review
Recipient: Your e-mail address Subject: Story awaiting review Message:
Greetings Editor,
%username has submitted a story for your review. -Happy Web Team
Description:
Notify editor of a story pending review
A unique description for this advanced action. This description will be displayed In the Interface of modules that integrate with Actions, such as Trigger module.
Recipient:
The email address to which the message should be sent OR enter %svttvy if you would like to send an e-mail to the author or the original post.
Subject:
Story awaiting review
The subject of the message.
Message:
Story awaiting review
The subject of the message.
Message:
|
Greetings Editor, | |
|
%usemame has submitted a story for your review. | |
|
-Happy Web Team | |
The message that should be sent. Vou may Include the following variables; %slte_nemer Sfeusername, %itode_url, % node type, %tltle, %teaser, %body. Not all variables wlil be available In all contexts.
The message that should be sent. Vou may Include the following variables; %slte_nemer Sfeusername, %itode_url, % node type, %tltle, %teaser, %body. Not all variables wlil be available In all contexts.
FIGURE 10-6
3. Create a new Send E-mail action with the following information: ^ Description: Notify author of return to Draft status
Recipient: %author
Subject: Additional work required for your story
Message:
Greetings %username,
Your story entitled %title has been reviewed but not yet approved. Please review the editor comments, revise your story, and resubmit it for editor review. We look forward to seeing your completed work.
Thank you for your contribution,
-Happy Web Team
4. Create a new Send E-mail action with the following information: ^ Description: Notify author of story approval
^ Recipient: %author
^ Subject: Your story has been approved ^ Message:
Greetings %username,
Congratulations, your story entitled %title has been approved. Thank you for your contribution, -Happy Web Team
NOTE The Token module (http://drupai.org/project/token,) can provide additional variables for use in the automated e-mails sent by an action.
Create the Workflow
With the three Send E-mail actions set up, you are ready to create the Workflow. Ensure that the Workflow module is installed and enabled, and then follow these steps:
1. Navigate to Administer C> Site Building C> Workflow.
2. Click Add Workflow and name it Review Process, as shown in Figure 10-7.
In the next steps you will add multiple states to this workflow. The result is shown in Figure 10-8.
FIGURE 10-7
|
Workflow |
Operations | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Review process |
Add state Actions Edit Delete | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
State |
Operations | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
(creation) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Draft |
Edit Delete | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Editor review |
Edit Delete | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Approved/Pu bl ¡shed |
Edit Delete | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
FIGURE 10-7 FIGURE 10-8 Click Add State to the right of the newly created workflow and enter the following, as shown in Figure 10-9: ^ State name: Draft Weight: 0
NOTE The weight of a state is important, because states are processed in order of their weights. 4. Click Add State to the right of the newly created workflow and enter the following: ^ State name: Editor review 5. Click Add State to the right of the newly created workflow and enter the following: ^ State name: Approved/Published 6. At the bottom of the Workflow page, set the workflow of the Story content type to Review Process, as shown in Figure 10-10. Click the Save Workflow Mapping button.
FIGURE 10-9
FIGURE 10-9 FIGURE 10-10 7. Back on the main Workflow page click the Edit link to the right of the Review Process workflow to configure the state mapping. 8. On the Edit screen of the Review Process workflow, select the following checkboxes: ^ (creation) C> Draft: Author ^ Draft C> Editor Review: Author ^ Editor Review C> Draft: Editors ^ Editor Review C> Approved/Published: Editors ^ Approved/Published: None Figure 10-11 shows the completed Review Process permission set.
9. While still on the Edit screen of the Review Process workflow, check Author and Editors under Workflow Tab Permissions, as shown in Figure 10-12. 10. Click the Save button. Add Actions to the Workflow Next, you need to associate the Send E-mail actions with their respective state change triggers. Follow these steps: 1. On the main Workflow page (Administer C> Site Building C> Workflow), click Actions to the right of the Review Process workflow. This will bring you to the Workflow tab of the Trigger module configuration screen. 2. Associate the Send E-mail actions under the corresponding triggers, as shown in Figure 10-13. □ Workflow tab permissions IvT author □ anonymous user □ authenticated user WI Editors Select any roles that should have access to the workflow tab on nooes that bave a workflow. FIGURE 10-12
FIGURE 10-13 FIGURE 10-13 Test! After a multitude of steps, you are finally done with the workflow creation process. At this point, when writers create a story, it will immediately be placed in the Draft state. They can then use the Workflow tab to send the draft to the editor for review. Editors may approve the story (place it in the Approved/ Published state) or reject the story (place it back in the Draft state). After a story is in the Approved/ Published state, neither the writer nor the editor can modify its state. To test this, follow these steps: 1. Log out and login as Writer. 2. Create a new story node using any text for a title and body. 3. Save the story node you just created, and note the new Workflow tab at the top of the screen, as shown in Figure 10-14. Click this new tab. New story ^^^ Edit workflow TTiis is a new story written with a workflow enabled content type. Add new comment 4. Choose the Editor Review option, enter a comment, and click Submit. Refer to Figure 10-15 for an example. 5. Note the URL of the node you are editing. 6. Log out and log back in as Editor. 7. Navigate to the URL from step 5. NOTE The Workflow module integrates with the Views modules, allowing you to create a custom list of nodes within a specified state. 8. Choose the Approved/Published option, add a comment, and click Submit. Figure 10-16 demonstrates how this should appear. Current state: Draft Change Review process state: O Draft 0 Editor review Schedule: © Immediately O Schedule for state change at: Please enter a time In 24 hour (eg. HH:MM) format. If no time Is Included, the def; current time Is: Mon, 01/26/2009 - 13:31 Comment: Please consider this article for the front page (submlT) FIGURE 10-15 You're done! Now that you have walked through each step of a workflow, take a few minutes to bounce a node around the states of a workflow. You will have to do this on a new node, however, because the permissions set during the exercise do not allow a node to change state after it reaches the Approved/ Published state. A nice feature of the Workflow module is the work log that manages to track each state change along with the details of the state change. Figure 10-17 shows a sample work log. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Post a comment