Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
centreon
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Groupe EDF
Public
centreon
Commits
a63cc10a
Commit
a63cc10a
authored
Feb 28, 2018
by
Jean-Baptiste
Committed by
loiclau
Feb 28, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add views - Filter And Sort (#6054)
* Fix filter bug in adding views and sorting views.
parent
e18a6c88
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
www/api/class/centreon_home_customview.class.php
www/api/class/centreon_home_customview.class.php
+11
-2
No files found.
www/api/class/centreon_home_customview.class.php
View file @
a63cc10a
...
...
@@ -53,6 +53,11 @@ class CentreonHomeCustomview extends CentreonWebService
{
global
$centreon
;
$views
=
array
();
$q
=
array
();
if
(
isset
(
$this
->
arguments
[
'q'
])
&&
$this
->
arguments
[
'q'
]
!=
''
)
{
$q
[]
=
'%'
.
$this
->
arguments
[
'q'
]
.
'%'
;
}
$query
=
'SELECT custom_view_id, name FROM ('
.
'SELECT cv.custom_view_id, cv.name FROM custom_views cv '
.
'INNER JOIN custom_view_user_relation cvur ON cv.custom_view_id = cvur.custom_view_id '
.
...
...
@@ -69,9 +74,13 @@ class CentreonHomeCustomview extends CentreonWebService
'WHERE d.custom_view_id NOT IN ('
.
'SELECT cvur2.custom_view_id FROM custom_view_user_relation cvur2 '
.
'WHERE cvur2.user_id = '
.
$centreon
->
user
->
user_id
.
' '
.
'AND cvur2.is_consumed = 1) '
;
'AND cvur2.is_consumed = 1) '
.
(
count
(
$q
)
>
0
?
'AND d.name like ? '
:
''
)
.
') tmp ORDER BY tmp.name'
;
$stmt
=
$this
->
pearDB
->
prepare
(
$query
);
$dbResult
=
$this
->
pearDB
->
execute
(
$stmt
,
$q
);
$dbResult
=
$this
->
pearDB
->
query
(
$query
);
while
(
$row
=
$dbResult
->
fetch
())
{
$views
[]
=
array
(
'id'
=>
$row
[
'custom_view_id'
],
...
...
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