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
Mikolaï Krol
erp5
Commits
dbd5c0d0
Commit
dbd5c0d0
authored
Mar 06, 2018
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Replicate jio 3.27.0 changes
parent
59622856
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
43 deletions
+93
-43
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_jio_js.js
...athTemplateItem/web_page_module/rjs_gadget_erp5_jio_js.js
+91
-41
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_jio_js.xml
...thTemplateItem/web_page_module/rjs_gadget_erp5_jio_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_jio_js.js
View file @
dbd5c0d0
/*global window, rJS, RSVP, UriTemplate, URI,
Query,
SimpleQuery, ComplexQuery, jIO */
/*global window, rJS, RSVP, UriTemplate, URI, SimpleQuery, ComplexQuery, jIO */
/*jslint indent: 2, maxerr: 3, nomen: true */
/*jslint indent: 2, maxerr: 3, nomen: true */
(
function
(
window
,
rJS
,
RSVP
,
UriTemplate
,
URI
,
Query
,
SimpleQuery
,
ComplexQuery
,
jIO
)
{
(
function
(
window
,
rJS
,
RSVP
,
UriTemplate
,
URI
,
SimpleQuery
,
ComplexQuery
,
jIO
)
{
"
use strict
"
;
"
use strict
"
;
function
wrapJioCall
(
gadget
,
method_name
,
argument_list
)
{
function
wrapJioCall
(
gadget
,
method_name
,
argument_list
)
{
...
@@ -42,12 +42,26 @@
...
@@ -42,12 +42,26 @@
function
isSingleLocalRoles
(
parsed_query
)
{
function
isSingleLocalRoles
(
parsed_query
)
{
if
((
parsed_query
instanceof
SimpleQuery
)
&&
if
((
parsed_query
instanceof
SimpleQuery
)
&&
(
parsed_query
.
operator
===
undefined
)
&&
(
parsed_query
.
key
===
'
local_roles
'
))
{
(
parsed_query
.
key
===
'
local_roles
'
))
{
// local_roles:"Assignee"
// local_roles:"Assignee"
return
parsed_query
.
value
;
return
parsed_query
.
value
;
}
}
}
}
function
isSingleDomain
(
parsed_query
)
{
if
((
parsed_query
instanceof
SimpleQuery
)
&&
(
parsed_query
.
operator
===
undefined
)
&&
(
parsed_query
.
key
!==
undefined
)
&&
(
parsed_query
.
key
.
indexOf
(
'
selection_domain_
'
)
===
0
))
{
// domain_region:"europe/france"
var
result
=
{};
result
[
parsed_query
.
key
.
slice
(
'
selection_domain_
'
.
length
)]
=
parsed_query
.
value
;
return
result
;
}
}
function
isMultipleLocalRoles
(
parsed_query
)
{
function
isMultipleLocalRoles
(
parsed_query
)
{
var
i
,
var
i
,
sub_query
,
sub_query
,
...
@@ -59,6 +73,7 @@
...
@@ -59,6 +73,7 @@
for
(
i
=
0
;
i
<
parsed_query
.
query_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
parsed_query
.
query_list
.
length
;
i
+=
1
)
{
sub_query
=
parsed_query
.
query_list
[
i
];
sub_query
=
parsed_query
.
query_list
[
i
];
if
((
sub_query
instanceof
SimpleQuery
)
&&
if
((
sub_query
instanceof
SimpleQuery
)
&&
(
sub_query
.
key
!==
undefined
)
&&
(
sub_query
.
key
===
'
local_roles
'
))
{
(
sub_query
.
key
===
'
local_roles
'
))
{
local_role_list
.
push
(
sub_query
.
value
);
local_role_list
.
push
(
sub_query
.
value
);
}
else
{
}
else
{
...
@@ -104,76 +119,111 @@
...
@@ -104,76 +119,111 @@
});
});
})
})
.
declareMethod
(
'
allDocs
'
,
function
(
option
_dict
)
{
.
declareMethod
(
'
allDocs
'
,
function
(
option
s
)
{
// throw new Error('do not use all docs');
// throw new Error('do not use all docs');
if
(
option
_dict
.
list_method_template
===
undefined
)
{
if
(
option
s
.
list_method_template
===
undefined
)
{
return
wrapJioCall
(
this
,
'
allDocs
'
,
arguments
);
return
wrapJioCall
(
this
,
'
allDocs
'
,
arguments
);
}
}
var
query
=
option
_dict
.
query
,
var
query
=
option
s
.
query
,
i
,
i
,
key
,
parsed_query
,
parsed_query
,
sub_query
,
sub_query
,
result_list
,
result_list
,
tmp_list
=
[],
local_roles
,
local_roles
;
local_role_found
=
false
,
if
(
option_dict
.
query
)
{
selection_domain
,
parsed_query
=
jIO
.
QueryFactory
.
create
(
option_dict
.
query
);
sort_list
=
[];
if
(
options
.
query
)
{
parsed_query
=
jIO
.
QueryFactory
.
create
(
options
.
query
);
result_list
=
isSingleLocalRoles
(
parsed_query
);
result_list
=
isSingleLocalRoles
(
parsed_query
);
if
(
result_list
)
{
if
(
result_list
)
{
query
=
undefined
;
query
=
undefined
;
local_roles
=
result_list
;
local_roles
=
result_list
;
}
else
{
}
else
{
result_list
=
isSingleDomain
(
parsed_query
);
result_list
=
isMultipleLocalRoles
(
parsed_query
);
if
(
result_list
)
{
if
(
result_list
)
{
query
=
undefined
;
query
=
undefined
;
local_roles
=
result_list
;
selection_domain
=
result_list
;
}
else
if
((
parsed_query
instanceof
ComplexQuery
)
&&
}
else
{
(
parsed_query
.
operator
===
'
AND
'
))
{
result_list
=
isMultipleLocalRoles
(
parsed_query
);
// portal_type:"Person" AND local_roles:"Assignee"
if
(
result_list
)
{
for
(
i
=
0
;
i
<
parsed_query
.
query_list
.
length
;
i
+=
1
)
{
query
=
undefined
;
sub_query
=
parsed_query
.
query_list
[
i
];
local_roles
=
result_list
;
}
else
if
((
parsed_query
instanceof
ComplexQuery
)
&&
result_list
=
isSingleLocalRoles
(
sub_query
);
(
parsed_query
.
operator
===
'
AND
'
))
{
if
(
result_list
)
{
local_roles
=
result_list
;
// portal_type:"Person" AND local_roles:"Assignee"
parsed_query
.
query_list
.
splice
(
i
,
1
);
// AND selection_domain_region:"europe/france"
query
=
Query
.
objectToSearchText
(
parsed_query
);
for
(
i
=
0
;
i
<
parsed_query
.
query_list
.
length
;
i
+=
1
)
{
i
=
parsed_query
.
query_list
.
length
;
sub_query
=
parsed_query
.
query_list
[
i
];
}
else
{
result_list
=
isMultipleLocalRoles
(
sub_query
);
if
(
!
local_role_found
)
{
result_list
=
isSingleLocalRoles
(
sub_query
);
if
(
result_list
)
{
local_roles
=
result_list
;
parsed_query
.
query_list
.
splice
(
i
,
1
);
query
=
jIO
.
Query
.
objectToSearchText
(
parsed_query
);
local_role_found
=
true
;
}
else
{
result_list
=
isMultipleLocalRoles
(
sub_query
);
if
(
result_list
)
{
local_roles
=
result_list
;
parsed_query
.
query_list
.
splice
(
i
,
1
);
query
=
jIO
.
Query
.
objectToSearchText
(
parsed_query
);
local_role_found
=
true
;
}
}
}
result_list
=
isSingleDomain
(
sub_query
);
if
(
result_list
)
{
if
(
result_list
)
{
local_roles
=
result_list
;
parsed_query
.
query_list
.
splice
(
i
,
1
);
parsed_query
.
query_list
.
splice
(
i
,
1
);
query
=
Query
.
objectToSearchText
(
parsed_query
);
query
=
jIO
.
Query
.
objectToSearchText
(
parsed_query
);
i
=
parsed_query
.
query_list
.
length
;
if
(
selection_domain
)
{
for
(
key
in
result_list
)
{
if
(
result_list
.
hasOwnProperty
(
key
))
{
selection_domain
[
key
]
=
result_list
[
key
];
}
}
}
else
{
selection_domain
=
result_list
;
}
i
-=
1
;
}
}
}
}
}
}
}
}
}
}
option_dict
.
query
=
query
;
option_dict
.
local_roles
=
local_roles
;
}
}
if
(
option_dict
.
sort_on
)
{
for
(
i
=
0
;
i
<
option_dict
.
sort_on
.
length
;
i
+=
1
)
{
if
(
options
.
sort_on
)
{
tmp_list
.
push
(
JSON
.
stringify
(
option_dict
.
sort_on
[
i
]));
for
(
i
=
0
;
i
<
options
.
sort_on
.
length
;
i
+=
1
)
{
sort_list
.
push
(
JSON
.
stringify
(
options
.
sort_on
[
i
]));
}
}
option_dict
.
sort_on
=
tmp_list
;
}
}
if
(
selection_domain
)
{
selection_domain
=
JSON
.
stringify
(
selection_domain
);
}
options
.
query
=
query
;
options
.
sort_on
=
sort_list
;
options
.
local_roles
=
local_roles
;
options
.
selection_domain
=
selection_domain
;
return
wrapJioCall
(
return
wrapJioCall
(
this
,
this
,
'
getAttachment
'
,
'
getAttachment
'
,
[
[
// XXX Ugly hardcoded meaningless id...
// XXX Ugly hardcoded meaningless id...
"
erp5
"
,
"
erp5
"
,
new
UriTemplate
.
parse
(
option
_dict
.
list_method_template
)
new
UriTemplate
.
parse
(
option
s
.
list_method_template
)
.
expand
(
option
_dict
),
.
expand
(
option
s
),
{
format
:
"
json
"
}
{
format
:
"
json
"
}
]
]
)
)
...
@@ -224,4 +274,4 @@
...
@@ -224,4 +274,4 @@
return
wrapJioCall
(
this
,
'
post
'
,
[
doc
]);
return
wrapJioCall
(
this
,
'
post
'
,
[
doc
]);
});
});
}(
window
,
rJS
,
RSVP
,
UriTemplate
,
URI
,
Query
,
SimpleQuery
,
ComplexQuery
,
jIO
));
}(
window
,
rJS
,
RSVP
,
UriTemplate
,
URI
,
SimpleQuery
,
ComplexQuery
,
jIO
));
\ No newline at end of file
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_jio_js.xml
View file @
dbd5c0d0
...
@@ -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
3.59331.40212.55432
</string>
</value>
<value>
<string>
96
5.65535.18355.17288
</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
12454358.3
3
</float>
<float>
15
20357812.7
3
</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