mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-25 00:53:48 +00:00
add a required field to custom fields type
ref Chill-project/Chill-CustomFields#17
This commit is contained in:
@@ -22,6 +22,8 @@ Chill\CustomFieldsBundle\Entity\CustomField:
|
||||
type: float
|
||||
options:
|
||||
type: json_array
|
||||
required:
|
||||
type: boolean
|
||||
lifecycleCallbacks: { }
|
||||
manyToOne:
|
||||
customFieldGroup:
|
||||
|
35
Resources/migrations/Version20151210155904.php
Normal file
35
Resources/migrations/Version20151210155904.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
||||
/**
|
||||
* Auto-generated Migration: Please modify to your needs!
|
||||
*/
|
||||
class Version20151210155904 extends AbstractMigration
|
||||
{
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
// this up() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE customfield ADD required BOOLEAN DEFAULT FALSE');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Schema $schema
|
||||
*/
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE CustomField DROP required');
|
||||
|
||||
}
|
||||
}
|
@@ -39,6 +39,9 @@ General informations: Informations générales
|
||||
Options: Options
|
||||
Custom fields group: Groupe de champ personnalisé
|
||||
Ordering: Ordre d'apparition
|
||||
Required field: Champs requis
|
||||
An answer is required: Une réponse est requise
|
||||
Any answer is required: Aucune réponse n'est requise
|
||||
Back to the group: Retour au groupe de champs personnalisé
|
||||
Slug: Identifiant textuel
|
||||
The custom field has been created: Le champ personnalisé est créé
|
||||
|
@@ -29,6 +29,7 @@
|
||||
{{ form_row(edit_form.customFieldsGroup) }}
|
||||
{% endif %}
|
||||
{{ form_row(edit_form.ordering) }}
|
||||
{{ form_row(edit_form.required) }}
|
||||
{% if edit_form.options is not empty %}
|
||||
<h2>{{ 'Options'|trans }}</h2>
|
||||
{% for option in edit_form.options %}
|
||||
|
@@ -30,6 +30,7 @@
|
||||
{{ form_row(form.customFieldsGroup) }}
|
||||
{% endif %}
|
||||
{{ form_row(form.ordering) }}
|
||||
{{ form_row(form.required) }}
|
||||
{% if form.options is not empty %}
|
||||
<h2>{{ 'Options'|trans }}</h2>
|
||||
{% for option in form.options %}
|
||||
|
Reference in New Issue
Block a user