git clone https://github.com/ignat-s/crm-application.git
composer install --prefer-dist
app/console oro:install --env=dev --user-name=admin --user-email=admin@example.com --user-firstname=John --user-lastname=Doe --user-password=admin --sample-data=n --force
app/console oro:install --env=test --user-name=admin --user-email=admin@example.com --user-firstname=John --user-lastname=Doe --user-password=admin --sample-data=n
используй бд с другим именем, например orocrm_test
после этого запусти
app/console doctrine:fixture:load --no-debug --append --no-interaction --env=test --fixtures vendor/oro/platform/src/Oro/src/Oro/Bundle/TestFrameworkBundle/Fixtures
- Configure PHP (Settings > PHP)
- Configure tests (Edit configuration > Defaults > PHPUnit)
- Exclude app/cache
See detailed information https://github.com/ignat-s/crm-application/tree/master
git submodule add https://github.com/ignat-s/Acme.git src/Acme
- Add submodule git submodule add https://github.com/ignat-s/Acme.git src/Acme
- Create bundle class Acme\Bundle\TaskBundle\AcmeTaskBundle
- Create extension class Acme\Bundle\TaskBundle\DependencyInjection\AcmeTaskExtension
- Add Acme/Bundle/TaskBundle/Resources/config/services.yml
- Add Acme/Bundle/TaskBundle/Resources/translations/messages.en.yml
Create Acme/Bundle/TaskBundle/Resources/config/oro/bundles.yml
bundles:
- Acme\Bundle\TaskBundle\AcmeTaskBundle
Update cache:
app/console cache:clear
- Create Task entity (id, title, description, related contact, status, assignee, owner, created at, updated at)
- Create TaskStatus entity (name, label)
- Create data fixture for statuses (open, closed, in progress)
- Update database schema
app/console doctrine:schema:update --dump-sql
app/console doctrine:schema:update --force
- Load fixtures of statuses
app/console doctrine:fixture:load --fixtures src/Acme/src/Acme/Bundle/TaskBundle/DataFixtures/ --append
- Add grid config Acme/Bundle/TaskBundle/Resources/config/datagrid.yml
- Add controller class Acme\Bundle\TaskBundle\Controller\TaskController
- Add Acme/Bundle/TaskBundle/Resources/config/oro/routing.yml
- Add template Acme/Bundle/TaskBundle/Resources/views/Task/index.html.twig
- Demonstrate tasks grid
- Create form type Acme\Bundle\TaskBundle\Form\Type\TaskType (title, status, description, assignee, owner)
- Create Acme/Bundle/TaskBundle/Resources/config/validation.yml
- Create controller actions
- Add create button to template Acme/Bundle/TaskBundle/Resources/views/Task/index.html.twig
- Create template Acme/Bundle/TaskBundle/Resources/views/Task/update.html.twig
- Demonstrate create/edit task
- Add task view page
- Add controller action
- Add Acme/Bundle/TaskBundle/Resources/views/Task/view.html.twig
- Add actions
- Add properties
- Add "Acme" and "Tasks" items into application menu
- Add "Show tasks list" and "Create new task" items into shortcuts
- Add oro_titles with titles for index, create, view, update
- Run app/console oro:navigation:init
- Add oro_title_set to Acme/Bundle/TaskBundle/Resources/views/Task/index.html.twig
- Add oro_title_set to Acme/Bundle/TaskBundle/Resources/views/Task/view.html.twig
- Add oro_title_set to Acme/Bundle/TaskBundle/Resources/views/Task/update.html.twig
- Add annotation to Task @Config( defaultValues={ "ownership"={ "owner_type"="USER", "owner_field_name"="owner", "owner_column_name"="owner_id" }, "security"={ "type"="ACL" } } )
- Run command app/console oro:entity-config:update
- Remove owner from form type as it's automatically added
- Remove owner validation.yml as this constraint is embedded in field that automatically added
- Add ACL annotations to TaskController
- Go to roles and check Task entity
- Change VIEW permission in Administrator role for Task from System to User and check how grid automatically protects users, change VIEW to System again
- Change EDIT permission in Administrator role for Task from System to User and check permission error when you click on edit users
- Add ACL annotations to datagrid.yml
- Go to Task that is not with your owner and click edit to show permission error
- Add ACL checks to templates
- Add search.yml
- Add Acme/Bundle/TaskBundle/Resources/views/Task/searchResult.html.twig
- Demonstrate search
- Add formatting of owner and assignee name on the task view
- Add formatting of created at/updated at the task search result
- Show other twig function for formatting: oro_format_address, oro_format_datetime, oro_format_date, oro_format_time, oro_format_name, oro_format_number, oro_format_currency, oro_format_decimal, oro_format_percent, oro_format_spellout, oro_format_duration, oro_format_ordinal
- Add Loggable annotation to Task and "dataaudit"={"auditable"=true}
- Add to Task fields
- @Oro\Versioned
- @ConfigField(defaultValues={"dataaudit"={"auditable"=true}})
- Run commands to update config cache:clear oro:entity-config:init oro:entity-config:update
- Demonstrate how auditable works
- Add JMS annotations to Task
- Add Acme/Bundle/TaskBundle/Controller/Api/Rest/TaskController
- Run cache:clear to warmup Acl annotations
- Update Acme/Bundle/TaskBundle/Resources/config/oro/routing.yml with api
- Check http://orocrm-training.local/app_dev.php/api/doc/ and demonstrate how it works
- Add delete_link property and delete action to datagrid.yml
- Add delete button to task view
- Add Acme\Bundle\TaskBundle\DependencyInjection\Configuration
- Update Acme\Bundle\TaskBundle\DependencyInjection\AcmeTaskExtension
- Add Acme/Bundle/TaskBundle/Resources/config/system_configuration.yml
- Go to System -> Configuration and check new settings
- Update cron in OS sudo crontab -e */1 * * * * /usr/local/bin/php /path/to/app/console --env=prod oro:cron >> /dev/null
- Update messages.en.yml
- Add Acme\Bundle\TaskBundle\Entity\Repository\TaskRepository and update Task entity Entity annotation
- Add Acme\Bundle\TaskBundle\Model\Statistics
- Update services.yml with acme_task.statistics service
- Add Acme\Bundle\TaskBundle\Command\SendStatisticsCommand
- Add AcmeTaskBundle:Task:statisticsMail.txt.twig
- Go to System -> Job Queue and check job executions
- Configure SMPT
- Add Acme/Bundle/TaskBundle/Resources/config/entity_output.yml with data of Task entity
- Add template to Acme/Bundle/TaskBundle/DataFixtures/data/email/create_task.html.twig
- Add Acme\Bundle\TaskBundle\DataFixtures\ORM\LoadEmailTemplates
- Update @ConfigField in Task to support "email"={"available_in_template"=true}
- Load email templates app/console doctrine:fixture:load --append --fixtures src/OroAcme/src/Acme/Bundle/TaskBundle/DataFixtures/ORM/
- Go to System -> Emails -> Templates and check created template
- Go to System -> Notification -> Create notification rule
- Create task and check email
- Add Acme/Bundle/TaskBundle/Resources/public/sidebar_widgets/assigned_tasks/widget.yml
- Add Acme/Bundle/TaskBundle/Resources/public/sidebar_widgets/assigned_tasks/js/widget.js
- Add requirejs.yml
- Run commands cache:clear oro:requirejs:build
- Add Acme/Bundle/TaskBundle/Resources/translations/jsmessages.en.yml
- Add
- Update app/config.yml fos_js_routing: routes_to_expose: [oro_, acme_]
- Run commands app/console fos:js-routing:dump --target web/js/routes.js app/console cache:clear
- Add Acme/Bundle/TaskBundle/Resources/public/css/acme.less
- Run commands app/console assetic:dump
- Update TaskController, add method getAssignedTasksAction
- Add extend ExtendTask
- Create string field
- Check datagrid, it should have a new column
- Update Acme/Bundle/TaskBundle/Resources/views/Task/update.html.twig and check edit form
- Update Acme/Bundle/TaskBundle/Resources/views/Task/view.html.twig and check view page
- Update Acme/Bundle/TaskBundle/Resources/config/datagrid.yml and add acme_task_assigned_tasks_grid
- Add placeholder in Acme/Bundle/TaskBundle/Resources/config/placeholders.yml
- Run command cache:clear
- Add template Acme/Bundle/TaskBundle/Resources/views/Task/assignedTasks.html.twig with content of placeholder 5 Add controller action Acme/Bundle/TaskBundle/Controller/TaskController::assignedTasks
- Add template Acme/Bundle/TaskBundle/Resources/views/Task/widget/assignedTasks.html.twig with content widget
- Add Acme\Bundle\TaskBundle\EventListener\Datagrid\AssignedTasksListener and update services.yml
- Demonstrate grid
- Add Acme\Bundle\TaskBundle\Twig\AcmeTaskExtension and update services.yml
- Update Acme/Bundle/TaskBundle/Resources/config/placeholders.yml with placeholder of create buttons
- Run command cache:clear
- Add Acme/Bundle/TaskBundle/Resources/views/Task/createUserTaskButton.html.twig
- Update action Acme/Bundle/TaskBundle/Controller/TaskController::createAction to use assigneeId
Questions and notes.
ACL:
- Do we need to execute command php app/console init:acl (http://symfony.com/doc/current/cookbook/security/acl.html)
- What do we support "
- Class-Scope: Allows to set permissions for all objects with the same type.
- Object-Scope: Allows to set permissions for one specific object.
- Class-Field-Scope: Allows to set permissions for all objects with the same type, but only to a specific field of the objects.
- Object-Field-Scope: Allows to set permissions for a specific object, and only to a specific field of that object. "
- What is the difference created in BU and assigned to BU?
- Business Unit ownersip type invalid image Mike was create Account C and make Second BU as owner, Robert was create Account D and make Child BU as owner
- All records in datagrids automatically protect with access levels?
- https://github.com/laboro/platform/blob/master/src/Oro/Bundle/SecurityBundle/Resources/doc/acl-manager.md entity: AcmeBundle:AcmeEntity Entity:AcmeBundle:SomeEntity
- After the setting new ACL permissions to an object, the changes must be saved. It can be done with flush function
- https://github.com/laboro/platform/blob/master/src/Oro/Bundle/SecurityBundle/Resources/doc/implementation.md "permissions"="VIEW;EDIT"
- @Acl annotations only on controllers?
bindings: - { class: someClass, method: someMethod} 11. Is it required to set id and where it's used?7
* @Acl(
* id="acme_task_view",
* type="entity",
* class="AcmeTaskBundle:Task",
* permission="VIEW"
* )
- After annotations are added do we need to execute any command?
- Ownership is required in most cases?
- Can ownership be changed by other bundle?
- Flush is required after changing acl permission is it means that ACL works using Doctrine (in Symfony's original ACL they use PDO directly)
- acl_resource in grid?
Search:
- Why we need all_data in target fields?
- How search works
Notes:
- Translation issues, for example OroUser:User:index.html.twig when using addButton
- Translation of entities is not convenient and will not work in all languages: 'Update'|trans ~ ' ' ~ 'oro.user.grouAclManagerp.entity_label'|trans 'New'|trans ~ ' ' ~ 'oro.user.group.entity_label'|trans
Search
- If "search_template" option is missing error occurred An exception has been thrown during the rendering of a template ("Trying to access not existing parameter: "template"") in OroSearchBundle:Search:searchResults.html.twig at line 49.
- If "title_fields" is empty error displayed on search result page: Catchable fatal error: Object of class Acme\Bundle\TaskBundle\Entity\Task could not be converted to string in /home/ignat/dev/orocrm-training/vendor/oro/platform/src/Oro/Bundle/SearchBundle/EventListener/PrepareResultItemListener.php on line 134
- Search.yml files are not validated
Cron
- Run daemon in UI?
- Updating cron schedule of command is not supported?
- Command to run cron in bash in invalid?