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
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
alecs_myu
erp5
Commits
f774f59f
Commit
f774f59f
authored
Dec 28, 2017
by
Tomáš Peterka
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 @@
(
function
(
window
,
rJS
,
URI
,
RSVP
)
{
"
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
)
{
var
key
;
if
(
gadget
.
state
.
options
.
form_content
)
{
for
(
key
in
result
)
{
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
];
}
}
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.xml
View file @
f774f59f
...
...
@@ -136,12 +136,6 @@
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
processing_status_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAU=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
...
...
@@ -163,7 +157,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
romain
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -185,8 +179,8 @@
</tuple>
<state>
<tuple>
<float>
1
411464845.21
</float>
<string>
GMT
</string>
<float>
1
514233767.52
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
...
...
@@ -230,7 +224,7 @@
</item>
<item>
<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>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +242,7 @@
</tuple>
<state>
<tuple>
<float>
15
08331971.69
</float>
<float>
15
14478159.1
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
@@ -260,61 +254,4 @@
</tuple>
</pickle>
</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>
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
View file @
f774f59f
...
...
@@ -3,20 +3,6 @@
(
function
(
window
,
rJS
,
RSVP
,
calculatePageTitle
)
{
"
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
)
/////////////////////////////////////////////////////////////////
// Acquired methods
...
...
@@ -64,15 +50,6 @@
rendered_form
=
gadget
.
state
.
erp5_document
.
_embedded
.
_view
,
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
.
form_definition
=
gadget
.
state
.
form_definition
;
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 @@
</item>
<item>
<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>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
15
07809117.8
</float>
<float>
15
14478835.97
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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