Commit eafe2f02 authored by Guillaume28's avatar Guillaume28

fix(customview): Fix share custom view (#6109)

parent 977563e9
......@@ -7,12 +7,14 @@ Feature: Custom views
Given I am logged in a Centreon server with some widgets
# public views
@critical
Scenario: Share public custom view
Given a publicly shared custom view
When a user wishes to add a new custom view
Then he can add the public view
And he cannot modify the content of the shared view
@critical
Scenario: Remove public share
Given a publicly shared custom view
And a user is using the public view
......@@ -20,6 +22,7 @@ Feature: Custom views
Then the view is not visible anymore
And the user can use the public view again
@critical
Scenario: Remove public share by owner
Given a publicly shared custom view
And a user is using the public view
......@@ -27,12 +30,14 @@ Feature: Custom views
Then the view is not visible anymore for the user
# user shared locked views
@critical
Scenario: Share read-only custom view with users
Given a custom view shared in read only with a user
When the user wishes to add a new custom view
Then he can add the shared view
And he cannot modify the content of the shared view
@critical
Scenario: Remove read-only custom view shared with users
Given a custom view shared in read only with a user
And the user is using the shared view
......@@ -40,12 +45,14 @@ Feature: Custom views
Then the view is not visible anymore
And the user can use the shared view again
@critical
Scenario: Update a read only custom view shared with users
Given a custom view shared in read only with a user
And the user is using the shared view
When the owner modifies the custom view
Then the changes are reflected on all users displaying the custom view
@critical
Scenario: Delete a shared custom view
Given a custom view shared in read only with a user
And the user is using the shared view
......@@ -53,11 +60,13 @@ Feature: Custom views
Then the view is removed for all users displaying the custom view
# user shared not locked views
@critical
Scenario: Modify a shared view
Given a shared custom view
When the user is using the shared view
Then he can modify the content of the shared view
@critical
Scenario: Remove an unlocked shared view
Given a shared custom view
And the user is using the shared view
......@@ -65,6 +74,7 @@ Feature: Custom views
Then the view is not visible anymore
And the user can use the shared view again
@critical
Scenario: Modify an unlocked shared view and applies changes
Given a shared custom view
And the user is using the shared view
......@@ -72,6 +82,7 @@ Feature: Custom views
Then the changes are reflected on all users displaying the custom view
#Then a warning is shown to the user who wants to apply the changes
@critical
Scenario: Deletion of an unlocked shared view
Given a shared custom view
And the user is using the shared view
......@@ -80,12 +91,14 @@ Feature: Custom views
And the view is removed for the owner
# contact groups shared locked views
@critical
Scenario: Share read-only custom view with groups
Given a custom view shared in read only with a group
When the user wishes to add a new custom view
Then he can add the shared view
And he cannot modify the content of the shared view
@critical
Scenario: Remove read-only custom view shared with groups
Given a custom view shared in read only with a group
And the user is using the shared view
......@@ -93,12 +106,14 @@ Feature: Custom views
Then the view is not visible anymore
And the user can use the shared view again
@critical
Scenario: Update a read only custom view shared with groups
Given a custom view shared in read only with a group
And the user is using the shared view
When the owner modifies the custom view
Then the changes are reflected on all users displaying the custom view
@critical
Scenario: Delete a shared custom view with groups
Given a custom view shared in read only with a group
And the user is using the shared view
......@@ -106,11 +121,13 @@ Feature: Custom views
Then the view is removed for all users displaying the custom view
# contact groups shared not locked views
@critical
Scenario: Modify a shared view with groups
Given a shared custom view with a group
When the user is using the shared view
Then he can modify the content of the shared view
@critical
Scenario: Remove an unlocked shared view with groups
Given a shared custom view with a group
And the user is using the shared view
......@@ -118,6 +135,7 @@ Feature: Custom views
Then the view is not visible anymore
And the user can use the shared view again
@critical
Scenario: Modify an unlocked shared view with groups and applies changes
Given a shared custom view with a group
And the user is using the shared view
......@@ -125,6 +143,7 @@ Feature: Custom views
Then the changes are reflected on all users displaying the custom view
#Then a warning is shown to the user who wants to apply the changes
@critical
Scenario: Deletion of an unlocked shared view with groups
Given a shared custom view with a group
And the user is using the shared view
......
......@@ -76,12 +76,12 @@ class CentreonHomeCustomview extends CentreonWebService
'WHERE cvur2.user_id = ' . $centreon->user->user_id . ' ' .
'AND cvur2.is_consumed = 1) ' .
(count($q) > 0 ? 'AND d.name like ? ' : '') .
') tmp ORDER BY tmp.name';
'ORDER BY name';
$stmt = $this->pearDB->prepare($query);
$dbResult = $this->pearDB->execute($stmt, $q);
while ($row = $dbResult->fetch()) {
while ($row = $dbResult->fetchRow()) {
$views[] = array(
'id' => $row['custom_view_id'],
'text' => $row['name']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment