|
@@ -1,83 +0,0 @@
|
|
|
-<?php
|
|
|
-
|
|
|
-namespace WorkflowBundle\Admin;
|
|
|
-
|
|
|
-use Base\AdminBundle\Admin\BaseAdmin;
|
|
|
-use Sonata\AdminBundle\Datagrid\DatagridMapper;
|
|
|
-use Sonata\AdminBundle\Datagrid\ListMapper;
|
|
|
-use Sonata\AdminBundle\Form\FormMapper;
|
|
|
-use Sonata\AdminBundle\Show\ShowMapper;
|
|
|
-use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
|
|
-use \WorkflowBundle\Utils\DoctrineEvents;
|
|
|
-use \WorkflowBundle\Utils\WorkFlowEntityClasses;
|
|
|
-
|
|
|
-class Doctrine2WorkFlowActionAdmin extends BaseAdmin
|
|
|
-{
|
|
|
-
|
|
|
- /**
|
|
|
- * @param DatagridMapper $datagridMapper
|
|
|
- */
|
|
|
- protected function configureDatagridFilters(DatagridMapper $datagridMapper)
|
|
|
- {
|
|
|
- $datagridMapper
|
|
|
- ->add('name')
|
|
|
- ->add('eventName')
|
|
|
- ->add('entityClass')
|
|
|
- ;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @param ListMapper $listMapper
|
|
|
- */
|
|
|
- protected function configureListFields(ListMapper $listMapper)
|
|
|
- {
|
|
|
- $listMapper
|
|
|
- ->add('name')
|
|
|
- ->add('eventName')
|
|
|
- ->add('entityClass')
|
|
|
- ->add('actions')
|
|
|
- ->add('_action', null, array(
|
|
|
- 'actions' => array(
|
|
|
- 'show' => array(),
|
|
|
- 'edit' => array(),
|
|
|
- 'delete' => array(),
|
|
|
- )
|
|
|
- ))
|
|
|
- ;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @param FormMapper $formMapper
|
|
|
- */
|
|
|
- protected function configureFormFields(FormMapper $formMapper)
|
|
|
- {
|
|
|
- $formMapper
|
|
|
- ->add('name')
|
|
|
- ->add('eventName', ChoiceType::class, array(
|
|
|
- 'choices' => DoctrineEvents::getDoctrineEventChoices(),
|
|
|
- ))
|
|
|
- ->add('entityClass', ChoiceType::class, array(
|
|
|
- 'choices' => WorkFlowEntityClasses::getChoices(),
|
|
|
- ))
|
|
|
- ->add('actions', null, array(
|
|
|
- 'multiple' => true,
|
|
|
- 'expanded' => true,
|
|
|
- 'by_reference' => false
|
|
|
- ))
|
|
|
- ;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * @param ShowMapper $showMapper
|
|
|
- */
|
|
|
- protected function configureShowFields(ShowMapper $showMapper)
|
|
|
- {
|
|
|
- $showMapper
|
|
|
- ->add('name')
|
|
|
- ->add('eventName')
|
|
|
- ->add('entityClass')
|
|
|
- ->add('actions')
|
|
|
- ;
|
|
|
- }
|
|
|
-
|
|
|
-}
|