Open mary2501 opened 6 years ago
Hello,
datagrids.yml
....
action_configuration:
enable_user: false
reset_password: false
disable_user: false
works.
Thank you @manowark, I tried also this solution but it's not working. Has worked for you?
For which grid you trying this? For users-grid
?
For this grid used Oro\Bundle\UserBundle\Datagrid\ActionChecker
which returns array like above.
Maybe you need to change it?
I have created a my personal user-grid like this
datagrids:
my-grid:
source:
type: orm
query:
select:
- u.id
- u.email
- u.firstName
- u.lastName
- >
(CASE WHEN (:client IS NOT NULL) THEN
CASE WHEN u.id IN (:data_in) AND u.id NOT IN (:data_not_in)
THEN true ELSE false END
ELSE
CASE WHEN u.id IN (:data_in) AND u.id NOT IN (:data_not_in)
THEN true ELSE false END
END) as hasProperty
from:
- { table: Oro\Bundle\UserBundle\Entity\User, alias: u }
bind_parameters:
-
name: client
default: null
columns:
hasProperty:
label: hasProperty
editable: true
frontend_type: boolean
firstName:
label: firstName
lastName:
label: lastName
email:
label: email
id:
renderable: false
properties:
id: ~
sorters:
columns:
hasProperty: { data_name: hasProperty }
default:
hasProperty: DESC
options:
routerEnabled: false
rowSelection:
dataField: id
columnName: hasProperty
selectors:
included: '#append'
excluded: '#remove'
Where is it displayed? I mean page, route, for which entity?
In a widget.. Has a same behaviour when click add contacts in this url: https://demo.orocrm.com/desktop/account/update/42?grid[accountsgrid]=i%3D1%26p%3D25%26s%255Bname%255D%3D-1%26c%3Did0.name1.contactName1.contactEmail1.contactPhone1.ownerName1.createdAt1.updatedAt1.tags1%26v%3D__all__%26a%3Dgrid
But when click 'add', ORO add the red areas
Now I understand. For your case action_configuration
not enough.
This three operations configured as mass_action
for datagrid and in 2.6 version (I think it is your version) have next configuration: https://github.com/oroinc/platform/blob/2.6/src/Oro/Bundle/UserBundle/Resources/config/oro/actions.yml#L181-L182. It is already fixed in master branch.
So, I think, your first solution is the most correct for 2.6 version of application.
Just add to Acme/Bundle/YourCustomBundle/Resources/config/oro/actions.yml
operations:
reset_password:
exclude_datagrids:
- my_datagrid_name
user_enable:
exclude_datagrids:
- my_datagrid_name
user_disable:
exclude_datagrids:
- my_datagrid_name
I added in my datagrid configuration the following lines to disable some actions added automatically by ORO when using the User class
but it's not working.
I finally have find a solution adding the following lines in actions.yml to disable some actions written in oro/platform/src/Oro/Bundle/UserBundle/Resources/config/oro/actions.yml