[Erp5-report] r38586 fx.algrain - /experimental/bt5/erp5_credential/SkinTemplateItem/portal...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Sep 23 12:24:29 CEST 2010


Author: fx.algrain
Date: Thu Sep 23 12:24:24 2010
New Revision: 38586

URL: http://svn.erp5.org?rev=38586&view=rev
Log:
Add docstring.
Take in case the creation of a credential request with a connected user.

Modified:
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newCredentialRequest.xml
    experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newPersonCredentialUpdate.xml

Modified: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newCredentialRequest.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newCredentialRequest.xml?rev=38586&r1=38585&r2=38586&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newCredentialRequest.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newCredentialRequest.xml [utf8] Thu Sep 23 12:24:24 2010
@@ -80,6 +80,17 @@ credential_request = module.newContent(\
                 corporate_name=corporate_name,\n
                 birthday=birthday)\n
 \n
+#We attach the current user to the credential request if not anonymous\n
+if not context.portal_membership.isAnonymousUser():\n
+  person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
+  destination_decision = []\n
+  if person.getReference() == reference:\n
+    destination_decision.append(person.getRelativeUrl())\n
+  if person.getDefaultCareerSubordinationTitle() == corporate_name:\n
+    destination_decision.append(person.getDefaultCareerSubordination())\n
+  if destination_decision:\n
+    credential_request.setDestinationDecision(destination_decision)\n
+\n
 credential_request.submit()\n
 portal_status_message = context.Base_translateString("A new credential request has been created.")\n
 return context.Base_redirect(dialog_id, keep_items = dict(portal_status_message=portal_status_message ))\n
@@ -152,6 +163,8 @@ return context.Base_redirect(dialog_id, 
                             <string>module</string>
                             <string>first_name</string>
                             <string>credential_request</string>
+                            <string>person</string>
+                            <string>destination_decision</string>
                             <string>portal_status_message</string>
                             <string>dict</string>
                           </tuple>

Modified: experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newPersonCredentialUpdate.xml
URL: http://svn.erp5.org/experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newPersonCredentialUpdate.xml?rev=38586&r1=38585&r2=38586&view=diff
==============================================================================
--- experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newPersonCredentialUpdate.xml [utf8] (original)
+++ experimental/bt5/erp5_credential/SkinTemplateItem/portal_skins/erp5_credential/ERP5Site_newPersonCredentialUpdate.xml [utf8] Thu Sep 23 12:24:24 2010
@@ -50,7 +50,8 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
+            <value> <string>"""Create a credential update in relation with the person object of current user"""\n
+person = context.ERP5Site_getAuthenticatedMemberPersonValue()\n
 \n
 if not person:\n
   portal_status_message = context.Base_translateString("Can\'t find corresponding person, it\'s not possible to update your credentials.")\n




More information about the Erp5-report mailing list