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
amrani
erp5
Commits
3bc0bec8
Commit
3bc0bec8
authored
Nov 24, 2015
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Add custom list method compatibility support for the local_roles parameter
parent
e5a44f2c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
87 additions
and
5 deletions
+87
-5
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
+87
-5
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_jio_js.xml
View file @
3bc0bec8
...
@@ -101,9 +101,9 @@
...
@@ -101,9 +101,9 @@
<key>
<string>
text_content
</string>
</key>
<key>
<string>
text_content
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
<value>
<string
encoding=
"cdata"
>
<![CDATA[
/*global window, rJS, RSVP, UriTemplate, URI */\n
/*global window, rJS, RSVP, UriTemplate, URI
, objectToSearchText, SimpleQuery, ComplexQuery, jIO
*/\n
/*jslint indent: 2, maxerr: 3, nomen: true */\n
/*jslint indent: 2, maxerr: 3, nomen: true */\n
(function (window, rJS, RSVP, UriTemplate, URI) {\n
(function (window, rJS, RSVP, UriTemplate, URI
, objectToSearchText, SimpleQuery, ComplexQuery, jIO
) {\n
"use strict";\n
"use strict";\n
\n
\n
function wrapJioCall(gadget, method_name, argument_list) {\n
function wrapJioCall(gadget, method_name, argument_list) {\n
...
@@ -117,6 +117,38 @@
...
@@ -117,6 +117,38 @@
throw error;\n
throw error;\n
});\n
});\n
}\n
}\n
\n
function isSingleLocalRoles(parsed_query) {\n
if ((parsed_query instanceof SimpleQuery) &&\n
(parsed_query.key === \'local_roles\')) {\n
// local_roles:"Assignee"\n
return parsed_query.value;\n
}\n
}\n
\n
function isMultipleLocalRoles(parsed_query) {\n
var i,\n
sub_query,\n
is_multiple = true,\n
local_role_list = [];\n
if ((parsed_query instanceof ComplexQuery) &&\n
(parsed_query.operator === \'OR\')) {\n
\n
for (i = 0; i < parsed_query.query_list.length; i += 1) {\n
sub_query = parsed_query.query_list[i];\n
if ((sub_query instanceof SimpleQuery) &&\n
(sub_query.key === \'local_roles\')) {\n
local_role_list.push(sub_query.value);\n
} else {\n
is_multiple = false;\n
}\n
}\n
if (is_multiple) {\n
// local_roles:"Assignee" OR local_roles:"Assignor"\n
return local_role_list;\n
}\n
}\n
}\n
\n
\n
rJS(window)\n
rJS(window)\n
\n
\n
...
@@ -155,6 +187,56 @@
...
@@ -155,6 +187,56 @@
if (option_dict.list_method_template === undefined) {\n
if (option_dict.list_method_template === undefined) {\n
return wrapJioCall(this, \'allDocs\', arguments);\n
return wrapJioCall(this, \'allDocs\', arguments);\n
}\n
}\n
\n
var query = option_dict.query,\n
i,\n
parsed_query,\n
sub_query,\n
result_list,\n
local_roles;\n
if (option_dict.query) {\n
parsed_query = jIO.QueryFactory.create(option_dict.query);\n
\n
result_list = isSingleLocalRoles(parsed_query);\n
if (result_list) {\n
query = undefined;\n
local_roles = result_list;\n
} else {\n
\n
result_list = isMultipleLocalRoles(parsed_query);\n
if (result_list) {\n
query = undefined;\n
local_roles = result_list;\n
} else if ((parsed_query instanceof ComplexQuery) &&\n
(parsed_query.operator === \'AND\')) {\n
\n
// portal_type:"Person" AND local_roles:"Assignee"\n
for (i = 0; i < parsed_query.query_list.length; i += 1) {\n
sub_query = parsed_query.query_list[i];\n
\n
result_list = isSingleLocalRoles(sub_query);\n
if (result_list) {\n
local_roles = result_list;\n
parsed_query.query_list.splice(i, 1);\n
query = objectToSearchText(parsed_query);\n
i = parsed_query.query_list.length;\n
} else {\n
result_list = isMultipleLocalRoles(sub_query);\n
if (result_list) {\n
local_roles = result_list;\n
parsed_query.query_list.splice(i, 1);\n
query = objectToSearchText(parsed_query);\n
i = parsed_query.query_list.length;\n
}\n
}\n
}\n
}\n
\n
}\n
option_dict.query = query;\n
option_dict.local_roles = local_roles;\n
}\n
\n
return wrapJioCall(\n
return wrapJioCall(\n
this,\n
this,\n
\'getAttachment\',\n
\'getAttachment\',\n
...
@@ -198,7 +280,7 @@
...
@@ -198,7 +280,7 @@
return wrapJioCall(this, \'putAttachment\', [id, name, JSON.stringify(json)]);\n
return wrapJioCall(this, \'putAttachment\', [id, name, JSON.stringify(json)]);\n
});\n
});\n
\n
\n
}(window, rJS, RSVP, UriTemplate, URI));
}(window, rJS, RSVP, UriTemplate, URI
, objectToSearchText, SimpleQuery, ComplexQuery, jIO
));
]]>
</string>
</value>
]]>
</string>
</value>
</item>
</item>
...
@@ -335,7 +417,7 @@
...
@@ -335,7 +417,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
6.56060.11774.33006
</string>
</value>
<value>
<string>
94
7.15020.24457.52667
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -353,7 +435,7 @@
...
@@ -353,7 +435,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
144
6547368.37
</float>
<float>
144
8016802.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