[Erp5-report] r38525 fx.algrain - /experimental/bt5/erp5_credential/SkinTemplateItem/portal...
nobody at svn.erp5.org
nobody at svn.erp5.org
Tue Sep 21 17:17:36 CEST 2010
Author: fx.algrain
Date: Tue Sep 21 17:17:35 2010
New Revision: 38525
URL: http://svn.erp5.org?rev=38525&view=rev
Log:
Credential_copyRegistredInformation use a proxy role to allow modification.
(This allow to don't allow modification on an organisation by a user but throw the credential update we allow it and so we can restrict his modification scope)
Rename a parameter to be more precise
Modified:
experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updatePersonInformation.xml
experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_copyRegistredInformation.xml
Modified: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updatePersonInformation.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updatePersonInformation.xml?rev=38525&r1=38524&r2=38525&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updatePersonInformation.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/CredentialUpdate_updatePersonInformation.xml [utf8] Tue Sep 21 17:17:35 2010
@@ -60,7 +60,9 @@ person_mapping = (\n
# (credential, person)\n
(\'first_name\', \'first_name\'),\n
(\'last_name\', \'last_name\'),\n
+ (\'gender\', \'gender\'),\n
(\'birthday\', \'birthday\'),\n
+ (\'nationality\', \'nationality\'),\n
(\'default_email_text\', \'default_email_text\'),\n
(\'default_telephone_text\', \'default_telephone_text\'),\n
(\'default_fax_text\', \'default_fax_text\'),\n
@@ -71,12 +73,13 @@ person_mapping = (\n
(\'default_mobile_telephone_text\', \'default_mobile_telephone_text\'),\n
(\'activity_list\', \'default_career_activity_list\'),\n
(\'function_list\', \'default_career_function_list\'),\n
+ (\'skill_list\', \'default_career_skill_list\'),\n
(\'default_credential_question_answer\', \'default_credential_question_answer\'),\n
(\'default_credential_question_question\', \'default_credential_question_question\'),\n
(\'default_credential_question_question_free_text\', \'default_credential_question_question_free_text\'),\n
)\n
\n
-context.Credential_copyRegistredInformation(person, person_mapping)\n
+context.Credential_copyRegistredInformation(person, person_mapping,copy_none_value=False)\n
\n
if context.getPassword():\n
context.Credential_updatePersonPassword()\n
@@ -88,8 +91,8 @@ assignment_mapping = (\n
(\'function_list\', \'function_list\'),\n
)\n
\n
-for assingment in person.searchFolder(portal_type="Assignment", validation_state="open"):\n
- context.Credential_copyRegistredInformation(assignment, assignment_mapping,copy_empty_value=False,erase_empty_value=False)\n
+for assignment in person.searchFolder(portal_type="Assignment", validation_state="open"):\n
+ context.Credential_copyRegistredInformation(assignment, assignment_mapping,copy_none_value=False,erase_empty_value=False)\n
</string> </value>
</item>
<item>
@@ -136,11 +139,10 @@ for assingment in person.searchFolder(po
<string>context</string>
<string>person</string>
<string>person_mapping</string>
+ <string>False</string>
<string>assignment_mapping</string>
<string>_getiter_</string>
- <string>assingment</string>
<string>assignment</string>
- <string>False</string>
</tuple>
</value>
</item>
Modified: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_copyRegistredInformation.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_copyRegistredInformation.xml?rev=38525&r1=38524&r2=38525&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_copyRegistredInformation.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/Credential_copyRegistredInformation.xml [utf8] Tue Sep 21 17:17:35 2010
@@ -54,7 +54,7 @@
Parameters:\n
destination -- Object where copy property value\n
mapping -- Define property mapping (List of tuple of 2 property)\n
-copy_empty_value -- Copy or not empty value of context to destination\n
+copy_none_value -- Copy or not None value of context to destination\n
erase_empty_value -- Erase or not empty value of destination"""\n
def getAccessor(property):\n
return "".join([x.capitalize() for x in property.split(\'_\')])\n
@@ -63,7 +63,7 @@ def copyValue(source_document, source_ac
destination_document, destination_accessor):\n
getter = getattr(source_document, \'get%s\' % source_accessor)\n
value = getter()\n
- if not value and copy_empty_value or value:\n
+ if value is None and copy_none_value or value is not None:\n
old_getter = getattr(destination_document, \'get%s\' % destination_accessor) \n
old_value = old_getter()\n
if not old_value and erase_empty_value or old_value: \n
@@ -89,7 +89,15 @@ copyDocument(context, destination, mappi
</item>
<item>
<key> <string>_params</string> </key>
- <value> <string>destination,mapping,copy_empty_value=True,erase_empty_value=True</string> </value>
+ <value> <string>destination,mapping,copy_none_value=True,erase_empty_value=True</string> </value>
+ </item>
+ <item>
+ <key> <string>_proxy_roles</string> </key>
+ <value>
+ <tuple>
+ <string>Assignee</string>
+ </tuple>
+ </value>
</item>
<item>
<key> <string>errors</string> </key>
@@ -117,7 +125,7 @@ copyDocument(context, destination, mappi
<tuple>
<string>destination</string>
<string>mapping</string>
- <string>copy_empty_value</string>
+ <string>copy_none_value</string>
<string>erase_empty_value</string>
<string>getAccessor</string>
<string>copyValue</string>
More information about the Erp5-report
mailing list