rename 'label' to 'name'.

Warning : this commit require to rename some table column, but the
original Version file has been update.

If you do not care to loose your date, you may run :

```
php app/console doctrine:migrations:execute --down 20160318111334
php app/console doctrine:migrations:execute --up 20160318111334
php app/console doctrine:cache:metadata #(if you have a cache for
doctrine meta date)
```
close #20
This commit is contained in:
Julien Fastré 2016-03-24 23:27:39 +01:00
parent 20c49d5bd0
commit d8de53ca3c
30 changed files with 71 additions and 71 deletions

View File

@ -29,7 +29,7 @@ class LoadEventTypes extends AbstractFixture implements OrderedFixtureInterface
{ {
$type = (new EventType()) $type = (new EventType())
->setActive(true) ->setActive(true)
->setLabel(array('fr' => 'Échange de savoirs', 'en' => 'Exchange of knowledge')) ->setName(array('fr' => 'Échange de savoirs', 'en' => 'Exchange of knowledge'))
; ;
$manager->persist($type); $manager->persist($type);
$this->addReference('event_type_knowledge', $type); $this->addReference('event_type_knowledge', $type);
@ -37,26 +37,26 @@ class LoadEventTypes extends AbstractFixture implements OrderedFixtureInterface
$role = (new Role()) $role = (new Role())
->setActive(true) ->setActive(true)
->setLabel(array('fr' => 'Participant', 'nl' => 'Deelneemer', 'en' => 'Participant')) ->setName(array('fr' => 'Participant', 'nl' => 'Deelneemer', 'en' => 'Participant'))
->setType($type) ->setType($type)
; ;
$manager->persist($role); $manager->persist($role);
$role = (new Role()) $role = (new Role())
->setActive(true) ->setActive(true)
->setLabel(array('fr' => 'Animateur')) ->setName(array('fr' => 'Animateur'))
->setType($type); ->setType($type);
$manager->persist($role); $manager->persist($role);
$status = (new Status()) $status = (new Status())
->setActive(true) ->setActive(true)
->setLabel(array('fr' => 'Inscrit')) ->setName(array('fr' => 'Inscrit'))
->setType($type); ->setType($type);
$manager->persist($status); $manager->persist($status);
$status = (new Status()) $status = (new Status())
->setActive(true) ->setActive(true)
->setLabel(array('fr' => 'Présent')) ->setName(array('fr' => 'Présent'))
->setType($type) ->setType($type)
; ;
$manager->persist($status); $manager->persist($status);
@ -64,7 +64,7 @@ class LoadEventTypes extends AbstractFixture implements OrderedFixtureInterface
$type = (new EventType()) $type = (new EventType())
->setActive(true) ->setActive(true)
->setLabel(array('fr' => 'Formation', 'en' => 'Course', 'nl' => 'Opleiding')) ->setName(array('fr' => 'Formation', 'en' => 'Course', 'nl' => 'Opleiding'))
; ;
$manager->persist($type); $manager->persist($type);
$this->addReference('event_type_course', $type); $this->addReference('event_type_course', $type);
@ -72,21 +72,21 @@ class LoadEventTypes extends AbstractFixture implements OrderedFixtureInterface
$role = (new Role()) $role = (new Role())
->setActive(true) ->setActive(true)
->setLabel(array('fr' => 'Participant', 'nl' => 'Deelneemer', 'en' => 'Participant')) ->setName(array('fr' => 'Participant', 'nl' => 'Deelneemer', 'en' => 'Participant'))
->setType($type) ->setType($type)
; ;
$manager->persist($role); $manager->persist($role);
$status = (new Status()) $status = (new Status())
->setActive(true) ->setActive(true)
->setLabel(array('fr' => 'Inscrit')) ->setName(array('fr' => 'Inscrit'))
->setType($type) ->setType($type)
; ;
$manager->persist($status); $manager->persist($status);
$status = (new Status()) $status = (new Status())
->setActive(true) ->setActive(true)
->setLabel(array('fr' => 'En liste d\'attente')) ->setName(array('fr' => 'En liste d\'attente'))
->setType($type) ->setType($type)
; ;
$manager->persist($status); $manager->persist($status);

View File

@ -80,7 +80,7 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa
for($i=0; $i<$expectedNumber; $i++) { for($i=0; $i<$expectedNumber; $i++) {
$event = (new Event()) $event = (new Event())
->setDate($this->faker->dateTimeBetween('-2 years', '+6 months')) ->setDate($this->faker->dateTimeBetween('-2 years', '+6 months'))
->setLabel($this->faker->words(rand(2,4), true)) ->setName($this->faker->words(rand(2,4), true))
->setType($this->getReference(LoadEventTypes::$refs[array_rand(LoadEventTypes::$refs)])) ->setType($this->getReference(LoadEventTypes::$refs[array_rand(LoadEventTypes::$refs)]))
->setCenter($center) ->setCenter($center)
->setCircle( ->setCircle(

View File

@ -18,7 +18,7 @@ class Event implements HasCenterInterface, HasScopeInterface
/** /**
* @var string * @var string
*/ */
private $label; private $name;
/** /**
* @var \DateTime * @var \DateTime
@ -74,9 +74,9 @@ class Event implements HasCenterInterface, HasScopeInterface
* *
* @return Event * @return Event
*/ */
public function setLabel($label) public function setName($label)
{ {
$this->label = $label; $this->name = $label;
return $this; return $this;
} }
@ -86,9 +86,9 @@ class Event implements HasCenterInterface, HasScopeInterface
* *
* @return string * @return string
*/ */
public function getLabel() public function getName()
{ {
return $this->label; return $this->name;
} }
/** /**

View File

@ -15,7 +15,7 @@ class EventType
/** /**
* @var array * @var array
*/ */
private $label; private $name;
/** /**
* @var boolean * @var boolean
@ -58,9 +58,9 @@ class EventType
* *
* @return EventType * @return EventType
*/ */
public function setLabel($label) public function setName($label)
{ {
$this->label = $label; $this->name = $label;
return $this; return $this;
} }
@ -70,9 +70,9 @@ class EventType
* *
* @return array * @return array
*/ */
public function getLabel() public function getName()
{ {
return $this->label; return $this->name;
} }
/** /**

View File

@ -15,7 +15,7 @@ class Role
/** /**
* @var array * @var array
*/ */
private $label; private $name;
/** /**
* @var boolean * @var boolean
@ -45,9 +45,9 @@ class Role
* *
* @return Role * @return Role
*/ */
public function setLabel($label) public function setName($label)
{ {
$this->label = $label; $this->name = $label;
return $this; return $this;
} }
@ -57,9 +57,9 @@ class Role
* *
* @return array * @return array
*/ */
public function getLabel() public function getName()
{ {
return $this->label; return $this->name;
} }
/** /**

View File

@ -15,7 +15,7 @@ class Status
/** /**
* @var array * @var array
*/ */
private $label; private $name;
/** /**
* @var boolean * @var boolean
@ -41,13 +41,13 @@ class Status
/** /**
* Set label * Set label
* *
* @param array $label * @param array $name
* *
* @return Status * @return Status
*/ */
public function setLabel($label) public function setName($name)
{ {
$this->label = $label; $this->name = $name;
return $this; return $this;
} }
@ -57,9 +57,9 @@ class Status
* *
* @return array * @return array
*/ */
public function getLabel() public function getName()
{ {
return $this->label; return $this->name;
} }

View File

@ -67,7 +67,7 @@ class EventType extends AbstractType
} }
$builder $builder
->add('label') ->add('name')
->add( ->add(
'date', 'date',
'date', 'date',

View File

@ -15,7 +15,7 @@ class EventTypeType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('label') ->add('name')
->add('active') ->add('active')
; ;
} }

View File

@ -76,7 +76,7 @@ class ParticipationType extends AbstractType
); );
}, },
'choice_label' => function(Role $r) use ($translatableStringHelper) { 'choice_label' => function(Role $r) use ($translatableStringHelper) {
return $translatableStringHelper->localize($r->getLabel()); return $translatableStringHelper->localize($r->getName());
} }
)); ));
@ -102,7 +102,7 @@ class ParticipationType extends AbstractType
return $qb; return $qb;
}, },
'choice_label' => function(Status $s) use ($translatableStringHelper) { 'choice_label' => function(Status $s) use ($translatableStringHelper) {
return $translatableStringHelper->localize($s->getLabel()); return $translatableStringHelper->localize($s->getName());
} }
)); ));

View File

@ -15,7 +15,7 @@ class RoleType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('label') ->add('name')
->add('active') ->add('active')
->add('type') ->add('type')
; ;

View File

@ -15,7 +15,7 @@ class StatusType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('label') ->add('name')
->add('active') ->add('active')
->add('type') ->add('type')
; ;

View File

@ -62,7 +62,7 @@ class TranslatableEventType extends AbstractType
->where('et.active = true'); ->where('et.active = true');
}, },
'choice_label' => function (EventType $t) use ($helper) { 'choice_label' => function (EventType $t) use ($helper) {
return $helper->localize($t->getLabel()); return $helper->localize($t->getName());
}, },
) )
); );

View File

@ -8,7 +8,7 @@ Chill\EventBundle\Entity\Event:
generator: generator:
strategy: AUTO strategy: AUTO
fields: fields:
label: name:
type: string type: string
length: '150' length: '150'
date: date:

View File

@ -8,7 +8,7 @@ Chill\EventBundle\Entity\EventType:
generator: generator:
strategy: AUTO strategy: AUTO
fields: fields:
label: name:
type: json_array type: json_array
active: active:
type: boolean type: boolean

View File

@ -8,7 +8,7 @@ Chill\EventBundle\Entity\Role:
generator: generator:
strategy: AUTO strategy: AUTO
fields: fields:
label: name:
type: json_array type: json_array
active: active:
type: boolean type: boolean

View File

@ -8,7 +8,7 @@ Chill\EventBundle\Entity\Status:
generator: generator:
strategy: AUTO strategy: AUTO
fields: fields:
label: name:
type: json_array type: json_array
active: active:
type: boolean type: boolean

View File

@ -24,24 +24,24 @@ class Version20160318111334 extends AbstractMigration
$this->addSql('CREATE SEQUENCE chill_event_event_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE chill_event_event_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE SEQUENCE chill_event_participation_id_seq INCREMENT BY 1 MINVALUE 1 START 1'); $this->addSql('CREATE SEQUENCE chill_event_participation_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE chill_event_event_type (' $this->addSql('CREATE TABLE chill_event_event_type ('
. 'id INT NOT NULL, label JSON NOT NULL, ' . 'id INT NOT NULL, name JSON NOT NULL, '
. 'active BOOLEAN NOT NULL, PRIMARY KEY(id))'); . 'active BOOLEAN NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE TABLE chill_event_role (' $this->addSql('CREATE TABLE chill_event_role ('
. 'id INT NOT NULL, ' . 'id INT NOT NULL, '
. 'type_id INT DEFAULT NULL, ' . 'type_id INT DEFAULT NULL, '
. 'label JSON NOT NULL, ' . 'name JSON NOT NULL, '
. 'active BOOLEAN NOT NULL, ' . 'active BOOLEAN NOT NULL, '
. 'PRIMARY KEY(id))'); . 'PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_AA714E54C54C8C93 ON chill_event_role (type_id)'); $this->addSql('CREATE INDEX IDX_AA714E54C54C8C93 ON chill_event_role (type_id)');
$this->addSql('CREATE TABLE chill_event_status (id INT NOT NULL, ' $this->addSql('CREATE TABLE chill_event_status (id INT NOT NULL, '
. 'type_id INT DEFAULT NULL, ' . 'type_id INT DEFAULT NULL, '
. 'label JSON NOT NULL, ' . 'name JSON NOT NULL, '
. 'active BOOLEAN NOT NULL, ' . 'active BOOLEAN NOT NULL, '
. 'PRIMARY KEY(id))'); . 'PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_A6CC85D0C54C8C93 ON chill_event_status (type_id)'); $this->addSql('CREATE INDEX IDX_A6CC85D0C54C8C93 ON chill_event_status (type_id)');
$this->addSql('CREATE TABLE chill_event_event (' $this->addSql('CREATE TABLE chill_event_event ('
. 'id INT NOT NULL, ' . 'id INT NOT NULL, '
. 'label VARCHAR(150) NOT NULL, ' . 'name VARCHAR(150) NOT NULL, '
. 'date DATE NOT NULL, ' . 'date DATE NOT NULL, '
. 'center_id INT DEFAULT NULL, ' . 'center_id INT DEFAULT NULL, '
. 'type_id INT DEFAULT NULL, ' . 'type_id INT DEFAULT NULL, '

View File

@ -11,7 +11,7 @@
{% if edit_form.center is defined %} {% if edit_form.center is defined %}
{{ form_row(edit_form.center) }} {{ form_row(edit_form.center) }}
{% endif %} {% endif %}
{{ form_row(edit_form.label) }} {{ form_row(edit_form.name) }}
{{ form_row(edit_form.date) }} {{ form_row(edit_form.date) }}
{{ form_row(edit_form.type, { 'label': 'Event type' }) }} {{ form_row(edit_form.type, { 'label': 'Event type' }) }}

View File

@ -7,7 +7,7 @@
<thead> <thead>
<tr> <tr>
<th>Id</th> <th>Id</th>
<th>Label</th> <th>Name</th>
<th>Date</th> <th>Date</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -16,7 +16,7 @@
{% for entity in entities %} {% for entity in entities %}
<tr> <tr>
<td><a href="{{ path('chill_event__event_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td> <td><a href="{{ path('chill_event__event_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
<td>{{ entity.label }}</td> <td>{{ entity.name }}</td>
<td>{% if entity.date %}{{ entity.date|date('Y-m-d H:i:s') }}{% endif %}</td> <td>{% if entity.date %}{{ entity.date|date('Y-m-d H:i:s') }}{% endif %}</td>
<td> <td>
<ul> <ul>

View File

@ -16,9 +16,9 @@
<tbody> <tbody>
{% for event in events %} {% for event in events %}
<tr> <tr>
<td>{{ event.label }}</td> <td>{{ event.name }}</td>
<td>{{ event.date|localizeddate('long', 'none') }}</td> <td>{{ event.date|localizeddate('long', 'none') }}</td>
<td>{{ event.type.label|localize_translatable_string }}</td> <td>{{ event.type.name|localize_translatable_string }}</td>
<td> <td>
<ul class="record_actions"> <ul class="record_actions">
<li> <li>

View File

@ -9,7 +9,7 @@
{{ form_errors(form) }} {{ form_errors(form) }}
{{ form_row(form.circle) }} {{ form_row(form.circle) }}
{{ form_row(form.center) }} {{ form_row(form.center) }}
{{ form_row(form.label) }} {{ form_row(form.name) }}
{{ form_row(form.date) }} {{ form_row(form.date) }}
{{ form_row(form.type, { 'label': 'Event type' }) }} {{ form_row(form.type, { 'label': 'Event type' }) }}

View File

@ -1,6 +1,6 @@
{% extends 'ChillEventBundle::layout.html.twig' %} {% extends 'ChillEventBundle::layout.html.twig' %}
{% block title 'Event : %label%'|trans({ '%label%' : event.label } ) %} {% block title 'Event : %label%'|trans({ '%label%' : event.name } ) %}
{% import 'ChillPersonBundle:Person:macro.html.twig' as person_macro %} {% import 'ChillPersonBundle:Person:macro.html.twig' as person_macro %}
@ -11,7 +11,7 @@
<tbody> <tbody>
<tr> <tr>
<th>{{ 'Name'|trans }}</th> <th>{{ 'Name'|trans }}</th>
<td>{{ event.label }}</td> <td>{{ event.name }}</td>
</tr> </tr>
<tr> <tr>
<th>{{ 'Date'|trans }}</th> <th>{{ 'Date'|trans }}</th>
@ -19,7 +19,7 @@
</tr> </tr>
<tr> <tr>
<th>{{ 'Event type'|trans }}</th> <th>{{ 'Event type'|trans }}</th>
<td>{{ event.type.label|localize_translatable_string }}</td> <td>{{ event.type.name|localize_translatable_string }}</td>
</tr> </tr>
<tr> <tr>
<th>{{ 'Circle'|trans }}</th> <th>{{ 'Circle'|trans }}</th>
@ -55,9 +55,9 @@
{% for participation in event.participations %} {% for participation in event.participations %}
<tr> <tr>
<td>{{ person_macro.render(participation.person) }}</td> <td>{{ person_macro.render(participation.person) }}</td>
<td>{{ participation.role.label|localize_translatable_string }}</td> <td>{{ participation.role.name|localize_translatable_string }}</td>
<td>{{ participation.status.label|localize_translatable_string }}</td> <td>{{ participation.status.name|localize_translatable_string }}</td>
<td>{{ participation.lastUpdate|time_diff }} <i class="fa fa-calendar-o" title="{{ participation.lastUpdate|localizeddate("long", "medium")|escape('html_attr') }}"></i></td> <td>{{ participation.lastUpdate|time_diff }} <i class="fa fa-info-circle" title="{{ participation.lastUpdate|localizeddate("long", "medium")|escape('html_attr') }}"></i></td>
<td> <td>
<ul class="record_actions"> <ul class="record_actions">
{% if is_granted('CHILL_EVENT_PARTICIPATION_UPDATE', participation) %} {% if is_granted('CHILL_EVENT_PARTICIPATION_UPDATE', participation) %}

View File

@ -16,7 +16,7 @@
{% for entity in entities %} {% for entity in entities %}
<tr> <tr>
<td><a href="{{ path('{_locale}_admin_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td> <td><a href="{{ path('{_locale}_admin_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
<td>{{ entity.label }}</td> <td>{{ entity.name }}</td>
<td>{{ entity.active }}</td> <td>{{ entity.active }}</td>
<td> <td>
<ul> <ul>

View File

@ -10,8 +10,8 @@
<td>{{ entity.id }}</td> <td>{{ entity.id }}</td>
</tr> </tr>
<tr> <tr>
<th>Label</th> <th>Name</th>
<td>{{ entity.label }}</td> <td>{{ entity.name }}</td>
</tr> </tr>
<tr> <tr>
<th>Active</th> <th>Active</th>

View File

@ -13,7 +13,7 @@
</tr> </tr>
<tr> <tr>
<th>{{ 'Associated event'|trans }} </th> <th>{{ 'Associated event'|trans }} </th>
<td>{{ participation.event.label }}</td> <td>{{ participation.event.name }}</td>
</tr> </tr>
<tr> <tr>
<th>{{ 'Date'|trans }} </th> <th>{{ 'Date'|trans }} </th>

View File

@ -15,7 +15,7 @@
</tr> </tr>
<tr> <tr>
<th>{{ 'Associated event'|trans }} </th> <th>{{ 'Associated event'|trans }} </th>
<td>{{ participation.event.label }}</td> <td>{{ participation.event.name }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View File

@ -7,7 +7,7 @@
<thead> <thead>
<tr> <tr>
<th>Id</th> <th>Id</th>
<th>Label</th> <th>Name</th>
<th>Active</th> <th>Active</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -16,7 +16,7 @@
{% for entity in entities %} {% for entity in entities %}
<tr> <tr>
<td><a href="{{ path('{_locale}_admin_role_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td> <td><a href="{{ path('{_locale}_admin_role_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
<td>{{ entity.label }}</td> <td>{{ entity.name }}</td>
<td>{{ entity.active }}</td> <td>{{ entity.active }}</td>
<td> <td>
<ul> <ul>

View File

@ -10,8 +10,8 @@
<td>{{ entity.id }}</td> <td>{{ entity.id }}</td>
</tr> </tr>
<tr> <tr>
<th>Label</th> <th>Name</th>
<td>{{ entity.label }}</td> <td>{{ entity.name }}</td>
</tr> </tr>
<tr> <tr>
<th>Active</th> <th>Active</th>

View File

@ -7,7 +7,7 @@
<thead> <thead>
<tr> <tr>
<th>Id</th> <th>Id</th>
<th>Label</th> <th>Name</th>
<th>Active</th> <th>Active</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -16,7 +16,7 @@
{% for entity in entities %} {% for entity in entities %}
<tr> <tr>
<td><a href="{{ path('fr_admin_event_status_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td> <td><a href="{{ path('fr_admin_event_status_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
<td>{{ entity.label }}</td> <td>{{ entity.name }}</td>
<td>{{ entity.active }}</td> <td>{{ entity.active }}</td>
<td> <td>
<ul> <ul>

View File

@ -10,8 +10,8 @@
<td>{{ entity.id }}</td> <td>{{ entity.id }}</td>
</tr> </tr>
<tr> <tr>
<th>Label</th> <th>Name</th>
<td>{{ entity.label }}</td> <td>{{ entity.name }}</td>
</tr> </tr>
<tr> <tr>
<th>Active</th> <th>Active</th>