Compare commits

...

118 Commits

Author SHA1 Message Date
80ea712475 changelog and changies 2023-09-14 16:17:22 +02:00
0e47a1cf59 Merge branch '38-gestion-doublon' into 'master'
fix the doublons module

Closes #38

See merge request Chill-Projet/chill-bundles!577
2023-09-14 14:08:51 +00:00
6a554c1c8c Merge branch 'tasks_mission_type_filter' into 'master'
Add filter to tasks based on mission type (AMLI)

See merge request Chill-Projet/chill-bundles!588
2023-09-14 14:08:33 +00:00
0bd8ad84a8 Merge branch 'use_crud_for_center' into 'master'
Use crud for center and add isActive property

See merge request Chill-Projet/chill-bundles!587
2023-09-14 14:07:28 +00:00
115d71ad34 php cs fixes 2023-09-14 15:56:39 +02:00
7ca2380dad php cs fixes 2023-09-14 15:53:42 +02:00
ac9704f154 add changie gestion doublon 2023-09-14 15:47:17 +02:00
87ea841aaa fix rector 2023-09-14 15:47:17 +02:00
dccc2bf4a5 use newer notation for declaring service 2023-09-14 15:47:17 +02:00
599510c3b9 Use PickUserLocationType instead of an EntityType 2023-09-14 15:47:17 +02:00
18971b3204 remove unused comment on Version migration 2023-09-14 15:47:17 +02:00
735a4aa97c csfixer after (rebuild php container) 2023-09-14 15:47:17 +02:00
7cdbee2d0f run rector 2023-09-14 15:47:17 +02:00
95dfb4ba52 cs fixer 2023-09-14 15:47:17 +02:00
22241ca7b1 add changies 2023-09-14 15:47:17 +02:00
13faa572ef Fix missing translation in acpw exports 2023-09-14 15:47:17 +02:00
72f0c460ab Feature: [export] add byLocation filter/aggregators in asideActivity exports 2023-09-14 15:47:17 +02:00
c546c4a207 Feature: add location in asideActivity pages (user currentLocation by default) 2023-09-14 15:47:16 +02:00
5cea4a647d Feature: migrate changes in Location attribute in Asideactivity Entity 2023-09-14 15:47:16 +02:00
207e109d1e Improve NotificationMailerTest by adding an assertion
This assertion is performed by Prophecy's shouldBeCalled* method.
2023-09-14 15:47:16 +02:00
758ad9bc87 [test][household] add a test to check if leaveMovement write an enddate when member startdate is today 2023-09-14 15:47:16 +02:00
90c8f1e3cf add new changie 2023-09-14 15:47:16 +02:00
05d86f1a70 Fix: [Household] allow to set an enddate to member who is repositionned at the same date
addMovement was correct
leaveMovement were not, enddate was not written when startdate was same
2023-09-14 15:47:16 +02:00
99cf7b8e8d UX: minor design correction on badge-person in household banner 2023-09-14 15:47:16 +02:00
68f2c7df25 Fixed: [vuejs] fix missing translation in HouseholdMembersEditor component 2023-09-14 15:47:16 +02:00
6f1dd5b3f2 Fix new CS 2023-09-14 15:47:16 +02:00
e7a9b10d0d NotificationMailer: add tests when user does not have any email 2023-09-14 15:47:16 +02:00
b4f8c7d261 NotificationMailer: send to correct destinees 2023-09-14 15:47:16 +02:00
65b585d4a9 Add test to NotificationMailer::postPersistComment 2023-09-14 15:47:16 +02:00
2cec4a770e Fixed: [notificationMailer] invert 'if continue' condition inside foreach loop 2023-09-14 15:47:16 +02:00
52c5807cd5 add changie 2023-09-14 15:47:16 +02:00
bf7f375daf Fixed: [export] bad type in form of EmergencyFilter and CalendarRangeFilter 2023-09-14 15:47:16 +02:00
cd85e37c1b do active center filtering in frontend for person creation 2023-09-14 14:30:58 +02:00
67e9127f8e docs: correct code block display 2023-09-14 12:40:32 +02:00
754515f185 php cs fixes 2023-09-14 12:25:56 +02:00
15fbfbb621 add developer faq in the index + some language corrections 2023-09-14 12:17:01 +02:00
cf294541ae Add a developer faq to the chill documentation 2023-09-14 12:11:28 +02:00
b4f9501af5 php cs fixes 2023-09-14 11:47:54 +02:00
c1a586dfb9 php cs fix 2023-09-12 16:07:50 +02:00
57a1a49fac fix user filter not combining with other filters 2023-09-12 15:55:03 +02:00
19789acbbe php cs fixes 2023-09-12 15:18:03 +02:00
77180ebb0c Fix error in the doublons queries 2023-09-12 14:19:10 +02:00
6e2377b7ee remove commented code 2023-09-12 13:21:58 +02:00
4d111cd6cf filter out active centers in api 2023-09-11 16:37:27 +02:00
9600543fec Merge branch 'master' into use_crud_for_center 2023-09-11 14:57:51 +02:00
86315b1579 only show active centers from the reachable centers for creation of person 2023-09-11 14:43:52 +02:00
0355699a69 php cs fix 2023-09-11 13:53:40 +02:00
efd43c3791 refactor code after review 2023-09-11 13:53:09 +02:00
f770664798 phpstan fix 2023-09-11 13:06:07 +02:00
74645c065b use different logic to decide whether mission type filter should be shown 2023-09-11 13:01:43 +02:00
c1d70ec63e try fix error cannot insert multiple commands into prepared statement 2023-09-11 11:23:21 +02:00
36ca0fcbfc php cs fixer 2023-09-08 10:50:57 +02:00
91c4c3c270 Merge branch 'master' into tasks_mission_type_filter 2023-09-08 10:49:44 +02:00
92b1b17679 Merge branch 'master' into 38-gestion-doublon 2023-09-07 16:08:27 +02:00
c19d1ff0c7 php cs fixer 2023-09-07 16:08:18 +02:00
94f26df81e Make test personMove work for centers 2023-09-07 16:07:23 +02:00
ae9f1e3905 Merge branch '133-location-asideactivity' into 'master'
Resolve "Ajouter la localisation aux activités annexes"

Closes #133

See merge request Chill-Projet/chill-bundles!581
2023-09-07 11:13:18 +00:00
b6fe830f1e use newer notation for declaring service 2023-09-07 13:08:55 +02:00
665f0b4ccb Use PickUserLocationType instead of an EntityType 2023-09-07 13:08:55 +02:00
30fa57b999 remove unused comment on Version migration 2023-09-07 12:57:41 +02:00
0a6131abcc csfixer after (rebuild php container) 2023-09-07 12:16:47 +02:00
bd4f3e38eb run rector 2023-09-07 12:16:47 +02:00
75bca46b98 cs fixer 2023-09-07 12:16:47 +02:00
fe1fe31b68 add changies 2023-09-07 12:16:46 +02:00
46a5464429 Fix missing translation in acpw exports 2023-09-07 12:16:46 +02:00
67ea62f33d Feature: [export] add byLocation filter/aggregators in asideActivity exports 2023-09-07 12:16:46 +02:00
0e16ab4c18 Feature: add location in asideActivity pages (user currentLocation by default) 2023-09-07 12:16:45 +02:00
a68fef8547 Feature: migrate changes in Location attribute in Asideactivity Entity 2023-09-07 12:16:45 +02:00
fe89e527e6 Merge branch '136-household-reposition-date' into 'master'
Fix bug when repositionning at same date in Household

See merge request Chill-Projet/chill-bundles!584
2023-09-07 09:35:02 +00:00
7b28bb7561 Improve NotificationMailerTest by adding an assertion
This assertion is performed by Prophecy's shouldBeCalled* method.
2023-09-07 11:30:04 +02:00
8f793d8985 [test][household] add a test to check if leaveMovement write an enddate when member startdate is today 2023-09-07 11:30:04 +02:00
264e19e20a add new changie 2023-09-07 11:30:04 +02:00
f30b4ff452 DX php cs fixer 2023-09-06 16:22:03 +02:00
f3a37d435f FEATURE [form][isActive] add form field for isActive property 2023-09-06 16:21:29 +02:00
f0c6d00953 Fix: [Household] allow to set an enddate to member who is repositionned at the same date
addMovement was correct
leaveMovement were not, enddate was not written when startdate was same
2023-09-06 16:19:59 +02:00
fe5e1e5557 UX: minor design correction on badge-person in household banner 2023-09-06 16:19:58 +02:00
16fcd03a02 Fixed: [vuejs] fix missing translation in HouseholdMembersEditor component 2023-09-06 16:19:58 +02:00
34ee2b3ba5 Fix new CS 2023-09-06 16:18:28 +02:00
03baee4286 FIX [repository][center] adjust center repository to find all active entities 2023-09-06 16:07:14 +02:00
bc5c420f92 Merge branch '137-send-reply-when-adding-notification-comments' into 'master'
Resolve: Send reply email to all recipees when add comments in notifications

See merge request Chill-Projet/chill-bundles!585
2023-09-06 14:05:31 +00:00
b256c3176e FIX [migration][center] set default value in center migration to add isActive 2023-09-06 16:05:21 +02:00
53cc43f8d3 NotificationMailer: add tests when user does not have any email 2023-09-06 15:59:36 +02:00
40a72d9fca NotificationMailer: send to correct destinees 2023-09-06 15:59:35 +02:00
82b3025842 DX php cs fixer 2023-09-06 15:56:48 +02:00
7c7c5862c6 FEATURE [center][isActive] add getter and setter + integrate into template 2023-09-06 15:56:04 +02:00
6301505563 DX add changie 2023-09-06 15:52:26 +02:00
ba41ab98f7 FEATURE [isActive][center] add isActive property to the center entity 2023-09-06 15:50:45 +02:00
fa47dcd5b6 FIX [center][crud] use crud controller for center entity 2023-09-06 15:50:12 +02:00
f3fbd5314a Add test to NotificationMailer::postPersistComment 2023-09-06 15:47:45 +02:00
e9f90e2dd2 Merge branch '135-bad-type-in-emergency-filter' into 'master'
Resolve "[saved exports] erreur de typage quand on veut remodifier un export sauvegardé"

See merge request Chill-Projet/chill-bundles!582
2023-09-06 12:40:54 +00:00
dcae15e8d8 Fixed: [notificationMailer] invert 'if continue' condition inside foreach loop 2023-08-24 15:20:53 +02:00
9ccbba2deb add changie 2023-08-22 14:28:35 +02:00
87cdf2e53b Fixed: [export] bad type in form of EmergencyFilter and CalendarRangeFilter 2023-08-22 14:24:40 +02:00
bf27e81e35 DX add changie 2023-08-21 16:10:32 +02:00
6275623f5e FIX [task][filter] use config parameter for list of mission types 2023-08-21 11:40:30 +02:00
bc4af576bc FIX [filter][missionType] reimplement mission type task filter 2023-08-21 11:24:33 +02:00
01e9a15bd7 FIX [sort][center] sort list of centers in admin alphabetically 2023-08-21 10:09:34 +02:00
256579af89 FIX Assign the correct id_seq for PersonMoveAccompanyingPeriodParticipationHandler 2023-08-03 11:41:36 +02:00
3af065e530 WIP [centerHistory] Try to get test to work for personCenterHistory 2023-08-03 11:40:47 +02:00
fd79692f6d FEATURE [relationships] Add personMoveRelationHandler and test for this 2023-08-03 11:39:09 +02:00
7758d62f86 FIX remove var_dump 2023-07-27 10:47:42 +02:00
2921073da3 [centerHistory] add conditions to be sure at least one center history exists per person 2023-07-27 10:34:19 +02:00
f02d97ddb0 FEATURE [centerHistory] attempt to complete test for centerHistory 2023-07-27 10:18:30 +02:00
95b3933650 Version 2.5.3 2023-07-20 12:30:51 +02:00
b7a6a88e70 DX run changie to batch and merge 2023-07-20 12:24:26 +02:00
9846cd5acb DX phpstan, csfix, remove dumps 2023-07-20 12:12:34 +02:00
032eed0424 DX add changie 2023-07-20 11:37:59 +02:00
767ed89f80 FIX [document][list] 'or' query statements were not added to query for rendez vous documents causing all rendez-vous documents from all users to appear in dossiers that had a parcours. 'Or' statements add to where clause 2023-07-20 10:52:22 +02:00
15bf4d6d6d Update CONTRIBUTING.md 2023-07-18 06:42:21 +00:00
c7cdb3a092 Add CONTRIBUTING 2023-07-18 06:37:26 +00:00
bb187f5463 WIP started center_history query for duplicate person merge 2023-07-17 07:50:10 +02:00
860e076b89 [test] add dataprovider for testing move person where both are participating in the same parcours 2023-07-13 16:18:39 +02:00
e0cdf06e99 FIX [duplicate] adding test and handlers to handle fusion of doublons with special cases - after codewithme session 2023-07-13 15:30:33 +02:00
0423540976 FIX [duplicate][personpicker] use dynamic person picker to assign duplicate manually 2023-07-12 11:17:25 +02:00
fcd4c3b92e DX add changie 2023-07-12 11:12:22 +02:00
7c109d909a Merge branch '38-gestion-doublon' of gitlab.com:Chill-Projet/chill-bundles into 38-gestion-doublon 2023-07-12 10:52:13 +02:00
d825a8509b FIX [duplicate][delete] fix error messages for treating the accompaning_period_work linked to the person that will be deleted 2023-07-12 10:51:55 +02:00
e8690d249f FIX [duplicate][delete] fix error messages for treating the accompaning_period_work linked to the person that will be deleted 2023-07-12 10:42:46 +02:00
191 changed files with 1977 additions and 819 deletions

3
.changes/v2.5.3.md Normal file
View File

@@ -0,0 +1,3 @@
## v2.5.3 - 2023-07-20
### Fixed
* ([#132](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/132)) Rendez-vous documents created would appear in all documents lists of all persons with an accompanying period. Or statements are now added to the where clause to filter out documents that come from unrelated accompanying period/ or person rendez-vous.

21
.changes/v2.6.0.md Normal file
View File

@@ -0,0 +1,21 @@
## v2.6.0 - 2023-09-14
### Feature
* ([#133](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/133)) Add locations in Aside Activity. By default, suggest user location, otherwise a select with all locations.
* ([#133](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/133)) Adapt Aside Activity exports: display location, filter by location, group by location
* Use the CRUD controller for center entity + add the isActive property to be able to mask instances of Center that are no longer in use.
### Fixed
* ([#107](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/107)) reinstate the fusion of duplicate persons
* Missing translation in Work Actions exports
* Reimplement the mission type filter on tasks, only for instances that have a config parameter indicating true for this.
* ([#135](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/135)) Corrects a typing error in 2 filters, which caused an
error when trying to reedit a saved export
* ([#136](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/136)) [household] when moving a person to a sharing position to a not-sharing position on the same household on the same date, remove the previous household membership on the same household. This fix duplicate member.
* Add missing translation for comment field placeholder in repositionning household editor.
* Do not send an email to creator twice when adding a comment to a notification
* ([#107](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/107)) Fix gestion doublon functionality to work with chill bundles v2
### UX
* Uniformize badge-person in household banner (background, size)

View File

@@ -6,6 +6,32 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
and is generated by [Changie](https://github.com/miniscruff/changie).
## v2.6.0 - 2023-09-14
### Feature
* ([#133](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/133)) Add locations in Aside Activity. By default, suggest user location, otherwise a select with all locations.
* ([#133](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/133)) Adapt Aside Activity exports: display location, filter by location, group by location
* Use the CRUD controller for center entity + add the isActive property to be able to mask instances of Center that are no longer in use.
### Fixed
* ([#107](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/107)) reinstate the fusion of duplicate persons
* Missing translation in Work Actions exports
* Reimplement the mission type filter on tasks, only for instances that have a config parameter indicating true for this.
* ([#135](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/135)) Corrects a typing error in 2 filters, which caused an
error when trying to reedit a saved export
* ([#136](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/136)) [household] when moving a person to a sharing position to a not-sharing position on the same household on the same date, remove the previous household membership on the same household. This fix duplicate member.
* Add missing translation for comment field placeholder in repositionning household editor.
* Do not send an email to creator twice when adding a comment to a notification
* ([#107](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/107)) Fix gestion doublon functionality to work with chill bundles v2
### UX
* Uniformize badge-person in household banner (background, size)
## v2.5.3 - 2023-07-20
### Fixed
* ([#132](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/132)) Rendez-vous documents created would appear in all documents lists of all persons with an accompanying period. Or statements are now added to the where clause to filter out documents that come from unrelated accompanying period/ or person rendez-vous.
## v2.5.2 - 2023-07-15
### Fixed
* [Collate Address] when updating address point, do not use the point's address reference if the similarity is below the requirement for associating the address reference and the address (it uses the postcode's center instead)

80
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,80 @@
# Contributing
Chill is an open source, community-driven project.
If you'd like to contribute, please read the following.
## What can you do ?
Chill is an open-source project driven by a community of developers, users and social workers. If you don't feel ready to contribute code or patches, reviewing issues and pull requests (PRs) can be a great start to get involved and give back.
If you don't have your own instance or don't want to use it, you can try to reproduce bugs using the instance https://demo.chill.social
## Core team
The core team is the group of developers that determine the direction and evolution of the Chill project. Their votes rule if the features and patches proposed by the community are approved or rejected.
All the Chill Core members are long-time contributors with solid technical expertise and they have demonstrated a strong commitment to drive the project forward.
The core team:
- elects his own members;
- merge pull requests;
### members
Project leader: [julienfastre](https://gitlab.com/julienfastre)
Core members:
- [tchama](https://gitlab.com/tchama)
- [LenaertsJ](https://gitlab.com/LenaertsJ)
- [nobohan](https://gitlab.com/nobohan)
### Becoming a project member
About once a year, the core team discusses the opportunity to invite new members. To become a core team member, you must:
- take part on the development for at least 6 month: propose multiple merge requests and participate to the peer review process;
- through this participation, demonstrate your technical skills and your knowledge of the software and any of their dependencies;
### Core Membership Revocation
A Symfony Core membership can be revoked for any of the following reasons:
- Refusal to follow the rules and policies stated in this document;
- Lack of activity for the past six months;
- Willful negligence or intent to harm the Chill project;
The decision is taken by the majority of project members.
## Code development rules
### Merge requests
Every merge request must contains:
- one more entries suitable for generating a changelog. This is done using the [changie utility](https://changie.dev);
- a comprehensible description of the changes;
- if applicable, automated tests should be adapted or created;
- the code style must pass the project's rules, and non phpstan errors must be raised nor rector refactoring suggestion.
The pipelines must pass.
In case of emergency, some rules may be temporarily ignored.
### Merge Request Voting Policy
- -1 votes must always be justified by technical and objective reasons;
- +1 (technically: approbation on the merge request) votes do not require justification, unless there is at least one -1 vote;
- Core members can change their votes as many times as they desire during the course of a merge request discussion;
- Core members are not allowed to vote on their own merge requests.
### Merge Request Merging Process
All code must be committed to the repository through merge requests, except for minor changes which can be committed directly to the repository.
### Release Policy
The Core members are also the release manager for every Chill version.

View File

@@ -94,7 +94,7 @@ class CountPerson implements ExportInterface
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
{
// we gather all center the user choose.
$centers = array_map(static fn($el) => $el['center'], $acl);
$centers = array_map(static fn ($el) => $el['center'], $acl);
$qb = $this->entityManager->createQueryBuilder();

View File

@@ -0,0 +1,36 @@
.. Copyright (C) 2014 Champs Libres Cooperative SCRLFS
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License".
.. _faq:
Frequently asked questions
####################
Continuous integration
***********
Pipeline fails, but php-cs-fixer doesn't alert me when running it locally ?
========================================
It is possible that you run php-cs-fixer on your local instance of chill and no fixes are made.
Everything seems fine, so you push. However once the pipeline is run in gitlab, you're notified that it failed due to php
cs errors.
In this case it's likely that you have to update your version of php-cs-fixer.
php-cs-fixer is installed when building the docker image: https://gitea.champs-libres.be/Chill-project/chill-skeleton-basic/src/branch/main/Dockerfile#L50
Consequently, to update php-cs-fixer we have to update the image by building it again.
For this the following commands can be used,
.. code-block:: php
docker compose build --pull php
# replace existing containers
docker compose up -d --force-recreate php

View File

@@ -9,7 +9,7 @@
Development
###########
As Chill rely on the `symfony <http://symfony.com>`_ framework, reading the framework's documentation should answer most of your questions. We are explaining here some tips to work with Chill, and things we provide to encounter our needs.
As Chill relies on the `symfony <http://symfony.com>`_ framework, reading the framework's documentation should answer most of your questions. We are explaining here some tips to work with Chill, and help with things we've encountered.
.. toctree::
:maxdepth: 2
@@ -37,6 +37,7 @@ As Chill rely on the `symfony <http://symfony.com>`_ framework, reading the fram
Cron Jobs <cronjob.rst>
Info about entities <entity-info.rst>
Info about database (in French) <database-principles.rst>
Developer FAQ <FAQ.rst>
Layout and UI
**************

View File

@@ -56,7 +56,7 @@ class ChillMainConfiguration implements ConfigurationInterface
->end() // end of widgets
->end() // end of root/children
->end() // end of root
;
;
return $treeBuilder;
}

View File

@@ -2,6 +2,13 @@
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\LevelSetList;

View File

@@ -13,6 +13,4 @@ namespace Chill\ActivityBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillActivityBundle extends Bundle
{
}
class ChillActivityBundle extends Bundle {}

View File

@@ -72,8 +72,7 @@ final class ActivityController extends AbstractController
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
private readonly TranslatableStringHelperInterface $translatableStringHelper,
private readonly PaginatorFactory $paginatorFactory,
) {
}
) {}
/**
* Deletes a Activity entity.
@@ -320,7 +319,6 @@ final class ActivityController extends AbstractController
private function buildFilterOrder(AccompanyingPeriod|Person $associated): FilterOrderHelper
{
$filterBuilder = $this->filterOrderHelperFactory->create(self::class);
$types = $this->activityACLAwareRepository->findActivityTypeByAssociated($associated);
$jobs = $this->activityACLAwareRepository->findUserJobByAssociated($associated);

View File

@@ -36,9 +36,7 @@ class AvgActivityDuration implements ExportInterface, GroupedExportInterface
$this->repository = $em->getRepository(Activity::class);
}
public function buildForm(FormBuilderInterface $builder)
{
}
public function buildForm(FormBuilderInterface $builder) {}
public function getFormDefaultData(): array
{
return [];

View File

@@ -36,9 +36,7 @@ class CountActivity implements ExportInterface, GroupedExportInterface
$this->repository = $em->getRepository(Activity::class);
}
public function buildForm(FormBuilderInterface $builder)
{
}
public function buildForm(FormBuilderInterface $builder) {}
public function getFormDefaultData(): array
{
return [];

View File

@@ -32,9 +32,7 @@ class CountActivity implements ExportInterface, GroupedExportInterface
$this->activityRepository = $activityRepository;
}
public function buildForm(FormBuilderInterface $builder)
{
}
public function buildForm(FormBuilderInterface $builder) {}
public function getFormDefaultData(): array
{
return [];

View File

@@ -50,9 +50,7 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
$this->activityRepository = $activityRepository;
}
public function buildForm(FormBuilderInterface $builder)
{
}
public function buildForm(FormBuilderInterface $builder) {}
public function getFormDefaultData(): array
{
return [];

View File

@@ -104,9 +104,7 @@ class ListActivityHelper
->addGroupBy('location.id');
}
public function buildForm(FormBuilderInterface $builder)
{
}
public function buildForm(FormBuilderInterface $builder) {}
public function getAllowedFormattersTypes()
{

View File

@@ -22,11 +22,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class EmergencyFilter implements FilterInterface
{
private const CHOICES = [
'activity is emergency' => true,
'activity is not emergency' => false,
'activity is emergency' => 'true',
'activity is not emergency' => 'false',
];
private const DEFAULT_CHOICE = false;
private const DEFAULT_CHOICE = 'false';
private TranslatorInterface $translator;

View File

@@ -23,8 +23,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
{
public function __construct(
private RollingDateConverterInterface $rollingDateConverter,
) {
}
) {}
public function getTitle()
{

View File

@@ -47,8 +47,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
private EntityManagerInterface $em,
private Security $security,
private RequestStack $requestStack,
) {
}
) {}
/**
* @throws NonUniqueResultException
@@ -322,7 +321,7 @@ final readonly class ActivityACLAwareRepository implements ActivityACLAwareRepos
$counter++;
}
foreach ($person->getAccompanyingPeriodParticipations() as $participation) {
foreach ($person->getAccompanyingPeriodParticipations() as $participation) {
if (!$this->security->isGranted(ActivityVoter::SEE, $participation->getAccompanyingPeriod())) {
continue;
}

View File

@@ -43,8 +43,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum
private CenterResolverManagerInterface $centerResolverManager,
private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser,
private Security $security
) {
}
) {}
public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface
{

View File

@@ -36,8 +36,7 @@ final class AccompanyingPeriodActivityGenericDocProvider implements GenericDocFo
private EntityManagerInterface $em,
private Security $security,
private ActivityDocumentACLAwareRepositoryInterface $activityDocumentACLAwareRepository,
) {
}
) {}
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
{

View File

@@ -29,8 +29,7 @@ final readonly class PersonActivityGenericDocProvider implements GenericDocForPe
public function __construct(
private Security $security,
private ActivityDocumentACLAwareRepositoryInterface $personActivityDocumentACLAwareRepository,
) {
}
) {}
public function buildFetchQueryForPerson(Person $person, ?DateTimeImmutable $startDate = null, ?DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
{

View File

@@ -122,5 +122,4 @@ class ActivityDocumentACLAwareRepositoryTest extends KernelTestCase
yield [$person, $scopes, true, null, new \DateTimeImmutable("1 week ago"), "content"];
yield [$person, [], true, new \DateTimeImmutable("1 month ago"), new \DateTimeImmutable("1 week ago"), "content"];
}
}

View File

@@ -13,6 +13,4 @@ namespace Chill\AsideActivityBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillAsideActivityBundle extends Bundle
{
}
class ChillAsideActivityBundle extends Bundle {}

View File

@@ -33,6 +33,7 @@ final class AsideActivityController extends CRUDController
$asideActivity = new AsideActivity();
$asideActivity->setAgent($this->getUser());
$asideActivity->setLocation($this->getUser()->getCurrentLocation());
$duration = $request->query->get('duration', '300');
$duration = DateTime::createFromFormat('U', $duration);

View File

@@ -14,6 +14,7 @@ namespace Chill\AsideActivityBundle\Entity;
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\Location;
use DateTimeInterface;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
@@ -60,9 +61,10 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface
private ?int $id = null;
/**
* @ORM\Column(type="string", length=100, nullable=true)
* @ORM\ManyToOne(targetEntity=Location::class)
* @ORM\JoinColumn(nullable=true)
*/
private $location;
private ?Location $location = null;
/**
* @ORM\Column(type="text", nullable=true)
@@ -115,7 +117,7 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface
return $this->id;
}
public function getLocation(): ?string
public function getLocation(): ?Location
{
return $this->location;
}
@@ -175,7 +177,7 @@ class AsideActivity implements TrackCreationInterface, TrackUpdateInterface
return $this;
}
public function setLocation(?string $location): self
public function setLocation(?Location $location): self
{
$this->location = $location;

View File

@@ -0,0 +1,98 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\Export\Aggregator;
use Chill\AsideActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Repository\LocationRepository;
use Closure;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
class ByLocationAggregator implements AggregatorInterface
{
public function __construct(private LocationRepository $locationRepository) {}
/**
* @inheritDoc
*/
public function buildForm(FormBuilderInterface $builder): void
{
// no form
}
/**
* @inheritDoc
*/
public function getFormDefaultData(): array
{
return [];
}
/**
* @inheritDoc
*/
public function getLabels($key, array $values, $data)
{
return function ($value): string {
if ('_header' === $value) {
return 'export.aggregator.Aside activity localisation';
}
if (null === $value || '' === $value || null === $l = $this->locationRepository->find($value)) {
return '';
}
return $l->getName();
};
}
/**
* @inheritDoc
*/
public function getQueryKeys($data): array
{
return ['by_aside_activity_location_aggregator'];
}
/**
* @inheritDoc
*/
public function getTitle(): string
{
return 'export.aggregator.Group by aside activity location';
}
/**
* @inheritDoc
*/
public function addRole(): ?string
{
return null;
}
/**
* @inheritDoc
*/
public function alterQuery(QueryBuilder $qb, $data): void
{
$qb->addSelect('IDENTITY(aside.location) AS by_aside_activity_location_aggregator')
->addGroupBy('by_aside_activity_location_aggregator');
}
/**
* @inheritDoc
*/
public function applyOn(): string
{
return Declarations::ASIDE_ACTIVITY_TYPE;
}
}

View File

@@ -31,9 +31,7 @@ class AvgAsideActivityDuration implements ExportInterface, GroupedExportInterfac
$this->repository = $repository;
}
public function buildForm(FormBuilderInterface $builder)
{
}
public function buildForm(FormBuilderInterface $builder) {}
public function getFormDefaultData(): array
{
return [];

View File

@@ -31,9 +31,7 @@ class CountAsideActivity implements ExportInterface, GroupedExportInterface
$this->repository = $repository;
}
public function buildForm(FormBuilderInterface $builder)
{
}
public function buildForm(FormBuilderInterface $builder) {}
public function getFormDefaultData(): array
{
return [];

View File

@@ -23,6 +23,7 @@ use Chill\MainBundle\Export\Helper\DateTimeHelper;
use Chill\MainBundle\Export\Helper\UserHelper;
use Chill\MainBundle\Export\ListInterface;
use Chill\MainBundle\Repository\CenterRepositoryInterface;
use Chill\MainBundle\Repository\LocationRepository;
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use DateTimeInterface;
@@ -58,6 +59,7 @@ final class ListAsideActivity implements ListInterface, GroupedExportInterface
CenterRepositoryInterface $centerRepository,
AsideActivityCategoryRepository $asideActivityCategoryRepository,
CategoryRender $categoryRender,
private LocationRepository $locationRepository,
TranslatableStringHelperInterface $translatableStringHelper
) {
$this->em = $em;
@@ -70,9 +72,8 @@ final class ListAsideActivity implements ListInterface, GroupedExportInterface
$this->translatableStringHelper = $translatableStringHelper;
}
public function buildForm(FormBuilderInterface $builder)
{
}
public function buildForm(FormBuilderInterface $builder) {}
public function getFormDefaultData(): array
{
return [];
@@ -145,6 +146,19 @@ final class ListAsideActivity implements ListInterface, GroupedExportInterface
return $this->categoryRender->renderString($c, []);
};
case 'location':
return function ($value) {
if ('_header' === $value) {
return 'export.aside_activity.location';
}
if (null === $value || '' === $value || null === $l = $this->locationRepository->find($value)) {
return '';
}
return $l->getName();
};
case 'main_scope':
return function ($value) {
if ('_header' === $value) {
@@ -191,6 +205,7 @@ final class ListAsideActivity implements ListInterface, GroupedExportInterface
'date',
'duration',
'note',
'location',
];
}
@@ -226,6 +241,7 @@ final class ListAsideActivity implements ListInterface, GroupedExportInterface
->addSelect('IDENTITY(aside.type) AS aside_activity_type')
->addSelect('aside.date')
->addSelect('aside.duration')
->addSelect('IDENTITY(aside.location) AS location')
->addSelect('aside.note');
return $qb;

View File

@@ -31,9 +31,7 @@ class SumAsideActivityDuration implements ExportInterface, GroupedExportInterfac
$this->repository = $repository;
}
public function buildForm(FormBuilderInterface $builder)
{
}
public function buildForm(FormBuilderInterface $builder) {}
public function getFormDefaultData(): array
{
return [];

View File

@@ -0,0 +1,104 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\AsideActivityBundle\Export\Filter;
use Chill\AsideActivityBundle\Export\Declarations;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\PickUserLocationType;
use Chill\MainBundle\Repository\LocationRepository;
use Doctrine\ORM\QueryBuilder;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Security\Core\Security;
final readonly class ByLocationFilter implements FilterInterface
{
public function __construct(
private Security $security
) {}
/**
* @inheritDoc
*/
public function getTitle(): string
{
return 'export.filter.Filter by aside activity location';
}
/**
* @inheritDoc
*/
public function buildForm(FormBuilderInterface $builder): void
{
$builder
->add('locations', PickUserLocationType::class);
}
/**
* @inheritDoc
*/
public function getFormDefaultData(): array
{
$user = $this->security->getUser();
if ($user instanceof User) {
return [
'locations' => $user->getCurrentLocation(),
];
}
return [
'locations' => null,
];
}
/**
* @inheritDoc
*/
public function describeAction($data, $format = 'string'): array
{
$locations = $data['locations']->map(fn (Location $l): string => $l->getName());
return ['export.filter.Filtered by aside activity location: only %location%', [
'%location%' => implode(', ', $locations),
]];
}
/**
* @inheritDoc
*/
public function addRole(): ?string
{
return null;
}
/**
* @inheritDoc
*/
public function alterQuery(QueryBuilder $qb, $data): void
{
$clause = $qb->expr()->in('aside.location', ':locations');
$qb->andWhere($clause);
$qb->setParameter('locations', $data['locations']);
}
/**
* @inheritDoc
*/
public function applyOn(): string
{
return Declarations::ASIDE_ACTIVITY_TYPE;
}
}

View File

@@ -13,13 +13,16 @@ namespace Chill\AsideActivityBundle\Form;
use Chill\AsideActivityBundle\Entity\AsideActivity;
use Chill\AsideActivityBundle\Form\Type\PickAsideActivityCategoryType;
use Chill\MainBundle\Entity\Location;
use Chill\MainBundle\Form\Type\ChillDateType;
use Chill\MainBundle\Form\Type\ChillTextareaType;
use Chill\MainBundle\Form\Type\PickUserDynamicType;
use Chill\MainBundle\Form\Type\PickUserLocationType;
use DateInterval;
use DateTime;
use DateTimeImmutable;
use DateTimeZone;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToTimestampTransformer;
@@ -77,7 +80,9 @@ final class AsideActivityFormType extends AbstractType
->add('note', ChillTextareaType::class, [
'label' => 'Note',
'required' => false,
]);
])
->add('location', PickUserLocationType::class)
;
foreach (['duration'] as $fieldName) {
$builder->get($fieldName)

View File

@@ -39,6 +39,9 @@
</span>
{% endif %}
</div>
{%- if entity.location.name is defined -%}
<div><i class="fa fa-fw fa-map-marker"></i>{{ entity.location.name }}</div>
{%- endif -%}
</div>
<div class="item-col" style="justify-content: flex-end;">
<div class="box">

View File

@@ -22,6 +22,13 @@
<dt class="inline">{{ 'Created for'|trans }}</dt>
<dd>{{ entity.agent }}</dd>
<dt class="inline">{{ 'Asideactivity location'|trans }}</dt>
{%- if entity.location.name is defined -%}
<dd>{{ entity.location.name }}</dd>
{%- else -%}
<dd><span class="chill-no-data-statement">{{ 'No data given'|trans }}</span></dd>
{%- endif -%}
<h2 class="chill-red">{{ 'Activity data'|trans }}</h2>

View File

@@ -46,19 +46,27 @@ services:
tags:
- { name: chill.export_filter, alias: 'aside_activity_user_filter' }
Chill\AsideActivityBundle\Export\Filter\ByLocationFilter:
tags:
- { name: chill.export_filter, alias: 'aside_activity_location_filter' }
## Aggregators
chill.aside_activity.export.type_aggregator:
class: Chill\AsideActivityBundle\Export\Aggregator\ByActivityTypeAggregator
tags:
- { name: chill.export_aggregator, alias: activity_type_aggregator }
- { name: chill.export_aggregator, alias: 'activity_type_aggregator' }
chill.aside_activity.export.user_job_aggregator:
class: Chill\AsideActivityBundle\Export\Aggregator\ByUserJobAggregator
tags:
- { name: chill.export_aggregator, alias: aside_activity_user_job_aggregator }
- { name: chill.export_aggregator, alias: 'aside_activity_user_job_aggregator' }
chill.aside_activity.export.user_scope_aggregator:
class: Chill\AsideActivityBundle\Export\Aggregator\ByUserScopeAggregator
tags:
- { name: chill.export_aggregator, alias: aside_activity_user_scope_aggregator }
- { name: chill.export_aggregator, alias: 'aside_activity_user_scope_aggregator' }
Chill\AsideActivityBundle\Export\Aggregator\ByLocationAggregator:
tags:
- { name: chill.export_aggregator, alias: 'aside_activity_location_aggregator' }

View File

@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\Migrations\AsideActivity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230816112809 extends AbstractMigration
{
public function getDescription(): string
{
return 'Update location attribute in asideactivity';
}
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX chill_asideactivity.IDX_A866DA0E64D218E');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity DROP CONSTRAINT FK_A866DA0E64D218E');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity DROP location_id');
$this->addSql('ALTER TABLE chill_asideactivity.AsideActivity ADD location VARCHAR(100) DEFAULT NULL');
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity ADD location_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity DROP location');
$this->addSql('ALTER TABLE chill_asideactivity.asideactivity ADD CONSTRAINT FK_A866DA0E64D218E FOREIGN KEY (location_id) REFERENCES chill_main_location (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_A866DA0E64D218E ON chill_asideactivity.asideactivity (location_id)');
}
}

View File

@@ -26,6 +26,7 @@ Users: Utilisateurs
Emergency: Urgent
by: "Par "
location: Lieu
Asideactivity location: Localisation de l'activité
# Crud
crud:
@@ -182,6 +183,7 @@ export:
duration: Durée
note: Note
id: Identifiant
location: Localisation
Exports of aside activities: Exports des activités annexes
Count aside activities: Nombre d'activités annexes
@@ -202,11 +204,16 @@ export:
Filter by user jobs: Filtrer les activités annexes par métier des utilisateurs
'Filtered aside activities by user scope: only %scopes%': "Filtré par service des utilisateur: uniquement %scopes%"
Filter by user scope: Filtrer les activités annexes par service d'utilisateur
Filter by aside activity location: Filtrer les activités annexes par localisation
'Filtered by aside activity location: only %location%': "Filtré par localisation: uniquement %location%"
aggregator:
Group by aside activity type: Grouper les activités annexes par type d'activité
Aside activity type: Type d'activité annexe
Aggregate by user job: Grouper les activités annexes par métier des utilisateurs
Aggregate by user scope: Grouper les activités annexes par service des utilisateurs
Aside activity location: Localisation des activités annexe
Group by aside activity location: Grouper les activités annexes par localisation
Aside activity localisation: Localisation
# ROLES
CHILL_ASIDE_ACTIVITY_STATS: Statistiques pour les activités annexes

View File

@@ -29,11 +29,11 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class CalendarRangeFilter implements FilterInterface
{
private const CHOICES = [
'Not made within a calendar range' => true,
'Made within a calendar range' => false,
'Not made within a calendar range' => 'true',
'Made within a calendar range' => 'false',
];
private const DEFAULT_CHOICE = false;
private const DEFAULT_CHOICE = 'false';
private TranslatorInterface $translator;

View File

@@ -28,8 +28,7 @@ final readonly class MSUserAbsenceReader implements MSUserAbsenceReaderInterface
private HttpClientInterface $machineHttpClient,
private MapCalendarToUser $mapCalendarToUser,
private ClockInterface $clock,
) {
}
) {}
/**
* @throw UserAbsenceSyncException when the data cannot be reached or is not valid from microsoft
@@ -65,5 +64,4 @@ final readonly class MSUserAbsenceReader implements MSUserAbsenceReaderInterface
default => throw new UserAbsenceSyncException("this status is not documented by Microsoft")
};
}
}

View File

@@ -21,8 +21,7 @@ readonly class MSUserAbsenceSync
private MSUserAbsenceReaderInterface $absenceReader,
private ClockInterface $clock,
private LoggerInterface $logger,
) {
}
) {}
public function syncUserAbsence(User $user): void
{

View File

@@ -48,23 +48,13 @@ class NullRemoteCalendarConnector implements RemoteCalendarConnectorInterface
return [];
}
public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void
{
}
public function removeCalendar(string $remoteId, array $remoteAttributes, User $user, ?CalendarRange $associatedCalendarRange = null): void {}
public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void
{
}
public function removeCalendarRange(string $remoteId, array $remoteAttributes, User $user): void {}
public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void
{
}
public function syncCalendar(Calendar $calendar, string $action, ?CalendarRange $previousCalendarRange, ?User $previousMainUser, ?array $oldInvites, ?array $newInvites): void {}
public function syncCalendarRange(CalendarRange $calendarRange): void
{
}
public function syncCalendarRange(CalendarRange $calendarRange): void {}
public function syncInvite(Invite $invite): void
{
}
public function syncInvite(Invite $invite): void {}
}

View File

@@ -23,6 +23,4 @@ use Symfony\Component\Form\FormBuilderInterface;
* @extends DocGeneratorContextWithPublicFormInterface<Calendar>
* @extends DocGeneratorContextWithAdminFormInterface<Calendar>
*/
interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInterface, DocGeneratorContextWithAdminFormInterface
{
}
interface CalendarContextInterface extends DocGeneratorContextWithPublicFormInterface, DocGeneratorContextWithAdminFormInterface {}

View File

@@ -39,8 +39,7 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen
public function __construct(
private Security $security,
private EntityManagerInterface $em
) {
}
) {}
/**
* @throws MappingException
@@ -147,6 +146,9 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen
return $query;
}
$query->addWhereClause(implode(" OR ", $or), $orParams, $orTypes);
return $this->addWhereClausesToQuery($query, $startDate, $endDate, $content);
}
@@ -187,6 +189,4 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen
return $query;
}
}

View File

@@ -39,8 +39,7 @@ final readonly class PersonCalendarGenericDocProvider implements GenericDocForPe
public function __construct(
private Security $security,
private EntityManagerInterface $em
) {
}
) {}
private function addWhereClausesToQuery(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
{

View File

@@ -172,5 +172,4 @@ class MSUserAbsenceReaderTest extends TestCase
"User is absent: absence is always enabled"
];
}
}

View File

@@ -16,9 +16,7 @@ use Symfony\Component\Form\FormBuilderInterface;
class CustomFieldsTitleType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
}
public function buildForm(FormBuilderInterface $builder, array $options) {}
public function getBlockPrefix()
{

View File

@@ -31,8 +31,7 @@ final readonly class GenericDocForAccompanyingPeriodController
private PaginatorFactory $paginator,
private Security $security,
private EngineInterface $twig,
) {
}
) {}
/**
* @param AccompanyingPeriod $accompanyingPeriod
@@ -94,5 +93,4 @@ final readonly class GenericDocForAccompanyingPeriodController
]
));
}
}

View File

@@ -30,8 +30,7 @@ final readonly class GenericDocForPerson
private PaginatorFactory $paginator,
private Security $security,
private EngineInterface $twig,
) {
}
) {}
/**
* @throws \Doctrine\DBAL\Exception
@@ -91,5 +90,4 @@ final readonly class GenericDocForPerson
]
));
}
}

View File

@@ -54,8 +54,7 @@ class FetchQuery implements FetchQueryInterface
private array $selectIdentifierTypes = [],
private array $selectDateParams = [],
private array $selectDateTypes = [],
) {
}
) {}
public function addJoinClause(string $sql, array $params = [], array $types = []): int
{
@@ -82,7 +81,6 @@ class FetchQuery implements FetchQueryInterface
}
unset($this->wheres[$index], $this->whereParams[$index], $this->whereTypes[$index]);
}
public function removeJoinClause(int $index): void
@@ -92,7 +90,6 @@ class FetchQuery implements FetchQueryInterface
}
unset($this->joins[$index], $this->joinParams[$index], $this->joinTypes[$index]);
}
public function getSelectKeyString(): string

View File

@@ -21,8 +21,7 @@ final readonly class GenericDocDTO
public array $identifiers,
public \DateTimeImmutable $docDate,
public AccompanyingPeriod|Person $linked,
) {
}
) {}
public function getContext(): string
{

View File

@@ -27,5 +27,4 @@ interface GenericDocForAccompanyingPeriodProviderInterface
* Return true if the user is allowed to see some documents for this provider.
*/
public function isAllowedForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod): bool;
}

View File

@@ -32,8 +32,7 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
public function __construct(
private Security $security,
private EntityManagerInterface $entityManager,
) {
}
) {}
public function buildFetchQueryForAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null, ?string $origin = null): FetchQueryInterface
{
@@ -143,5 +142,4 @@ final readonly class AccompanyingCourseDocumentGenericDocProvider implements Gen
return $query;
}
}

View File

@@ -28,8 +28,7 @@ final readonly class PersonDocumentGenericDocProvider implements GenericDocForPe
public function __construct(
private Security $security,
private PersonDocumentACLAwareRepositoryInterface $personDocumentACLAwareRepository,
) {
}
) {}
public function buildFetchQueryForPerson(
Person $person,

View File

@@ -24,8 +24,7 @@ final readonly class AccompanyingCourseDocumentGenericDocRenderer implements Gen
public function __construct(
private AccompanyingCourseDocumentRepository $accompanyingCourseDocumentRepository,
private PersonDocumentRepository $personDocumentRepository,
) {
}
) {}
public function supports(GenericDocDTO $genericDocDTO, $options = []): bool
{

View File

@@ -25,8 +25,7 @@ final readonly class GenericDocExtensionRuntime implements RuntimeExtensionInter
* @var list<GenericDocRendererInterface>
*/
private iterable $renderers,
) {
}
) {}
/**
* @throws RuntimeError
@@ -46,5 +45,4 @@ final readonly class GenericDocExtensionRuntime implements RuntimeExtensionInter
throw new \LogicException("no renderer found");
}
}

View File

@@ -20,5 +20,4 @@ interface GenericDocRendererInterface
public function getTemplate(GenericDocDTO $genericDocDTO, $options = []): string;
public function getTemplateData(GenericDocDTO $genericDocDTO, $options = []): array;
}

View File

@@ -38,8 +38,7 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA
private CenterResolverManagerInterface $centerResolverManager,
private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser,
private Security $security,
) {
}
) {}
public function buildQueryByPerson(Person $person): QueryBuilder
{
@@ -98,7 +97,6 @@ final readonly class PersonDocumentACLAwareRepository implements PersonDocumentA
continue;
}
$orPersonId[] = $participation->getPerson()->getId();
}
if ([] === $orPersonId) {

View File

@@ -54,9 +54,6 @@ class FetchQueryToSqlBuilderTest extends KernelTestCase
);
self::assertEquals(['foo', 'bar_baz', 'baz'], $params);
self::assertEquals([Types::STRING, Types::STRING, Types::STRING], $types);
}
public function testToSqlWithoutWhere(): void
@@ -85,5 +82,4 @@ class FetchQueryToSqlBuilderTest extends KernelTestCase
self::assertEquals([], $params);
self::assertEquals([], $types);
}
}

View File

@@ -142,7 +142,6 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase
yield [$period, new DateTimeImmutable('2 years ago'), new DateTimeImmutable('1 year ago'), null];
yield [$period, null, null, 'test'];
yield [$period, new DateTimeImmutable('2 years ago'), new DateTimeImmutable('1 year ago'), 'test'];
}
public function provideDataBuildFetchQueryForPerson(): iterable
@@ -154,5 +153,4 @@ class PersonDocumentACLAwareRepositoryTest extends KernelTestCase
yield [null, null, 'test'];
yield [new DateTimeImmutable('2 years ago'), new DateTimeImmutable('1 year ago'), 'test'];
}
}

View File

@@ -13,6 +13,4 @@ namespace Chill\EventBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillEventBundle extends Bundle
{
}
class ChillEventBundle extends Bundle {}

View File

@@ -16,6 +16,4 @@ use Doctrine\ORM\EntityRepository;
/**
* Class EventRepository.
*/
class EventRepository extends EntityRepository
{
}
class EventRepository extends EntityRepository {}

View File

@@ -152,7 +152,7 @@ class EventSearch extends AbstractSearch
$orWhere = $qb->expr()->orX();
foreach ($reachableCenters as $center) {
$n = $n+1;
$n = $n + 1;
$circles = $this->authorizationHelper->getReachableScopes(
$this->security->getUser(),
'CHILL_EVENT_SEE',

View File

@@ -13,6 +13,4 @@ namespace Chill\FamilyMembersBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class ChillAMLIFamilyMembersBundle extends Bundle
{
}
class ChillAMLIFamilyMembersBundle extends Bundle {}

View File

@@ -150,9 +150,7 @@ abstract class AbstractCRUDController extends AbstractController
return new $class();
}
protected function customizeQuery(string $action, Request $request, $query): void
{
}
protected function customizeQuery(string $action, Request $request, $query): void {}
protected function getActionConfig(string $action)
{

View File

@@ -242,13 +242,9 @@ class CRUDController extends AbstractController
/**
* Customize the form created by createFormFor.
*/
protected function customizeForm(string $action, FormInterface $form)
{
}
protected function customizeForm(string $action, FormInterface $form) {}
protected function customizeQuery(string $action, Request $request, $query): void
{
}
protected function customizeQuery(string $action, Request $request, $query): void {}
/**
* @param $id
@@ -927,9 +923,7 @@ class CRUDController extends AbstractController
}
}
protected function onFormValid(string $action, object $entity, FormInterface $form, Request $request)
{
}
protected function onFormValid(string $action, object $entity, FormInterface $form, Request $request) {}
/**
* @param $action
@@ -952,77 +946,55 @@ class CRUDController extends AbstractController
/**
* @param $entity
*/
protected function onPostFlush(string $action, $entity, FormInterface $form, Request $request)
{
}
protected function onPostFlush(string $action, $entity, FormInterface $form, Request $request) {}
/**
* method used by indexAction.
*
* @param mixed $query
*/
protected function onPostIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $query)
{
}
protected function onPostIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $query) {}
/**
* method used by indexAction.
*
* @param mixed $entities
*/
protected function onPostIndexFetchQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $entities)
{
}
protected function onPostIndexFetchQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator, $entities) {}
/**
* @param $entity
*/
protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request)
{
}
protected function onPostPersist(string $action, $entity, FormInterface $form, Request $request) {}
/**
* @param $entity
*/
protected function onPostRemove(string $action, $entity, FormInterface $form, Request $request)
{
}
protected function onPostRemove(string $action, $entity, FormInterface $form, Request $request) {}
protected function onPreDelete(string $action, Request $request)
{
}
protected function onPreDelete(string $action, Request $request) {}
/**
* @param $entity
*/
protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request)
{
}
protected function onPreFlush(string $action, $entity, FormInterface $form, Request $request) {}
protected function onPreIndex(string $action, Request $request)
{
}
protected function onPreIndex(string $action, Request $request) {}
/**
* method used by indexAction.
*/
protected function onPreIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator)
{
}
protected function onPreIndexBuildQuery(string $action, Request $request, int $totalItems, PaginatorInterface $paginator) {}
/**
* @param $entity
*/
protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request)
{
}
protected function onPrePersist(string $action, $entity, FormInterface $form, Request $request) {}
/**
* @param $entity
*/
protected function onPreRemove(string $action, $entity, FormInterface $form, Request $request)
{
}
protected function onPreRemove(string $action, $entity, FormInterface $form, Request $request) {}
/**
* Add ordering fields in the query build by self::queryEntities.

View File

@@ -16,6 +16,4 @@ use Symfony\Component\Form\AbstractType;
/**
* Class CRUDDeleteEntityForm.
*/
class CRUDDeleteEntityForm extends AbstractType
{
}
class CRUDDeleteEntityForm extends AbstractType {}

View File

@@ -213,14 +213,8 @@ class LoadPostalCodesCommand extends Command
}
}
class ExistingPostalCodeException extends Exception
{
}
class ExistingPostalCodeException extends Exception {}
class CountryCodeNotFoundException extends Exception
{
}
class CountryCodeNotFoundException extends Exception {}
class PostalCodeNotValidException extends Exception
{
}
class PostalCodeNotValidException extends Exception {}

View File

@@ -11,176 +11,22 @@ declare(strict_types=1);
namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Form\CenterType;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Chill\MainBundle\Pagination\PaginatorInterface;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\HttpFoundation\Request;
/**
* Class CenterController.
*/
class CenterController extends AbstractController
class CenterController extends CRUDController
{
/**
* Creates a new Center entity.
*/
public function createAction(Request $request)
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
{
$center = new Center();
$form = $this->createCreateForm($center);
$form->handleRequest($request);
$query->addOrderBy('e.name', 'ASC');
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($center);
$em->flush();
return $this->redirect($this->generateUrl('admin_center'));
}
return $this->render('@ChillMain/Center/new.html.twig', [
'entity' => $center,
'form' => $form->createView(),
]);
}
/**
* Displays a form to edit an existing Center entity.
*
* @param mixed $id
*/
public function editAction($id)
{
$em = $this->getDoctrine()->getManager();
$center = $em->getRepository(\Chill\MainBundle\Entity\Center::class)->find($id);
if (!$center) {
throw $this->createNotFoundException('Unable to find Center entity.');
}
$editForm = $this->createEditForm($center);
return $this->render('@ChillMain/Center/edit.html.twig', [
'entity' => $center,
'edit_form' => $editForm->createView(),
]);
}
/**
* Lists all Center entities.
*/
public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$entities = $em->getRepository(\Chill\MainBundle\Entity\Center::class)->findAll();
return $this->render('@ChillMain/Center/index.html.twig', [
'entities' => $entities,
]);
}
/**
* Displays a form to create a new Center entity.
*/
public function newAction()
{
$center = new Center();
$form = $this->createCreateForm($center);
return $this->render('@ChillMain/Center/new.html.twig', [
'entity' => $center,
'form' => $form->createView(),
]);
}
/**
* Finds and displays a Center entity.
*
* @param mixed $id
*/
public function showAction($id)
{
$em = $this->getDoctrine()->getManager();
$center = $em->getRepository(\Chill\MainBundle\Entity\Center::class)->find($id);
if (!$center) {
throw $this->createNotFoundException('Unable to find Center entity.');
}
return $this->render('@ChillMain/Center/show.html.twig', [
'entity' => $center,
]);
}
/**
* Edits an existing Center entity.
*
* @param mixed $id
*/
public function updateAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$center = $em->getRepository(\Chill\MainBundle\Entity\Center::class)->find($id);
if (!$center) {
throw $this->createNotFoundException('Unable to find Center entity.');
}
$editForm = $this->createEditForm($center);
$editForm->handleRequest($request);
if ($editForm->isValid()) {
$em->flush();
return $this->redirect($this->generateUrl('admin_center_edit', ['id' => $id]));
}
return $this->render('@ChillMain/Center/edit.html.twig', [
'entity' => $center,
'edit_form' => $editForm->createView(),
]);
}
/**
* Creates a form to create a Center entity.
*
* @param Center $center The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createCreateForm(Center $center)
{
$form = $this->createForm(CenterType::class, $center, [
'action' => $this->generateUrl('admin_center_create'),
'method' => 'POST',
]);
$form->add('submit', SubmitType::class, ['label' => 'Create']);
return $form;
}
/**
* Creates a form to edit a Center entity.
*
* @param Center $center The entity
*
* @return \Symfony\Component\Form\Form The form
*/
private function createEditForm(Center $center)
{
$form = $this->createForm(CenterType::class, $center, [
'action' => $this->generateUrl('admin_center_update', ['id' => $center->getId()]),
'method' => 'PUT',
]);
$form->add('submit', SubmitType::class, ['label' => 'Update']);
return $form;
return parent::orderQuery($action, $query, $request, $paginator);
}
}

View File

@@ -13,6 +13,4 @@ namespace Chill\MainBundle\Controller;
use Chill\MainBundle\CRUD\Controller\CRUDController;
class LocationTypeController extends CRUDController
{
}
class LocationTypeController extends CRUDController {}

View File

@@ -44,7 +44,5 @@ class LoginController extends AbstractController
]);
}
public function LoginCheckAction(Request $request)
{
}
public function LoginCheckAction(Request $request) {}
}

View File

@@ -50,8 +50,7 @@ final class PermissionsGroupController extends AbstractController
private readonly EntityManagerInterface $em,
private readonly PermissionsGroupRepository $permissionsGroupRepository,
private readonly RoleScopeRepository $roleScopeRepository,
) {
}
) {}
/**
*/

View File

@@ -27,8 +27,7 @@ final readonly class UserExportController
private UserRepositoryInterface $userRepository,
private Security $security,
private TranslatorInterface $translator,
) {
}
) {}
/**
* @throws \League\Csv\CannotInsertRecord

View File

@@ -88,7 +88,6 @@ class CronManager implements CronManagerInterface
foreach ($orderedJobs as $job) {
if ($job->canRun($lasts[$job->getKey()] ?? null)) {
if (array_key_exists($job->getKey(), $lasts)) {
$executionData = $lasts[$job->getKey()]->getLastExecutionData();
$this->entityManager

View File

@@ -12,6 +12,7 @@ declare(strict_types=1);
namespace Chill\MainBundle\DependencyInjection;
use Chill\MainBundle\Controller\AddressApiController;
use Chill\MainBundle\Controller\CenterController;
use Chill\MainBundle\Controller\CivilityApiController;
use Chill\MainBundle\Controller\CivilityController;
use Chill\MainBundle\Controller\CountryController;
@@ -44,6 +45,7 @@ use Chill\MainBundle\Doctrine\DQL\Unaccent;
use Chill\MainBundle\Doctrine\ORM\Hydration\FlatHierarchyEntityHydrator;
use Chill\MainBundle\Doctrine\Type\NativeDateIntervalType;
use Chill\MainBundle\Doctrine\Type\PointType;
use Chill\MainBundle\Entity\Center;
use Chill\MainBundle\Entity\Civility;
use Chill\MainBundle\Entity\Country;
use Chill\MainBundle\Entity\GeographicalUnitLayer;
@@ -53,6 +55,7 @@ use Chill\MainBundle\Entity\LocationType;
use Chill\MainBundle\Entity\Regroupment;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\UserJob;
use Chill\MainBundle\Form\CenterType;
use Chill\MainBundle\Form\CivilityType;
use Chill\MainBundle\Form\CountryType;
use Chill\MainBundle\Form\LanguageType;
@@ -524,6 +527,27 @@ class ChillMainExtension extends Extension implements
],
],
],
[
'class' => Center::class,
'name' => 'center',
'base_path' => '/admin/center',
'form_class' => CenterType::class,
'controller' => CenterController::class,
'actions' => [
'index' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Admin/Center/index.html.twig',
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Admin/Center/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillMain/Admin/Center/edit.html.twig',
],
],
],
],
'apis' => [
[

View File

@@ -48,6 +48,11 @@ class Center implements HasCenterInterface
*/
private string $name = '';
/**
* @ORM\Column(type="boolean")
*/
private bool $isActive = true;
/**
* @var Collection<Regroupment>
* @ORM\ManyToMany(targetEntity=Regroupment::class, mappedBy="centers")
@@ -121,6 +126,11 @@ class Center implements HasCenterInterface
return $this->regroupments;
}
public function getIsActive(): bool
{
return $this->isActive;
}
/**
* @param $name
*
@@ -132,4 +142,11 @@ class Center implements HasCenterInterface
return $this;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
}

View File

@@ -175,9 +175,7 @@ class User implements UserInterface
return $this;
}
public function eraseCredentials()
{
}
public function eraseCredentials() {}
public function getAbsenceStart(): ?DateTimeImmutable
{

View File

@@ -26,8 +26,7 @@ final readonly class ExportFormHelper
private AuthorizationHelperForCurrentUserInterface $authorizationHelper,
private ExportManager $exportManager,
private FormFactoryInterface $formFactory,
) {
}
) {}
public function getDefaultData(string $step, ExportInterface|DirectExportInterface $export, array $options = []): array
{

View File

@@ -20,6 +20,4 @@ namespace Chill\MainBundle\Export;
*
* When used, the `ExportManager` will not handle aggregator for this class.
*/
interface ListInterface extends ExportInterface
{
}
interface ListInterface extends ExportInterface {}

View File

@@ -11,7 +11,10 @@ declare(strict_types=1);
namespace Chill\MainBundle\Form;
use Chill\MainBundle\Entity\Center;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
@@ -21,24 +24,18 @@ class CenterType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('name', TextType::class);
->add('name', TextType::class, [
'label' => 'Nom',
])
->add('isActive', CheckboxType::class, [
'label' => 'Actif ?',
'required' => false,
]);
}
/**
* @param OptionsResolverInterface $resolver
*/
public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
'data_class' => \Chill\MainBundle\Entity\Center::class,
]);
}
/**
* @return string
*/
public function getBlockPrefix()
{
return 'chill_mainbundle_center';
$resolver
->setDefault('class', Center::class);
}
}

View File

@@ -19,9 +19,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class AggregatorType extends AbstractType
{
public function __construct()
{
}
public function __construct() {}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -21,9 +21,7 @@ class FilterType extends AbstractType
{
public const ENABLED_FIELD = 'enabled';
public function __construct()
{
}
public function __construct() {}
public function buildForm(FormBuilderInterface $builder, array $options)
{

View File

@@ -122,7 +122,6 @@ final class FilterOrderType extends \Symfony\Component\Form\AbstractType
foreach ($helper->getUserPickers() as $name => [
'label' => $label, 'options' => $opts
]) {
$userPickersBuilder->add(
$name,
PickUserDynamicType::class,
@@ -136,7 +135,6 @@ final class FilterOrderType extends \Symfony\Component\Form\AbstractType
$builder->add($userPickersBuilder);
}
}
public static function buildCheckboxChoices(array $choices, array $trans = []): array

View File

@@ -61,6 +61,8 @@ class PickCenterType extends AbstractType
{
$centers = $this->getReachableCenters($options['role'], $options['scopes']);
$centersActive = array_filter($centers, fn (Center $c) => $c->getIsActive());
if (count($centers) <= 1) {
$multiple = $options['choice_options']['multiple'] ?? false;
$builder->add('center', HiddenType::class);
@@ -75,7 +77,7 @@ class PickCenterType extends AbstractType
$options['choice_options'],
[
'class' => Center::class,
'choices' => $centers,
'choices' => $centersActive,
]
)
);

View File

@@ -67,6 +67,7 @@ class UserType extends AbstractType
'class' => Center::class,
'query_builder' => static function (EntityRepository $er) {
$qb = $er->createQueryBuilder('c');
$qb->where($qb->expr()->eq('c.isActive', 'true'));
$qb->addOrderBy('c.name');
return $qb;

View File

@@ -40,13 +40,18 @@ class NotificationMailer
public function postPersistComment(NotificationComment $comment, PostPersistEventArgs $eventArgs): void
{
foreach (
array_merge(
$comment->getNotification()->getAddressees()->toArray(),
[$comment->getNotification()->getSender()]
) as $dest
) {
if (null === $dest->getEmail() || $comment->getCreatedBy() !== $dest) {
$dests = [$comment->getNotification()->getSender(), ...$comment->getNotification()->getAddressees()->toArray()];
$uniqueDests = [];
foreach ($dests as $dest) {
// avoid duplication
if (in_array(spl_object_hash($dest), $uniqueDests, true)) {
continue;
}
$uniqueDests[] = spl_object_hash($dest);
// do not send if the sender does not have any email, nor to the creator of the comment
if (null === $dest->getEmail() || $comment->getCreatedBy() === $dest) {
continue;
}
$email = new TemplatedEmail();

View File

@@ -13,6 +13,4 @@ namespace Chill\MainBundle\Notification\Exception;
use RuntimeException;
class NotificationHandlerNotFound extends RuntimeException
{
}
class NotificationHandlerNotFound extends RuntimeException {}

View File

@@ -16,6 +16,4 @@ use Redis;
/**
* Redis client configured by chill main.
*/
class ChillRedis extends Redis
{
}
class ChillRedis extends Redis {}

View File

@@ -29,9 +29,12 @@ final class CenterRepository implements CenterRepositoryInterface
return $this->repository->find($id, $lockMode, $lockVersion);
}
/**
* @return Center[]
*/
public function findActive(): array
{
return $this->findAll();
return $this->repository->findBy(['isActive' => true], ['name' => 'ASC']);
}
/**

View File

@@ -0,0 +1,11 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@@ -0,0 +1,39 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block table_entities_thead_tr %}
<th>{{ 'Label'|trans }}</th>
<th>{{ 'Active'|trans }}</th>
<th>&nbsp;</th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.name }}</td>
<td style="text-align:center">
{% if entity.isActive %}
<i class="fa fa-check-square-o"></i>
{% else %}
<i class="fa fa-square-o"></i>
{% endif %}
</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ chill_path_add_return_path('chill_crud_center_edit', { 'id': entity.id }) }}" class="btn btn-edit"></a>
</li>
</ul>
</td>
</tr>
{% endfor %}
{% endblock %}
{% block actions_before %}
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
{% endblock %}
{% endembed %}
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}
{% include('@ChillMain/CRUD/_new_title.html.twig') %}
{% endblock %}
{% block admin_content %}
{% embed '@ChillMain/CRUD/_new_content.html.twig' %}
{% block content_form_actions_save_and_show %}{% endblock %}
{% endembed %}
{% endblock admin_content %}

View File

@@ -1,23 +0,0 @@
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Center edit'|trans }}{% endblock %}
{% block admin_content -%}
<h1>{{ 'Center edit'|trans }}</h1>
{{ form_start(edit_form) }}
{{ form_row(edit_form.name) }}
<ul class="record_actions sticky-form-buttons">
<li class='cancel'>
<a href="{{ path('admin_center') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
<li>
{{ form_widget(edit_form.submit, { 'attr' : { 'class' : 'btn btn-update' }}) }}
</li>
</ul>
{{ form_end(edit_form) }}
{% endblock %}

View File

@@ -1,50 +0,0 @@
{% extends '@ChillMain/CRUD/Admin/index.html.twig' %}
{% block title %}{{ 'Center list'|trans }}{% endblock %}
{% block admin_content -%}
{% embed '@ChillMain/CRUD/_index.html.twig' %}
{% block index_header %}
<h1>{{ 'Center list'|trans }}</h1>
{% endblock %}
{% block filter_order %}{% endblock %}
{% block table_entities_thead_tr %}
<th>id</th>
<th>{{ 'Name'|trans }}</th>
<th>{{ 'Actions'|trans }}</th>
{% endblock %}
{% block table_entities_tbody %}
{% for entity in entities %}
<tr>
<td>{{ entity.id }}</td>
<td>{{ entity.name }}</td>
<td>
<ul class="record_actions">
<li>
<a href="{{ path('admin_center_edit', { 'id': entity.id }) }}" class="btn btn-edit">{{ 'edit'|trans }}</a>
</li>
</ul>
</td>
</tr>
{% endfor %}
{% endblock %}
{% block pagination %}{% endblock %}
{% block list_actions %}
<ul class="record_actions sticky-form-buttons">
<li class='cancel'>
<a href="{{ path('chill_main_admin_central') }}" class="btn btn-cancel">{{'Back to the admin'|trans}}</a>
</li>
<li>
<a href="{{ path('admin_center_new') }}" class="btn btn-create">{{ 'Create a new center'|trans }}</a>
</li>
</ul>
{% endblock list_actions %}
{% endembed %}
{% endblock %}

View File

@@ -1,23 +0,0 @@
{% extends '@ChillMain/Admin/layoutWithVerticalMenu.html.twig' %}
{% block title %}{{ 'Center creation'|trans }}{% endblock %}
{% block admin_content -%}
<h1>{{ 'Center creation'|trans }}</h1>
{{ form_start(form) }}
{{ form_row(form.name) }}
<ul class="record_actions sticky-form-buttons">
<li class='cancel'>
<a href="{{ path('admin_center') }}" class="btn btn-cancel">
{{ 'Back to the list'|trans }}
</a>
</li>
<li>
{{ form_widget(form.submit, { 'attr' : { 'class' : 'btn btn-save' }}) }}
</li>
</ul>
{{ form_end(form) }}
{% endblock %}

View File

@@ -49,7 +49,7 @@ class AdminUserMenuBuilder implements LocalMenuBuilderInterface
]);
$menu->addChild('Center list', [
'route' => 'admin_center',
'route' => 'chill_crud_center_index',
])->setExtras(['order' => 1010]);
$menu->addChild('Regroupements des centres', [

View File

@@ -13,6 +13,4 @@ namespace Chill\MainBundle\Search;
use Exception;
class ParsingException extends Exception
{
}
class ParsingException extends Exception {}

View File

@@ -24,6 +24,4 @@ use const E_USER_DEPRECATED;
*
* This abstract Voter provide generic methods to handle object specific to Chill
*/
abstract class AbstractChillVoter extends Voter implements ChillVoterInterface
{
}
abstract class AbstractChillVoter extends Voter implements ChillVoterInterface {}

View File

@@ -14,6 +14,4 @@ namespace Chill\MainBundle\Security\Authorization;
/**
* Provides methods for compiling voter and build admin role fields.
*/
interface ChillVoterInterface
{
}
interface ChillVoterInterface {}

View File

@@ -63,6 +63,7 @@ class CenterNormalizer implements DenormalizerInterface, NormalizerInterface
'id' => $center->getId(),
'type' => 'center',
'name' => $center->getName(),
'isActive' => $center->getIsActive()
];
}

Some files were not shown because too many files have changed in this diff Show More