Commit cb7d3c6b authored by Romain Courteaud's avatar Romain Courteaud

Allow to redirect to another document when passing a workflow transition.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24162 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4aa8065b
...@@ -125,8 +125,12 @@ except ValidationFailed, error_message:\n ...@@ -125,8 +125,12 @@ except ValidationFailed, error_message:\n
\n \n
portal_status_message = request.get(\'portal_status_message\', translateString(\'Status changed.\'))\n portal_status_message = request.get(\'portal_status_message\', translateString(\'Status changed.\'))\n
\n \n
# Allow to redirect to another document\n
redirect_document_path = request.get(\'redirect_document_path\', context.getRelativeUrl())\n
redirect_document = context.restrictedTraverse(redirect_document_path)\n
\n
return context.ERP5Site_redirect(\n return context.ERP5Site_redirect(\n
\'%s/%s\' % (context.absolute_url(), form_id),\n \'%s/%s\' % (redirect_document.absolute_url(), form_id),\n
keep_items={\'portal_status_message\': portal_status_message})\n keep_items={\'portal_status_message\': portal_status_message})\n
</string> </value> </string> </value>
</item> </item>
...@@ -203,6 +207,8 @@ return context.ERP5Site_redirect(\n ...@@ -203,6 +207,8 @@ return context.ERP5Site_redirect(\n
<string>same_type</string> <string>same_type</string>
<string>str</string> <string>str</string>
<string>portal_status_message</string> <string>portal_status_message</string>
<string>redirect_document_path</string>
<string>redirect_document</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
622 624
\ 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