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
1
Issues
1
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
Roque
erp5
Commits
3d350c00
Commit
3d350c00
authored
Jun 18, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: action page handles new configuration fields
parent
e59a7e4d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
22 deletions
+40
-22
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.js
...eb_page_module/gadget_officejs_page_action_officejs_js.js
+38
-20
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.xml
...b_page_module/gadget_officejs_page_action_officejs_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.js
View file @
3d350c00
...
...
@@ -38,6 +38,16 @@
);
}
function
filterViews
(
views_dict
,
app_view
,
default_view
)
{
//TODO: there must be only one "View" action (title = "View")
// this is for scenarios were the portal type has several "View" (like view, jio_view, custom_view)
// priority: app_view ; default_view ; other (reference=view)
// if views_dict contains app_view -> remove all "View" entries
// else if contains default_view -> remove all "View" entries
// else get first "View" and remove all other "View" entries
return
views_dict
;
}
gadget_klass
/////////////////////////////////////////////////////////////////
// Acquired methods
...
...
@@ -90,19 +100,26 @@
action_info_dict
=
{
views
:
{},
actions
:
{}},
//TODO use Query to avoid strings
query
=
'
portal_type: "Action Information" AND parent_relative_url: "portal_types/
'
+
portal_type
+
'
"
'
,
app_actions
;
app_actions
,
app_view
,
default_view
;
return
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
declareGadget
(
"
gadget_officejs_common_utils.html
"
),
gadget
.
getSetting
(
'
app_view_reference
'
),
gadget
.
getSetting
(
'
default_view_reference
'
)
]);
})
.
push
(
function
(
result_list
)
{
app_view
=
result_list
[
1
];
default_view
=
result_list
[
2
];
return
result_list
[
0
].
getAppActions
(
portal_type
);
})
.
push
(
function
(
app_actions_result
)
{
app_actions
=
app_actions_result
;
app_actions
=
app_actions_result
.
map
(
function
(
pair
)
{
return
pair
[
1
];
});
return
gadget
.
jio_allDocs
({
query
:
query
})
.
push
(
function
(
action_list
)
{
var
path_for_jio_get_list
=
[],
row
;
...
...
@@ -114,12 +131,11 @@
return
RSVP
.
all
(
path_for_jio_get_list
);
})
.
push
(
function
(
action_document_list
)
{
var
action_settings_list
=
[],
page
,
action_key
,
action_doc
,
key
,
action_settings
;
var
page
,
action_key
,
action_doc
,
key
,
action_settings
;
for
(
action_key
in
action_document_list
)
{
//TODO filter actions: discard actions that are not in getSettings("app_actions")
//there must be one "View" action. If not, use default view (like jio_view in getsettings)
if
(
action_document_list
.
hasOwnProperty
(
action_key
))
{
action_doc
=
action_document_list
[
action_key
];
if
(
app_actions
.
includes
(
action_doc
.
reference
))
{
action_settings
=
{
page
:
undefined
,
jio_key
:
options
.
jio_key
,
...
...
@@ -138,6 +154,8 @@
}
}
}
}
action_info_dict
.
views
=
filterViews
(
action_info_dict
.
views
,
app_view
,
default_view
);
return
action_info_dict
;
});
});
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.xml
View file @
3d350c00
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
976.31
000.44303.9591
</string>
</value>
<value>
<string>
976.31
395.21170.7816
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
15608
48207.92
</float>
<float>
15608
71889.71
</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