Commit b49b5ef2 authored by Romain Courteaud's avatar Romain Courteaud

break break

parent 344db397
......@@ -75,7 +75,7 @@ if (not context.isWebMode()) and (context.REQUEST.get('web_section_value', None)
# form_id = 'view' means use default document view. Let the JS handle it
# In case of dialog submit, if redirecting to the original form, let the JS handle the navigation history
if (form_id not in [None, 'Base_viewFakePythonScriptActionForm']) and \
if (form_id not in [None, 'Base_viewFakePythonScriptActionForm', 'Base_viewFakeJumpForm']) and \
((form_id != 'view') or (keep_items is not None)) and \
(form_id != previous_form_id) and \
(not form_id.startswith('http')) and \
......
......@@ -1323,6 +1323,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
# Try to embed the form in the result
if (view == view_action['id']):
current_action = parseActionUrl('%s' % view_action['url']) # current action/view being rendered
current_action['category_type'] = erp5_action_key
if view and (view != 'view') and (current_action.get('view_id', None) is None):
# XXX Allow to directly render a form
......@@ -1352,8 +1353,11 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
# If our "form" is actually a Script (nothing is sure in ERP5) or anything else than Form
# (e.g. function or bound class method will) not have .meta_type thus be considered a Script
# then we execute it directly
if ("Script" in getattr(view_instance, "meta_type", "Script")) or ():
view_instance = getattr(traversed_document, 'Base_viewFakePythonScriptActionForm')
if "Script" in getattr(view_instance, "meta_type", "Script"):
if current_action.get('category_type', None) == 'object_jump':
view_instance = getattr(traversed_document, 'Base_viewFakeJumpForm')
else:
view_instance = getattr(traversed_document, 'Base_viewFakePythonScriptActionForm')
if view_instance.pt == "form_dialog":
# If there is a "form_id" in the REQUEST then it means that last view was actually a form
......@@ -1367,7 +1371,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
renderForm(traversed_document, view_instance, embedded_dict,
selection_params=extra_param_json, extra_param_json=extra_param_json)
if view_instance.pt == "form_python_action":
if view_instance.pt in ["form_python_action", "form_jump"]:
for k, v in current_action['params'].items():
renderHiddenField(embedded_dict, k, v)
embedded_dict['_embedded']['form_definition']['group_list'][-1][1].append((k, {'meta_type': 'StringField'}))
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ERP5 Form" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>action_title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>edit_order</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>enctype</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>group_list</string> </key>
<value>
<list>
<string>left</string>
<string>right</string>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
</value>
</item>
<item>
<key> <string>groups</string> </key>
<value>
<dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>left</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>right</string> </key>
<value>
<list/>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Base_viewFakeJumpForm</string> </value>
</item>
<item>
<key> <string>method</string> </key>
<value> <string>POST</string> </value>
</item>
<item>
<key> <string>name</string> </key>
<value> <string>Base_viewFakePythonScriptActionForm</string> </value>
</item>
<item>
<key> <string>pt</string> </key>
<value> <string>form_jump</string> </value>
</item>
<item>
<key> <string>row_length</string> </key>
<value> <int>4</int> </value>
</item>
<item>
<key> <string>stored_encoding</string> </key>
<value> <string>UTF-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode_mode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>update_action</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>update_action_title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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