mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 13:03:50 +00:00
Add a link between accompanying period and user
It is now allowed to indicates who make/made the accompanying period. This feature may be hidden by a specific configuration option. Default to visible.
This commit is contained in:
@@ -23,3 +23,6 @@ Chill\PersonBundle\Entity\AccompanyingPeriod:
|
||||
closingMotive:
|
||||
targetEntity: Chill\PersonBundle\Entity\AccompanyingPeriod\ClosingMotive
|
||||
nullable: true
|
||||
user:
|
||||
targetEntity: Chill\MainBundle\Entity\User
|
||||
nullable: true
|
||||
|
@@ -2,19 +2,7 @@ parameters:
|
||||
# cl_chill_person.example.class: Chill\PersonBundle\Example
|
||||
|
||||
services:
|
||||
chill.person.form.person_creation:
|
||||
class: Chill\PersonBundle\Form\PersonType
|
||||
arguments:
|
||||
- %chill_person.person_fields%
|
||||
tags:
|
||||
- { name: form.type }
|
||||
|
||||
chill.person.accompanying_period_closing_motive:
|
||||
class: Chill\PersonBundle\Form\Type\ClosingMotiveType
|
||||
arguments:
|
||||
- "@chill.main.helper.translatable_string"
|
||||
tags:
|
||||
- { name: form.type, alias: closing_motive }
|
||||
|
||||
|
||||
chill.person.form.type.select2maritalstatus:
|
||||
class: Chill\PersonBundle\Form\Type\Select2MaritalStatusType
|
||||
@@ -59,16 +47,6 @@ services:
|
||||
tags:
|
||||
- { name: form.type, alias: chill_personbundle_person_creation }
|
||||
|
||||
chill.person.form.type.pick_person:
|
||||
class: Chill\PersonBundle\Form\Type\PickPersonType
|
||||
arguments:
|
||||
- "@chill.person.repository.person"
|
||||
- "@security.token_storage"
|
||||
- "@chill.main.security.authorization.helper"
|
||||
- '@Symfony\Component\Routing\Generator\UrlGeneratorInterface'
|
||||
- '@Symfony\Component\Translation\TranslatorInterface'
|
||||
tags:
|
||||
- { name: form.type }
|
||||
|
||||
chill.person.repository.person:
|
||||
class: Chill\PersonBundle\Entity\PersonRepository
|
||||
|
31
Resources/config/services/form.yml
Normal file
31
Resources/config/services/form.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
services:
|
||||
chill.person.form.person_creation:
|
||||
class: Chill\PersonBundle\Form\PersonType
|
||||
arguments:
|
||||
- "%chill_person.person_fields%"
|
||||
tags:
|
||||
- { name: form.type }
|
||||
|
||||
chill.person.accompanying_period_closing_motive:
|
||||
class: Chill\PersonBundle\Form\Type\ClosingMotiveType
|
||||
arguments:
|
||||
- "@chill.main.helper.translatable_string"
|
||||
tags:
|
||||
- { name: form.type, alias: closing_motive }
|
||||
|
||||
Chill\PersonBundle\Form\AccompanyingPeriodType:
|
||||
arguments:
|
||||
$config: "%chill_person.accompanying_period_fields%"
|
||||
tags:
|
||||
- { name: form.type }
|
||||
|
||||
chill.person.form.type.pick_person:
|
||||
class: Chill\PersonBundle\Form\Type\PickPersonType
|
||||
arguments:
|
||||
- "@chill.person.repository.person"
|
||||
- "@security.token_storage"
|
||||
- "@chill.main.security.authorization.helper"
|
||||
- '@Symfony\Component\Routing\Generator\UrlGeneratorInterface'
|
||||
- '@Symfony\Component\Translation\TranslatorInterface'
|
||||
tags:
|
||||
- { name: form.type }
|
24
Resources/migrations/Version20190701124238.php
Normal file
24
Resources/migrations/Version20190701124238.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Add a link between accompanying periods and users
|
||||
*/
|
||||
final class Version20190701124238 extends AbstractMigration
|
||||
{
|
||||
public function up(Schema $schema) : void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_person_accompanying_period ADD user_id INT DEFAULT NULL;');
|
||||
$this->addSql('ALTER TABLE chill_person_accompanying_period ADD CONSTRAINT FK_E260A868A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE;');
|
||||
$this->addSql('CREATE INDEX IDX_E260A868A76ED395 ON chill_person_accompanying_period (user_id);');
|
||||
}
|
||||
|
||||
public function down(Schema $schema) : void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_person_accompanying_period DROP user_id');
|
||||
}
|
||||
}
|
@@ -127,6 +127,7 @@ Re-Open a period: Ré-ouvrir une période d'accompagnement
|
||||
Are you sure you want to re-open this period ?: Êtes-vous sûr de vouloir ré-ouvrir cette période d'accompagnement ?
|
||||
'The period has been re-opened': La période d'accompagnement a été ré-ouverte.
|
||||
Pediod closing form is not valid: Le formulaire n'est pas valide
|
||||
Accompanying user: Accompagnant
|
||||
No data given: Pas d'information
|
||||
# pickAPersonType
|
||||
Pick a person: Choisir une personne
|
||||
|
@@ -39,6 +39,10 @@
|
||||
{% if form.closingMotive is defined %}
|
||||
{{ form_row(form.closingMotive, {'label' : 'Closing motive'} ) }}
|
||||
{% endif %}
|
||||
|
||||
{% if form.user is defined %}
|
||||
{{ form_row(form.user, {'label': 'Accompanying user'}) }}
|
||||
{% endif %}
|
||||
|
||||
{{ form_row(form.remark, {'label' : 'Remark' } ) }}
|
||||
|
||||
|
@@ -10,6 +10,9 @@
|
||||
<tr>
|
||||
<th class="chill-red">{{ 'Opening date'|trans }}</th>
|
||||
<th class="chill-green">{{ 'Closing date'|trans }}</th>
|
||||
{% if chill_accompanying_periods.fields.user == 'visible' %}
|
||||
<th class="chill-green">{{ 'Accompanying user'|trans }}</th>
|
||||
{% endif %}
|
||||
<th class="chill-orange">{{ 'Remark'|trans }}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
@@ -26,6 +29,15 @@
|
||||
{{ accompanying_period.closingDate|localizeddate('long', 'none', app.request.locale) }}
|
||||
{% endif %}
|
||||
{% endspaceless %}</td>
|
||||
{% if chill_accompanying_periods.fields.user == 'visible' %}
|
||||
<td>
|
||||
{% if accompanying_period.user %}
|
||||
{{ accompanying_period.user.username }}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
{% if accompanying_period.remark is empty %}
|
||||
<p class="chill-no-data-statement">{{ 'No remark'|trans }}</p>
|
||||
|
Reference in New Issue
Block a user