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
142
Merge Requests
142
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
f774f59f
Commit
f774f59f
authored
Dec 28, 2017
by
Tomáš Peterka
3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[renderjs_ui] Form saves dynamic content only of (editable)fields
parent
199e7247
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
94 deletions
+15
-94
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
+8
-1
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.xml
...lateItem/web_page_module/rjs_gadget_erp5_page_form_js.xml
+5
-68
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
+0
-23
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
View file @
f774f59f
...
@@ -3,12 +3,19 @@
...
@@ -3,12 +3,19 @@
(
function
(
window
,
rJS
,
URI
,
RSVP
)
{
(
function
(
window
,
rJS
,
URI
,
RSVP
)
{
"
use strict
"
;
"
use strict
"
;
/** Return local modifications to editable form fields after leaving the form
for a while - for example selecting a related object.
@argument result is possible current field value
*/
function
loadFormContent
(
gadget
,
result
)
{
function
loadFormContent
(
gadget
,
result
)
{
var
key
;
var
key
;
if
(
gadget
.
state
.
options
.
form_content
)
{
if
(
gadget
.
state
.
options
.
form_content
)
{
for
(
key
in
result
)
{
for
(
key
in
result
)
{
if
(
result
.
hasOwnProperty
(
key
))
{
if
(
result
.
hasOwnProperty
(
key
))
{
if
(
gadget
.
state
.
options
.
form_content
[
result
[
key
].
key
])
{
if
(
typeof
result
[
key
]
===
"
object
"
&&
result
[
key
].
hasOwnProperty
(
"
key
"
)
&&
gadget
.
state
.
options
.
form_content
[
result
[
key
].
key
])
{
result
[
key
].
default
=
gadget
.
state
.
options
.
form_content
[
result
[
key
].
key
];
result
[
key
].
default
=
gadget
.
state
.
options
.
form_content
[
result
[
key
].
key
];
}
}
}
}
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.xml
View file @
f774f59f
...
@@ -136,12 +136,6 @@
...
@@ -136,12 +136,6 @@
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</value>
</item>
</item>
<item>
<key>
<string>
processing_status_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAU=
</string>
</persistent>
</value>
</item>
</dictionary>
</dictionary>
</value>
</value>
</item>
</item>
...
@@ -163,7 +157,7 @@
...
@@ -163,7 +157,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
actor
</string>
</key>
<key>
<string>
actor
</string>
</key>
<value>
<string>
romain
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
comment
</string>
</key>
<key>
<string>
comment
</string>
</key>
...
@@ -185,8 +179,8 @@
...
@@ -185,8 +179,8 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1
411464845.21
</float>
<float>
1
514233767.52
</float>
<string>
GMT
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
</object>
</object>
...
@@ -230,7 +224,7 @@
...
@@ -230,7 +224,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
2.55953.16877.49032
</string>
</value>
<value>
<string>
96
4.24685.30142.17664
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +242,7 @@
...
@@ -248,7 +242,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
15
08331971.69
</float>
<float>
15
14478159.1
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
@@ -260,61 +254,4 @@
...
@@ -260,61 +254,4 @@
</tuple>
</tuple>
</pickle>
</pickle>
</record>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
detect_converted_file
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
romain
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_processing_state
</string>
</key>
<value>
<string>
converted
</string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
0.0.0.0
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1411464822.6
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
</ZopeData>
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
View file @
f774f59f
...
@@ -3,20 +3,6 @@
...
@@ -3,20 +3,6 @@
(
function
(
window
,
rJS
,
RSVP
,
calculatePageTitle
)
{
(
function
(
window
,
rJS
,
RSVP
,
calculatePageTitle
)
{
"
use strict
"
;
"
use strict
"
;
function
isGoodNonEditableField
(
field
)
{
// ListBox and FormBox should always get a chance to render
if
(
field
.
type
===
"
ListBox
"
)
{
return
true
;
}
if
(
field
.
type
===
"
FormBox
"
)
{
return
true
;
}
// hidden fields should not be obviously rendered
if
(
field
.
hidden
===
1
)
{
return
false
;
}
// field without default
if
(
!
field
.
default
)
{
return
false
;
}
if
(
field
.
default
.
length
===
0
)
{
return
false
;
}
if
(
field
.
default
.
length
===
1
&&
(
!
field
.
default
[
0
]))
{
return
false
;
}
return
true
;
}
rJS
(
window
)
rJS
(
window
)
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// Acquired methods
// Acquired methods
...
@@ -64,15 +50,6 @@
...
@@ -64,15 +50,6 @@
rendered_form
=
gadget
.
state
.
erp5_document
.
_embedded
.
_view
,
rendered_form
=
gadget
.
state
.
erp5_document
.
_embedded
.
_view
,
key
;
key
;
// Remove all empty or otherwise bad non-editable fields
for
(
key
in
rendered_form
)
{
if
(
rendered_form
.
hasOwnProperty
(
key
)
&&
(
key
[
0
]
!==
"
_
"
))
{
if
(
!
isGoodNonEditableField
(
rendered_form
[
key
]))
{
delete
rendered_form
[
key
];
}
}
}
form_options
.
erp5_document
=
gadget
.
state
.
erp5_document
;
form_options
.
erp5_document
=
gadget
.
state
.
erp5_document
;
form_options
.
form_definition
=
gadget
.
state
.
form_definition
;
form_options
.
form_definition
=
gadget
.
state
.
form_definition
;
form_options
.
view
=
gadget
.
state
.
view
;
form_options
.
view
=
gadget
.
state
.
view
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.xml
View file @
f774f59f
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
2.35930.39344.6741
</string>
</value>
<value>
<string>
96
4.25532.35708.31044
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
15
07809117.8
</float>
<float>
15
14478835.97
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
Tomáš Peterka
@katomaso
mentioned in commit
3ee08353
·
Jan 08, 2018
mentioned in commit
3ee08353
mentioned in commit 3ee08353b0dbd997d29d8c050b5095ae8e29eaa8
Toggle commit list
Tomáš Peterka
@katomaso
mentioned in commit
92556fec
·
Jan 08, 2018
mentioned in commit
92556fec
mentioned in commit 92556fec6bde9bdd1a867f3cad7eaf19e637cd38
Toggle commit list
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