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
Amer
erp5
Commits
57ce5d6c
Commit
57ce5d6c
authored
Apr 03, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: minor fixes and code cleanup-refactor on controller rendering
parent
0409c95d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
15 deletions
+22
-15
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.js
...e_module/gadget_officejs_controller_page_controller_js.js
+20
-13
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.xml
..._module/gadget_officejs_controller_page_controller_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.js
View file @
57ce5d6c
...
...
@@ -88,8 +88,12 @@
// This is the custom code to handle this specific reply action
// it should be somewhere else to keep the controller generic
if
(
action_reference
==
"
reply
"
)
{
var
doc
=
{
title
:
"
Re:
"
+
document
.
title
,
var
doc
,
title
=
document
.
title
;
if
(
!
title
.
startsWith
(
"
Re:
"
))
{
title
=
"
Re:
"
+
document
.
title
;
}
doc
=
{
title
:
title
,
portal_type
:
document
.
portal_type
,
parent_relative_url
:
document
.
parent_relative_url
};
...
...
@@ -113,7 +117,7 @@
return
gadget
.
jio_allDocs
({
query
:
query
})
.
push
(
function
(
data
)
{
if
(
data
.
data
.
rows
.
length
===
0
)
{
throw
"
Can not find action for portal type
"
+
portal_type
;
throw
"
Can not find action
"
+
action_reference
+
"
for portal type
"
+
portal_type
;
}
return
gadget
.
jio_get
(
data
.
data
.
rows
[
0
].
id
);
})
...
...
@@ -207,7 +211,7 @@
return
gadget
.
handleAction
(
options
.
jio_key
,
document
,
view_parameters
);
})
.
push
(
function
(
result_list
)
{
return
gadget
.
getFormDefinition
(
document
.
portal_type
,
result_list
[
2
])
//action_reference)
return
gadget
.
getFormDefinition
(
document
.
portal_type
,
result_list
[
2
])
.
push
(
function
(
form_definition
)
{
return
gadget
.
changeState
({
jio_key
:
result_list
[
0
],
...
...
@@ -215,7 +219,11 @@
child_gadget_url
:
child_gadget_url
,
form_definition
:
form_definition
,
editable
:
options
.
editable
,
view
:
result_list
[
2
]
view
:
result_list
[
2
],
//HARDCODED: following fields should be indicated by the configuration
has_more_views
:
false
,
has_more_actions
:
result_list
[
2
]
==
default_view
,
is_form_list
:
false
});
});
});
...
...
@@ -264,9 +272,8 @@
]);
})
.
push
(
function
(
result_list
)
{
var
is_form_list
=
false
,
//TODO: configuration must indicate if is a form or list view
url_list
=
result_list
[
0
],
header_dict
;
if
(
is_form_list
)
{
var
url_list
=
result_list
[
0
],
header_dict
;
if
(
gadget
.
state
.
is_form_list
)
{
header_dict
=
{
panel_action
:
true
,
jump_url
:
""
,
...
...
@@ -282,14 +289,14 @@
next_url
:
url_list
[
4
],
page_title
:
gadget
.
state
.
doc
.
title
};
if
(
false
)
{
//TODO: configuration must indicate if there are more views
if
(
gadget
.
state
.
has_more_views
)
{
header_dict
.
tab_url
=
url_list
[
0
];
}
if
(
gadget
.
state
.
editable
===
"
true
"
)
{
header_dict
.
save_action
=
true
;
}
}
if
(
true
)
{
//TODO: configuration must indicate if there are more actions
if
(
gadget
.
state
.
has_more_actions
)
{
header_dict
.
actions_url
=
url_list
[
1
];
}
if
(
url_list
[
7
])
{
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.xml
View file @
57ce5d6c
...
...
@@ -225,7 +225,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.518
31.61563.42956
</string>
</value>
<value>
<string>
974.518
86.25651.1723
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -243,7 +243,7 @@
</tuple>
<state>
<tuple>
<float>
155432
0403.23
</float>
<float>
155432
3825.38
</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