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
144
Merge Requests
144
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
2a3f4c11
Commit
2a3f4c11
authored
Nov 14, 2019
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: Extend code to support submit dialog with custom method
parent
8e39f2fe
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
171 additions
and
155 deletions
+171
-155
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_html.xml
...m/web_page_module/rjs_gadget_erp5_pt_form_dialog_html.xml
+163
-151
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
...Item/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
+8
-4
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_html.xml
View file @
2a3f4c11
This diff is collapsed.
Click to expand it.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
View file @
2a3f4c11
...
...
@@ -19,7 +19,7 @@
});
}
function
submitDialog
(
is_updating
)
{
function
submitDialog
(
is_updating
,
custom_dialog_method
)
{
var
gadget
=
this
,
button_container
=
gadget
.
element
.
querySelector
(
'
.dialog_button_container
'
),
...
...
@@ -55,7 +55,7 @@
}
}
// ERP5 expects target Script name in dialog_method field
data
.
dialog_method
=
gadget
.
state
.
form_definition
.
action
;
data
.
dialog_method
=
custom_dialog_method
||
gadget
.
state
.
form_definition
.
action
;
// For Update Action - override the default value from "action"
if
(
is_updating
)
{
data
.
dialog_method
=
gadget
.
state
.
form_definition
.
update_action
;
...
...
@@ -82,7 +82,6 @@
if
(
gadget
.
state
.
redirect_to_parent
)
{
return
gadget
.
redirect
({
command
:
'
history_previous
'
});
}
console
.
log
(
'
COSUCOUS
'
,
result
);
if
((
gadget
.
state
.
jio_key
===
result
.
jio_key
)
&&
(
!
result
.
view
))
{
// don't update navigation history when not really redirecting
...
...
@@ -107,7 +106,6 @@
}
}
console
.
log
(
'
lets redirect
'
,
command
,
result
.
jio_key
,
result
.
view
);
// forced document change thus we update history
return
gadget
.
redirect
({
command
:
command
,
...
...
@@ -131,6 +129,10 @@
}
function
submitDialogWithCustomDialogMethod
(
param_list
)
{
return
submitDialog
.
apply
(
this
,
[
false
,
param_list
[
0
]]);
}
var
gadget_klass
=
rJS
(
window
),
dialog_button_source
=
gadget_klass
.
__template_element
.
getElementById
(
"
dialog-button-template
"
)
...
...
@@ -153,6 +155,8 @@
.
declareAcquiredMethod
(
"
translate
"
,
"
translate
"
)
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
.
declareAcquiredMethod
(
"
submitContent
"
,
"
submitContent
"
)
.
allowPublicAcquisition
(
"
submitDialogWithCustomDialogMethod
"
,
submitDialogWithCustomDialogMethod
)
/////////////////////////////////////////////////////////////////
// Proxy methods to the child gadget
...
...
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