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
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
erp5
Commits
d5d448de
Commit
d5d448de
authored
Jun 17, 2019
by
Tristan Cavelier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "DATETIMEFIELDUPDATE WIP add raw changes to make test to work, now recode it !"
This reverts commit
7c386987
.
parent
476e9402
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
38 deletions
+0
-38
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
...plateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
+0
-38
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
View file @
d5d448de
...
...
@@ -70,7 +70,6 @@ and handling data send&receive.
if
(
typeof
result
[
key
]
===
"
object
"
&&
result
[
key
].
hasOwnProperty
(
"
key
"
)
&&
gadget
.
state
.
options
.
form_content
[
result
[
key
].
key
])
{
console
.
log
(
"
page_form: in loadFormContent
"
,
result
[
key
][
'
default
'
],
gadget
.
state
.
options
.
form_content
[
result
[
key
].
key
]);
result
[
key
][
'
default
'
]
=
gadget
.
state
.
options
.
form_content
[
result
[
key
].
key
];
}
}
...
...
@@ -123,7 +122,6 @@ and handling data send&receive.
// Proxy methods to the child gadget
/////////////////////////////////////////////////////////////////
.
declareMethod
(
'
triggerSubmit
'
,
function
triggerSubmit
()
{
console
.
log
(
"
page form: triggeringSubmit
"
);
return
this
.
getDeclaredGadget
(
'
fg
'
)
.
push
(
function
(
g
)
{
return
g
.
triggerSubmit
();
...
...
@@ -165,15 +163,6 @@ and handling data send&receive.
.
allowPublicAcquisition
(
'
notifySubmit
'
,
function
notifySubmit
()
{
return
this
.
triggerSubmit
();
})
.
allowPublicAcquisition
(
"
notifyChange
"
,
function
notifyChange
(
params
)
{
var
gadget
=
this
;
console
.
log
(
"
page form: notifyChange
"
,
params
);
return
gadget
.
getDeclaredGadget
(
"
fg
"
)
.
push
(
g
=>
g
.
getContent
())
.
push
(
content
=>
{
gadget
.
_XXX_change_content
=
content
;
return
gadget
.
notifyChange
.
apply
(
gadget
,
params
);
});
})
/**/
/**
* Render obtain ERP5 Document and assigned Form Definition.
*
...
...
@@ -308,23 +297,7 @@ and handling data send&receive.
sub_options
.
jio_key
=
options
.
jio_key
;
// jIO identifier of currently rendered ERP5 document
sub_options
.
editable
=
options
.
editable
;
// form decides on editability of its fields
console
.
log
(
"
page form: page_template_gadget.render
"
,
sub_options
);
return
page_template_gadget
.
getContent
()
// XXX don't do it if jio_key is different than previous one
.
push
(
function
(
content
)
{
console
.
log
(
"
page form: gadget._XXX_submitted_content
"
,
gadget
.
_XXX_submitted_content
);
console
.
log
(
"
page form: page_template_gadget.getContent
"
,
content
);
try
{
if
(
gadget
.
_XXX_submitted_content
&&
gadget
.
_XXX_change_content
)
if
(
sub_options
.
erp5_document
.
_embedded
.
_view
.
my_short_title
.
key
===
"
field_my_short_title
"
)
if
(
gadget
.
_XXX_submitted_content
.
field_my_short_title
===
sub_options
.
erp5_document
.
_embedded
.
_view
.
my_short_title
.
default
)
if
(
sub_options
.
erp5_document
.
_embedded
.
_view
.
my_short_title
.
default
!==
content
.
field_my_short_title
)
sub_options
.
erp5_document
.
_embedded
.
_view
.
my_short_title
.
default
=
content
.
field_my_short_title
;
// please notifyChange at end of this onChangeState ?
}
catch
(
_
)
{}
delete
gadget
.
_XXX_change_content
;
delete
gadget
.
_XXX_submitted_content
;
return
page_template_gadget
.
render
(
sub_options
);
});
})
.
push
(
function
()
{
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
...
...
@@ -378,16 +351,12 @@ and handling data send&receive.
on failure it throws an error with the invalid response
*/
.
allowPublicAcquisition
(
"
submitContent
"
,
function
submitContent
(
param_list
)
{
console
.
log
(
"
page form: submitContent on call
"
);
var
gadget
=
this
,
jio_key
=
param_list
[
0
],
target_url
=
param_list
[
1
],
content_dict
=
param_list
[
2
];
return
gadget
.
notifySubmitting
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
fg
"
).
push
(
g
=>
g
.
getContent
()).
push
(
content
=>
{
gadget
.
_XXX_submitted_content
=
content
;
});
})
.
push
(
function
()
{
return
gadget
.
jio_putAttachment
(
jio_key
,
target_url
,
content_dict
);
})
...
...
@@ -402,7 +371,6 @@ and handling data send&receive.
.
push
(
function
(
response_text
)
{
var
response
=
JSON
.
parse
(
response_text
.
target
.
result
);
console
.
log
(
"
page form: notifySubmitted
"
);
return
gadget
.
notifySubmitted
({
"
message
"
:
response
.
portal_status_message
,
"
status
"
:
response
.
portal_status_level
||
"
success
"
...
...
@@ -449,7 +417,6 @@ and handling data send&receive.
return
response_view
.
_notification
.
message
;
})
.
push
(
function
(
translated_message
)
{
console
.
log
(
"
page form: notifySubmitted
"
);
return
gadget
.
notifySubmitted
({
"
message
"
:
translated_message
,
"
status
"
:
response_view
.
_notification
?
response_view
.
_notification
.
status
:
"
success
"
...
...
@@ -481,7 +448,6 @@ and handling data send&receive.
attachment
.
target
.
status
<
400
)
{
return
gadget
.
translate
(
"
Action succeeded.
"
)
.
push
(
function
(
translated_message
)
{
console
.
log
(
"
page form: notifySubmitted
"
);
return
gadget
.
notifySubmitted
({
"
message
"
:
translated_message
,
"
status
"
:
"
success
"
...
...
@@ -496,7 +462,6 @@ and handling data send&receive.
// likely product of export/report (thus PDF, ODT ...)
return
gadget
.
translate
(
"
Data received.
"
)
.
push
(
function
(
translated_message
)
{
console
.
log
(
"
page form: notifySubmitted
"
);
return
gadget
.
notifySubmitted
({
"
message
"
:
translated_message
,
"
status
"
:
"
success
"
...
...
@@ -526,7 +491,6 @@ and handling data send&receive.
if
(
error
===
undefined
||
error
.
target
===
undefined
)
{
return
gadget
.
translate
(
'
Encountered an unknown error. Try to resubmit.
'
)
.
push
(
function
(
translated_message
)
{
console
.
log
(
"
page form: notifySubmitted
"
);
return
gadget
.
notifySubmitted
({
'
message
'
:
translated_message
,
'
status
'
:
'
error
'
...
...
@@ -551,7 +515,6 @@ and handling data send&receive.
if
(
error
.
target
.
response
.
type
===
'
application/json
'
||
error
.
target
.
response
.
type
===
'
application/hal+json
'
)
{
console
.
log
(
"
page form: notifySubmitted
"
);
return
gadget
.
notifySubmitted
()
.
push
(
function
()
{
return
jIO
.
util
.
readBlobAsText
(
error
.
target
.
response
);
...
...
@@ -601,7 +564,6 @@ and handling data send&receive.
// If the response in empty with only HTTP Status code then we display
// our static translated error_text to the user
console
.
log
(
"
page form: notifySubmitted
"
);
return
gadget
.
notifySubmitted
()
.
push
(
function
()
{
return
gadget
.
translate
(
error_text
);
...
...
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