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
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Roque
erp5
Commits
2286f48a
Commit
2286f48a
authored
Jul 15, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: fixes on custom action handling
parent
629d34ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_js.js
...teItem/web_page_module/gadget_officejs_common_utils_js.js
+1
-1
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_local_controller_js.js
...le/gadget_officejs_controller_page_local_controller_js.js
+2
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.js
.../web_page_module/gadget_officejs_page_handle_action_js.js
+7
-4
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_js.js
View file @
2286f48a
...
...
@@ -172,7 +172,7 @@
form_type
=
'
dialog
'
;
child_gadget_url
=
'
gadget_erp5_pt_form_dialog.html
'
;
break
;
case
'
object_
jio_js_script
'
:
case
'
object_
action
'
:
form_type
=
'
dialog
'
;
child_gadget_url
=
'
gadget_erp5_pt_form_dialog.html
'
;
break
;
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_local_controller_js.js
View file @
2286f48a
...
...
@@ -26,6 +26,8 @@
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
(
options
)
{
//TODO: set this in site configuration
options
.
editable
=
true
;
var
gadget
=
this
,
default_view
,
app_view
,
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.js
View file @
2286f48a
...
...
@@ -60,7 +60,9 @@
action_gadget_url
,
form_type
=
form_info
[
0
],
child_gadget_url
=
form_info
[
1
],
valid_action
=
form_definition
.
action_type
===
"
object_jio_js_script
"
&&
//an action form must have a GadgetField called "gadget_field_new_action_js_script"
//this gadget will point the custom action gadget
valid_action
=
form_definition
.
action_type
===
"
object_action
"
&&
form_definition
.
fields_raw_properties
.
hasOwnProperty
(
"
gadget_field_action_js_script
"
),
state_options
=
{
doc
:
{},
...
...
@@ -73,6 +75,8 @@
};
if
(
valid_action
)
{
action_gadget_url
=
form_definition
.
fields_raw_properties
.
gadget_field_action_js_script
.
values
.
gadget_url
;
// as custom gadget render is being done here, avoid to child gadget to render it
delete
form_definition
.
fields_raw_properties
.
gadget_field_action_js_script
;
gadget
.
element
.
appendChild
(
fragment
);
return
gadget
.
declareGadget
(
action_gadget_url
,
{
scope
:
"
action_field
"
,
...
...
@@ -83,6 +87,7 @@
})
.
push
(
function
(
doc
)
{
state_options
.
doc
=
doc
;
state_options
.
action_gadget_url
=
action_gadget_url
;
return
gadget
.
changeState
(
state_options
);
});
}
else
{
...
...
@@ -117,12 +122,10 @@
//target_url = options[1],
content_dict
=
options
[
2
],
fragment
=
document
.
createElement
(
'
div
'
),
action_gadget_url
,
jio_key
;
if
(
gadget
.
state
.
valid_action
)
{
action_gadget_url
=
gadget
.
state
.
form_definition
.
fields_raw_properties
.
gadget_field_action_js_script
.
values
.
gadget_url
;
gadget
.
element
.
appendChild
(
fragment
);
return
gadget
.
declareGadget
(
action_gadget_url
,
{
return
gadget
.
declareGadget
(
gadget
.
state
.
action_gadget_url
,
{
scope
:
"
action_field
"
,
element
:
fragment
})
...
...
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