[Erp5-report] r37879 fabien - in /experimental/bt5/erp5_credential: TestTemplateItem/ Workf...

nobody at svn.erp5.org nobody at svn.erp5.org
Wed Aug 18 11:54:45 CEST 2010


Author: fabien
Date: Wed Aug 18 11:54:39 2010
New Revision: 37879

URL: http://svn.erp5.org?rev=37879&view=rev
Log:
The workflow change :
- approve -> accept
- a new state has been added (close)

A mail is now sent on subscription

Added:
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow.xml
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/interactions/
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/interactions.xml
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/interactions/credential_automatic_accept.xml
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts/
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts.xml
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts/Credential_accept.xml
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/variables.xml
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/worklists.xml
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/interactions/CredentialRecovery_accept.xml
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/Credential_acceptCredentialRecovery.xml
Modified:
    experimental/bt5/erp5_credential/TestTemplateItem/testERP5Credential.py
    experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/CredentialRequest_createUserAccount.xml
    experimental/bt5/erp5_credential/bt/revision
    experimental/bt5/erp5_credential/bt/template_workflow_id_list

Modified: experimental/bt5/erp5_credential/TestTemplateItem/testERP5Credential.py
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/TestTemplateItem/testERP5Credential.py?rev=37879&r1=37878&r2=37879&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/TestTemplateItem/testERP5Credential.py [utf8] (original)
+++ experimental/bt5/erp5_credential/TestTemplateItem/testERP5Credential.py [utf8] Wed Aug 18 11:54:39 2010
@@ -136,14 +136,14 @@ class TestERP5Credential(ERP5TypeTestCas
 
   def _setAutomaticWorkflowOnPortalTypeList(self, portal_type_list):
     '''
-      set the workflow credential_automatic_approve_interraction_workflow on
+      set the workflow credential_automatic_accept_interraction_workflow on
       all portal_types parameters
     '''
     if not isinstance(portal_type_list, list):
       portal_type_list = [portal_type_list]
     for portal_type in portal_type_list:
       pw = self.getWorkflowTool()
-      workflow_id = 'credential_automatic_approve_interraction_workflow'
+      workflow_id = 'credential_automatic_accept_interraction_workflow'
       cbt = pw._chains_by_type
       props = {}
       for id, wf_ids in cbt.iteritems():
@@ -158,7 +158,7 @@ class TestERP5Credential(ERP5TypeTestCas
       (should be define in project specific bt). The methode remove it.
     '''
     pw = self.getWorkflowTool()
-    workflow_id = 'credential_automatic_approve_interraction_workflow'
+    workflow_id = 'credential_automatic_accept_interraction_workflow'
     cbt = pw._chains_by_type
     props = {}
     for id, wf_ids in cbt.iteritems():
@@ -202,10 +202,10 @@ class TestERP5Credential(ERP5TypeTestCas
     self.assertEquals(len(result), 1)
     sequence.edit(subscription_request=result[0])
 
-  def stepApproveSubscriptionRequest(self, sequence=None, sequence_list=None,
+  def stepAcceptSubscriptionRequest(self, sequence=None, sequence_list=None,
       **kw):
     subscription_request = sequence.get('subscription_request')
-    subscription_request.approve()
+    subscription_request.accept()
 
   def stepCheckAccountIsCreated(self, sequence=None, sequence_list=None, **kw):
     # check a person have been created
@@ -255,10 +255,10 @@ class TestERP5Credential(ERP5TypeTestCas
     self.assertTrue('name="field_your_default_email_text" '\
         'value="homer.simpson at fox.com"' in result)
 
-  def stepApproveCredentialUpdate(self, sequence=None, sequence_list=None,
+  def stepAcceptCredentialUpdate(self, sequence=None, sequence_list=None,
       **kw):
     credential_update = sequence.get('credential_update')
-    credential_update.approve()
+    credential_update.accept()
 
   def stepCheckCredentialUpdate(self, sequence=None, sequence_list=None,
       **kw):
@@ -380,14 +380,14 @@ class TestERP5Credential(ERP5TypeTestCas
     sequence_list.addSequenceString(sequence_string)
     sequence_list.play(self)
 
-  def test_02_approveSubscriptionRequest(self):
+  def test_02_acceptSubscriptionRequest(self):
     '''
     Check that after approval, the account is created and the user is able to
     log in the system.
     '''
     sequence_list = SequenceList()
     sequence_string = 'CreateSimpleSubscriptionRequest '\
-                      'ApproveSubscriptionRequest Tic '\
+                      'AcceptSubscriptionRequest Tic '\
                       'CheckAccountIsCreated '\
 
     sequence_list.addSequenceString(sequence_string)
@@ -400,10 +400,10 @@ class TestERP5Credential(ERP5TypeTestCas
     '''
     sequence_list = SequenceList()
     sequence_string = 'CreateSimpleSubscriptionRequest '\
-                      'ApproveSubscriptionRequest Tic '\
+                      'AcceptSubscriptionRequest Tic '\
                       'CreateCredentialUpdate '\
                       'CheckCredentialUpdateForm '\
-                      'ApproveCredentialUpdate Tic '\
+                      'AcceptCredentialUpdate Tic '\
                       'CheckCredentialUpdate '\
 
     sequence_list.addSequenceString(sequence_string)
@@ -411,9 +411,9 @@ class TestERP5Credential(ERP5TypeTestCas
 
   def test_04_automaticCredentialRequestApproval(self):
     '''
-    if the workflow credential_automatic_approve_interraction_workflow
+    if the workflow credential_automatic_accept_interraction_workflow
     is defined on Credential Request portal_type, the Credential Request object
-    should be approved automatically and account created without any human
+    should be accepted automatically and account created without any human
     intervention
     '''
     sequence_list = SequenceList()
@@ -426,15 +426,15 @@ class TestERP5Credential(ERP5TypeTestCas
 
   def test_05_automaticCredentialUpdateApproval(self):
     '''
-    if the workflow credential_automatic_approve_interraction_workflow
+    if the workflow credential_automatic_accept_interraction_workflow
     is defined on Credential Update portal_type, the Credential Update object
-    should be approved automatically and object modified without any human
+    should be accepted automatically and object modified without any human
     intervention
     '''
     sequence_list = SequenceList()
     sequence_string = 'SetAutomaticWorkflowOnCredentialUpdate '\
                       'CreateSimpleSubscriptionRequest '\
-                      'ApproveSubscriptionRequest Tic '\
+                      'AcceptSubscriptionRequest Tic '\
                       'CreateCredentialUpdate Tic '\
                       'CheckCredentialUpdate '\
 
@@ -448,7 +448,7 @@ class TestERP5Credential(ERP5TypeTestCas
     '''
     sequence_list = SequenceList()
     sequence_string = 'CreateSubscriptionRequestWithSecurityQuestionCategory '\
-                      'ApproveSubscriptionRequest Tic '\
+                      'AcceptSubscriptionRequest Tic '\
                       'CheckSecurityQuestionCategoryAsBeenCopiedOnPersonObject '\
 
     sequence_list.addSequenceString(sequence_string)
@@ -461,7 +461,7 @@ class TestERP5Credential(ERP5TypeTestCas
     '''
     sequence_list = SequenceList()
     sequence_string = 'CreateSubscriptionRequestWithSecurityQuestionFreeText '\
-                      'ApproveSubscriptionRequest Tic '\
+                      'AcceptSubscriptionRequest Tic '\
                       'CheckSecurityQuestionFreeTextAsBeenCopiedOnPersonObject '\
 
     sequence_list.addSequenceString(sequence_string)

Added: experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow.xml?rev=37879&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow.xml (added)
+++ experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow.xml [utf8] Wed Aug 18 11:54:39 2010
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="InteractionWorkflowDefinition" module="Products.ERP5.InteractionWorkflow"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_objects</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>creation_guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>When this workflow is set on Credential Update or Credential Request, it will automatically accept it without requesting any review from another user.\r\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>groups</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>credential_automatic_accept_interraction_workflow</string> </value>
+        </item>
+        <item>
+            <key> <string>manager_bypass</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Credential Automatic Approve</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/interactions.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/interactions.xml?rev=37879&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/interactions.xml (added)
+++ experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/interactions.xml [utf8] Wed Aug 18 11:54:39 2010
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="Interaction" module="Products.ERP5.Interaction"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_mapping</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_objects</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>interactions</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/interactions/credential_automatic_accept.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/interactions/credential_automatic_accept.xml?rev=37879&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/interactions/credential_automatic_accept.xml (added)
+++ experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/interactions/credential_automatic_accept.xml [utf8] Wed Aug 18 11:54:39 2010
@@ -0,0 +1,96 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <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>activate_script_name</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>after_script_name</string> </key>
+            <value>
+              <list>
+                <string>Credential_accept</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>before_commit_script_name</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>accept() transition will be automatically called after submit without any human review.</string> </value>
+        </item>
+        <item>
+            <key> <string>guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>credential_automatic_accept</string> </value>
+        </item>
+        <item>
+            <key> <string>method_id</string> </key>
+            <value>
+              <list>
+                <string>submit</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>once_per_transaction</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>portal_type_filter</string> </key>
+            <value>
+              <list>
+                <string>Credential Request</string>
+                <string>Credential Update</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>script_name</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Accept Credential Automatically</string> </value>
+        </item>
+        <item>
+            <key> <string>trigger_type</string> </key>
+            <value> <int>2</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts.xml?rev=37879&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts.xml (added)
+++ experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts.xml [utf8] Wed Aug 18 11:54:39 2010
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="Scripts" module="Products.DCWorkflow.Scripts"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_mapping</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_objects</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>scripts</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts/Credential_accept.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts/Credential_accept.xml?rev=37879&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts/Credential_accept.xml (added)
+++ experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/scripts/Credential_accept.xml [utf8] Wed Aug 18 11:54:39 2010
@@ -0,0 +1,143 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>"""\n
+  This script is used to automatically approve a submitted credential object.\n
+  The interaction use a system preference to call this script or not.\n
+"""\n
+\n
+credential_object = state_change[\'object\']\n
+if credential_object.getValidationState() == \'submitted\':\n
+  credential_object.accept()\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>state_change</string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>state_change</string>
+                            <string>_getitem_</string>
+                            <string>credential_object</string>
+                            <string>_getattr_</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Credential_accept</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>This script use Proxy Role(Manager)</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/variables.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/variables.xml?rev=37879&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/variables.xml (added)
+++ experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/variables.xml [utf8] Wed Aug 18 11:54:39 2010
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="Variables" module="Products.DCWorkflow.Variables"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_mapping</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>variables</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/worklists.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/worklists.xml?rev=37879&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/worklists.xml (added)
+++ experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_automatic_accept_interraction_workflow/worklists.xml [utf8] Wed Aug 18 11:54:39 2010
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="Worklists" module="Products.DCWorkflow.Worklists"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_mapping</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>worklists</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Added: experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/interactions/CredentialRecovery_accept.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/interactions/CredentialRecovery_accept.xml?rev=37879&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/interactions/CredentialRecovery_accept.xml (added)
+++ experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/interactions/CredentialRecovery_accept.xml [utf8] Wed Aug 18 11:54:39 2010
@@ -0,0 +1,95 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="InteractionDefinition" module="Products.ERP5.Interaction"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <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>activate_script_name</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>after_script_name</string> </key>
+            <value>
+              <list>
+                <string>Credential_acceptCredentialRecovery</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>before_commit_script_name</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>Reject the credential recovery in case the answers don\'t match.</string> </value>
+        </item>
+        <item>
+            <key> <string>guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>CredentialRecovery_accept</string> </value>
+        </item>
+        <item>
+            <key> <string>method_id</string> </key>
+            <value>
+              <list>
+                <string>_forceSetPassword</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>once_per_transaction</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>portal_type_filter</string> </key>
+            <value>
+              <list>
+                <string>Person</string>
+              </list>
+            </value>
+        </item>
+        <item>
+            <key> <string>script_name</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Credential Reject</string> </value>
+        </item>
+        <item>
+            <key> <string>trigger_type</string> </key>
+            <value> <int>2</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/CredentialRequest_createUserAccount.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/CredentialRequest_createUserAccount.xml?rev=37879&r1=37878&r2=37879&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/CredentialRequest_createUserAccount.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/CredentialRequest_createUserAccount.xml [utf8] Wed Aug 18 11:54:39 2010
@@ -53,8 +53,9 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>portal = state_change.getPortal()\n
-credential_request = state_change[\'object\']\n
+            <value> <string>credential_request = state_change[\'object\']\n
+portal = credential_request.getPortalObject()\n
+Base_translateString = portal.Base_translateString\n
 \n
 # create a person corresponding to the request\n
 person_module = portal.getDefaultModule(\'Person\')\n
@@ -83,6 +84,15 @@ assignment = person.newContent(portal_ty
 \n
 # open the assignment\n
 assignment.open()\n
+\n
+# send mail\n
+subject = Base_translateString("${instance_name} account created",\n
+    mapping=dict(instance_name=portal.getTitle()))\n
+message = Base_translateString("\\nCongratulation, the creation of you new " \\\n
+    "${instance_name} account \'${user_id}\' is finished.\\n\\nThank you",\n
+    mapping=dict(instance_name=portal.getTitle(), user_id=credential_request.getUserId()))\n
+portal.portal_notifications.sendMessage(sender=None,\n
+    recipient=[person,], subject=subject, message=message)\n
 </string> </value>
         </item>
         <item>
@@ -128,16 +138,21 @@ assignment.open()\n
                         <value>
                           <tuple>
                             <string>state_change</string>
-                            <string>_getattr_</string>
-                            <string>portal</string>
                             <string>_getitem_</string>
                             <string>credential_request</string>
+                            <string>_getattr_</string>
+                            <string>portal</string>
+                            <string>Base_translateString</string>
                             <string>person_module</string>
                             <string>person_kw</string>
                             <string>_apply_</string>
                             <string>person</string>
                             <string>DateTime</string>
                             <string>assignment</string>
+                            <string>dict</string>
+                            <string>subject</string>
+                            <string>message</string>
+                            <string>None</string>
                           </tuple>
                         </value>
                     </item>

Added: experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/Credential_acceptCredentialRecovery.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/Credential_acceptCredentialRecovery.xml?rev=37879&view=auto
==============================================================================
--- experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/Credential_acceptCredentialRecovery.xml (added)
+++ experimental/bt5/erp5_credential/WorkflowTemplateItem/portal_workflow/credential_interaction_workflow/scripts/Credential_acceptCredentialRecovery.xml [utf8] Wed Aug 18 11:54:39 2010
@@ -0,0 +1,150 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>Script_magic</string> </key>
+            <value> <int>3</int> </value>
+        </item>
+        <item>
+            <key> <string>_bind_names</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>_asgns</string> </key>
+                        <value>
+                          <dictionary>
+                            <item>
+                                <key> <string>name_container</string> </key>
+                                <value> <string>container</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_context</string> </key>
+                                <value> <string>context</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_m_self</string> </key>
+                                <value> <string>script</string> </value>
+                            </item>
+                            <item>
+                                <key> <string>name_subpath</string> </key>
+                                <value> <string>traverse_subpath</string> </value>
+                            </item>
+                          </dictionary>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>_body</string> </key>
+            <value> <string>\'\'\'\n
+When the password is changed, this mean that credential recoveries for this user works, so they\n
+should be approved.\n
+\'\'\'\n
+portal = state_change.getPortal()\n
+person = state_change[\'object\']\n
+\n
+credential_recovery_module = portal.getDefaultModule(\'Credential Recovery\')\n
+\n
+result = credential_recovery_module.searchFolder(portal_type=\'Credential Recovery\',\n
+                                                 destination_decision_uid=person.getUid(),\n
+                                                 validation_state=\'submitted\')\n
+for credential_recovery in result:\n
+  credential_recovery.getObject().accept()\n
+</string> </value>
+        </item>
+        <item>
+            <key> <string>_code</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>_params</string> </key>
+            <value> <string>state_change</string> </value>
+        </item>
+        <item>
+            <key> <string>_proxy_roles</string> </key>
+            <value>
+              <tuple>
+                <string>Manager</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>errors</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_code</string> </key>
+            <value>
+              <object>
+                <klass>
+                  <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+                </klass>
+                <tuple/>
+                <state>
+                  <dictionary>
+                    <item>
+                        <key> <string>co_argcount</string> </key>
+                        <value> <int>1</int> </value>
+                    </item>
+                    <item>
+                        <key> <string>co_varnames</string> </key>
+                        <value>
+                          <tuple>
+                            <string>state_change</string>
+                            <string>_getattr_</string>
+                            <string>portal</string>
+                            <string>_getitem_</string>
+                            <string>person</string>
+                            <string>credential_recovery_module</string>
+                            <string>result</string>
+                            <string>_getiter_</string>
+                            <string>credential_recovery</string>
+                          </tuple>
+                        </value>
+                    </item>
+                  </dictionary>
+                </state>
+              </object>
+            </value>
+        </item>
+        <item>
+            <key> <string>func_defaults</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>Credential_acceptCredentialRecovery</string> </value>
+        </item>
+        <item>
+            <key> <string>warnings</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>

Modified: experimental/bt5/erp5_credential/bt/revision
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/bt/revision?rev=37879&r1=37878&r2=37879&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/bt/revision [utf8] (original)
+++ experimental/bt5/erp5_credential/bt/revision [utf8] Wed Aug 18 11:54:39 2010
@@ -1 +1 @@
-123
\ No newline at end of file
+125
\ No newline at end of file

Modified: experimental/bt5/erp5_credential/bt/template_workflow_id_list
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/bt/template_workflow_id_list?rev=37879&r1=37878&r2=37879&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/bt/template_workflow_id_list [utf8] (original)
+++ experimental/bt5/erp5_credential/bt/template_workflow_id_list [utf8] Wed Aug 18 11:54:39 2010
@@ -1,3 +1,3 @@
-credential_automatic_approve_interraction_workflow
+credential_automatic_accept_interraction_workflow
 credential_interaction_workflow
 credential_validation_workflow
\ No newline at end of file




More information about the Erp5-report mailing list