services:
    oro_call.event_listener.datagrid.call:
        class: Oro\Bundle\CallBundle\EventListener\Datagrid\CallListener
        arguments:
          - "@doctrine.orm.entity_manager"
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.before.widget-base-calls-grid, method: onBuildBefore }
            - { name: kernel.event_listener, event: oro_datagrid.datagrid.build.after.widget-base-calls-grid, method: onBuildAfter }

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

    oro_call.listener.entity_listener:
        class: Oro\Bundle\CallBundle\EventListener\EntityListener
        arguments:
            - "@oro_call.call.activity.manager"
        tags:
            - { name: doctrine.event_listener, event: onFlush }

    oro_call.call.activity.manager:
        class: Oro\Bundle\CallBundle\Entity\Manager\CallActivityManager
        arguments:
            - "@oro_activity.manager"

    oro_call.activity_list.provider:
        class: Oro\Bundle\CallBundle\Provider\CallActivityListProvider
        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\CallBundle\Entity\Call, priority: 10 }

    oro_call.placeholder.log_call.filter:
        class: Oro\Bundle\CallBundle\Placeholder\LogCallPlaceholderFilter
        public: true
        arguments:
            - "@oro_activity.manager"

    oro_call.twig.call_extension:
        class: Oro\Bundle\CallBundle\Twig\OroCallExtension
        public: false
        arguments:
            - "@oro_platform.twig.service_locator"
        tags:
            - { name: twig.extension }

    oro_call.event_listener.datagrid.my_contacts_activity:
        class: Oro\Bundle\UserBundle\Datagrid\WidgetOwnerListener
        arguments:
            - '@oro_user.dashboard.owner_helper'
            - '@oro_dashboard.widget_configs'
            - 'owner'
        tags:
            - { name: kernel.event_listener, event: oro_datagrid.orm_datasource.result.before.dashboard-recent-calls-grid, method: onResultBefore }
