Activity Reasons, Activity Reasons Category, Activity Types in Translatable strings

This commit is contained in:
Marc Ducobu
2015-07-02 11:33:16 +02:00
parent e9fdfb341d
commit 5bd8b22569
19 changed files with 228 additions and 51 deletions

View File

@@ -8,9 +8,8 @@ Chill\ActivityBundle\Entity\ActivityReason:
generator:
strategy: AUTO
fields:
label:
type: string
length: 255
name:
type: json_array
active:
type: boolean
manyToOne:

View File

@@ -8,9 +8,8 @@ Chill\ActivityBundle\Entity\ActivityReasonCategory:
generator:
strategy: AUTO
fields:
label:
type: string
length: 255
name:
type: json_array
active:
type: boolean
lifecycleCallbacks: { }

View File

@@ -9,6 +9,5 @@ Chill\ActivityBundle\Entity\ActivityType:
strategy: AUTO
fields:
name:
type: string
length: 255
type: json_array
lifecycleCallbacks: { }

View File

@@ -1,4 +1,4 @@
activitytype:
chill_activity_activitytype:
path: /{_locale}/admin/activitytype/
defaults: { _controller: "ChillActivityBundle:ActivityType:index" }
options:

View File

@@ -1,4 +1,7 @@
services:
# chill_activity.example:
# class: Chill\ActivityBundle\Example
# arguments: [@service_id, "plain_value", %parameter%]
chill.activity.form.type.translatableactivityreasoncategory:
class: Chill\ActivityBundle\Form\Type\TranslatableActivityReasonCategory
arguments:
- "@request_stack"
tags:
- { name: form.type, alias: translatable_activity_reason_category }

View File

@@ -0,0 +1,64 @@
<?php
/*
* Chill is a software for social workers
*
* Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>, <info@champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your needs!
*/
class Version20150702093317 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 ActivityReasonCategory DROP COLUMN label;');
$this->addSql('ALTER TABLE ActivityReasonCategory ADD COLUMN name JSON;');
$this->addSql('ALTER TABLE ActivityReason DROP COLUMN label;');
$this->addSql('ALTER TABLE ActivityReason ADD COLUMN name JSON;');
$this->addSql('ALTER TABLE ActivityType DROP COLUMN name;');
$this->addSql('ALTER TABLE ActivityType ADD COLUMN name JSON;');
}
/**
* @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 ActivityReasonCategory DROP COLUMN name;');
$this->addSql('ALTER TABLE ActivityReasonCategory ADD COLUMN label VARCHAR(255) NOT NULL;');
$this->addSql('ALTER TABLE ActivityReason DROP COLUMN name;');
$this->addSql('ALTER TABLE ActivityReason ADD COLUMN label VARCHAR(255) NOT NULL;');
$this->addSql('ALTER TABLE ActivityType DROP COLUMN name;');
$this->addSql('ALTER TABLE ActivityType ADD COLUMN name VARCHAR(255) NOT NULL;');
}
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -31,7 +31,7 @@
{% for entity in entities %}
<tr>
<td><a href="{{ path('chill_activity_activitytype_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
<td>{{ entity.name }}</td>
<td>{{ entity.name|localize_translatable_string }}</td>
<td>
<ul>
<li>

View File

@@ -27,7 +27,7 @@
</tr>
<tr>
<th>Name</th>
<td>{{ entity.name }}</td>
<td>{{ entity.name|localize_translatable_string }}</td>
</tr>
</tbody>
</table>