mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-21 01:28:47 +02:00
N°8771 - Add Symfony form component to iTop core
- IO debug
This commit is contained in:
@@ -12,6 +12,7 @@ use Combodo\iTop\Forms\Block\IO\Format\ClassIOFormat;
|
||||
use Combodo\iTop\Forms\Block\IO\FormInput;
|
||||
use Combodo\iTop\Forms\Block\IO\FormOutput;
|
||||
use Combodo\iTop\Forms\Converter\StringToAttributeConverter;
|
||||
use Combodo\iTop\Forms\FormType\AttributeChoiceType;
|
||||
|
||||
/**
|
||||
* Form block for choice of class attributes.
|
||||
@@ -54,4 +55,10 @@ class AttributeChoiceFormBlock extends ChoiceFormBlock
|
||||
|
||||
return $aOptions;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
public function GetFormType(): string
|
||||
{
|
||||
return AttributeChoiceType::class;
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,8 @@ use Combodo\iTop\Forms\Block\Base\ChoiceFormBlock;
|
||||
use Combodo\iTop\Forms\Block\IO\Format\AttributeIOFormat;
|
||||
use Combodo\iTop\Forms\Block\IO\Format\ClassIOFormat;
|
||||
use Combodo\iTop\Forms\Block\IO\FormInput;
|
||||
use Combodo\iTop\Forms\FormType\AttributeChoiceType;
|
||||
use Combodo\iTop\Forms\FormType\AttributeValueChoiceType;
|
||||
|
||||
/**
|
||||
* Form block for choice of class attribute values.
|
||||
@@ -65,4 +67,10 @@ class AttributeValueChoiceFormBlock extends ChoiceFormBlock
|
||||
return $aOptions;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
public function GetFormType(): string
|
||||
{
|
||||
return AttributeValueChoiceType::class;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -21,20 +21,6 @@ class AttributeChoiceType extends AbstractType
|
||||
return ChoiceType::class;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
|
||||
$resolver->setDefault('inputs', [
|
||||
'object_class' => 'string'
|
||||
]);
|
||||
|
||||
$resolver->setDefault('outputs', [
|
||||
'attribute' => function($oData) {
|
||||
return $oData;
|
||||
}
|
||||
]);
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
// on pre submit
|
||||
|
||||
@@ -21,22 +21,6 @@ class AttributeValueChoiceType extends AbstractType
|
||||
return ChoiceType::class;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefault('required', false);
|
||||
$resolver->setDefault('multiple', true);
|
||||
|
||||
$resolver->setDefault('attr', array(
|
||||
'size' => 10,
|
||||
'style' => 'height: auto;'
|
||||
));
|
||||
|
||||
$resolver->setDefault('inputs', array(
|
||||
'object_class' => 'string',
|
||||
'attribute' => 'string'
|
||||
));
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
// on pre submit
|
||||
|
||||
Reference in New Issue
Block a user