Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
ecommerce-ui
Commits
525c2cc1
Commit
525c2cc1
authored
May 01, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app: add checkbox-based jio query including OR/AND handling
parent
a681a879
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
4 deletions
+32
-4
js/erp5_loader.js
js/erp5_loader.js
+32
-4
No files found.
js/erp5_loader.js
View file @
525c2cc1
...
...
@@ -2984,8 +2984,33 @@
// content.set..., no need for dynamic content and pointer
map
.
actions
=
{
"
custom_checkbox_search
"
:
function
(
obj
)
{
var
form_check_list
,
i
,
check_len
,
check
,
value_str
;
// TODO: it should be possible to inherit results so a dynamic listview
// could be child of a form, which is not dynamic!
form_check_list
=
obj
.
element
.
parentNode
.
parentNode
.
nextSibling
.
getElementsByTagName
(
"
input
"
);
value_str
=
""
;
for
(
i
=
0
,
check_len
=
form_check_list
.
length
;
i
<
check_len
;
i
+=
1
)
{
check
=
form_check_list
[
i
];
if
(
check
.
type
=
"
checkbox
"
&&
check
.
checked
)
{
value_str
+=
"
group=
"
+
check
.
id
.
split
(
"
select_
"
)[
1
]
+
"
|
"
;
}
}
$
.
mobile
.
changePage
(
"
#
"
+
window
.
encodeURIComponent
(
"
product_module&query:
"
+
value_str
.
slice
(
0
,
-
1
)
)
);
},
"
custom_search
"
:
function
(
obj
)
{
$
.
mobile
.
changePage
(
"
#
"
+
window
.
encodeURIComponent
(
"
product_module&value:
"
+
obj
.
element
.
value
));
$
.
mobile
.
changePage
(
"
#
"
+
window
.
encodeURIComponent
(
"
product_module&value:
"
+
obj
.
element
.
value
)
);
},
"
set_search
"
:
function
(
obj
)
{
...
...
@@ -4447,7 +4472,7 @@
// "foo" = "bar"
if
(
is_value
&&
key
)
{
obj
.
query
+=
'
AND (
'
+
key
+
'
: "
'
+
value
+
'
")
'
;
obj
.
query
+=
'
AND (
'
+
key
+
'
:
=
"
'
+
value
+
'
")
'
;
obj
.
start
=
0
;
obj
.
items
=
1
;
obj
.
restore
=
[
key
,
value
];
...
...
@@ -4465,7 +4490,7 @@
"
key
"
,
field_list
[
i
]
))
{
wrap
+=
field_list
[
i
]
+
'
: "
'
+
wrap
+=
field_list
[
i
]
+
'
:
=
"
'
+
obj
.
wildcard_character
+
value
+
obj
.
wildcard_character
+
'
" OR
'
;
...
...
@@ -4510,6 +4535,7 @@
obj
.
limit
=
[];
}
}
return
obj
;
};
...
...
@@ -7044,6 +7070,7 @@
* limit:start=0+items=5&
* sort:id=ascending+foo=descending&
* select:id+foo+baz+cous
* value:foo+bar+baz
*
* @method parseQueryParameter
* @param {string} str String to parse
...
...
@@ -7064,7 +7091,8 @@
switch
(
indicator
)
{
case
"
query
"
:
initial_query
.
query
=
param
[
1
].
replace
(
"
=
"
,
"
:=
"
,
"
g
"
)
.
replace
(
"
+
"
,
"
AND
"
,
"
g
"
);
.
replace
(
"
+
"
,
"
AND
"
,
"
g
"
)
.
replace
(
"
|
"
,
"
OR
"
,
"
g
"
);
break
;
case
"
limit
"
:
// NOTE: Thanks Tristan!
...
...
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