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
Bryan Kaperick
erp5
Commits
95f7985a
Commit
95f7985a
authored
Sep 25, 2015
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: show hidden items info in search text and optimize query creation
parent
08c2d1c8
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
32 deletions
+30
-32
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
...mplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
+18
-26
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
+3
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
...teItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
+9
-4
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
95f7985a
...
@@ -163,12 +163,10 @@
...
@@ -163,12 +163,10 @@
gadget.props.domain_tree = options.domain_tree;\n
gadget.props.domain_tree = options.domain_tree;\n
gadget.props.jio_key = options.jio_key;\n
gadget.props.jio_key = options.jio_key;\n
gadget.props.view = options.view;\n
gadget.props.view = options.view;\n
gadget.props.hide_item = options.hide_item;\n
if (options.sort_list) {\n
if (options.sort_list) {\n
gadget.props.sort_list = Object.keys(options.sort_list).map(function (key) {return options.sort_list[key]; });\n
gadget.props.sort_list = Object.keys(options.sort_list).map(function (key) {return options.sort_list[key]; });\n
}\n
}\n
if (options.hide_item) {\n
gadget.props.hide_item = Object.keys(options.hide_item).map(function (key) {return options.hide_item[key]; });\n
}\n
if (field_json.show_anchor) {\n
if (field_json.show_anchor) {\n
th = document.createElement("th");\n
th = document.createElement("th");\n
th.textContent = "Jump";\n
th.textContent = "Jump";\n
...
@@ -220,7 +218,7 @@
...
@@ -220,7 +218,7 @@
select_list = [],\n
select_list = [],\n
dataset,\n
dataset,\n
counter,\n
counter,\n
hide_item = gadget.props.hide_item
|| []
,\n
hide_item = gadget.props.hide_item,\n
tmp_hide_item,\n
tmp_hide_item,\n
sort_list = gadget.props.sort_list || [],\n
sort_list = gadget.props.sort_list || [],\n
i,\n
i,\n
...
@@ -263,23 +261,13 @@
...
@@ -263,23 +261,13 @@
\n
\n
\n
\n
\n
\n
if (hide_item.length >
0) {\n
if (hide_item) {\n
tmp_hide_item = "catalog.uid: (";\n
for (i = 0; i
< hide_item.length
;
i
+=
1)
{\n
tmp_hide_item
+=
hide_item[i];\n
if
(i
!==
hide_item.length
-
1)
{\n
tmp_hide_item
+=
",
";\n
}
else
{\n
tmp_hide_item
+=
")";\n
}\n
}\n
\n
if (query_string !== "") {\n
if (query_string !== "") {\n
query_string
+=
\'
AND
\'
+
tmp_
hide_item;\n
query_string += \' AND \' + hide_item;\n
} else if (field_json.list_method_template === undefined) {\n
} else if (field_json.list_method_template === undefined) {\n
query_string =
\'
AND
\'
+
tmp_
hide_item;\n
query_string = \' AND \' + hide_item;\n
} else {\n
} else {\n
query_string =
tmp_
hide_item;\n
query_string = hide_item;\n
}\n
}\n
}\n
}\n
\n
\n
...
@@ -512,6 +500,7 @@
...
@@ -512,6 +500,7 @@
.declareService(function () {\n
.declareService(function () {\n
var gadget = this,\n
var gadget = this,\n
selected_uid_list,\n
selected_uid_list,\n
selected_uid_query,\n
hide_form = gadget.props.element.querySelector(".hide_form");\n
hide_form = gadget.props.element.querySelector(".hide_form");\n
/* hide form */\n
/* hide form */\n
loopEventListener(\n
loopEventListener(\n
...
@@ -525,21 +514,24 @@
...
@@ -525,21 +514,24 @@
th,\n
th,\n
hide_form_elements,\n
hide_form_elements,\n
checkbox;\n
checkbox;\n
hide_form_elements = gadget.props.element.querySelectorAll(".hide_form_element");\n
\n
hide_form_elements = gadget.props.element.querySelectorAll(".hide_form_element:checked");\n
if (hide_form_elements.length > 0) {\n
if (hide_form_elements.length > 0) {\n
selected_uid_
list = []
;\n
selected_uid_
query = "catalog.uid: ("
;\n
for (i = 0; i
< hide_form_elements.length
;
i
+=
1)
{\n
for (i = 0; i
< hide_form_elements.length
;
i
+=
1)
{\n
if
(hide_form_elements[i].checked)
{\n
selected_uid_query
+=
hide_form_elements[i].parentElement.getAttribute("value");\n
selected_uid_list.push(hide_form_elements[i].parentElement.getAttribute("value"));\n
if
(i
!==
hide_form_elements.length
-
1)
{\n
selected_uid_query
+=
",
";\n
}
else
{\n
selected_uid_query
+=
")";\n
}\n
}\n
hide_form_elements[i].parentElement.removeChild(hide_form_elements[i]);\n
}\n
}\n
\n
\n
return
gadget.redirect({jio_key:
gadget.props.jio_key,\n
return
gadget.redirect({jio_key:
gadget.props.jio_key,\n
"extended_search":
gadget.props.extended_search
||
"",\n
"extended_search":
gadget.props.extended_search
||
"",\n
"domain_tree":
gadget.props.domain_tree
||
"",\n
"domain_tree":
gadget.props.domain_tree
||
"",\n
"sort_list":
gadget.props.sort_list
||
"",\n
"sort_list":
gadget.props.sort_list
||
"",\n
"hide_item":
selected_uid_
list
});\n
"hide_item":
selected_uid_
query
});\n
}\n
}\n
th =
document.createElement("th");\n
th =
document.createElement("th");\n
\n
\n
...
@@ -733,7 +725,7 @@
...
@@ -733,7 +725,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
945.6
2766.49396.353
2
</string>
</value>
<value>
<string>
945.6
4123.65425.2401
2
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -751,7 +743,7 @@
...
@@ -751,7 +743,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14431
03658.85
</float>
<float>
14431
85166.52
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_list_js.xml
View file @
95f7985a
...
@@ -170,6 +170,7 @@
...
@@ -170,6 +170,7 @@
}\n
}\n
if (options.hide_item) {\n
if (options.hide_item) {\n
form_options.form_definition.hide_item = options.hide_item;\n
form_options.form_definition.hide_item = options.hide_item;\n
search_options.hide_item = options.hide_item;\n
}\n
}\n
\n
\n
if (options.domain_tree) {\n
if (options.domain_tree) {\n
...
@@ -384,7 +385,7 @@
...
@@ -384,7 +385,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
945.6
1352.44246.61576
</string>
</value>
<value>
<string>
945.6
4053.62550.18722
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -402,7 +403,7 @@
...
@@ -402,7 +403,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14431
03764.9
</float>
<float>
14431
85583.96
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_searchfield_js.xml
View file @
95f7985a
...
@@ -145,6 +145,8 @@
...
@@ -145,6 +145,8 @@
var append_class,\n
var append_class,\n
append_attribute,\n
append_attribute,\n
placeholder = "",\n
placeholder = "",\n
value,\n
hide_value,\n
is_disabled = option_dict.disabled,\n
is_disabled = option_dict.disabled,\n
search_gadget = this;\n
search_gadget = this;\n
\n
\n
...
@@ -152,11 +154,14 @@
...
@@ -152,11 +154,14 @@
append_class = " ui-disabled";\n
append_class = " ui-disabled";\n
append_attribute = \' disabled="disabled\';\n
append_attribute = \' disabled="disabled\';\n
}\n
}\n
\n
value = option_dict.extended_search || "";\n
if (option_dict.hide_item) {\n
value = (value === ""? option_dict.hide_item : value + " AND " + option_dict.hide_item);\n
}\n
return new RSVP.Queue()\n
return new RSVP.Queue()\n
.push(function () {\n
.push(function () {\n
return search_gadget.translateHtml(panel_template({\n
return search_gadget.translateHtml(panel_template({\n
widget_value:
option_dict.extended_search || placeholder
,\n
widget_value:
value
,\n
widget_theme: option_dict.theme || "c",\n
widget_theme: option_dict.theme || "c",\n
widget_status_attribute: append_attribute || placeholder,\n
widget_status_attribute: append_attribute || placeholder,\n
widget_status_class: append_class || placeholder\n
widget_status_class: append_class || placeholder\n
...
@@ -348,7 +353,7 @@
...
@@ -348,7 +353,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
945.
13775.30295.6487
0
</string>
</value>
<value>
<string>
945.
64076.531.5533
0
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -366,7 +371,7 @@
...
@@ -366,7 +371,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
144
0164409.7
7
</float>
<float>
144
3183688.6
7
</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