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

View File

@ -80,7 +80,7 @@ class LoadParticipation extends AbstractFixture implements OrderedFixtureInterfa
for($i=0; $i<$expectedNumber; $i++) {
$event = (new Event())
->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)]))
->setCenter($center)
->setCircle(

View File

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

View File

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

View File

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

View File

@ -15,7 +15,7 @@ class Status
/**
* @var array
*/
private $label;
private $name;
/**
* @var boolean
@ -41,13 +41,13 @@ class Status
/**
* Set label
*
* @param array $label
* @param array $name
*
* @return Status
*/
public function setLabel($label)
public function setName($name)
{
$this->label = $label;
$this->name = $name;
return $this;
}
@ -57,9 +57,9 @@ class Status
*
* @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
->add('label')
->add('name')
->add(
'date',
'date',

View File

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

View File

@ -76,7 +76,7 @@ class ParticipationType extends AbstractType
);
},
'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;
},
'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)
{
$builder
->add('label')
->add('name')
->add('active')
->add('type')
;

View File

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

View File

@ -62,7 +62,7 @@ class TranslatableEventType extends AbstractType
->where('et.active = true');
},
'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:
strategy: AUTO
fields:
label:
name:
type: string
length: '150'
date:

View File

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

View File

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

View File

@ -8,7 +8,7 @@ Chill\EventBundle\Entity\Status:
generator:
strategy: AUTO
fields:
label:
name:
type: json_array
active:
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_participation_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$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))');
$this->addSql('CREATE TABLE chill_event_role ('
. 'id INT NOT NULL, '
. 'type_id INT DEFAULT NULL, '
. 'label JSON NOT NULL, '
. 'name JSON NOT NULL, '
. 'active BOOLEAN NOT NULL, '
. 'PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_AA714E54C54C8C93 ON chill_event_role (type_id)');
$this->addSql('CREATE TABLE chill_event_status (id INT NOT NULL, '
. 'type_id INT DEFAULT NULL, '
. 'label JSON NOT NULL, '
. 'name JSON NOT NULL, '
. 'active BOOLEAN NOT NULL, '
. 'PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_A6CC85D0C54C8C93 ON chill_event_status (type_id)');
$this->addSql('CREATE TABLE chill_event_event ('
. 'id INT NOT NULL, '
. 'label VARCHAR(150) NOT NULL, '
. 'name VARCHAR(150) NOT NULL, '
. 'date DATE NOT NULL, '
. 'center_id INT DEFAULT NULL, '
. 'type_id INT DEFAULT NULL, '

View File

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

View File

@ -7,7 +7,7 @@
<thead>
<tr>
<th>Id</th>
<th>Label</th>
<th>Name</th>
<th>Date</th>
<th>Actions</th>
</tr>
@ -16,7 +16,7 @@
{% for entity in entities %}
<tr>
<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>
<ul>

View File

@ -16,9 +16,9 @@
<tbody>
{% for event in events %}
<tr>
<td>{{ event.label }}</td>
<td>{{ event.name }}</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>
<ul class="record_actions">
<li>

View File

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

View File

@ -1,6 +1,6 @@
{% 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 %}
@ -11,7 +11,7 @@
<tbody>
<tr>
<th>{{ 'Name'|trans }}</th>
<td>{{ event.label }}</td>
<td>{{ event.name }}</td>
</tr>
<tr>
<th>{{ 'Date'|trans }}</th>
@ -19,7 +19,7 @@
</tr>
<tr>
<th>{{ 'Event type'|trans }}</th>
<td>{{ event.type.label|localize_translatable_string }}</td>
<td>{{ event.type.name|localize_translatable_string }}</td>
</tr>
<tr>
<th>{{ 'Circle'|trans }}</th>
@ -55,9 +55,9 @@
{% for participation in event.participations %}
<tr>
<td>{{ person_macro.render(participation.person) }}</td>
<td>{{ participation.role.label|localize_translatable_string }}</td>
<td>{{ participation.status.label|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.role.name|localize_translatable_string }}</td>
<td>{{ participation.status.name|localize_translatable_string }}</td>
<td>{{ participation.lastUpdate|time_diff }} <i class="fa fa-info-circle" title="{{ participation.lastUpdate|localizeddate("long", "medium")|escape('html_attr') }}"></i></td>
<td>
<ul class="record_actions">
{% if is_granted('CHILL_EVENT_PARTICIPATION_UPDATE', participation) %}

View File

@ -16,7 +16,7 @@
{% for entity in entities %}
<tr>
<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>
<ul>

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@
<thead>
<tr>
<th>Id</th>
<th>Label</th>
<th>Name</th>
<th>Active</th>
<th>Actions</th>
</tr>
@ -16,7 +16,7 @@
{% for entity in entities %}
<tr>
<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>
<ul>

View File

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

View File

@ -7,7 +7,7 @@
<thead>
<tr>
<th>Id</th>
<th>Label</th>
<th>Name</th>
<th>Active</th>
<th>Actions</th>
</tr>
@ -16,7 +16,7 @@
{% for entity in entities %}
<tr>
<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>
<ul>

View File

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