[Erp5-report] r21341 - in /erp5/trunk/bt5/erp5_egov: LocalRolesTemplateItem/ WorkflowTempla...
nobody at svn.erp5.org
nobody at svn.erp5.org
Thu Jun 5 10:34:12 CEST 2008
Author: fabien
Date: Thu Jun 5 10:34:10 2008
New Revision: 21341
URL: http://svn.erp5.org?rev=21341&view=rev
Log:
* translate attachement title from french to english
* update PDFDocument_validateFormDataBeforeSubmission from
egov_anonymous_workflow
* update SubscriptionForm_createAccount script to not have proxyrole and add
EGov_setPasswordAsManager script with manager proxyrole
* add roles on organisation_module
Added:
erp5/trunk/bt5/erp5_egov/LocalRolesTemplateItem/
erp5/trunk/bt5/erp5_egov/LocalRolesTemplateItem/organisation_module.xml
erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/EGov_setPasswordAsManager.xml
Modified:
erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_anonymous_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml
erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml
erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/SubscriptionForm_createAccount.xml
erp5/trunk/bt5/erp5_egov/bt/revision
erp5/trunk/bt5/erp5_egov/bt/template_local_roles_list
Added: erp5/trunk/bt5/erp5_egov/LocalRolesTemplateItem/organisation_module.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/LocalRolesTemplateItem/organisation_module.xml?rev=21341&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_egov/LocalRolesTemplateItem/organisation_module.xml (added)
+++ erp5/trunk/bt5/erp5_egov/LocalRolesTemplateItem/organisation_module.xml Thu Jun 5 10:34:10 2008
@@ -1,0 +1,15 @@
+<local_roles_item>
+ <local_roles>
+ <role id='CSC_DGID-DI-CGE'>
+ <item>Author</item>
+ </role>
+ <role id='DGID-DI-CGE'>
+ <item>Auditor</item>
+ </role>
+ <role id='admin'>
+ <item>Owner</item>
+ </role>
+ </local_roles>
+ <group_local_roles>
+ </group_local_roles>
+</local_roles_item>
Modified: erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_anonymous_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_anonymous_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml?rev=21341&r1=21340&r2=21341&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_anonymous_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml (original)
+++ erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_anonymous_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml Thu Jun 5 10:34:10 2008
@@ -67,28 +67,41 @@
<key> <string>_body</string> </key>
<value> <string>\'\'\'This script check that all required files have been uploaded\'\'\'\n
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
-portal = state_change.getPortalObject()\n
+document = state_change[\'object\']\n
+portal = document.getPortalObject()\n
N_ = portal.Base_translateString\n
\n
-document = state_change[\'object\']\n
portal_type = document.getPortalType()\n
\n
# dict of required documents\n
-attachement_type_dict = {\'Carte ID\':\'Required\',\n
- \'Tableau des d\xc3\xa9penses\':\'Optional\',\n
- \'D\xc3\xa9tail des \xc3\xa9xon\xc3\xa9ratations\':\'Required\',\n
- \'Application Certificate\':\'Optional\',\n
+attachement_type_dict = { \'Declaration TVA\':\n
+ {\n
+ \'ID Card\':\'Required\',\n
+ \'Expenditure Table\':\'Optional\',\n
+ \'Exemptions Details\':\'Required\',\n
+ \'Application Certificate\':\'Optional\',\n
+ },\n
+ \'Subscription Form\':\n
+ {\n
+ \'ID Card\':\'Required\',\n
+ \'M0 Form\':\'Required\',\n
+ }\n
}\n
+\n
+# if the portal type is not mapped, no attached files are required\n
+if not attachement_type_dict.has_key(portal_type):\n
+ return\n
\n
document_title_list = [x.getTitle() for x in document.contentValues(portal_type=\'File\')]\n
\n
-required_title_list = [x for x,y in attachement_type_dict.items() if y == \'Required\']\n
+# get only required documents\n
+required_title_list = [x for x,y in attachement_type_dict[portal_type].items() if y == \'Required\']\n
\n
message = \'The following documents are missing to submit the request :\'\n
missing_document_list = []\n
for required_title in required_title_list:\n
if required_title not in document_title_list:\n
- missing_document_list.append(\'%s\' % required_title)\n
+ missing_document_list.append(N_(required_title))\n
\n
if len(missing_document_list):\n
message = N_(message)\n
@@ -138,11 +151,11 @@
<string>state_change</string>
<string>Products.DCWorkflow.DCWorkflow</string>
<string>ValidationFailed</string>
+ <string>_getitem_</string>
+ <string>document</string>
<string>_getattr_</string>
<string>portal</string>
<string>N_</string>
- <string>_getitem_</string>
- <string>document</string>
<string>portal_type</string>
<string>attachement_type_dict</string>
<string>append</string>
Added: erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/EGov_setPasswordAsManager.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/EGov_setPasswordAsManager.xml?rev=21341&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/EGov_setPasswordAsManager.xml (added)
+++ erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/EGov_setPasswordAsManager.xml Thu Jun 5 10:34:10 2008
@@ -1,0 +1,149 @@
+<?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>Python_magic</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>Script_magic</string> </key>
+ <value> <int>3</int> </value>
+ </item>
+ <item>
+ <key> <string>__ac_local_roles__</string> </key>
+ <value>
+ <none/>
+ </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>organisation.setPassword(password)\n
+</string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_filepath</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string>organisation, password</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>2</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>organisation</string>
+ <string>password</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>EGov_setPasswordAsManager</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml?rev=21341&r1=21340&r2=21341&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml (original)
+++ erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/PDFDocument_validateFormDataBeforeSubmission.xml Thu Jun 5 10:34:10 2008
@@ -76,9 +76,9 @@
# dict of required documents\n
attachement_type_dict = { \'Declaration TVA\':\n
{\n
- \'Carte ID\':\'Required\',\n
- \'Tableau des d\xc3\xa9penses\':\'Optional\',\n
- \'D\xc3\xa9tail des \xc3\xa9xon\xc3\xa9ratations\':\'Required\',\n
+ \'ID Card\':\'Required\',\n
+ \'Expenditure Table\':\'Optional\',\n
+ \'Exemptions Details\':\'Required\',\n
\'Application Certificate\':\'Optional\',\n
},\n
\'Subscription Form\':\n
Modified: erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/SubscriptionForm_createAccount.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/SubscriptionForm_createAccount.xml?rev=21341&r1=21340&r2=21341&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/SubscriptionForm_createAccount.xml (original)
+++ erp5/trunk/bt5/erp5_egov/WorkflowTemplateItem/portal_workflow/egov_interaction_workflow/scripts/SubscriptionForm_createAccount.xml Thu Jun 5 10:34:10 2008
@@ -65,28 +65,34 @@
</item>
<item>
<key> <string>_body</string> </key>
- <value> <string>portal = state_change.getPortalObject()\n
+ <value> <string>changed_object = state_change[\'object\']\n
+\n
+portal = changed_object.getPortalObject()\n
organisation_module = portal.getDefaultModule(portal_type=\'Organisation\')\n
-new_organisation = organisation_module.newContent(portal_type=\'Organisation\')\n
-\n
-changed_object = state_change[\'object\']\n
-new_organisation.setTitle(changed_object.getCompanyName())\n
-new_organisation.setCorporateName(changed_object.getCompanyName())\n
-new_organisation.setAddressStreetAddress(changed_object.getAddressStreetAddress())\n
-new_organisation.setAddressZipCode(changed_object.getAddressZipCode())\n
-new_organisation.setAddressCity(changed_object.getAddressCity())\n
-new_organisation.setAddressRegion(changed_object.getAddressRegion())\n
-new_organisation.setCorporateRegistrationCode(changed_object.getNinea())\n
-\n
-# XXX this should not be hardcoded\n
-new_organisation.setRole(\'registry/entreprise\')\n
\n
login = changed_object.getCompanyName().lower()\n
-new_organisation.setReference(login)\n
+\n
+new_organisation = organisation_module.newContent(\\\n
+ portal_type=\'Organisation\',\n
+ title=changed_object.getCompanyName(),\n
+ corporate_name=changed_object.getCompanyName(),\n
+ address_street_address=changed_object.getAddressStreetAddress(),\n
+ address_zip_code=changed_object.getAddressZipCode(),\n
+ address_city=changed_object.getAddressCity(),\n
+ address_region=changed_object.getAddressRegion(),\n
+ corporate_registration_code=changed_object.getNinea(),\n
+ role=\'registry/entreprise\', #XXX this should not be hardcoded\n
+ reference=login)\n
+\n
+\n
+# set the password required a manager role, so a script with a proxy role is\n
+# used\n
password = changed_object.Person_generatePassword()\n
-new_organisation.setPassword(password)\n
+context.EGov_setPasswordAsManager(new_organisation, password)\n
\n
-#here, call a method to send credentials by mail\n
+# here, call a method to send credentials by email\n
+# XXX in the future, it should be possible to chose the mean to receive\n
+# credentials (email, sms, postal mail)\n
user_email = changed_object.getEmail()\n
changed_object.sendCrendentialsByEMail(login, password, user_email)\n
</string> </value>
@@ -110,9 +116,7 @@
<item>
<key> <string>_proxy_roles</string> </key>
<value>
- <tuple>
- <string>Manager</string>
- </tuple>
+ <tuple/>
</value>
</item>
<item>
@@ -140,14 +144,15 @@
<value>
<tuple>
<string>state_change</string>
+ <string>_getitem_</string>
+ <string>changed_object</string>
<string>_getattr_</string>
<string>portal</string>
<string>organisation_module</string>
+ <string>login</string>
<string>new_organisation</string>
- <string>_getitem_</string>
- <string>changed_object</string>
- <string>login</string>
<string>password</string>
+ <string>context</string>
<string>user_email</string>
</tuple>
</value>
Modified: erp5/trunk/bt5/erp5_egov/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/bt/revision?rev=21341&r1=21340&r2=21341&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_egov/bt/revision (original)
+++ erp5/trunk/bt5/erp5_egov/bt/revision Thu Jun 5 10:34:10 2008
@@ -1,1 +1,1 @@
-125
+127
Modified: erp5/trunk/bt5/erp5_egov/bt/template_local_roles_list
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_egov/bt/template_local_roles_list?rev=21341&r1=21340&r2=21341&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_egov/bt/template_local_roles_list (original)
+++ erp5/trunk/bt5/erp5_egov/bt/template_local_roles_list Thu Jun 5 10:34:10 2008
@@ -1,0 +1,1 @@
+organisation_module
More information about the Erp5-report
mailing list