mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-05 14:25:00 +00:00
Prepare for moving into monorepo
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration;
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
|
||||
/**
|
||||
* create schema for chill budget
|
||||
*/
|
||||
final class Version20180522080432 extends AbstractMigration
|
||||
{
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
$this->addSql('CREATE SCHEMA chill_budget');
|
||||
$this->addSql('DROP SEQUENCE report_id_seq CASCADE');
|
||||
$this->addSql('CREATE SEQUENCE chill_budget.resource_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$this->addSql('CREATE SEQUENCE chill_budget.charge_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
|
||||
$this->addSql('CREATE TABLE chill_budget.resource (id INT NOT NULL, person_id INT DEFAULT NULL, type VARCHAR(255) NOT NULL, amount NUMERIC(10, 2) NOT NULL, comment TEXT DEFAULT NULL, startDate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, endDate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE INDEX IDX_5E0A5E97217BBB47 ON chill_budget.resource (person_id)');
|
||||
$this->addSql('COMMENT ON COLUMN chill_budget.resource.startDate IS \'(DC2Type:datetime_immutable)\'');
|
||||
$this->addSql('COMMENT ON COLUMN chill_budget.resource.endDate IS \'(DC2Type:datetime_immutable)\'');
|
||||
$this->addSql('CREATE TABLE chill_budget.charge (id INT NOT NULL, person_id INT DEFAULT NULL, type VARCHAR(255) NOT NULL, amount NUMERIC(10, 2) NOT NULL, comment TEXT DEFAULT NULL, startDate TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, endDate TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, help VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE INDEX IDX_5C99D2C3217BBB47 ON chill_budget.charge (person_id)');
|
||||
$this->addSql('COMMENT ON COLUMN chill_budget.charge.startDate IS \'(DC2Type:datetime_immutable)\'');
|
||||
$this->addSql('COMMENT ON COLUMN chill_budget.charge.endDate IS \'(DC2Type:datetime_immutable)\'');
|
||||
$this->addSql('ALTER TABLE chill_budget.resource ADD CONSTRAINT FK_5E0A5E97217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE chill_budget.charge ADD CONSTRAINT FK_5C99D2C3217BBB47 FOREIGN KEY (person_id) REFERENCES chill_person_person (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
|
||||
}
|
||||
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
$this->addSql('CREATE SCHEMA chill_budget CASCADE');
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,26 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Application\Migrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* autorise les valeurs nulles dans "HELP"
|
||||
*/
|
||||
final class Version20181219145631 extends AbstractMigration
|
||||
{
|
||||
public function up(Schema $schema) : void
|
||||
{
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE chill_budget.charge ALTER help DROP NOT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema) : void
|
||||
{
|
||||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
||||
|
||||
$this->addSql('ALTER TABLE chill_budget.charge ALTER help SET NOT NULL');
|
||||
}
|
||||
}
|
@@ -0,0 +1,60 @@
|
||||
Budget: Budget
|
||||
Budget for %name%: Budget de %name%
|
||||
Resource element type: Nature de la ressource
|
||||
Actual budget: Budget actuel
|
||||
Actual resources: Ressources actuelles
|
||||
Actual charges: Charges actuelles
|
||||
Past budget: Éléments du budget passé
|
||||
Past resources: Ressources passées
|
||||
Past charges: Chargées passées
|
||||
Future budget: Futurs éléments du budget
|
||||
Future resources: Ressources futures
|
||||
Future charges: Charges futures
|
||||
Budget element type: Nature
|
||||
Validity period: Période de validité
|
||||
Start of validity period: Début de la période de validité
|
||||
End of validity period: Fin de la période de validité
|
||||
Total: Total
|
||||
Create new resource: Créer une nouvelle ressource
|
||||
Create new charge: Créer une nouvelle charge
|
||||
|
||||
There isn't any element recorded: Aucun élément enregistré
|
||||
No resources registered: Aucune ressource enregistrée
|
||||
No charges registered: Aucune charge enregistrée
|
||||
No past resources registered: Aucune ressource passée
|
||||
No past charges registered: Aucune charge passée
|
||||
No future resources registered: Aucune ressource future enregistrée
|
||||
No future charges registered: Aucune ressource future enregistrée
|
||||
|
||||
New Resource for %name%: Nouvelle ressource pour %name%
|
||||
New Charge for %name%: Nouvelle charge pour %name%
|
||||
Edit Resource for %name%: Modifier une ressource de %name%
|
||||
Edit Charge for %name%: Modifier une charge de %name%
|
||||
Remove resource: Supprimer la ressource
|
||||
Remove charge: Supprimer la charge
|
||||
Are you sure you want to remove the ressource "%type%" associated to "%name%" ?: Êtes-vous sûr·e de vouloir supprimer la ressource de nature "%type%" associée à %name% ?
|
||||
Are you sure you want to remove the charge "%type%" associated to "%name%" ?: Êtes-vous sûr·e de vouloir supprimer la charge de nature "%type%" associée à %name% ?
|
||||
Resource deleted: Ressource supprimée
|
||||
Charge deleted: Charge supprimée
|
||||
Charge created: Charge créée
|
||||
Resource created: Ressource créée
|
||||
Resource updated: Resource mise à jour
|
||||
Charge updated: charge mise à jour
|
||||
|
||||
Choose a resource type: Choisissez un type de ressource
|
||||
Choose a charge type: Choisissez un type de charge
|
||||
Amount: Montant
|
||||
Comment: Commentaire
|
||||
|
||||
Help to pay charges: Aide au payement des dépenses d'énergie
|
||||
Choose a status: Choisissez un état
|
||||
charge.help.running: En cours
|
||||
charge.help.no: Non demandé
|
||||
charge.help.yes: Oui
|
||||
charge.help.not-concerned: Non concerné
|
||||
|
||||
Budget calculator: Calculs et indices sur le budget
|
||||
Budget calculator result: Résultats
|
||||
|
||||
'Valid since %startDate% until %endDate%': Valide depuis le %startDate% jusqu'au %endDate%
|
||||
'Valid since %startDate%': Valide depuis le %startDate%
|
@@ -0,0 +1,2 @@
|
||||
The amount cannot be empty: Le montant ne peut pas être vide ou égal à zéro
|
||||
The budget element's end date must be after the start date: La date de fin doit être après la date de début
|
@@ -0,0 +1,19 @@
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = '' %}
|
||||
{% set person = element.person %}
|
||||
|
||||
{% block title 'Remove resource'|trans %}
|
||||
|
||||
{% block personcontent %}
|
||||
|
||||
{{ include('ChillMainBundle:Util:confirmation_template.html.twig',
|
||||
{
|
||||
'title' : 'Remove charge'|trans,
|
||||
'confirm_question' : 'Are you sure you want to remove the charge "%type%" associated to "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname, '%type%': element.type|budget_element_type_display('charge') } ),
|
||||
'cancel_route' : 'chill_budget_elements_index',
|
||||
'cancel_parameters' : { 'id' : element.person.id },
|
||||
'form' : delete_form
|
||||
} ) }}
|
||||
|
||||
{% endblock %}
|
@@ -0,0 +1,31 @@
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = '' %}
|
||||
{% set title = 'Edit Charge for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %}
|
||||
{% block title title %}
|
||||
|
||||
{% block personcontent %}
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
|
||||
{{ form_row(form.type) }}
|
||||
{{ form_row(form.amount) }}
|
||||
{{ form_row(form.help) }}
|
||||
{{ form_row(form.comment) }}
|
||||
{{ form_row(form.startDate) }}
|
||||
{{ form_row(form.endDate) }}
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel">
|
||||
<a href="{{ path("chill_budget_elements_index", { 'id': person.id } ) }}" class="sc-button bt-cancel">
|
||||
{{ 'Back to the list'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_widget(form.submit, { 'attr' : { 'class': 'sc-button bt-create' }, 'label': 'Edit' } ) }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
@@ -0,0 +1,31 @@
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = '' %}
|
||||
{% set title = 'New Charge for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %}
|
||||
{% block title title %}
|
||||
|
||||
{% block personcontent %}
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
|
||||
{{ form_row(form.type) }}
|
||||
{{ form_row(form.amount) }}
|
||||
{{ form_row(form.help) }}
|
||||
{{ form_row(form.comment) }}
|
||||
{{ form_row(form.startDate) }}
|
||||
{{ form_row(form.endDate) }}
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel">
|
||||
<a href="{{ path("chill_budget_elements_index", { 'id': person.id } ) }}" class="sc-button bt-cancel">
|
||||
{{ 'Back to the list'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_widget(form.submit, { 'attr' : { 'class': 'sc-button bt-create' }, 'label': 'Create' } ) }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
@@ -0,0 +1,52 @@
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = '' %}
|
||||
{% set person = element.person %}
|
||||
{% set title = 'Charge for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %}
|
||||
|
||||
{% block title title %}
|
||||
|
||||
{% block personcontent %}
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
<dl class="chill_view_data">
|
||||
<dt>{{ 'Type'|trans }}</dt>
|
||||
<dd>{{ element.type|budget_element_type_display('charge') }}</dd>
|
||||
|
||||
<dt>{{ 'Amount'|trans }}</dt>
|
||||
<dd>{{ element.amount|localizedcurrency('EUR') }}</dd>
|
||||
|
||||
<dt>{{ 'Validity period'|trans }}</dt>
|
||||
<dd>
|
||||
{% if element.endDate is not null %}
|
||||
{{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': element.startDate|localizeddate('long', 'none'), '%endDate%': familyMember.endDate|localizeddate('long', 'none') } ) }}
|
||||
{% else %}
|
||||
{{ 'Valid since %startDate%'|trans( { '%startDate%': element.startDate|localizeddate('long', 'none') } ) }}
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
<dt>{{ 'Comment'|trans }}</dt>
|
||||
<dd>
|
||||
{%- if element.comment is not empty -%}
|
||||
<blockquote class="chill-user-quote">
|
||||
{{ element.comment }}
|
||||
</blockquote>
|
||||
{%- else -%}
|
||||
<span class="chill-no-data-statement">{{ 'Not given'|trans }}</span>
|
||||
{%- endif -%}
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel">
|
||||
<a href="{{ path("chill_budget_elements_index", { 'id': person.id } ) }}" class="sc-button bt-cancel">
|
||||
{{ 'Back to the list'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), element) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_budget_charge_edit', { 'id': element.id } ) }}" class="sc-button bt-edit">{{ 'Edit'|trans }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endblock %}
|
@@ -0,0 +1,228 @@
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = '' %}
|
||||
{% set title = 'Budget for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %}
|
||||
{% block title title %}
|
||||
|
||||
|
||||
{% set actualResources = [] %}
|
||||
{% set futureResources = [] %}
|
||||
{% set pastResources = [] %}
|
||||
|
||||
{% for r in resources %}
|
||||
{% if r.startDate|date('U') <= 'now'|date('U') %}
|
||||
{% if r.endDate is null or r.endDate|date('U') >= 'now'|date('U') %}
|
||||
{% set actualResources = actualResources|merge([ r ]) %}
|
||||
{% else %}
|
||||
{% set pastResources = pastResources|merge([ r ]) %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% set futureResources = futureResources|merge([ r ]) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% set actualCharges = [] %}
|
||||
{% set futureCharges = [] %}
|
||||
{% set pastCharges = [] %}
|
||||
|
||||
{% for c in charges %}
|
||||
{% if c.startDate|date('U') <= 'now'|date('U') %}
|
||||
{% if c.endDate is null or c.endDate|date('U') >= 'now'|date('U') %}
|
||||
{% set actualCharges = actualCharges|merge([ c ]) %}
|
||||
{% else %}
|
||||
{% set pastCharges = pastCharges|merge([ c ]) %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% set futureCharges = futureCharges|merge([ c ]) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
|
||||
{% macro table_elements(elements, family) %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'Budget element type'|trans }}</th>
|
||||
<th>{{ 'Amount'|trans }}</th>
|
||||
<th>{{ 'Validity period'|trans }}</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set total = 0 %}
|
||||
{% for f in elements %}
|
||||
{% set total = total + f.amount %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ f.type|budget_element_type_display(family) }}
|
||||
</td>
|
||||
<td>{{ f.amount|format_currency('EUR') }}</td>
|
||||
<td>
|
||||
{% if f.endDate is not null %}
|
||||
{{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': f.startDate|format_date('long'), '%endDate%': f.endDate|format_date('long') } ) }}
|
||||
{% else %}
|
||||
{{ 'Valid since %startDate%'|trans( { '%startDate%': f.startDate|format_date('long') } ) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
<ul class="record_actions">
|
||||
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::SHOW'), f) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_budget_' ~ family ~ '_view', { 'id': f.id } ) }}" class="sc-button bt-show"></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), f) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_budget_' ~ family ~'_edit', { 'id': f.id } ) }}" class="sc-button bt-edit"></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::DELETE'), f) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_budget_' ~ family ~ '_delete', { 'id': f.id } ) }}" class="sc-button bt-delete"></a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ 'Total'|trans }}
|
||||
</td>
|
||||
<td>
|
||||
{{ total|format_currency('EUR') }}
|
||||
</td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro table_results(results) %}
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th>{{ 'Budget calculator result'|trans }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for result in results %}
|
||||
<tr>
|
||||
<td>{{ result.label }}</td>
|
||||
<td>
|
||||
{% if result.type == constant('CHILL\\AMLI\\BudgetBundle\\Calculator\\CalculatorResult::TYPE_CURRENCY') %}
|
||||
{{ result.result|format_currency('EUR') }}
|
||||
{% elseif result.type == constant('CHILL\\AMLI\\BudgetBundle\\Calculator\\CalculatorResult::TYPE_PERCENTAGE') %}
|
||||
{{ result.result|round(2, 'ceil') ~ '%' }}
|
||||
{% else %}
|
||||
{{ result.result|round(2, 'common') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endmacro %}
|
||||
|
||||
{% import _self as m %}
|
||||
|
||||
{% block personcontent %}
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
<h2>{{ 'Actual budget'|trans }}</h2>
|
||||
|
||||
{% if resources|length == 0 and charges|length == 0 %}
|
||||
<p><span class="chill-no-data-statement">{{ "There isn't any element recorded"|trans }}</span></p>
|
||||
{% else %}
|
||||
<h3>{{ 'Actual resources'|trans }}</h3>
|
||||
|
||||
{% if actualResources|length > 0 %}
|
||||
{{ m.table_elements(actualResources, 'resource') }}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No resources registered'|trans }}</span>
|
||||
{% endif %}
|
||||
|
||||
<h3>{{ 'Actual charges'|trans }}</h3>
|
||||
|
||||
{% if actualCharges|length > 0 %}
|
||||
{{ m.table_elements(actualCharges, 'charge') }}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No charges registered'|trans }}</span>
|
||||
{% endif %}
|
||||
|
||||
{% if results|length > 0 %}
|
||||
<h2>{{ 'Budget calculator'|trans }}</h2>
|
||||
|
||||
{{ m.table_results(results) }}
|
||||
{% endif %}
|
||||
|
||||
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::CREATE'), person) %}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a class="sc-button bt-create" href="{{ path('chill_budget_resource_new', { 'id': person.id} ) }}">{{ 'Create new resource'|trans }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="sc-button bt-create" href="{{ path('chill_budget_charge_new', { 'id': person.id} ) }}">{{ 'Create new charge'|trans }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if pastCharges|length > 0 or pastResources|length > 0 %}
|
||||
<h2>{{ 'Past budget'|trans }}</h2>
|
||||
|
||||
<h3>{{ 'Past resources'|trans }}</h3>
|
||||
|
||||
{% if pastResources|length > 0 %}
|
||||
{{ m.table_elements(pastResources, 'resource') }}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No past resources registered'|trans }}</span>
|
||||
{% endif %}
|
||||
|
||||
<h3>{{ 'Past charges'|trans }}</h3>
|
||||
|
||||
{% if pastCharges|length > 0 %}
|
||||
{{ m.table_elements(pastCharges, 'charge') }}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No past charges registered'|trans }}</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if futureCharges|length > 0 or futureResources|length > 0 %}
|
||||
<h2>{{ 'Future budget'|trans }}</h2>
|
||||
|
||||
<h3>{{ 'Future resources'|trans }}</h3>
|
||||
|
||||
{% if futureResources|length > 0 %}
|
||||
{{ m.table_elements(futureResources, 'resource') }}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No future resources registered'|trans }}</span>
|
||||
{% endif %}
|
||||
|
||||
<h3>{{ 'Future charges'|trans }}</h3>
|
||||
|
||||
{% if futureCharges|length > 0 %}
|
||||
{{ m.table_elements(futureCharges, 'charge') }}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No future charges registered'|trans }}</span>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% if (resources|length + charges|length) == 0 or futureCharges|length > 0 or futureResources|length > 0 or pastCharges|length > 0 or pastResources|length > 0 %}
|
||||
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::CREATE'), person) %}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a class="sc-button bt-create" href="{{ path('chill_budget_resource_new', { 'id': person.id} ) }}">{{ 'Create new resource'|trans }}</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="sc-button bt-create" href="{{ path('chill_budget_charge_new', { 'id': person.id} ) }}">{{ 'Create new charge'|trans }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
@@ -0,0 +1,19 @@
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = '' %}
|
||||
{% set person = element.person %}
|
||||
|
||||
{% block title 'Remove resource'|trans %}
|
||||
|
||||
{% block personcontent %}
|
||||
|
||||
{{ include('ChillMainBundle:Util:confirmation_template.html.twig',
|
||||
{
|
||||
'title' : 'Remove resource'|trans,
|
||||
'confirm_question' : 'Are you sure you want to remove the ressource "%type%" associated to "%name%" ?'|trans({ '%name%' : person.firstname ~ ' ' ~ person.lastname, '%type%': element.type|budget_element_type_display('resource') } ),
|
||||
'cancel_route' : 'chill_budget_elements_index',
|
||||
'cancel_parameters' : { 'id' : element.person.id },
|
||||
'form' : delete_form
|
||||
} ) }}
|
||||
|
||||
{% endblock %}
|
@@ -0,0 +1,30 @@
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = '' %}
|
||||
{% set title = 'Edit Resource for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %}
|
||||
{% block title title %}
|
||||
|
||||
{% block personcontent %}
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
|
||||
{{ form_row(form.type) }}
|
||||
{{ form_row(form.amount) }}
|
||||
{{ form_row(form.comment) }}
|
||||
{{ form_row(form.startDate) }}
|
||||
{{ form_row(form.endDate) }}
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel">
|
||||
<a href="{{ path("chill_budget_elements_index", { 'id': person.id } ) }}" class="sc-button bt-cancel">
|
||||
{{ 'Back to the list'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_widget(form.submit, { 'attr' : { 'class': 'sc-button bt-create' }, 'label': 'Edit' } ) }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
@@ -0,0 +1,30 @@
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = '' %}
|
||||
{% set title = 'New Resource for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %}
|
||||
{% block title title %}
|
||||
|
||||
{% block personcontent %}
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
|
||||
{{ form_row(form.type) }}
|
||||
{{ form_row(form.amount) }}
|
||||
{{ form_row(form.comment) }}
|
||||
{{ form_row(form.startDate) }}
|
||||
{{ form_row(form.endDate) }}
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel">
|
||||
<a href="{{ path("chill_budget_elements_index", { 'id': person.id } ) }}" class="sc-button bt-cancel">
|
||||
{{ 'Back to the list'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_widget(form.submit, { 'attr' : { 'class': 'sc-button bt-create' }, 'label': 'Create' } ) }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
{{ form_end(form) }}
|
||||
{% endblock %}
|
@@ -0,0 +1,52 @@
|
||||
{% extends "@ChillPerson/layout.html.twig" %}
|
||||
|
||||
{% set activeRouteKey = '' %}
|
||||
{% set person = element.person %}
|
||||
{% set title = 'Resource for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %}
|
||||
|
||||
{% block title title %}
|
||||
|
||||
{% block personcontent %}
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
<dl class="chill_view_data">
|
||||
<dt>{{ 'Type'|trans }}</dt>
|
||||
<dd>{{ element.type|budget_element_type_display('resource') }}</dd>
|
||||
|
||||
<dt>{{ 'Amount'|trans }}</dt>
|
||||
<dd>{{ element.amount|format_currency('EUR') }}</dd>
|
||||
|
||||
<dt>{{ 'Validity period'|trans }}</dt>
|
||||
<dd>
|
||||
{% if element.endDate is not null %}
|
||||
{{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': element.startDate|format_date('long'), '%endDate%': familyMember.endDate|format_date('long') } ) }}
|
||||
{% else %}
|
||||
{{ 'Valid since %startDate%'|trans( { '%startDate%': element.startDate|format_date('long') } ) }}
|
||||
{% endif %}
|
||||
</dd>
|
||||
|
||||
<dt>{{ 'Comment'|trans }}</dt>
|
||||
<dd>
|
||||
{%- if element.comment is not empty -%}
|
||||
<blockquote class="chill-user-quote">
|
||||
{{ element.comment }}
|
||||
</blockquote>
|
||||
{%- else -%}
|
||||
<span class="chill-no-data-statement">{{ 'Not given'|trans }}</span>
|
||||
{%- endif -%}
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li class="cancel">
|
||||
<a href="{{ path("chill_budget_elements_index", { 'id': person.id } ) }}" class="sc-button bt-cancel">
|
||||
{{ 'Back to the list'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
{% if is_granted(constant('Chill\\AMLI\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), element) %}
|
||||
<li>
|
||||
<a href="{{ path('chill_budget_resource_edit', { 'id': element.id } ) }}" class="sc-button bt-edit">{{ 'Edit'|trans }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user