README.txt 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. ********************************************************************
  2. D R U P A L M O D U L E
  3. ********************************************************************
  4. Name: Workflow Module
  5. Author: John VanDyk
  6. Maintainers: Mark Fredrickson <mark.m.fredrickson at gmail dot com>
  7. John VanDyk drupal.org/user/2375
  8. Bastlynn http://drupal.org/user/275249
  9. Nancy Wichmann (NancyDru) http://drupal.org/user/101412
  10. John Voskuilen (johnv) http://drupal.org/user/591042
  11. Drupal: 7
  12. ********************************************************************
  13. CONTENTS:
  14. - DESCRIPTION
  15. - INSTALLATION:
  16. - GETTING STARTED: SETTING UP A WORKFLOW
  17. - GETTING STARTED: ADDING A WORKFLOW TO A CONTENT TYPE
  18. - GETTING STARTED: CREATING A NODE
  19. - ADVANCED SETTINGS
  20. - Token
  21. - Views
  22. - Avaiable hooks
  23. ********************************************************************
  24. DESCRIPTION
  25. The workflow module enables you to create arbitrary workflows in
  26. Drupal and associate them with node types.
  27. Workflows are made up of workflow states.
  28. Moving from one state to another is called a transition.
  29. Actions can be associated with transitions.
  30. Tokens are supported when modules Token and Entity_tokens are enabled.
  31. ********************************************************************
  32. INSTALLATION
  33. 1. Place the entire workflow directory into your Drupal
  34. sites/all/modules directory (or appropriate alternative).
  35. 2. Enable the workflow module by navigating to:
  36. Administration » Modules
  37. Enabling the workflow module will create the necessary database
  38. tables for you.
  39. 3. If you wish to use the administrative UI, then enable the
  40. Workflow UI module. There are several other optional modules
  41. that you may also enable, if needed.
  42. 4. If you want anyone besides the administrative user to be able
  43. to configure workflows (usually a bad idea), they must be given
  44. the "administer workflow" access permission:
  45. Administration » People » Permissions
  46. When the module is enabled and the user has the "administer
  47. workflow" permission, a "Workflow" menu should appear in the
  48. menu system under Configuration -> Workflow.
  49. You may also grant other Permissions to user roles.
  50. ********************************************************************
  51. GETTING STARTED: SETTING UP A WORKFLOW
  52. Let's create a new workflow. Click on Administer -> Configuration ->
  53. Workflow -> Workflow and click on the "Add workflow" tab.
  54. We'll start simple. Call our workflow "Draft-Done" and click Add Workflow.
  55. Now lets add some workflow states to our workflow. Click "add state" and
  56. enter "draft" and click the Add State button. Do the same for "done".
  57. So we've got a workflow with two states, "draft" and "done". Now we
  58. have to tell each state which other states it can move to. With only
  59. two states, this is easy. Click on the "edit" link to edit the workflow
  60. and see its states.
  61. The "From / To -->" column lists all states. To the right are columns
  62. for each state. Within each cell is a list of roles with checkboxes.
  63. This is confusing. It's easiest to understand if you read rows
  64. across from the left. For example, we start with the creation
  65. state. Who may move a node from its creation state to the "draft"
  66. state? Well, the author of the node, for one. So check the "author"
  67. checkbox.
  68. Who may move the node from the "draft" state to the "done" state?
  69. This is up to you. If you want authors to be able to do this,
  70. check the "author" checkbox under the "done" state. If you had
  71. another role, say "editor", that you wanted to give the ability
  72. to decree a node as "done", you'd check the checkbox next to
  73. the "editor" role and not the author role. In this scenario authors
  74. would turn in drafts and editors would say when they are "done".
  75. Be sure to click the Save button to save your settings.
  76. Now we could add an action (previously configured using the trigger
  77. module). Click on the Actions link above your workflow. Add the action
  78. to the transition.
  79. ********************************************************************
  80. GETTING STARTED: ADDING A WORKFLOW TO A CONTENT TYPE
  81. Now let's tell Drupal which node types should use this workflow. Go to
  82. Administration » Structure » Content types » MY_CONTENT_TYPE
  83. Add a field of 'Field Type' Workflow. Let's assign the Draft-Done workflow
  84. to the article node type and click Save.
  85. ********************************************************************
  86. GETTING STARTED: CREATING A NODE
  87. Now create a new article by going to Create content -> article. If there
  88. is no sign of a workflow interface here, don't panic. The interface
  89. is only displayed if there is more than one state to which the user
  90. can move the node (why bother the user with a form with only one
  91. selection?) Click Submit to create the article.
  92. You can see the state the node is in and the history of state changes
  93. by clicking on the Workflow tab while viewing a node.
  94. Changing the state to "done" and clicking Submit will fire the action
  95. you set up earlier.
  96. ********************************************************************
  97. ADVANCED SETTINGS:
  98. - In the Workflow Field Settings you'll find (amongst other settings)
  99. an option to choose how to display the available target settings. You
  100. may choose between 'select list', 'radio buttons' or 'action buttons'.
  101. The optons show the state labels, or - if you have set them in the
  102. Workflow Transitions Tab - the transition labels.
  103. - Be sure to enable the TOKEN module and the ENTITY TOKEN module to
  104. make use of extra tokens. They include all properties of the latest
  105. transition.
  106. How to test the available tokens?
  107. - Enable module 'Token'; use page admin/help/token;
  108. - Enable module 'Token example'; use page examples/token;
  109. - Enable module Automatic Entity Label, set a label, and save entity.
  110. It also contains a token '[node:last-transition:created:seconds]'
  111. that may be used with Rules to invoke actions, like sending reminder emails,
  112. when content was NOT updated or a workflow did NOT transition state
  113. for some time. Using these tokens you won't need PHP snippets.
  114. - If you have WORKFLOW VIEWS enabled, a "Workflow" menu item will appear in the
  115. navigation menu. This displays on a single page workflow state transition
  116. forms for all nodes on your system that are subject to workflow. Naturally
  117. you can modify and extend this View to your heart's content.
  118. - If you want to add functionality programmatically, please check the following
  119. files:
  120. - workflow.api.php for all available hooks;
  121. - workflow.test.inc for some rudimentary coding examples;
  122. - You'll find all settings in one of below pages:
  123. - /admin/config/workflow/workflow
  124. - /admin/people/permissions#module-workflow_admin_ui
  125. - /admin/structure/types/manage/MY_CONTENTY_TYPE/fields/MY_FIELD