diff --git a/composer.json b/composer.json index 033b3f19b..b47856954 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,6 @@ "symfony/monolog-bundle": "^3.5", "symfony/security-bundle": "^4.4", "symfony/serializer": "^5.3", - "symfony/swiftmailer-bundle": "^3.5", "symfony/templating": "^4.4", "symfony/translation": "^4.4", "symfony/twig-bundle": "^4.4", diff --git a/phpstan-baseline-level-4.neon b/phpstan-baseline-level-4.neon index 1b7bb5a07..833a55afb 100644 --- a/phpstan-baseline-level-4.neon +++ b/phpstan-baseline-level-4.neon @@ -2631,11 +2631,6 @@ parameters: count: 2 path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php - - - message: "#^Call to method getRoleScopes\\(\\) on an unknown class Chill\\\\MainBundle\\\\Entity\\\\PermissionGroup\\.$#" - count: 1 - path: src/Bundle/ChillMainBundle/Security/Authorization/AuthorizationHelper.php - - message: "#^Empty array passed to foreach\\.$#" count: 1 diff --git a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php index 798ae77b4..97678af50 100644 --- a/src/Bundle/ChillActivityBundle/Controller/ActivityController.php +++ b/src/Bundle/ChillActivityBundle/Controller/ActivityController.php @@ -41,7 +41,6 @@ use Symfony\Component\Form\Extension\Core\Type\SubmitType; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Serializer\SerializerInterface; use Symfony\Contracts\Translation\TranslatorInterface; use function array_key_exists; @@ -213,7 +212,7 @@ final class ActivityController extends AbstractController $form = $this->createForm(ActivityType::class, $entity, [ 'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null, - 'role' => new Role('CHILL_ACTIVITY_UPDATE'), + 'role' => 'CHILL_ACTIVITY_UPDATE', 'activityType' => $entity->getActivityType(), 'accompanyingPeriod' => $accompanyingPeriod, ]); @@ -442,7 +441,7 @@ final class ActivityController extends AbstractController $form = $this->createForm(ActivityType::class, $entity, [ 'center' => $this->centerResolver->resolveCenters($entity)[0] ?? null, - 'role' => new Role('CHILL_ACTIVITY_CREATE'), + 'role' => 'CHILL_ACTIVITY_CREATE', 'activityType' => $entity->getActivityType(), 'accompanyingPeriod' => $accompanyingPeriod, ]); diff --git a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php index 266fadfee..b2272dd7b 100644 --- a/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php +++ b/src/Bundle/ChillActivityBundle/Service/DocGenerator/ListActivitiesByAccompanyingPeriodContext.php @@ -120,7 +120,6 @@ class ListActivitiesByAccompanyingPeriodContext implements public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array { - $denormalized = $this->accompanyingPeriodContext->contextGenerationDataDenormalize($template, $entity, $data); foreach (['myActivitiesOnly', 'myWorksOnly'] as $k) { diff --git a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml index be12daca0..042fccc69 100644 --- a/src/Bundle/ChillActivityBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillActivityBundle/translations/messages.fr.yml @@ -106,6 +106,9 @@ CHILL_ACTIVITY_SEE_DETAILS: Voir le détail des échanges CHILL_ACTIVITY_DELETE: Supprimer un échange CHILL_ACTIVITY_STATS: Statistique des échanges CHILL_ACTIVITY_LIST: Liste des échanges +CHILL_ACTIVITY_CREATE_PERSON: Créer un échange lié à un usager +CHILL_ACTIVITY_CREATE_ACCOMPANYING_COURSE: Créer un échange lié à un parcours +CHILL_ACTIVITY_FULL: Voir les détails, créer, supprimer et mettre à jour un échange # admin Activities: Échanges diff --git a/src/Bundle/ChillBudgetBundle/Resources/public/page/chillbudget.scss b/src/Bundle/ChillBudgetBundle/Resources/public/page/chillbudget.scss index 20a87cce2..79f40dc76 100644 --- a/src/Bundle/ChillBudgetBundle/Resources/public/page/chillbudget.scss +++ b/src/Bundle/ChillBudgetBundle/Resources/public/page/chillbudget.scss @@ -1,39 +1,42 @@ -.subtitle { +h3.subtitle { margin-top: 1rem; margin-bottom: 1rem; padding: 1rem; + &::before { + font: normal normal normal 20px/1 ForkAwesome; + margin-right: 0.5em; + content: "\f061"; + } } -.family-title { + +$col_charge: #e03851d7; +$col_resource: #6d9e63d8; + +h4.family-title { + margin-top: 1.5rem; margin-bottom: 1rem !important; + padding-left: 0.7em; + i { + margin-right: 0.4em; + } + &.charge i { color: $col_charge; } + &.resource i { color: $col_resource; } } .budget-table th { th { color: white; } } -.budget-table { - th.charge { - background-color: #e03851d7; - } -} -.budget-table { - th.resource { - background-color: #6d9e63d8; - } -} -.budget-table { + +table.budget-table { th, td { padding: 10px; text-align: right; } - td.column-wide { - width: 20%; - } - td.column-small { - width: 15%; - &.right { - align-items: right; - } + th.charge { background-color: $col_charge; } + th.resource { background-color: $col_resource; } + td.column-fixed { + width: 9.5em; } } @@ -58,4 +61,4 @@ button[aria-expanded="true"] > span.folded, button[aria-expanded="false"] > span.unfolded { display: none; } button[aria-expanded="false"] > span.folded, -button[aria-expanded="true"] > span.unfolded { display: inline; } \ No newline at end of file +button[aria-expanded="true"] > span.unfolded { display: inline; } diff --git a/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_budget.html.twig b/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_budget.html.twig index 6e248bf0c..e75b83ee8 100644 --- a/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_budget.html.twig +++ b/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_budget.html.twig @@ -32,28 +32,21 @@ {% endif %} {% endfor %} -

{{ 'Actual budget'|trans }}

- {% if actualCharges|length > 0 or actualResources|length > 0 %} - {% include 'ChillBudgetBundle:Budget:_current_budget.html.twig' with { + {% include '@ChillBudget/Budget/_current_budget.html.twig' with { 'actualResources': actualResources, 'actualCharges': actualCharges, 'results': results, 'entity': entity } %} {% else %} -
-
-

{{ "There isn't any element recorded"|trans }}

-
-
+

{{ "There isn't any element recorded"|trans }}

{% endif %} {% if pastCharges|length > 0 or pastResources|length > 0 %} -

{{ 'Past budget'|trans }}

- - {% include 'ChillBudgetBundle:Budget:_past_budget.html.twig' with { +

{{ 'Past budget'|trans }}

+ {% include '@ChillBudget/Budget/_past_budget.html.twig' with { 'pastCharges': pastCharges, 'pastResources': pastResources, 'entity': entity @@ -61,9 +54,8 @@ {% endif %} {% if futureCharges|length > 0 or futureResources|length > 0 %} -

{{ 'Future budget'|trans }}

- - {% include 'ChillBudgetBundle:Budget:_future_budget.html.twig' with { +

{{ 'Future budget'|trans }}

+ {% include '@ChillBudget/Budget/_future_budget.html.twig' with { 'futureResources': futureResources, 'futureCharges': futureCharges, 'entity': entity diff --git a/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_current_budget.html.twig b/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_current_budget.html.twig index b996da211..d8626aee2 100644 --- a/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_current_budget.html.twig +++ b/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_current_budget.html.twig @@ -1,30 +1,17 @@ -{% from 'ChillBudgetBundle:Budget:_macros.html.twig' import table_elements, table_results %} - -{#

{{ 'Actual budget'|trans }}

#} - -
-

{{ 'Actual resources'|trans }}

+{% from '@ChillBudget/Budget/_macros.html.twig' import table_elements, table_results %} +
+

{{ 'Actual resources'|trans }}

{% if actualResources|length > 0 %} -
{{ table_elements(actualResources, 'resource') }} -
{% else %} -
{{ 'No resources registered'|trans }} -
{% endif %} -
-
-

{{ 'Actual charges'|trans }}

+

{{ 'Actual charges'|trans }}

{% if actualCharges|length > 0 %} -
{{ table_elements(actualCharges, 'charge') }} -
{% else %} -
{{ 'No charges registered'|trans }} -
{% endif %}
diff --git a/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_future_budget.html.twig b/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_future_budget.html.twig index 1547d8749..62f4e3e96 100644 --- a/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_future_budget.html.twig +++ b/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_future_budget.html.twig @@ -20,32 +20,23 @@ aria-labelledby="heading_future_{{ entity.id }}" data-bs-parent="#future_{{ entity.id }}"> -
-

{{ 'Future resources'|trans }}

+
+

{{ 'Future resources'|trans }}

{% if futureResources|length > 0 %} -
- {{ table_elements(futureResources, 'resource') }} -
+ {{ table_elements(futureResources, 'resource') }} {% else %} -
- {{ 'No future resources registered'|trans }} -
+ {{ 'No future resources registered'|trans }} {% endif %} -
-
-

{{ 'Future charges'|trans }}

+ +

{{ 'Future charges'|trans }}

{% if futureCharges|length > 0 %} -
- {{ table_elements(futureCharges, 'charge') }} -
+ {{ table_elements(futureCharges, 'charge') }} {% else %} -
- {{ 'No future charges registered'|trans }} -
+ {{ 'No future charges registered'|trans }} {% endif %}
- \ No newline at end of file + diff --git a/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_macros.html.twig b/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_macros.html.twig index e8d10578b..70e96d96c 100644 --- a/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_macros.html.twig +++ b/src/Bundle/ChillBudgetBundle/Resources/views/Budget/_macros.html.twig @@ -1,5 +1,5 @@ {% macro table_elements(elements, family) %} - +
@@ -13,25 +13,22 @@ {% for f in elements %} {% set total = total + f.amount %} - - - + -
{{ 'Budget element type'|trans }}
- - - {% if f.isResource %} - {{ f.resource.name|localize_translatable_string }} - {% else %} - {{ f.charge.name|localize_translatable_string }} - {% endif %} - + + {% if f.isResource %} + {{ f.resource.name|localize_translatable_string }} + {% else %} + {{ f.charge.name|localize_translatable_string }} + {% endif %} {{ f.amount|format_currency('EUR') }} + {{ f.amount|format_currency('EUR') }} {% if f.endDate is not null %} {{ f.startDate|format_date('short') ~ ' - ' ~ f.endDate|format_date('short') }} {% else %} - {{ f.startDate|format_date('short') ~ ' - ...' }} + {{ 'depuis le ' ~ f.startDate|format_date('short') }} {% endif %} +