Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
b49b5ef2
Commit
b49b5ef2
authored
Dec 19, 2019
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
break break
parent
344db397
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
135 additions
and
4 deletions
+135
-4
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_redirect.py
...ateItem/portal_skins/erp5_hal_json_style/Base_redirect.py
+1
-1
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+7
-3
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_web_hal_json/Base_viewFakeJumpForm.xml
.../portal_skins/erp5_web_hal_json/Base_viewFakeJumpForm.xml
+127
-0
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/Base_redirect.py
View file @
b49b5ef2
...
...
@@ -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
\
...
...
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
b49b5ef2
...
...
@@ -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'
}))
...
...
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_web_hal_json/Base_viewFakeJumpForm.xml
0 → 100644
View file @
b49b5ef2
<?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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment