Commit 84671589 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* improve the condition of 'Save & View' in Base_edit.

* modify Predicate_edit to support 'Save & View'.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27803 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 25ea4865
......@@ -261,11 +261,10 @@ spp.insert(0,s_url)\n
#calculate direct the url instead of using absolute_url\n
new_url = \'/\'.join(spp)\n
\n
# for web mode, we should use \'view\' instead of \'WebSite_view\',\n
# \'WebSection_view\' or \'WebPage_view\'.\n
# for web mode, we should use \'view\' instead of passed form_id\n
# after \'Save & View\'.\n
if context.REQUEST.get(\'is_web_mode\', False) and \\\n
form_id in (\'WebSite_view\', \'WebSection_view\', \'WebPage_view\',\n
\'WebPage_viewEditor\'):\n
not editable_mode:\n
form_id = \'view\'\n
\n
if not selection_index:\n
......
......@@ -53,7 +53,9 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># Updates attributes of an Zope document\n
<value> <string encoding="cdata"><![CDATA[
# Updates attributes of an Zope document\n
# which is in a class inheriting from ERP5 Base\n
#\n
# TODO\n
......@@ -103,6 +105,12 @@ except FormValidationError, validation_errors:\n
request.set(\'field_errors\', field_errors)\n
return form(request)\n
else:\n
# for web mode, we should use \'view\' instead of passed form_id\n
# after \'Save & View\'.\n
if context.REQUEST.get(\'is_web_mode\', False) and \\\n
not editable_mode:\n
form_id = \'view\'\n
\n
if not selection_index:\n
redirect_url = \'%s/%s?%s\' % (\n
context.absolute_url(),\n
......@@ -125,7 +133,9 @@ else:\n
)\n
\n
request[ \'RESPONSE\' ].redirect( redirect_url )\n
</string> </value>
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -193,6 +203,7 @@ request[ \'RESPONSE\' ].redirect( redirect_url )\n
<string>_apply_</string>
<string>validation_errors</string>
<string>field_errors</string>
<string>False</string>
<string>redirect_url</string>
</tuple>
</value>
......
1240
\ No newline at end of file
1241
\ 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