Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Amer
erp5
Commits
d3c8d637
Commit
d3c8d637
authored
5 years ago
by
Roque
Browse files
Options
Download
Email Patches
Plain Diff
erp5_post: new post action uses dialog form
parent
cebedaf6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
41 deletions
+38
-41
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/gadget_field_new_action_js_script.js.js
...l_skins/erp5_post/gadget_field_new_action_js_script.js.js
+38
-41
No files found.
bt5/erp5_post/SkinTemplateItem/portal_skins/erp5_post/gadget_field_new_action_js_script.js.js
View file @
d3c8d637
...
...
@@ -41,23 +41,17 @@
.
declareMethod
(
"
render
"
,
function
(
parent_options
,
action_reference
,
form_definition
)
{
var
gadget
=
this
;
return
gadget
.
createDocument
(
parent_options
)
.
push
(
function
(
jio_key
)
{
return
gadget
.
jio_get
(
jio_key
)
.
push
(
function
(
new_document
)
{
return
gadget
.
changeState
({
jio_key
:
jio_key
,
doc
:
new_document
,
child_gadget_url
:
'
gadget_erp5_pt_form_
view_editable
.html
'
,
form_type
:
'
page
'
,
doc
:
{
title
:
"
Untitled Document
"
}
,
parent_options
:
parent_options
,
child_gadget_url
:
'
gadget_erp5_pt_form_
dialog
.html
'
,
form_type
:
'
dialog
'
,
form_definition
:
form_definition
,
view
:
action_reference
,
editable
:
true
,
has_more_views
:
false
,
has_more_actions
:
true
});
});
});
})
.
onStateChange
(
function
()
{
...
...
@@ -79,19 +73,22 @@
var
gadget
=
this
,
jio_key
=
options
[
0
],
//target_url = options[1],
content_dict
=
options
[
2
]
;
return
gadget
.
notifySubmitting
()
.
push
(
function
()
{
return
gadget
.
jio_get
(
jio_key
);
})
.
push
(
function
(
document
)
{
var
property
;
content_dict
=
options
[
2
]
,
document
=
{
portal_type
:
gadget
.
state
.
parent_options
.
portal_type
,
parent_relative_url
:
gadget
.
state
.
parent_options
.
parent_relative_url
,
my_source_reference
:
gadget
.
state
.
parent_options
.
my_source_reference
},
property
;
delete
content_dict
.
dialog_method
;
for
(
property
in
content_dict
)
{
if
(
content_dict
.
hasOwnProperty
(
property
))
{
document
[
property
]
=
content_dict
[
property
];
document
[
'
my_
'
+
property
]
=
content_dict
[
property
];
}
}
return
gadget
.
jio_put
(
jio_key
,
document
);
return
this
.
createDocument
(
document
)
.
push
(
function
(
id
)
{
jio_key
=
id
;
return
gadget
.
notifySubmitting
();
})
.
push
(
function
()
{
return
gadget
.
notifySubmitted
({
message
:
'
Data Updated
'
,
status
:
'
success
'
});
...
...
This diff is collapsed.
Click to expand it.
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