services:
    oro_task.listener.datagrid.user_tasks:
        class: Oro\Bundle\TaskBundle\EventListener\Datagrid\UserTaskGridListener
        arguments:
            - "@oro_security.token_accessor"
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.before.user-tasks-grid, method: onBuildBefore }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.user-tasks-grid, method: onBuildAfter }

    oro_task.listener.datagrid.activity:
        class: Oro\Bundle\TaskBundle\EventListener\Datagrid\ActivityGridListener
        arguments:
            - "@oro_activity.manager"
            - "@oro_entity.routing_helper"
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.activity-tasks-grid, method: onBuildAfter }

    oro_task.widget_provider.actions.assign_task:
        parent: oro_ui.widget_provider.action_button.abstract
        arguments:
            - oro_assign_task_button
            - oro_assign_task_link
        tags:
            - { name: oro_ui.view_action_provider, group: activity }

    oro_task.calendar_provider:
        class: Oro\Bundle\TaskBundle\Provider\TaskCalendarProvider
        arguments:
            - "@oro_entity.doctrine_helper"
            - "@oro_security.acl_helper"
            - "@oro_task.task.normalizer"
            - "@translator"
            - '%oro_task.calendar_provider.my_tasks.enabled%'
        tags:
            - { name: oro_calendar.calendar_provider, alias: tasks }

    oro_task.task.normalizer:
        class: Oro\Bundle\TaskBundle\Provider\TaskCalendarNormalizer
        arguments:
            - "@oro_reminder.entity.manager"

    oro_task.placeholder.filter:
        class: Oro\Bundle\TaskBundle\Placeholder\PlaceholderFilter
        public: true
        arguments:
            - '%oro_task.calendar_provider.my_tasks.enabled%'

    oro_task.activity_list.provider:
        class: Oro\Bundle\TaskBundle\Provider\TaskActivityListProvider
        arguments:
            - "@oro_entity.doctrine_helper"
            - "@oro_security.owner.entity_owner_accessor.link"
            - "@oro_activity.association_helper"
            - "@oro_comment.association_helper"
        tags:
            - { name: oro_activity_list.provider, class: Oro\Bundle\TaskBundle\Entity\Task, priority: 20 }

    oro_task.validator.due_date_required:
        class: Oro\Bundle\TaskBundle\Validator\DueDateRequiredValidator
        tags:
            - { name: validator.constraint_validator, alias: oro_task.due_date_required_validator }

    oro_task.set_created_by_listener.listener:
        class: Oro\Bundle\TaskBundle\EventListener\SetCreatedByListener
        arguments:
            - '@security.token_storage'
        tags:
            - { name: doctrine.orm.entity_listener, entity: 'Oro\Bundle\TaskBundle\Entity\Task', event: prePersist }

    oro_task.form.form_template_data_provider.task:
        class: Oro\Bundle\TaskBundle\Form\TaskFormTemplateDataProvider
        public: false
        arguments:
            - '@router'
        tags:
            - { name: oro_form.form_template_data_provider, alias: oro_task_update }
