|
@@ -8,6 +8,7 @@ use Sonata\AdminBundle\Datagrid\ListMapper;
|
|
use Sonata\AdminBundle\Form\FormMapper;
|
|
use Sonata\AdminBundle\Form\FormMapper;
|
|
use Sonata\AdminBundle\Show\ShowMapper;
|
|
use Sonata\AdminBundle\Show\ShowMapper;
|
|
use Symfony\Component\Yaml\Yaml;
|
|
use Symfony\Component\Yaml\Yaml;
|
|
|
|
+use WorkflowBundle\Utils\WorkFlowEntityClasses;
|
|
|
|
|
|
class WorkflowAdmin extends BaseAdmin
|
|
class WorkflowAdmin extends BaseAdmin
|
|
{
|
|
{
|
|
@@ -63,6 +64,14 @@ class WorkflowAdmin extends BaseAdmin
|
|
protected function configureFormFields(FormMapper $formMapper)
|
|
protected function configureFormFields(FormMapper $formMapper)
|
|
{
|
|
{
|
|
|
|
|
|
|
|
+ $_supports = WorkFlowEntityClasses::getClass();
|
|
|
|
+ $supports = array();
|
|
|
|
+ foreach($_supports as $key => $class) {
|
|
|
|
+ if(class_exists($key)) {
|
|
|
|
+ $supports[$key] = $key;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
$formMapper
|
|
$formMapper
|
|
->add('name')
|
|
->add('name')
|
|
->add('description')
|
|
->add('description')
|
|
@@ -70,6 +79,7 @@ class WorkflowAdmin extends BaseAdmin
|
|
->add('type', 'choice', array('choices' => array('state_machine' => 'state_machine', 'workflow' => 'workflow')))
|
|
->add('type', 'choice', array('choices' => array('state_machine' => 'state_machine', 'workflow' => 'workflow')))
|
|
->add('markingType', 'choice', array('choices' => array('single_state' => 'single_state', 'multiple_state' => 'multiple_state')))
|
|
->add('markingType', 'choice', array('choices' => array('single_state' => 'single_state', 'multiple_state' => 'multiple_state')))
|
|
->add('markingName', 'choice', array('choices' => array('currentState' => 'currentState')))
|
|
->add('markingName', 'choice', array('choices' => array('currentState' => 'currentState')))
|
|
|
|
+ ->add('support', 'choice', array('choices' => $supports,'multiple' => true, 'required' => true))
|
|
->add('template', null, array('attr' => array('style' => 'height:500px;')))
|
|
->add('template', null, array('attr' => array('style' => 'height:500px;')))
|
|
|
|
|
|
->setHelps(array(
|
|
->setHelps(array(
|
|
@@ -97,6 +107,7 @@ class WorkflowAdmin extends BaseAdmin
|
|
->add('type')
|
|
->add('type')
|
|
->add('markingType')
|
|
->add('markingType')
|
|
->add('markingName')
|
|
->add('markingName')
|
|
|
|
+ ->add('support')
|
|
->add('template','string', array('template' => 'WorkflowBundle:Workflow:show_template.html.twig'))
|
|
->add('template','string', array('template' => 'WorkflowBundle:Workflow:show_template.html.twig'))
|
|
;
|
|
;
|
|
}
|
|
}
|