From 38f763fc81476e2eb5781f35073361c024338b13 Mon Sep 17 00:00:00 2001
From: Rafael Monnerat <rafael@nexedi.com>
Date: Wed, 4 Jun 2008 22:30:58 +0000
Subject: [PATCH] Improved item_workflow

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21331 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../portal_workflow/item_workflow.xml         |  2 +-
 .../item_workflow/states/deleted.xml          | 45 +++++++++++++
 .../item_workflow/states/draft.xml            |  5 +-
 .../item_workflow/states/invalidated.xml      | 50 ++++++++++++++
 .../item_workflow/states/validated.xml        | 48 +++++++++++++
 .../item_workflow/transitions/delete.xml      | 67 +++++++++++++++++++
 .../transitions/delete_action.xml             | 67 +++++++++++++++++++
 .../item_workflow/transitions/invalidate.xml  | 67 +++++++++++++++++++
 .../transitions/invalidate_action.xml         | 67 +++++++++++++++++++
 .../item_workflow/transitions/validate.xml    | 67 +++++++++++++++++++
 .../transitions/validate_action.xml           | 67 +++++++++++++++++++
 11 files changed, 550 insertions(+), 2 deletions(-)
 create mode 100644 bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/deleted.xml
 create mode 100644 bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/invalidated.xml
 create mode 100644 bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/validated.xml
 create mode 100644 bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/delete.xml
 create mode 100644 bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/delete_action.xml
 create mode 100644 bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/invalidate.xml
 create mode 100644 bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/invalidate_action.xml
 create mode 100644 bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/validate.xml
 create mode 100644 bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/validate_action.xml

diff --git a/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow.xml b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow.xml
index 593a705c7c..e85ca702c3 100644
--- a/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow.xml
+++ b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow.xml
@@ -47,7 +47,7 @@
         </item>
         <item>
             <key> <string>manager_bypass</string> </key>
-            <value> <int>0</int> </value>
+            <value> <int>1</int> </value>
         </item>
         <item>
             <key> <string>permissions</string> </key>
diff --git a/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/deleted.xml b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/deleted.xml
new file mode 100644
index 0000000000..5ad66643eb
--- /dev/null
+++ b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/deleted.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="StateDefinition" module="Products.DCWorkflow.States"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>deleted</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Deleted</string> </value>
+        </item>
+        <item>
+            <key> <string>transitions</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>type_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/draft.xml b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/draft.xml
index 854dd1157e..2e689dab0f 100644
--- a/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/draft.xml
+++ b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/draft.xml
@@ -36,7 +36,10 @@
         <item>
             <key> <string>transitions</string> </key>
             <value>
-              <tuple/>
+              <tuple>
+                <string>validate</string>
+                <string>validate_action</string>
+              </tuple>
             </value>
         </item>
         <item>
diff --git a/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/invalidated.xml b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/invalidated.xml
new file mode 100644
index 0000000000..b8c46aef94
--- /dev/null
+++ b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/invalidated.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="StateDefinition" module="Products.DCWorkflow.States"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>invalidated</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Invalidated</string> </value>
+        </item>
+        <item>
+            <key> <string>transitions</string> </key>
+            <value>
+              <tuple>
+                <string>delete</string>
+                <string>delete_action</string>
+                <string>validate</string>
+                <string>validate_action</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>type_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/validated.xml b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/validated.xml
new file mode 100644
index 0000000000..15a3ba5e47
--- /dev/null
+++ b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/states/validated.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="StateDefinition" module="Products.DCWorkflow.States"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>validated</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Validated</string> </value>
+        </item>
+        <item>
+            <key> <string>transitions</string> </key>
+            <value>
+              <tuple>
+                <string>invalidate</string>
+                <string>invalidate_action</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>type_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/delete.xml b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/delete.xml
new file mode 100644
index 0000000000..80cd6128ec
--- /dev/null
+++ b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/delete.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>actbox_category</string> </key>
+            <value> <string>workflow</string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_url</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>after_script_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>delete</string> </value>
+        </item>
+        <item>
+            <key> <string>new_state_id</string> </key>
+            <value> <string>deleted</string> </value>
+        </item>
+        <item>
+            <key> <string>script_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>trigger_type</string> </key>
+            <value> <int>2</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/delete_action.xml b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/delete_action.xml
new file mode 100644
index 0000000000..ec45bc4376
--- /dev/null
+++ b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/delete_action.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>actbox_category</string> </key>
+            <value> <string>workflow</string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_name</string> </key>
+            <value> <string>Delete</string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_url</string> </key>
+            <value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=delete_action</string> </value>
+        </item>
+        <item>
+            <key> <string>after_script_name</string> </key>
+            <value> <string>delete</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>delete_action</string> </value>
+        </item>
+        <item>
+            <key> <string>new_state_id</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>script_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>trigger_type</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/invalidate.xml b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/invalidate.xml
new file mode 100644
index 0000000000..f2b812b258
--- /dev/null
+++ b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/invalidate.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>actbox_category</string> </key>
+            <value> <string>workflow</string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_url</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>after_script_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>invalidate</string> </value>
+        </item>
+        <item>
+            <key> <string>new_state_id</string> </key>
+            <value> <string>invalidated</string> </value>
+        </item>
+        <item>
+            <key> <string>script_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>trigger_type</string> </key>
+            <value> <int>2</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/invalidate_action.xml b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/invalidate_action.xml
new file mode 100644
index 0000000000..dfdd98cee1
--- /dev/null
+++ b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/invalidate_action.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>actbox_category</string> </key>
+            <value> <string>workflow</string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_name</string> </key>
+            <value> <string>Invalidate</string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_url</string> </key>
+            <value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=invalidate_action</string> </value>
+        </item>
+        <item>
+            <key> <string>after_script_name</string> </key>
+            <value> <string>invalidate</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>invalidate_action</string> </value>
+        </item>
+        <item>
+            <key> <string>new_state_id</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>script_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>trigger_type</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/validate.xml b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/validate.xml
new file mode 100644
index 0000000000..e6d9db6383
--- /dev/null
+++ b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/validate.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>actbox_category</string> </key>
+            <value> <string>workflow</string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_url</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>after_script_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>validate</string> </value>
+        </item>
+        <item>
+            <key> <string>new_state_id</string> </key>
+            <value> <string>validated</string> </value>
+        </item>
+        <item>
+            <key> <string>script_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>trigger_type</string> </key>
+            <value> <int>2</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/validate_action.xml b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/validate_action.xml
new file mode 100644
index 0000000000..6daaafc346
--- /dev/null
+++ b/bt5/erp5_item/WorkflowTemplateItem/portal_workflow/item_workflow/transitions/validate_action.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>__ac_local_roles__</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>actbox_category</string> </key>
+            <value> <string>workflow</string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_name</string> </key>
+            <value> <string>Validate</string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_url</string> </key>
+            <value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=validate_action</string> </value>
+        </item>
+        <item>
+            <key> <string>after_script_name</string> </key>
+            <value> <string>validate</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>validate_action</string> </value>
+        </item>
+        <item>
+            <key> <string>new_state_id</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>script_name</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>trigger_type</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
-- 
2.30.9