From be0a4a399756c28a692f3a68e7e10338483371e4 Mon Sep 17 00:00:00 2001
From: Rafael Monnerat <rafael@nexedi.com>
Date: Tue, 20 May 2008 20:52:01 +0000
Subject: [PATCH] Added Restart for Stopped Task Reports. (Made by Lucas)

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@21045 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../task_report_workflow/states/stopped.xml   |  2 +
 .../transitions/restart.xml                   | 73 ++++++++++++++
 .../transitions/restart_action.xml            | 94 +++++++++++++++++++
 bt5/erp5_project/bt/revision                  |  2 +-
 4 files changed, 170 insertions(+), 1 deletion(-)
 create mode 100644 bt5/erp5_project/WorkflowTemplateItem/portal_workflow/task_report_workflow/transitions/restart.xml
 create mode 100644 bt5/erp5_project/WorkflowTemplateItem/portal_workflow/task_report_workflow/transitions/restart_action.xml

diff --git a/bt5/erp5_project/WorkflowTemplateItem/portal_workflow/task_report_workflow/states/stopped.xml b/bt5/erp5_project/WorkflowTemplateItem/portal_workflow/task_report_workflow/states/stopped.xml
index 3c26d9c993..bb3757196e 100644
--- a/bt5/erp5_project/WorkflowTemplateItem/portal_workflow/task_report_workflow/states/stopped.xml
+++ b/bt5/erp5_project/WorkflowTemplateItem/portal_workflow/task_report_workflow/states/stopped.xml
@@ -39,6 +39,8 @@
               <tuple>
                 <string>deliver</string>
                 <string>deliver_action</string>
+                <string>restart</string>
+                <string>restart_action</string>
               </tuple>
             </value>
         </item>
diff --git a/bt5/erp5_project/WorkflowTemplateItem/portal_workflow/task_report_workflow/transitions/restart.xml b/bt5/erp5_project/WorkflowTemplateItem/portal_workflow/task_report_workflow/transitions/restart.xml
new file mode 100644
index 0000000000..9ab753ff8b
--- /dev/null
+++ b/bt5/erp5_project/WorkflowTemplateItem/portal_workflow/task_report_workflow/transitions/restart.xml
@@ -0,0 +1,73 @@
+<?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>_owner</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>TaskReport_notifyAssignee</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>restart</string> </value>
+        </item>
+        <item>
+            <key> <string>new_state_id</string> </key>
+            <value> <string>started</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_project/WorkflowTemplateItem/portal_workflow/task_report_workflow/transitions/restart_action.xml b/bt5/erp5_project/WorkflowTemplateItem/portal_workflow/task_report_workflow/transitions/restart_action.xml
new file mode 100644
index 0000000000..8ea7d3058a
--- /dev/null
+++ b/bt5/erp5_project/WorkflowTemplateItem/portal_workflow/task_report_workflow/transitions/restart_action.xml
@@ -0,0 +1,94 @@
+<?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>_owner</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>Restart Task</string> </value>
+        </item>
+        <item>
+            <key> <string>actbox_url</string> </key>
+            <value> <string>%(content_url)s/BaseWorkflow_viewWorkflowActionDialog?workflow_action=restart_action</string> </value>
+        </item>
+        <item>
+            <key> <string>after_script_name</string> </key>
+            <value> <string>restart</string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>The task will return to started state.</string> </value>
+        </item>
+        <item>
+            <key> <string>guard</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>restart_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>Restart Task</string> </value>
+        </item>
+        <item>
+            <key> <string>trigger_type</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="Guard" module="Products.DCWorkflow.Guard"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>roles</string> </key>
+            <value>
+              <tuple>
+                <string>Assignee</string>
+                <string>Assignor</string>
+              </tuple>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/bt5/erp5_project/bt/revision b/bt5/erp5_project/bt/revision
index 266217da54..473995f402 100644
--- a/bt5/erp5_project/bt/revision
+++ b/bt5/erp5_project/bt/revision
@@ -1 +1 @@
-493
\ No newline at end of file
+494
\ No newline at end of file
-- 
2.30.9