Commit ce2458d7 authored by Gabriel Monnerat's avatar Gabriel Monnerat

Add script to be used by ERP5Site_registerCredentialRequest. The goals of this...

Add script to be used by ERP5Site_registerCredentialRequest. The goals of this script is to be overwritten
for each project that you want create one Credential Request or Person with specific role and function
parent 6c91dd3b
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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 is script is used by ERP5Site_registerCredentialRequest to be overwritten \n
for each project that you want create one Credential Request or Person \n
with specific role and function\n
"""\n
return dict(role_list=[], function_list=[])\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_getDefaultAssignmentArgumentDict</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -57,6 +57,13 @@ language = context.getPortalObject().Localizer.get_selected_language()\n ...@@ -57,6 +57,13 @@ language = context.getPortalObject().Localizer.get_selected_language()\n
module = context.getDefaultModule(\'Credential Request\')\n module = context.getDefaultModule(\'Credential Request\')\n
username = reference\n username = reference\n
organisation_title = career_subordination_title\n organisation_title = career_subordination_title\n
\n
assignment_dict = context.Base_getDefaultAssignmentArgumentDict()\n
if not role:\n
role = assignment_dict["role_list"]\n
if not function:\n
function = assignment_dict["function_list"]\n
\n
document = module.newContent(portal_type=\'Credential Request\',\n document = module.newContent(portal_type=\'Credential Request\',\n
first_name=first_name,\n first_name=first_name,\n
last_name=last_name,\n last_name=last_name,\n
...@@ -68,6 +75,8 @@ document = module.newContent(portal_type=\'Credential Request\',\n ...@@ -68,6 +75,8 @@ document = module.newContent(portal_type=\'Credential Request\',\n
default_address_city=default_address_city,\n default_address_city=default_address_city,\n
default_address_zip_code=default_address_zip_code,\n default_address_zip_code=default_address_zip_code,\n
language=language,\n language=language,\n
role=role,\n
function=function,\n
)\n )\n
\n \n
if not password in ["", None] and len(password.replace(\' \',\'\')) > 0:\n if not password in ["", None] and len(password.replace(\' \',\'\')) > 0:\n
...@@ -97,7 +106,7 @@ return REQUEST.RESPONSE.redirect(redirect_url)\n ...@@ -97,7 +106,7 @@ return REQUEST.RESPONSE.redirect(redirect_url)\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>first_name,last_name,reference,password,career_subordination_title,default_email_text,default_telephone_text,default_address_street_address,default_address_city,default_address_zip_code</string> </value> <value> <string>first_name,last_name,reference,password,career_subordination_title,default_email_text,default_telephone_text,default_address_street_address,default_address_city,default_address_zip_code,role=None,function=None</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
......
341 342
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment