add('name') ->add('description') ->add('enable') ->add('template') ; } /** * @param ListMapper $listMapper */ protected function configureListFields(ListMapper $listMapper) { $listMapper ->add('name') ->add('description') ->add('enable') ->add('usedByDefault') ->add('_action', null, array( 'actions' => array( 'show' => array(), 'edit' => array(), 'delete' => array() ) )); } /** * @param FormMapper $formMapper */ protected function configureFormFields(FormMapper $formMapper) { $template_example = " initial_place: state_two places: - state_one - state_two - state_three transitions: one_to_two: from: state_one to: state_two two_to_three: from: state_two to: state_three two_to_one: from: state_two to: state_one three_to_one: from: state_three to: state_one "; // Create => template_example $tempate_options = array( "attr" => array( 'style' => 'height:500px;', ), ); if (is_null($this->getSubject()->getId())) { $tempate_options['data'] = $template_example; } else { $this->parameters = array( 'workflow_name' => $this->getSubject()->getName(), 'workflow_subject' => $this->getSubject()->getSubject()); } $formMapper ->add('name') ->add('description') ->add('enable') ->add('usedByDefault') ->add('type', ChoiceType::class, array( 'choices' => array( 'state_machine' => 'state_machine', 'workflow' => 'workflow', ))) ->add('markingType', ChoiceType::class, array( 'choices' => array( 'single_state' => 'single_state', 'multiple_state' => 'multiple_state', ))) ->add('markingName', ChoiceType::class, array( 'choices' => array( 'currentState' => 'currentState', ))) ->add('support', ChoiceType::class, array( 'choices' => array_filter(WorkFlowEntityClasses::getChoices(), 'class_exists'), 'multiple' => true, 'required' => true, )) ->add('template', null, $tempate_options) ->setHelps(array( 'name' => $this->trans("helps.workflow_label_name"), 'type' => $this->trans("helps.workflow_label_type"), 'markingType' => $this->trans("helps.workflow_label_marking_type"), 'markingName' => $this->trans("helps.workflow_label_marking_name"), 'template' => $this->trans("helps.workflow_label_template"), )); } /** * @param ShowMapper $showMapper */ protected function configureShowFields(ShowMapper $showMapper) { $showMapper ->add('id') ->add('name') ->add('description') ->add('enable') ->add('usedByDefault') ->add('created') ->add('updated') ->add('type') ->add('markingType') ->add('markingName') ->add('support') ->add('template','string', array( 'template' => 'WorkflowBundle:Workflow:show_template.html.twig' )); } }