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
86591014
Commit
86591014
authored
May 24, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: using jio-queries instead of plain string
parent
ae55033e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
10 deletions
+55
-10
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_js.js
...teItem/web_page_module/gadget_officejs_common_utils_js.js
+53
-8
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_js.xml
...eItem/web_page_module/gadget_officejs_common_utils_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_js.js
View file @
86591014
/*global window, rJS,
RSVP
*/
/*global window, rJS,
Query, SimpleQuery, ComplexQuery
*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
)
{
(
function
(
window
,
rJS
,
Query
,
SimpleQuery
,
ComplexQuery
)
{
"
use strict
"
;
"
use strict
"
;
// TODO: check if there are other categories that are 'views' and find a less hardcoded way to get this
// TODO: check if there are other categories that are 'views' and find a less hardcoded way to get this
...
@@ -55,11 +55,29 @@
...
@@ -55,11 +55,29 @@
var
gadget
=
this
,
var
gadget
=
this
,
//for now, views and actions are handle together via handle_action gadget
//for now, views and actions are handle together via handle_action gadget
has_more_dict
=
{
views
:
{},
actions
:
{}},
has_more_dict
=
{
views
:
{},
actions
:
{}},
query
;
query
,
query_type
,
query_parent
;
// get all actions/views for the portal_type, if target action is a type of view
// get all actions/views for the portal_type, if target action is a type of view
// (exclude custom scripts and dialogs)
// (exclude custom scripts and dialogs)
if
(
view_categories
.
includes
(
action_category
))
{
if
(
view_categories
.
includes
(
action_category
))
{
query
=
'
portal_type: "Action Information" AND parent_relative_url: "portal_types/
'
+
portal_type
+
'
"
'
;
query_type
=
new
SimpleQuery
({
key
:
"
portal_type
"
,
operator
:
""
,
type
:
"
simple
"
,
value
:
"
Action Information
"
});
query_parent
=
new
SimpleQuery
({
key
:
"
parent_relative_url
"
,
operator
:
""
,
type
:
"
simple
"
,
value
:
"
portal_types/
"
+
portal_type
});
query
=
Query
.
objectToSearchText
(
new
ComplexQuery
({
operator
:
"
AND
"
,
query_list
:
[
query_type
,
query_parent
],
type
:
"
complex
"
}));
return
gadget
.
jio_allDocs
({
query
:
query
})
return
gadget
.
jio_allDocs
({
query
:
query
})
.
push
(
function
(
action_list
)
{
.
push
(
function
(
action_list
)
{
if
(
action_list
.
data
.
rows
.
length
>
0
)
{
if
(
action_list
.
data
.
rows
.
length
>
0
)
{
...
@@ -73,9 +91,36 @@
...
@@ -73,9 +91,36 @@
.
declareMethod
(
"
getFormDefinition
"
,
function
(
portal_type
,
action_reference
,
source_reference
)
{
.
declareMethod
(
"
getFormDefinition
"
,
function
(
portal_type
,
action_reference
,
source_reference
)
{
var
gadget
=
this
,
var
gadget
=
this
,
parent
=
"
portal_types/
"
+
portal_type
,
query
,
query
=
'
portal_type: "Action Information" AND reference: "
'
+
action_reference
+
'
" AND parent_relative_url: "
'
+
parent
+
'
"
'
,
action_type
,
action_type
,
action_title
,
form_definition
;
action_title
,
form_definition
,
query_type
,
query_parent
,
query_reference
;
query_reference
=
new
SimpleQuery
({
key
:
"
reference
"
,
operator
:
""
,
type
:
"
simple
"
,
value
:
action_reference
});
query_type
=
new
SimpleQuery
({
key
:
"
portal_type
"
,
operator
:
""
,
type
:
"
simple
"
,
value
:
"
Action Information
"
});
query_parent
=
new
SimpleQuery
({
key
:
"
parent_relative_url
"
,
operator
:
""
,
type
:
"
simple
"
,
value
:
"
portal_types/
"
+
portal_type
});
query
=
Query
.
objectToSearchText
(
new
ComplexQuery
({
operator
:
"
AND
"
,
query_list
:
[
query_type
,
query_parent
,
query_reference
],
type
:
"
complex
"
}));
return
gadget
.
jio_allDocs
({
query
:
query
})
return
gadget
.
jio_allDocs
({
query
:
query
})
.
push
(
function
(
data
)
{
.
push
(
function
(
data
)
{
if
(
data
.
data
.
rows
.
length
===
0
)
{
if
(
data
.
data
.
rows
.
length
===
0
)
{
...
@@ -102,4 +147,4 @@
...
@@ -102,4 +147,4 @@
});
});
});
});
}(
window
,
rJS
,
RSVP
));
}(
window
,
rJS
,
Query
,
SimpleQuery
,
ComplexQuery
));
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_utils_js.xml
View file @
86591014
...
@@ -269,7 +269,7 @@
...
@@ -269,7 +269,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.
47864.34898.9710
</string>
</value>
<value>
<string>
975.
61005.40376.25702
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -287,7 +287,7 @@
...
@@ -287,7 +287,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
155
7927902.87
</float>
<float>
155
8716356.0
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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