mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-12 09:44:58 +00:00
Compare commits
122 Commits
signature-
...
v3.2.0
Author | SHA1 | Date | |
---|---|---|---|
1cadc71d5a | |||
2b45a51f57 | |||
4c66adee86 | |||
6c8fd99cd1 | |||
e886387f17 | |||
c79f030310 | |||
a648fd09b0 | |||
1bd5e6d582 | |||
80940a7b19 | |||
7541238c1e | |||
34748dca76 | |||
12bb264eb5 | |||
ac3ac432e1 | |||
d04f9ae9ff | |||
086f391dc9 | |||
06cbfdd0c3 | |||
f1844ae02b | |||
73b0dd6009 | |||
4d8bcc5a5a | |||
5dfa5e1e7f | |||
588f02cdf4 | |||
30b66d5806 | |||
5786759daa | |||
0c1c1cbf8b | |||
9741794f7a | |||
5ca558bba3 | |||
9d05f2ac2b | |||
566c40dd84 | |||
0d2e0b4e91 | |||
30ebd00693 | |||
8b1d73356f | |||
ddfaa2861e | |||
9416a19d85 | |||
34bbee2031 | |||
7f1764658a | |||
43c3cc26ea | |||
74593a7d28 | |||
e629dbf994 | |||
8e02db6c85 | |||
7183d9a3b1 | |||
70335a6360 | |||
fa64f44cf1 | |||
f34c94fd65 | |||
73d80af80a | |||
363cbc8a76 | |||
9f3893243e | |||
7520d746e8 | |||
052e09cf64 | |||
77ece243c0 | |||
a47c8d916b | |||
5fce9ee9fb | |||
47d954fe9f | |||
d9dc2d1f4e | |||
37cfc035a3 | |||
2eb686ffdb | |||
34e2a26d1e | |||
789c977aba | |||
0ba93ec7c6 | |||
b9d2f5efa3 | |||
567c01f395 | |||
67a6eb17db | |||
b78f0980f5 | |||
f428afc7ca | |||
18899d665d | |||
59f9ac25ba | |||
2da6b746fb | |||
11f75bf6f1 | |||
a1db1a1d65 | |||
bdfdabe10e | |||
843a2a4b5b | |||
6781fdbd9b | |||
e6102d339b | |||
06cb3ddcd1 | |||
05d56c6eeb | |||
23e7f4a120 | |||
3eeb105913 | |||
726cdb385f | |||
406eba80d2 | |||
236e8117d4 | |||
e6bfcddae2 | |||
d61c090cee | |||
43dd94dad6 | |||
f7f8319749 | |||
376ce59917 | |||
06d6227d0e | |||
de914f4f17 | |||
e831cb1656 | |||
94875d83b3 | |||
8e30873001 | |||
be8901a5c4
|
|||
7206e13984
|
|||
6f28d154c8
|
|||
1c0d334b91
|
|||
bc34d84d63
|
|||
f0f651edea
|
|||
5dfbdad13d
|
|||
b3e2d4ff9f | |||
01c2848a83
|
|||
d0ee381627
|
|||
8b1b255050
|
|||
5d0b531820 | |||
5be3cae288 | |||
4587f66402 | |||
2bef3c3878
|
|||
cea44d1788
|
|||
84069e03dc
|
|||
ad5e780936
|
|||
19accc4d00
|
|||
6cb085f5f7
|
|||
97239ada84
|
|||
643156f822 | |||
ff0b205591 | |||
2d67843901 | |||
2b09e1459c | |||
029524ba2c | |||
fa91e9494d | |||
4e72d6fea1
|
|||
5666b8b647
|
|||
|
0573f56782 | ||
|
3bee18b0fa | ||
|
843698a1d8 | ||
|
499640e48b |
@@ -1,4 +1,4 @@
|
|||||||
## v2.23.0 - 2024-07-23
|
## v2.23.0 - 2024-07-23 & 2024-07-19
|
||||||
### Feature
|
### Feature
|
||||||
* ([#221](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/221)) [DX] move async-upload-bundle features into chill-bundles
|
* ([#221](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/221)) [DX] move async-upload-bundle features into chill-bundles
|
||||||
* Add job bundle (module emploi)
|
* Add job bundle (module emploi)
|
||||||
@@ -6,6 +6,25 @@
|
|||||||
|
|
||||||
* Upgrade CKEditor and refactor configuration with use of typescript
|
* Upgrade CKEditor and refactor configuration with use of typescript
|
||||||
|
|
||||||
|
* ([#123](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/123)) Add a button to duplicate calendar ranges from a week to another one
|
||||||
|
* [admin] filter users by active / inactive in the admin user's list
|
||||||
|
* ([#273](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/273)) Add the possibility to mark all notifications as read
|
||||||
|
|
||||||
|
|
||||||
|
* Handle duplicate reference id in the import of reference addresses
|
||||||
|
* Do not update the "createdAt" column when importing postal code which does not change
|
||||||
|
* Display filename on file upload within the UI interface
|
||||||
### Fixed
|
### Fixed
|
||||||
* Fix resolving of centers for an household, which will fix in turn the access control
|
* Fix resolving of centers for an household, which will fix in turn the access control
|
||||||
* Resolved type hinting error in activity list export
|
* Resolved type hinting error in activity list export
|
||||||
|
* ([#271](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/271)) Take into account the acp closing date in the acp works date filter
|
||||||
|
|
||||||
|
### Traduction française des principaux changements
|
||||||
|
- Ajout d'un bouton pour dupliquer les périodes de disponibilités d'une semaine à une autre;
|
||||||
|
- dans l'interface d'administration, filtre sur les utilisateurs actifs. Par défaut, seul les utilisateurs
|
||||||
|
actifs sont affichés;
|
||||||
|
- Nouveau bouton pour indiquer toutes les notifications comme lues;
|
||||||
|
- Améliorations sur l'import des adresses et des codes postaux;
|
||||||
|
- Affiche le nom du fichier déposé quand on téléverse un fichier depuis le poste de travail local;
|
||||||
|
- Agrandit l'icône du type de fichier dans l'interface de dépôt de fichier;
|
||||||
|
- correction: tient compte de la date de fermeture du parcours dans les filtres sur les actions d'accompagnement.
|
||||||
|
3
.changes/v2.24.0.md
Normal file
3
.changes/v2.24.0.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
## v2.24.0 - 2024-09-11
|
||||||
|
### Feature
|
||||||
|
* ([#306](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/306)) When a document is converted or downloaded in the browser, this document is removed from the browser memory after 45s. Future click on the button re-download the document.
|
3
.changes/v3.1.0.md
Normal file
3
.changes/v3.1.0.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
## v3.1.0 - 2024-08-30
|
||||||
|
### Feature
|
||||||
|
* Add export aggregator to aggregate activities by household + filter persons that are not part of an accompanyingperiod during a certain timeframe.
|
6
.changes/v3.1.1.md
Normal file
6
.changes/v3.1.1.md
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
## v3.1.1 - 2024-10-01
|
||||||
|
### Fixed
|
||||||
|
* ([#308](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/308)) Show only the current referrer in the page "show" for an accompanying period workf
|
||||||
|
* ([#309](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/309)) Correctly compute the grouping by referrer aggregator
|
||||||
|
|
||||||
|
* Fixed typing of custom field long choice and custom field group
|
3
.changes/v3.2.0.md
Normal file
3
.changes/v3.2.0.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
## v3.2.0 - 2024-10-30
|
||||||
|
### Feature
|
||||||
|
* Introduce a gender entity
|
40
CHANGELOG.md
40
CHANGELOG.md
@@ -6,13 +6,32 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
|||||||
and is generated by [Changie](https://github.com/miniscruff/changie).
|
and is generated by [Changie](https://github.com/miniscruff/changie).
|
||||||
|
|
||||||
|
|
||||||
|
## v3.2.0 - 2024-10-30
|
||||||
|
### Feature
|
||||||
|
* Introduce a gender entity
|
||||||
|
|
||||||
|
## v3.1.1 - 2024-10-01
|
||||||
|
### Fixed
|
||||||
|
* ([#308](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/308)) Show only the current referrer in the page "show" for an accompanying period workf
|
||||||
|
* ([#309](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/309)) Correctly compute the grouping by referrer aggregator
|
||||||
|
|
||||||
|
* Fixed typing of custom field long choice and custom field group
|
||||||
|
|
||||||
|
## v3.1.0 - 2024-08-30
|
||||||
|
### Feature
|
||||||
|
* Add export aggregator to aggregate activities by household + filter persons that are not part of an accompanyingperiod during a certain timeframe.
|
||||||
|
|
||||||
## v3.0.0 - 2024-08-26
|
## v3.0.0 - 2024-08-26
|
||||||
### Fixed
|
### Fixed
|
||||||
* Fix delete action for accompanying periods in draft state
|
* Fix delete action for accompanying periods in draft state
|
||||||
* Fix connection to azure when making an calendar event in chill
|
* Fix connection to azure when making an calendar event in chill
|
||||||
* CollectionType js fixes for remove button and adding multiple entries
|
* CollectionType js fixes for remove button and adding multiple entries
|
||||||
|
|
||||||
## v2.23.0 - 2024-07-23
|
## v2.24.0 - 2024-09-11
|
||||||
|
### Feature
|
||||||
|
* ([#306](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/306)) When a document is converted or downloaded in the browser, this document is removed from the browser memory after 45s. Future click on the button re-download the document.
|
||||||
|
|
||||||
|
## v2.23.0 - 2024-07-23 & 2024-07-19
|
||||||
### Feature
|
### Feature
|
||||||
* ([#221](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/221)) [DX] move async-upload-bundle features into chill-bundles
|
* ([#221](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/221)) [DX] move async-upload-bundle features into chill-bundles
|
||||||
* Add job bundle (module emploi)
|
* Add job bundle (module emploi)
|
||||||
@@ -20,9 +39,28 @@ and is generated by [Changie](https://github.com/miniscruff/changie).
|
|||||||
|
|
||||||
* Upgrade CKEditor and refactor configuration with use of typescript
|
* Upgrade CKEditor and refactor configuration with use of typescript
|
||||||
|
|
||||||
|
* ([#123](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/123)) Add a button to duplicate calendar ranges from a week to another one
|
||||||
|
* [admin] filter users by active / inactive in the admin user's list
|
||||||
|
* ([#273](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/273)) Add the possibility to mark all notifications as read
|
||||||
|
|
||||||
|
|
||||||
|
* Handle duplicate reference id in the import of reference addresses
|
||||||
|
* Do not update the "createdAt" column when importing postal code which does not change
|
||||||
|
* Display filename on file upload within the UI interface
|
||||||
### Fixed
|
### Fixed
|
||||||
* Fix resolving of centers for an household, which will fix in turn the access control
|
* Fix resolving of centers for an household, which will fix in turn the access control
|
||||||
* Resolved type hinting error in activity list export
|
* Resolved type hinting error in activity list export
|
||||||
|
* ([#271](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/271)) Take into account the acp closing date in the acp works date filter
|
||||||
|
|
||||||
|
### Traduction française des principaux changements
|
||||||
|
- Ajout d'un bouton pour dupliquer les périodes de disponibilités d'une semaine à une autre;
|
||||||
|
- dans l'interface d'administration, filtre sur les utilisateurs actifs. Par défaut, seul les utilisateurs
|
||||||
|
actifs sont affichés;
|
||||||
|
- Nouveau bouton pour indiquer toutes les notifications comme lues;
|
||||||
|
- Améliorations sur l'import des adresses et des codes postaux;
|
||||||
|
- Affiche le nom du fichier déposé quand on téléverse un fichier depuis le poste de travail local;
|
||||||
|
- Agrandit l'icône du type de fichier dans l'interface de dépôt de fichier;
|
||||||
|
- correction: tient compte de la date de fermeture du parcours dans les filtres sur les actions d'accompagnement.
|
||||||
|
|
||||||
## v2.22.2 - 2024-07-03
|
## v2.22.2 - 2024-07-03
|
||||||
### Fixed
|
### Fixed
|
||||||
|
@@ -42,6 +42,7 @@
|
|||||||
"symfony/dom-crawler": "^5.4",
|
"symfony/dom-crawler": "^5.4",
|
||||||
"symfony/error-handler": "^5.4",
|
"symfony/error-handler": "^5.4",
|
||||||
"symfony/event-dispatcher": "^5.4",
|
"symfony/event-dispatcher": "^5.4",
|
||||||
|
"symfony/event-dispatcher-contracts": "^2.4",
|
||||||
"symfony/expression-language": "^5.4",
|
"symfony/expression-language": "^5.4",
|
||||||
"symfony/filesystem": "^5.4",
|
"symfony/filesystem": "^5.4",
|
||||||
"symfony/finder": "^5.4",
|
"symfony/finder": "^5.4",
|
||||||
|
@@ -39,9 +39,12 @@ Implements a :code:`Chill\MainBundle\Cron\CronJobInterface`. Here is an example:
|
|||||||
use Chill\MainBundle\Entity\CronJobExecution;
|
use Chill\MainBundle\Entity\CronJobExecution;
|
||||||
use DateInterval;
|
use DateInterval;
|
||||||
use DateTimeImmutable;
|
use DateTimeImmutable;
|
||||||
|
use Symfony\Component\Clock\ClockInterface;
|
||||||
|
|
||||||
class MyCronJob implements CronJobInterface
|
class MyCronJob implements CronJobInterface
|
||||||
{
|
{
|
||||||
|
function __construct(private ClockInterface $clock) {}
|
||||||
|
|
||||||
public function canRun(?CronJobExecution $cronJobExecution): bool
|
public function canRun(?CronJobExecution $cronJobExecution): bool
|
||||||
{
|
{
|
||||||
// the parameter $cronJobExecution contains data about the last execution of the cronjob
|
// the parameter $cronJobExecution contains data about the last execution of the cronjob
|
||||||
@@ -56,7 +59,7 @@ Implements a :code:`Chill\MainBundle\Cron\CronJobInterface`. Here is an example:
|
|||||||
|
|
||||||
// this cron job should be executed if the last execution is greater than one day, but only during the night
|
// this cron job should be executed if the last execution is greater than one day, but only during the night
|
||||||
|
|
||||||
$now = new DateTimeImmutable('now');
|
$now = $clock->now();
|
||||||
|
|
||||||
return $cronJobExecution->getLastStart() < $now->sub(new DateInterval('P1D'))
|
return $cronJobExecution->getLastStart() < $now->sub(new DateInterval('P1D'))
|
||||||
&& in_array($now->format('H'), self::ACCEPTED_HOURS, true)
|
&& in_array($now->format('H'), self::ACCEPTED_HOURS, true)
|
||||||
@@ -69,9 +72,14 @@ Implements a :code:`Chill\MainBundle\Cron\CronJobInterface`. Here is an example:
|
|||||||
return 'arbitrary-and-unique-key';
|
return 'arbitrary-and-unique-key';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function run(): void
|
public function run(array $lastExecutionData): void
|
||||||
{
|
{
|
||||||
// here, we execute the command
|
// here, we execute the command
|
||||||
|
|
||||||
|
// we return execution data, which will be served for next execution
|
||||||
|
// this data should be easily serializable in a json column: it should contains
|
||||||
|
// only int, string, etc. Avoid storing object
|
||||||
|
return ['last-execution-id' => 0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -59,7 +59,8 @@
|
|||||||
"vue-i18n": "^9.1.6",
|
"vue-i18n": "^9.1.6",
|
||||||
"vue-multiselect": "3.0.0-alpha.2",
|
"vue-multiselect": "3.0.0-alpha.2",
|
||||||
"vue-toast-notification": "^3.1.2",
|
"vue-toast-notification": "^3.1.2",
|
||||||
"vuex": "^4.0.0"
|
"vuex": "^4.0.0",
|
||||||
|
"bootstrap-icons": "^1.11.3"
|
||||||
},
|
},
|
||||||
"browserslist": [
|
"browserslist": [
|
||||||
"Firefox ESR"
|
"Firefox ESR"
|
||||||
|
@@ -68,7 +68,7 @@ final class ActivityController extends AbstractController
|
|||||||
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
|
private readonly FilterOrderHelperFactoryInterface $filterOrderHelperFactory,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
private readonly PaginatorFactory $paginatorFactory,
|
private readonly PaginatorFactory $paginatorFactory,
|
||||||
private readonly ChillSecurity $security
|
private readonly ChillSecurity $security,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -28,7 +28,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
protected ActivityReasonCategoryRepository $activityReasonCategoryRepository,
|
protected ActivityReasonCategoryRepository $activityReasonCategoryRepository,
|
||||||
protected ActivityReasonRepository $activityReasonRepository,
|
protected ActivityReasonRepository $activityReasonRepository,
|
||||||
protected TranslatableStringHelper $translatableStringHelper
|
protected TranslatableStringHelper $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -26,7 +26,7 @@ class ActivityUsersJobAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly UserJobRepositoryInterface $userJobRepository,
|
private readonly UserJobRepositoryInterface $userJobRepository,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -26,7 +26,7 @@ class ActivityUsersScopeAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ScopeRepositoryInterface $scopeRepository,
|
private readonly ScopeRepositoryInterface $scopeRepository,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -26,7 +26,7 @@ class CreatorJobAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly UserJobRepositoryInterface $userJobRepository,
|
private readonly UserJobRepositoryInterface $userJobRepository,
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper
|
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -26,7 +26,7 @@ class CreatorScopeAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ScopeRepository $scopeRepository,
|
private readonly ScopeRepository $scopeRepository,
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper
|
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -0,0 +1,99 @@
|
|||||||
|
<?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\ActivityBundle\Export\Aggregator\PersonAggregators;
|
||||||
|
|
||||||
|
use Chill\ActivityBundle\Export\Declarations;
|
||||||
|
use Chill\MainBundle\Export\AggregatorInterface;
|
||||||
|
use Chill\PersonBundle\Entity\Household\Household;
|
||||||
|
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
||||||
|
use Chill\PersonBundle\Repository\Household\HouseholdRepository;
|
||||||
|
use Doctrine\ORM\Query\Expr\Join;
|
||||||
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
use Symfony\Component\Form\FormBuilderInterface;
|
||||||
|
|
||||||
|
final readonly class HouseholdAggregator implements AggregatorInterface
|
||||||
|
{
|
||||||
|
public function __construct(private HouseholdRepository $householdRepository) {}
|
||||||
|
|
||||||
|
public function buildForm(FormBuilderInterface $builder)
|
||||||
|
{
|
||||||
|
// nothing to add here
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFormDefaultData(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getLabels($key, array $values, mixed $data)
|
||||||
|
{
|
||||||
|
return function (int|string|null $value): string|int {
|
||||||
|
if ('_header' === $value) {
|
||||||
|
return 'export.aggregator.person.by_household.household';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('' === $value || null === $value || null === $household = $this->householdRepository->find($value)) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $household->getId();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getQueryKeys($data)
|
||||||
|
{
|
||||||
|
return ['activity_household_agg'];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTitle()
|
||||||
|
{
|
||||||
|
return 'export.aggregator.person.by_household.title';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addRole(): ?string
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function alterQuery(QueryBuilder $qb, $data)
|
||||||
|
{
|
||||||
|
$qb->join(
|
||||||
|
HouseholdMember::class,
|
||||||
|
'activity_household_agg_household_member',
|
||||||
|
Join::WITH,
|
||||||
|
$qb->expr()->andX(
|
||||||
|
$qb->expr()->eq('activity_household_agg_household_member.person', 'activity.person'),
|
||||||
|
$qb->expr()->lte('activity_household_agg_household_member.startDate', 'activity.date'),
|
||||||
|
$qb->expr()->orX(
|
||||||
|
$qb->expr()->gte('activity_household_agg_household_member.endDate', 'activity.date'),
|
||||||
|
$qb->expr()->isNull('activity_household_agg_household_member.endDate')
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$qb->join(
|
||||||
|
Household::class,
|
||||||
|
'activity_household_agg_household',
|
||||||
|
Join::WITH,
|
||||||
|
$qb->expr()->eq('activity_household_agg_household_member.household', 'activity_household_agg_household')
|
||||||
|
);
|
||||||
|
|
||||||
|
$qb
|
||||||
|
->addSelect('activity_household_agg_household.id AS activity_household_agg')
|
||||||
|
->addGroupBy('activity_household_agg');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function applyOn()
|
||||||
|
{
|
||||||
|
return Declarations::ACTIVITY_PERSON;
|
||||||
|
}
|
||||||
|
}
|
@@ -19,6 +19,7 @@ use Chill\MainBundle\Export\FormatterInterface;
|
|||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
use Chill\MainBundle\Export\ListInterface;
|
use Chill\MainBundle\Export\ListInterface;
|
||||||
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
|
||||||
|
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
||||||
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
||||||
use Doctrine\DBAL\Exception\InvalidArgumentException;
|
use Doctrine\DBAL\Exception\InvalidArgumentException;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
@@ -44,6 +45,7 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
'person_firstname',
|
'person_firstname',
|
||||||
'person_lastname',
|
'person_lastname',
|
||||||
'person_id',
|
'person_id',
|
||||||
|
'household_id',
|
||||||
];
|
];
|
||||||
private readonly bool $filterStatsByCenters;
|
private readonly bool $filterStatsByCenters;
|
||||||
|
|
||||||
@@ -189,19 +191,26 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
{
|
{
|
||||||
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
$centers = array_map(static fn ($el) => $el['center'], $acl);
|
||||||
|
|
||||||
// throw an error if any fields are present
|
// throw an error if no fields are present
|
||||||
if (!\array_key_exists('fields', $data)) {
|
if (!\array_key_exists('fields', $data)) {
|
||||||
throw new InvalidArgumentException('Any fields have been checked.');
|
throw new InvalidArgumentException('No fields have been checked.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$qb = $this->entityManager->createQueryBuilder();
|
$qb = $this->entityManager->createQueryBuilder();
|
||||||
|
|
||||||
$qb
|
$qb
|
||||||
->from('ChillActivityBundle:Activity', 'activity')
|
->from('ChillActivityBundle:Activity', 'activity')
|
||||||
->join('activity.person', 'actperson');
|
->join('activity.person', 'person')
|
||||||
|
->join(
|
||||||
|
HouseholdMember::class,
|
||||||
|
'householdmember',
|
||||||
|
Query\Expr\Join::WITH,
|
||||||
|
'person = householdmember.person AND householdmember.startDate <= activity.date AND (householdmember.endDate IS NULL OR householdmember.endDate > activity.date)'
|
||||||
|
)
|
||||||
|
->join('householdmember.household', 'household');
|
||||||
|
|
||||||
if ($this->filterStatsByCenters) {
|
if ($this->filterStatsByCenters) {
|
||||||
$qb->join('actperson.centerHistory', 'centerHistory');
|
$qb->join('person.centerHistory', 'centerHistory');
|
||||||
$qb->where(
|
$qb->where(
|
||||||
$qb->expr()->andX(
|
$qb->expr()->andX(
|
||||||
$qb->expr()->lte('centerHistory.startDate', 'activity.date'),
|
$qb->expr()->lte('centerHistory.startDate', 'activity.date'),
|
||||||
@@ -224,17 +233,22 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'person_firstname':
|
case 'person_firstname':
|
||||||
$qb->addSelect('actperson.firstName AS person_firstname');
|
$qb->addSelect('person.firstName AS person_firstname');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'person_lastname':
|
case 'person_lastname':
|
||||||
$qb->addSelect('actperson.lastName AS person_lastname');
|
$qb->addSelect('person.lastName AS person_lastname');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'person_id':
|
case 'person_id':
|
||||||
$qb->addSelect('actperson.id AS person_id');
|
$qb->addSelect('person.id AS person_id');
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'household_id':
|
||||||
|
$qb->addSelect('household.id AS household_id');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -284,7 +298,7 @@ class ListActivity implements ListInterface, GroupedExportInterface
|
|||||||
return ActivityStatsVoter::LISTS;
|
return ActivityStatsVoter::LISTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function supportsModifiers()
|
public function supportsModifiers(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
Declarations::ACTIVITY,
|
Declarations::ACTIVITY,
|
||||||
|
@@ -42,7 +42,7 @@ class StatActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
/**
|
/**
|
||||||
* The action for this report.
|
* The action for this report.
|
||||||
*/
|
*/
|
||||||
protected string $action = 'sum'
|
protected string $action = 'sum',
|
||||||
) {
|
) {
|
||||||
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
$this->filterStatsByCenters = $parameterBag->get('chill_main')['acl']['filter_stats_by_center'];
|
||||||
}
|
}
|
||||||
|
@@ -39,7 +39,7 @@ class ListActivityHelper
|
|||||||
private readonly TranslatorInterface $translator,
|
private readonly TranslatorInterface $translator,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
private readonly TranslatableStringExportLabelHelper $translatableStringLabelHelper,
|
private readonly TranslatableStringExportLabelHelper $translatableStringLabelHelper,
|
||||||
private readonly UserHelper $userHelper
|
private readonly UserHelper $userHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addSelect(QueryBuilder $qb): void
|
public function addSelect(QueryBuilder $qb): void
|
||||||
|
@@ -73,7 +73,7 @@ final readonly class PeriodHavingActivityBetweenDatesFilter implements FilterInt
|
|||||||
|
|
||||||
$qb->andWhere(
|
$qb->andWhere(
|
||||||
$qb->expr()->exists(
|
$qb->expr()->exists(
|
||||||
'SELECT 1 FROM '.Activity::class." {$alias} WHERE {$alias}.date >= :{$from} AND {$alias}.date < :{$to} AND {$alias}.accompanyingPeriod = activity.accompanyingPeriod"
|
'SELECT 1 FROM '.Activity::class." {$alias} WHERE {$alias}.date >= :{$from} AND {$alias}.date < :{$to} AND {$alias}.accompanyingPeriod = acp"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -25,7 +25,7 @@ final readonly class ActivityPresenceFilter implements FilterInterface
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper,
|
private TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
private TranslatorInterface $translator
|
private TranslatorInterface $translator,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function getTitle()
|
public function getTitle()
|
||||||
|
@@ -26,7 +26,7 @@ class ActivityTypeFilter implements ExportElementValidatedInterface, FilterInter
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected TranslatableStringHelperInterface $translatableStringHelper,
|
protected TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
protected ActivityTypeRepositoryInterface $activityTypeRepository
|
protected ActivityTypeRepositoryInterface $activityTypeRepository,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -39,7 +39,7 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function alterQuery(QueryBuilder $qb, $data)
|
public function alterQuery(QueryBuilder $qb, $data): void
|
||||||
{
|
{
|
||||||
// create a subquery for activity
|
// create a subquery for activity
|
||||||
$sqb = $qb->getEntityManager()->createQueryBuilder();
|
$sqb = $qb->getEntityManager()->createQueryBuilder();
|
||||||
@@ -121,7 +121,7 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function describeAction($data, $format = 'string')
|
public function describeAction($data, $format = 'string'): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[] === $data['reasons'] ?
|
[] === $data['reasons'] ?
|
||||||
@@ -141,7 +141,7 @@ final readonly class PersonHavingActivityBetweenDateFilter implements ExportElem
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTitle()
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return 'export.filter.activity.person_between_dates.title';
|
return 'export.filter.activity.person_between_dates.title';
|
||||||
}
|
}
|
||||||
|
@@ -29,7 +29,7 @@ class UsersJobFilter implements FilterInterface
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
private readonly UserJobRepositoryInterface $userJobRepository
|
private readonly UserJobRepositoryInterface $userJobRepository,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -29,7 +29,7 @@ class UsersScopeFilter implements FilterInterface
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ScopeRepositoryInterface $scopeRepository,
|
private readonly ScopeRepositoryInterface $scopeRepository,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -59,7 +59,7 @@ class ActivityType extends AbstractType
|
|||||||
protected TranslatableStringHelper $translatableStringHelper,
|
protected TranslatableStringHelper $translatableStringHelper,
|
||||||
protected array $timeChoices,
|
protected array $timeChoices,
|
||||||
protected SocialIssueRender $socialIssueRender,
|
protected SocialIssueRender $socialIssueRender,
|
||||||
protected SocialActionRender $socialActionRender
|
protected SocialActionRender $socialActionRender,
|
||||||
) {
|
) {
|
||||||
if (!$tokenStorage->getToken()->getUser() instanceof User) {
|
if (!$tokenStorage->getToken()->getUser() instanceof User) {
|
||||||
throw new \RuntimeException('you should have a valid user');
|
throw new \RuntimeException('you should have a valid user');
|
||||||
|
@@ -27,7 +27,7 @@ class PickActivityReasonType extends AbstractType
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ActivityReasonRepository $activityReasonRepository,
|
private readonly ActivityReasonRepository $activityReasonRepository,
|
||||||
private readonly ActivityReasonRender $reasonRender,
|
private readonly ActivityReasonRender $reasonRender,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver)
|
public function configureOptions(OptionsResolver $resolver)
|
||||||
|
@@ -32,7 +32,7 @@ final readonly class ActivityDocumentACLAwareRepository implements ActivityDocum
|
|||||||
private EntityManagerInterface $em,
|
private EntityManagerInterface $em,
|
||||||
private CenterResolverManagerInterface $centerResolverManager,
|
private CenterResolverManagerInterface $centerResolverManager,
|
||||||
private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser,
|
private AuthorizationHelperForCurrentUserInterface $authorizationHelperForCurrentUser,
|
||||||
private Security $security
|
private Security $security,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface
|
public function buildFetchQueryActivityDocumentLinkedToPersonFromPersonContext(Person $person, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQueryInterface
|
||||||
|
@@ -25,7 +25,7 @@ class ActivityReasonRepository extends ServiceEntityRepository
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
ManagerRegistry $registry,
|
ManagerRegistry $registry,
|
||||||
private readonly RequestStack $requestStack
|
private readonly RequestStack $requestStack,
|
||||||
) {
|
) {
|
||||||
parent::__construct($registry, ActivityReason::class);
|
parent::__construct($registry, ActivityReason::class);
|
||||||
}
|
}
|
||||||
|
@@ -75,7 +75,7 @@ class ActivityVoter extends AbstractChillVoter implements ProvideRoleHierarchyIn
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
protected Security $security,
|
protected Security $security,
|
||||||
VoterHelperFactoryInterface $voterHelperFactory
|
VoterHelperFactoryInterface $voterHelperFactory,
|
||||||
) {
|
) {
|
||||||
$this->voterHelper = $voterHelperFactory->generate(self::class)
|
$this->voterHelper = $voterHelperFactory->generate(self::class)
|
||||||
->addCheckFor(Person::class, [self::SEE, self::CREATE])
|
->addCheckFor(Person::class, [self::SEE, self::CREATE])
|
||||||
|
@@ -50,7 +50,7 @@ class ActivityContext implements
|
|||||||
private readonly TranslatorInterface $translator,
|
private readonly TranslatorInterface $translator,
|
||||||
private readonly BaseContextData $baseContextData,
|
private readonly BaseContextData $baseContextData,
|
||||||
private readonly ThirdPartyRender $thirdPartyRender,
|
private readonly ThirdPartyRender $thirdPartyRender,
|
||||||
private readonly ThirdPartyRepository $thirdPartyRepository
|
private readonly ThirdPartyRepository $thirdPartyRepository,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function adminFormReverseTransform(array $data): array
|
public function adminFormReverseTransform(array $data): array
|
||||||
|
@@ -56,7 +56,7 @@ class ListActivitiesByAccompanyingPeriodContext implements
|
|||||||
private readonly SocialIssueRepository $socialIssueRepository,
|
private readonly SocialIssueRepository $socialIssueRepository,
|
||||||
private readonly ThirdPartyRepository $thirdPartyRepository,
|
private readonly ThirdPartyRepository $thirdPartyRepository,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
private readonly UserRepository $userRepository
|
private readonly UserRepository $userRepository,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function adminFormReverseTransform(array $data): array
|
public function adminFormReverseTransform(array $data): array
|
||||||
|
@@ -76,7 +76,7 @@ final class TranslatableActivityReasonTest extends TypeTestCase
|
|||||||
*/
|
*/
|
||||||
protected function getTranslatableStringHelper(
|
protected function getTranslatableStringHelper(
|
||||||
$locale = 'en',
|
$locale = 'en',
|
||||||
$fallbackLocale = 'en'
|
$fallbackLocale = 'en',
|
||||||
) {
|
) {
|
||||||
$prophet = new \Prophecy\Prophet();
|
$prophet = new \Prophecy\Prophet();
|
||||||
$requestStack = $prophet->prophesize();
|
$requestStack = $prophet->prophesize();
|
||||||
|
@@ -138,7 +138,7 @@ final class ActivityVoterTest extends KernelTestCase
|
|||||||
Scope $scope,
|
Scope $scope,
|
||||||
Center $center,
|
Center $center,
|
||||||
$attribute,
|
$attribute,
|
||||||
$message
|
$message,
|
||||||
) {
|
) {
|
||||||
$token = $this->prepareToken($user);
|
$token = $this->prepareToken($user);
|
||||||
$activity = $this->prepareActivity($scope, $this->preparePerson($center));
|
$activity = $this->prepareActivity($scope, $this->preparePerson($center));
|
||||||
|
@@ -32,7 +32,7 @@ class TimelineActivityProvider implements TimelineProviderInterface
|
|||||||
protected EntityManagerInterface $em,
|
protected EntityManagerInterface $em,
|
||||||
protected AuthorizationHelperInterface $helper,
|
protected AuthorizationHelperInterface $helper,
|
||||||
TokenStorageInterface $storage,
|
TokenStorageInterface $storage,
|
||||||
protected ActivityACLAwareRepository $aclAwareRepository
|
protected ActivityACLAwareRepository $aclAwareRepository,
|
||||||
) {
|
) {
|
||||||
if (!$storage->getToken()->getUser() instanceof User) {
|
if (!$storage->getToken()->getUser() instanceof User) {
|
||||||
throw new \RuntimeException('A user should be authenticated !');
|
throw new \RuntimeException('A user should be authenticated !');
|
||||||
|
@@ -243,3 +243,7 @@ services:
|
|||||||
Chill\ActivityBundle\Export\Aggregator\PersonAggregators\PersonAggregator:
|
Chill\ActivityBundle\Export\Aggregator\PersonAggregators\PersonAggregator:
|
||||||
tags:
|
tags:
|
||||||
- { name: chill.export_aggregator, alias: activity_person_agg }
|
- { name: chill.export_aggregator, alias: activity_person_agg }
|
||||||
|
|
||||||
|
Chill\ActivityBundle\Export\Aggregator\PersonAggregators\HouseholdAggregator:
|
||||||
|
tags:
|
||||||
|
- { name: chill.export_aggregator, alias: activity_household_agg }
|
||||||
|
@@ -428,6 +428,9 @@ export:
|
|||||||
by_person:
|
by_person:
|
||||||
title: Grouper les échanges par usager (dossier d'usager dans lequel l'échange est enregistré)
|
title: Grouper les échanges par usager (dossier d'usager dans lequel l'échange est enregistré)
|
||||||
person: Usager
|
person: Usager
|
||||||
|
by_household:
|
||||||
|
title: Grouper les échanges par ménage
|
||||||
|
household: Identifiant ménage
|
||||||
acp:
|
acp:
|
||||||
by_activity_type:
|
by_activity_type:
|
||||||
title: Grouper les parcours par type d'échange
|
title: Grouper les parcours par type d'échange
|
||||||
|
@@ -25,7 +25,7 @@ final class AsideActivityController extends CRUDController
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly AsideActivityCategoryRepository $categoryRepository,
|
private readonly AsideActivityCategoryRepository $categoryRepository,
|
||||||
private readonly Security $security
|
private readonly Security $security,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function createEntity(string $action, Request $request): object
|
public function createEntity(string $action, Request $request): object
|
||||||
@@ -76,7 +76,7 @@ final class AsideActivityController extends CRUDController
|
|||||||
string $action,
|
string $action,
|
||||||
$query,
|
$query,
|
||||||
Request $request,
|
Request $request,
|
||||||
PaginatorInterface $paginator
|
PaginatorInterface $paginator,
|
||||||
) {
|
) {
|
||||||
if ('index' === $action) {
|
if ('index' === $action) {
|
||||||
return $query->orderBy('e.date', 'DESC');
|
return $query->orderBy('e.date', 'DESC');
|
||||||
|
@@ -22,7 +22,7 @@ class ByActivityTypeAggregator implements AggregatorInterface
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly AsideActivityCategoryRepository $asideActivityCategoryRepository,
|
private readonly AsideActivityCategoryRepository $asideActivityCategoryRepository,
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper
|
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -26,7 +26,7 @@ class ByUserJobAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly UserJobRepositoryInterface $userJobRepository,
|
private readonly UserJobRepositoryInterface $userJobRepository,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -26,7 +26,7 @@ class ByUserScopeAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ScopeRepositoryInterface $scopeRepository,
|
private readonly ScopeRepositoryInterface $scopeRepository,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -41,7 +41,7 @@ final readonly class ListAsideActivity implements ListInterface, GroupedExportIn
|
|||||||
private AsideActivityCategoryRepository $asideActivityCategoryRepository,
|
private AsideActivityCategoryRepository $asideActivityCategoryRepository,
|
||||||
private CategoryRender $categoryRender,
|
private CategoryRender $categoryRender,
|
||||||
private LocationRepository $locationRepository,
|
private LocationRepository $locationRepository,
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper
|
private TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder) {}
|
public function buildForm(FormBuilderInterface $builder) {}
|
||||||
|
@@ -27,7 +27,7 @@ class ByActivityTypeFilter implements FilterInterface
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly CategoryRender $categoryRender,
|
private readonly CategoryRender $categoryRender,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
private readonly AsideActivityCategoryRepository $asideActivityTypeRepository
|
private readonly AsideActivityCategoryRepository $asideActivityTypeRepository,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -24,7 +24,7 @@ use Symfony\Component\Security\Core\Security;
|
|||||||
final readonly class ByLocationFilter implements FilterInterface
|
final readonly class ByLocationFilter implements FilterInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private Security $security
|
private Security $security,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
|
@@ -29,7 +29,7 @@ class ByUserJobFilter implements FilterInterface
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
private readonly UserJobRepositoryInterface $userJobRepository
|
private readonly UserJobRepositoryInterface $userJobRepository,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -29,7 +29,7 @@ class ByUserScopeFilter implements FilterInterface
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ScopeRepositoryInterface $scopeRepository,
|
private readonly ScopeRepositoryInterface $scopeRepository,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -44,7 +44,7 @@ class UserMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
CountNotificationTask $counter,
|
CountNotificationTask $counter,
|
||||||
TokenStorageInterface $tokenStorage,
|
TokenStorageInterface $tokenStorage,
|
||||||
TranslatorInterface $translator,
|
TranslatorInterface $translator,
|
||||||
AuthorizationCheckerInterface $authorizationChecker
|
AuthorizationCheckerInterface $authorizationChecker,
|
||||||
) {
|
) {
|
||||||
$this->counter = $counter;
|
$this->counter = $counter;
|
||||||
$this->tokenStorage = $tokenStorage;
|
$this->tokenStorage = $tokenStorage;
|
||||||
|
@@ -26,7 +26,7 @@ class AsideActivityVoter extends AbstractChillVoter implements ProvideRoleHierar
|
|||||||
private readonly VoterHelperInterface $voterHelper;
|
private readonly VoterHelperInterface $voterHelper;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
VoterHelperFactoryInterface $voterHelperFactory
|
VoterHelperFactoryInterface $voterHelperFactory,
|
||||||
) {
|
) {
|
||||||
$this->voterHelper = $voterHelperFactory
|
$this->voterHelper = $voterHelperFactory
|
||||||
->generate(self::class)
|
->generate(self::class)
|
||||||
|
@@ -47,7 +47,7 @@ class SendTestShortMessageOnCalendarCommand extends Command
|
|||||||
private readonly PhoneNumberHelperInterface $phoneNumberHelper,
|
private readonly PhoneNumberHelperInterface $phoneNumberHelper,
|
||||||
private readonly ShortMessageForCalendarBuilderInterface $messageForCalendarBuilder,
|
private readonly ShortMessageForCalendarBuilderInterface $messageForCalendarBuilder,
|
||||||
private readonly ShortMessageTransporterInterface $transporter,
|
private readonly ShortMessageTransporterInterface $transporter,
|
||||||
private readonly UserRepositoryInterface $userRepository
|
private readonly UserRepositoryInterface $userRepository,
|
||||||
) {
|
) {
|
||||||
parent::__construct('chill:calendar:test-send-short-message');
|
parent::__construct('chill:calendar:test-send-short-message');
|
||||||
}
|
}
|
||||||
|
@@ -59,7 +59,7 @@ class CalendarController extends AbstractController
|
|||||||
private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository,
|
private readonly AccompanyingPeriodRepository $accompanyingPeriodRepository,
|
||||||
private readonly UserRepositoryInterface $userRepository,
|
private readonly UserRepositoryInterface $userRepository,
|
||||||
private readonly TranslatorInterface $translator,
|
private readonly TranslatorInterface $translator,
|
||||||
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry
|
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -47,7 +47,7 @@ class CalendarDoc implements TrackCreationInterface, TrackUpdateInterface
|
|||||||
Calendar $calendar,
|
Calendar $calendar,
|
||||||
#[ORM\ManyToOne(targetEntity: StoredObject::class, cascade: ['persist'])]
|
#[ORM\ManyToOne(targetEntity: StoredObject::class, cascade: ['persist'])]
|
||||||
#[ORM\JoinColumn(nullable: false)]
|
#[ORM\JoinColumn(nullable: false)]
|
||||||
private ?StoredObject $storedObject
|
private ?StoredObject $storedObject,
|
||||||
) {
|
) {
|
||||||
$this->setCalendar($calendar);
|
$this->setCalendar($calendar);
|
||||||
$this->datetimeVersion = $calendar->getDateTimeVersion();
|
$this->datetimeVersion = $calendar->getDateTimeVersion();
|
||||||
|
@@ -26,7 +26,7 @@ final readonly class JobAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private UserJobRepository $jobRepository,
|
private UserJobRepository $jobRepository,
|
||||||
private TranslatableStringHelper $translatableStringHelper
|
private TranslatableStringHelper $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -26,7 +26,7 @@ final readonly class ScopeAggregator implements AggregatorInterface
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private ScopeRepository $scopeRepository,
|
private ScopeRepository $scopeRepository,
|
||||||
private TranslatableStringHelper $translatableStringHelper
|
private TranslatableStringHelper $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -28,7 +28,7 @@ final readonly class JobFilter implements FilterInterface
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private TranslatableStringHelper $translatableStringHelper,
|
private TranslatableStringHelper $translatableStringHelper,
|
||||||
private UserJobRepositoryInterface $userJobRepository
|
private UserJobRepositoryInterface $userJobRepository,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -30,7 +30,7 @@ class ScopeFilter implements FilterInterface
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
protected TranslatorInterface $translator,
|
protected TranslatorInterface $translator,
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper,
|
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||||
private readonly ScopeRepositoryInterface $scopeRepository
|
private readonly ScopeRepositoryInterface $scopeRepository,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function addRole(): ?string
|
public function addRole(): ?string
|
||||||
|
@@ -37,7 +37,7 @@ class CalendarType extends AbstractType
|
|||||||
private readonly IdToUsersDataTransformer $idToUsersDataTransformer,
|
private readonly IdToUsersDataTransformer $idToUsersDataTransformer,
|
||||||
private readonly IdToLocationDataTransformer $idToLocationDataTransformer,
|
private readonly IdToLocationDataTransformer $idToLocationDataTransformer,
|
||||||
private readonly ThirdPartiesToIdDataTransformer $partiesToIdDataTransformer,
|
private readonly ThirdPartiesToIdDataTransformer $partiesToIdDataTransformer,
|
||||||
private readonly IdToCalendarRangeDataTransformer $calendarRangeDataTransformer
|
private readonly IdToCalendarRangeDataTransformer $calendarRangeDataTransformer,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
|
@@ -46,7 +46,7 @@ class CalendarMessage
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
Calendar $calendar,
|
Calendar $calendar,
|
||||||
private readonly string $action,
|
private readonly string $action,
|
||||||
User $byUser
|
User $byUser,
|
||||||
) {
|
) {
|
||||||
$this->calendarId = $calendar->getId();
|
$this->calendarId = $calendar->getId();
|
||||||
$this->byUserId = $byUser->getId();
|
$this->byUserId = $byUser->getId();
|
||||||
|
@@ -59,7 +59,7 @@ final readonly class MSUserAbsenceReader implements MSUserAbsenceReaderInterface
|
|||||||
'alwaysEnabled' => true,
|
'alwaysEnabled' => true,
|
||||||
'scheduled' => RemoteEventConverter::convertStringDateWithoutTimezone($automaticRepliesSettings['scheduledStartDateTime']['dateTime']) < $this->clock->now()
|
'scheduled' => RemoteEventConverter::convertStringDateWithoutTimezone($automaticRepliesSettings['scheduledStartDateTime']['dateTime']) < $this->clock->now()
|
||||||
&& RemoteEventConverter::convertStringDateWithoutTimezone($automaticRepliesSettings['scheduledEndDateTime']['dateTime']) > $this->clock->now(),
|
&& RemoteEventConverter::convertStringDateWithoutTimezone($automaticRepliesSettings['scheduledEndDateTime']['dateTime']) > $this->clock->now(),
|
||||||
default => throw new UserAbsenceSyncException('this status is not documented by Microsoft')
|
default => throw new UserAbsenceSyncException('this status is not documented by Microsoft'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -177,7 +177,7 @@ class MapCalendarToUser
|
|||||||
User $user,
|
User $user,
|
||||||
int $expiration,
|
int $expiration,
|
||||||
?string $id = null,
|
?string $id = null,
|
||||||
?string $secret = null
|
?string $secret = null,
|
||||||
): void {
|
): void {
|
||||||
$user->setAttributeByDomain(self::METADATA_KEY, self::EXPIRATION_SUBSCRIPTION_EVENT, $expiration);
|
$user->setAttributeByDomain(self::METADATA_KEY, self::EXPIRATION_SUBSCRIPTION_EVENT, $expiration);
|
||||||
|
|
||||||
|
@@ -57,7 +57,7 @@ class RemoteEventConverter
|
|||||||
private readonly LocationConverter $locationConverter,
|
private readonly LocationConverter $locationConverter,
|
||||||
private readonly LoggerInterface $logger,
|
private readonly LoggerInterface $logger,
|
||||||
private readonly PersonRenderInterface $personRender,
|
private readonly PersonRenderInterface $personRender,
|
||||||
private readonly TranslatorInterface $translator
|
private readonly TranslatorInterface $translator,
|
||||||
) {
|
) {
|
||||||
$this->defaultDateTimeZone = (new \DateTimeImmutable())->getTimezone();
|
$this->defaultDateTimeZone = (new \DateTimeImmutable())->getTimezone();
|
||||||
$this->remoteDateTimeZone = self::getRemoteTimeZone();
|
$this->remoteDateTimeZone = self::getRemoteTimeZone();
|
||||||
|
@@ -351,7 +351,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
|
|||||||
[
|
[
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'lastModifiedDateTime' => $lastModified,
|
'lastModifiedDateTime' => $lastModified,
|
||||||
'changeKey' => $changeKey
|
'changeKey' => $changeKey,
|
||||||
] = $this->createOnRemote($eventData, $calendar->getMainUser(), 'calendar_'.$calendar->getId());
|
] = $this->createOnRemote($eventData, $calendar->getMainUser(), 'calendar_'.$calendar->getId());
|
||||||
|
|
||||||
if (null === $id) {
|
if (null === $id) {
|
||||||
@@ -427,7 +427,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
|
|||||||
[
|
[
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'lastModifiedDateTime' => $lastModified,
|
'lastModifiedDateTime' => $lastModified,
|
||||||
'changeKey' => $changeKey
|
'changeKey' => $changeKey,
|
||||||
] = $this->createOnRemote(
|
] = $this->createOnRemote(
|
||||||
$eventData,
|
$eventData,
|
||||||
$calendarRange->getUser(),
|
$calendarRange->getUser(),
|
||||||
@@ -564,7 +564,7 @@ class MSGraphRemoteCalendarConnector implements RemoteCalendarConnectorInterface
|
|||||||
[
|
[
|
||||||
'id' => $id,
|
'id' => $id,
|
||||||
'lastModifiedDateTime' => $lastModified,
|
'lastModifiedDateTime' => $lastModified,
|
||||||
'changeKey' => $changeKey
|
'changeKey' => $changeKey,
|
||||||
] = $this->patchOnRemote(
|
] = $this->patchOnRemote(
|
||||||
$calendar->getRemoteId(),
|
$calendar->getRemoteId(),
|
||||||
$eventData,
|
$eventData,
|
||||||
|
@@ -33,6 +33,6 @@ class RemoteEvent
|
|||||||
#[Serializer\Groups(['read'])]
|
#[Serializer\Groups(['read'])]
|
||||||
public \DateTimeImmutable $endDate,
|
public \DateTimeImmutable $endDate,
|
||||||
#[Serializer\Groups(['read'])]
|
#[Serializer\Groups(['read'])]
|
||||||
public bool $isAllDay = false
|
public bool $isAllDay = false,
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
|
@@ -65,7 +65,7 @@ class CalendarRangeRepository implements ObjectRepository
|
|||||||
\DateTimeImmutable $from,
|
\DateTimeImmutable $from,
|
||||||
\DateTimeImmutable $to,
|
\DateTimeImmutable $to,
|
||||||
?int $limit = null,
|
?int $limit = null,
|
||||||
?int $offset = null
|
?int $offset = null,
|
||||||
): array {
|
): array {
|
||||||
$qb = $this->buildQueryAvailableRangesForUser($user, $from, $to);
|
$qb = $this->buildQueryAvailableRangesForUser($user, $from, $to);
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
<label class="form-label">{{ $t('created_availabilities') }}</label>
|
<label class="form-label">{{ $t("created_availabilities") }}</label>
|
||||||
<vue-multiselect
|
<vue-multiselect
|
||||||
v-model="pickedLocation"
|
v-model="pickedLocation"
|
||||||
:options="locations"
|
:options="locations"
|
||||||
@@ -14,10 +14,15 @@
|
|||||||
></vue-multiselect>
|
></vue-multiselect>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="display-options row justify-content-between" style="margin-top: 1rem;">
|
<div
|
||||||
|
class="display-options row justify-content-between"
|
||||||
|
style="margin-top: 1rem"
|
||||||
|
>
|
||||||
<div class="col-sm-9 col-xs-12">
|
<div class="col-sm-9 col-xs-12">
|
||||||
<div class="input-group mb-3">
|
<div class="input-group mb-3">
|
||||||
<label class="input-group-text" for="slotDuration">Durée des créneaux</label>
|
<label class="input-group-text" for="slotDuration"
|
||||||
|
>Durée des créneaux</label
|
||||||
|
>
|
||||||
<select v-model="slotDuration" id="slotDuration" class="form-select">
|
<select v-model="slotDuration" id="slotDuration" class="form-select">
|
||||||
<option value="00:05:00">5 minutes</option>
|
<option value="00:05:00">5 minutes</option>
|
||||||
<option value="00:10:00">10 minutes</option>
|
<option value="00:10:00">10 minutes</option>
|
||||||
@@ -58,13 +63,20 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3 col-xs-12">
|
<div class="col-xs-12 col-sm-3">
|
||||||
<div class="float-end">
|
<div class="float-end">
|
||||||
<div class="form-check input-group">
|
<div class="form-check input-group">
|
||||||
<span class="input-group-text">
|
<span class="input-group-text">
|
||||||
<input id="showHideWE" class="mt-0" type="checkbox" v-model="showWeekends">
|
<input
|
||||||
|
id="showHideWE"
|
||||||
|
class="mt-0"
|
||||||
|
type="checkbox"
|
||||||
|
v-model="showWeekends"
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
<label for="showHideWE" class="form-check-label input-group-text">Week-ends</label>
|
<label for="showHideWE" class="form-check-label input-group-text"
|
||||||
|
>Week-ends</label
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -72,39 +84,86 @@
|
|||||||
<FullCalendar :options="calendarOptions" ref="calendarRef">
|
<FullCalendar :options="calendarOptions" ref="calendarRef">
|
||||||
<template v-slot:eventContent="arg: EventApi">
|
<template v-slot:eventContent="arg: EventApi">
|
||||||
<span :class="eventClasses(arg.event)">
|
<span :class="eventClasses(arg.event)">
|
||||||
<b v-if="arg.event.extendedProps.is === 'remote'">{{ arg.event.title}}</b>
|
<b v-if="arg.event.extendedProps.is === 'remote'">{{
|
||||||
<b v-else-if="arg.event.extendedProps.is === 'range'">{{ arg.timeText }} - {{ arg.event.extendedProps.locationName }}</b>
|
arg.event.title
|
||||||
<b v-else-if="arg.event.extendedProps.is === 'local'">{{ arg.event.title}}</b>
|
}}</b>
|
||||||
|
<b v-else-if="arg.event.extendedProps.is === 'range'"
|
||||||
|
>{{ arg.timeText }} - {{ arg.event.extendedProps.locationName }}</b
|
||||||
|
>
|
||||||
|
<b v-else-if="arg.event.extendedProps.is === 'local'">{{
|
||||||
|
arg.event.title
|
||||||
|
}}</b>
|
||||||
<b v-else>no 'is'</b>
|
<b v-else>no 'is'</b>
|
||||||
<a v-if="arg.event.extendedProps.is === 'range'" class="fa fa-fw fa-times delete"
|
<a
|
||||||
@click.prevent="onClickDelete(arg.event)">
|
v-if="arg.event.extendedProps.is === 'range'"
|
||||||
|
class="fa fa-fw fa-times delete"
|
||||||
|
@click.prevent="onClickDelete(arg.event)"
|
||||||
|
>
|
||||||
</a>
|
</a>
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</FullCalendar>
|
</FullCalendar>
|
||||||
|
|
||||||
<div id="copy-widget">
|
<div id="copy-widget">
|
||||||
<div class="container">
|
<div class="container mt-2 mb-2">
|
||||||
<div class="row align-items-center">
|
|
||||||
<div class="col-sm-4 col-xs-12">
|
<div class="row justify-content-between align-items-center mb-4">
|
||||||
<h6 class="chill-red">{{ $t('copy_range_from_to') }}</h6>
|
<div class="col-xs-12 col-sm-3 col-md-2">
|
||||||
|
<h6 class="chill-red">{{ $t("copy_range_from_to") }}</h6>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3 col-xs-12">
|
<div class="col-xs-12 col-sm-9 col-md-2">
|
||||||
|
<select v-model="dayOrWeek" id="dayOrWeek" class="form-select">
|
||||||
|
<option value="day">{{ $t("from_day_to_day") }}</option>
|
||||||
|
<option value="week">{{ $t("from_week_to_week") }}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<template v-if="dayOrWeek === 'day'">
|
||||||
|
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||||
<input class="form-control" type="date" v-model="copyFrom" />
|
<input class="form-control" type="date" v-model="copyFrom" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-1 col-xs-12" style="text-align: center; font-size: x-large;">
|
<div class="col-xs-12 col-sm-1 col-md-1 copy-chevron">
|
||||||
<i class="fa fa-angle-double-right"></i>
|
<i class="fa fa-angle-double-right"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3 col-xs-12" >
|
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||||
<input class="form-control" type="date" v-model="copyTo" />
|
<input class="form-control" type="date" v-model="copyTo" />
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-1">
|
<div class="col-xs-12 col-sm-5 col-md-1">
|
||||||
<button class="btn btn-action" @click="copyDay">
|
<button class="btn btn-action float-end" @click="copyDay">
|
||||||
{{ $t('copy_range') }}
|
{{ $t("copy_range") }}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||||
|
<select
|
||||||
|
v-model="copyFromWeek"
|
||||||
|
id="copyFromWeek"
|
||||||
|
class="form-select"
|
||||||
|
>
|
||||||
|
<option v-for="w in lastWeeks" :value="w.value" :key="w.value">
|
||||||
|
{{ w.text }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12 col-sm-1 col-md-1 copy-chevron">
|
||||||
|
<i class="fa fa-angle-double-right"></i>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12 col-sm-3 col-md-3">
|
||||||
|
<select v-model="copyToWeek" id="copyToWeek" class="form-select">
|
||||||
|
<option v-for="w in nextWeeks" :value="w.value" :key="w.value">
|
||||||
|
{{ w.text }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-12 col-sm-5 col-md-1">
|
||||||
|
<button class="btn btn-action float-end" @click="copyWeek">
|
||||||
|
{{ $t("copy_range") }}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- not directly seen, but include in a modal -->
|
<!-- not directly seen, but include in a modal -->
|
||||||
@@ -112,21 +171,31 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
CalendarOptions,
|
CalendarOptions,
|
||||||
DatesSetArg,
|
DatesSetArg,
|
||||||
EventInput
|
EventInput,
|
||||||
} from '@fullcalendar/core';
|
} from "@fullcalendar/core";
|
||||||
import {reactive, computed, ref} from "vue";
|
import { reactive, computed, ref, onMounted } from "vue";
|
||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
import {key} from './store';
|
import { key } from "./store";
|
||||||
import FullCalendar from '@fullcalendar/vue3';
|
import FullCalendar from "@fullcalendar/vue3";
|
||||||
import frLocale from '@fullcalendar/core/locales/fr';
|
import frLocale from "@fullcalendar/core/locales/fr";
|
||||||
import interactionPlugin, {DropArg, EventResizeDoneArg} from "@fullcalendar/interaction";
|
import interactionPlugin, {
|
||||||
|
DropArg,
|
||||||
|
EventResizeDoneArg,
|
||||||
|
} from "@fullcalendar/interaction";
|
||||||
import timeGridPlugin from "@fullcalendar/timegrid";
|
import timeGridPlugin from "@fullcalendar/timegrid";
|
||||||
import {EventApi, DateSelectArg, EventDropArg, EventClickArg} from "@fullcalendar/core";
|
import {
|
||||||
import {ISOToDate} from "../../../../../ChillMainBundle/Resources/public/chill/js/date";
|
EventApi,
|
||||||
|
DateSelectArg,
|
||||||
|
EventDropArg,
|
||||||
|
EventClickArg,
|
||||||
|
} from "@fullcalendar/core";
|
||||||
|
import {
|
||||||
|
dateToISO,
|
||||||
|
ISOToDate,
|
||||||
|
} from "../../../../../ChillMainBundle/Resources/public/chill/js/date";
|
||||||
import VueMultiselect from "vue-multiselect";
|
import VueMultiselect from "vue-multiselect";
|
||||||
import { Location } from "../../../../../ChillMainBundle/Resources/public/types";
|
import { Location } from "../../../../../ChillMainBundle/Resources/public/types";
|
||||||
import EditLocation from "./Components/EditLocation.vue";
|
import EditLocation from "./Components/EditLocation.vue";
|
||||||
@@ -137,17 +206,60 @@ const store = useStore(key);
|
|||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const showWeekends = ref(false);
|
const showWeekends = ref(false);
|
||||||
const slotDuration = ref('00:05:00');
|
const slotDuration = ref("00:15:00");
|
||||||
const slotMinTime = ref('09:00:00');
|
const slotMinTime = ref("09:00:00");
|
||||||
const slotMaxTime = ref('18:00:00');
|
const slotMaxTime = ref("18:00:00");
|
||||||
const copyFrom = ref<string | null>(null);
|
const copyFrom = ref<string | null>(null);
|
||||||
const copyTo = ref<string | null>(null);
|
const copyTo = ref<string | null>(null);
|
||||||
const editLocation = ref<InstanceType<typeof EditLocation> | null>(null)
|
const editLocation = ref<InstanceType<typeof EditLocation> | null>(null);
|
||||||
|
const dayOrWeek = ref("day");
|
||||||
|
const copyFromWeek = ref<string | null>(null);
|
||||||
|
const copyToWeek = ref<string | null>(null);
|
||||||
|
|
||||||
|
interface Weeks {
|
||||||
|
value: string | null;
|
||||||
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const getMonday = (week: number): Date => {
|
||||||
|
const lastMonday = new Date();
|
||||||
|
lastMonday.setDate(
|
||||||
|
lastMonday.getDate() - ((lastMonday.getDay() + 6) % 7) + week * 7
|
||||||
|
);
|
||||||
|
return lastMonday;
|
||||||
|
};
|
||||||
|
|
||||||
|
const dateOptions: Intl.DateTimeFormatOptions = {
|
||||||
|
weekday: "long",
|
||||||
|
year: "numeric",
|
||||||
|
month: "long",
|
||||||
|
day: "numeric",
|
||||||
|
};
|
||||||
|
|
||||||
|
const lastWeeks = computed((): Weeks[] =>
|
||||||
|
Array.from(Array(30).keys()).map((w) => {
|
||||||
|
const lastMonday = getMonday(15-w);
|
||||||
|
return {
|
||||||
|
value: dateToISO(lastMonday),
|
||||||
|
text: `Semaine du ${lastMonday.toLocaleDateString("fr-FR", dateOptions)}`,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
const nextWeeks = computed((): Weeks[] =>
|
||||||
|
Array.from(Array(52).keys()).map((w) => {
|
||||||
|
const nextMonday = getMonday(w + 1);
|
||||||
|
return {
|
||||||
|
value: dateToISO(nextMonday),
|
||||||
|
text: `Semaine du ${nextMonday.toLocaleDateString("fr-FR", dateOptions)}`,
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
const baseOptions = ref<CalendarOptions>({
|
const baseOptions = ref<CalendarOptions>({
|
||||||
locale: frLocale,
|
locale: frLocale,
|
||||||
plugins: [interactionPlugin, timeGridPlugin],
|
plugins: [interactionPlugin, timeGridPlugin],
|
||||||
initialView: 'timeGridWeek',
|
initialView: "timeGridWeek",
|
||||||
initialDate: new Date(),
|
initialDate: new Date(),
|
||||||
scrollTimeReset: false,
|
scrollTimeReset: false,
|
||||||
selectable: true,
|
selectable: true,
|
||||||
@@ -164,9 +276,9 @@ const baseOptions = ref<CalendarOptions>({
|
|||||||
selectMirror: false,
|
selectMirror: false,
|
||||||
editable: true,
|
editable: true,
|
||||||
headerToolbar: {
|
headerToolbar: {
|
||||||
left: 'prev,next today',
|
left: "prev,next today",
|
||||||
center: 'title',
|
center: "title",
|
||||||
right: 'timeGridWeek,timeGridDay'
|
right: "timeGridWeek,timeGridDay",
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -180,20 +292,23 @@ const locations = computed<Location[]>(() => {
|
|||||||
|
|
||||||
const pickedLocation = computed<Location | null>({
|
const pickedLocation = computed<Location | null>({
|
||||||
get(): Location | null {
|
get(): Location | null {
|
||||||
return store.state.locations.locationPicked || store.state.locations.currentLocation;
|
return (
|
||||||
|
store.state.locations.locationPicked ||
|
||||||
|
store.state.locations.currentLocation
|
||||||
|
);
|
||||||
},
|
},
|
||||||
set(newLocation: Location | null): void {
|
set(newLocation: Location | null): void {
|
||||||
store.commit('locations/setLocationPicked', newLocation, {root: true});
|
store.commit("locations/setLocationPicked", newLocation, { root: true });
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* return the show classes for the event
|
* return the show classes for the event
|
||||||
* @param arg
|
* @param arg
|
||||||
*/
|
*/
|
||||||
const eventClasses = function (arg: EventApi): object {
|
const eventClasses = function (arg: EventApi): object {
|
||||||
return {'calendarRangeItems': true};
|
return { calendarRangeItems: true };
|
||||||
}
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// currently, all events are stored into calendarRanges, due to reactivity bug
|
// currently, all events are stored into calendarRanges, due to reactivity bug
|
||||||
@@ -230,51 +345,60 @@ const calendarOptions = computed((): CalendarOptions => {
|
|||||||
* launched when the calendar range date change
|
* launched when the calendar range date change
|
||||||
*/
|
*/
|
||||||
function onDatesSet(event: DatesSetArg): void {
|
function onDatesSet(event: DatesSetArg): void {
|
||||||
store.dispatch('fullCalendar/setCurrentDatesView', {start: event.start, end: event.end});
|
store.dispatch("fullCalendar/setCurrentDatesView", {
|
||||||
|
start: event.start,
|
||||||
|
end: event.end,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDateSelect(event: DateSelectArg): void {
|
function onDateSelect(event: DateSelectArg): void {
|
||||||
|
|
||||||
if (null === pickedLocation.value) {
|
if (null === pickedLocation.value) {
|
||||||
window.alert("Indiquez une localisation avant de créer une période de disponibilité.");
|
window.alert(
|
||||||
|
"Indiquez une localisation avant de créer une période de disponibilité."
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
store.dispatch('calendarRanges/createRange', {start: event.start, end: event.end, location: pickedLocation.value});
|
store.dispatch("calendarRanges/createRange", {
|
||||||
|
start: event.start,
|
||||||
|
end: event.end,
|
||||||
|
location: pickedLocation.value,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When a calendar range is deleted
|
* When a calendar range is deleted
|
||||||
*/
|
*/
|
||||||
function onClickDelete(event: EventApi): void {
|
function onClickDelete(event: EventApi): void {
|
||||||
console.log('onClickDelete', event);
|
if (event.extendedProps.is !== "range") {
|
||||||
|
|
||||||
if (event.extendedProps.is !== 'range') {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
store.dispatch('calendarRanges/deleteRange', event.extendedProps.calendarRangeId);
|
store.dispatch(
|
||||||
|
"calendarRanges/deleteRange",
|
||||||
|
event.extendedProps.calendarRangeId
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function onEventDropOrResize(payload: EventDropArg | EventResizeDoneArg) {
|
function onEventDropOrResize(payload: EventDropArg | EventResizeDoneArg) {
|
||||||
if (payload.event.extendedProps.is !== 'range') {
|
if (payload.event.extendedProps.is !== "range") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const changedEvent = payload.event;
|
const changedEvent = payload.event;
|
||||||
|
|
||||||
store.dispatch('calendarRanges/patchRangeTime', {
|
store.dispatch("calendarRanges/patchRangeTime", {
|
||||||
calendarRangeId: payload.event.extendedProps.calendarRangeId,
|
calendarRangeId: payload.event.extendedProps.calendarRangeId,
|
||||||
start: payload.event.start,
|
start: payload.event.start,
|
||||||
end: payload.event.end,
|
end: payload.event.end,
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
function onEventClick(payload: EventClickArg): void {
|
function onEventClick(payload: EventClickArg): void {
|
||||||
// @ts-ignore TS does not recognize the target. But it does exists.
|
// @ts-ignore TS does not recognize the target. But it does exists.
|
||||||
if (payload.jsEvent.target.classList.contains('delete')) {
|
if (payload.jsEvent.target.classList.contains("delete")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (payload.event.extendedProps.is !== 'range') {
|
if (payload.event.extendedProps.is !== "range") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -285,10 +409,26 @@ function copyDay() {
|
|||||||
if (null === copyFrom.value || null === copyTo.value) {
|
if (null === copyFrom.value || null === copyTo.value) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
store.dispatch("calendarRanges/copyFromDayToAnotherDay", {
|
||||||
store.dispatch('calendarRanges/copyFromDayToAnotherDay', {from: ISOToDate(copyFrom.value), to: ISOToDate(copyTo.value)})
|
from: ISOToDate(copyFrom.value),
|
||||||
|
to: ISOToDate(copyTo.value),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function copyWeek() {
|
||||||
|
if (null === copyFromWeek.value || null === copyToWeek.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
store.dispatch("calendarRanges/copyFromWeekToAnotherWeek", {
|
||||||
|
fromMonday: ISOToDate(copyFromWeek.value),
|
||||||
|
toMonday: ISOToDate(copyToWeek.value),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
copyFromWeek.value = dateToISO(getMonday(0));
|
||||||
|
copyToWeek.value = dateToISO(getMonday(1));
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@@ -299,4 +439,9 @@ function copyDay() {
|
|||||||
z-index: 9999999999;
|
z-index: 9999999999;
|
||||||
padding: 0.25rem 0 0.25rem;
|
padding: 0.25rem 0 0.25rem;
|
||||||
}
|
}
|
||||||
|
div.copy-chevron {
|
||||||
|
text-align: center;
|
||||||
|
font-size: x-large;
|
||||||
|
width: 2rem;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@@ -5,11 +5,9 @@ const appMessages = {
|
|||||||
show_my_calendar: "Afficher mon calendrier",
|
show_my_calendar: "Afficher mon calendrier",
|
||||||
show_weekends: "Afficher les week-ends",
|
show_weekends: "Afficher les week-ends",
|
||||||
copy_range: "Copier",
|
copy_range: "Copier",
|
||||||
copy_range_from_to: "Copier les plages d'un jour à l'autre",
|
copy_range_from_to: "Copier les plages",
|
||||||
copy_range_to_next_day: "Copier les plages du jour au jour suivant",
|
from_day_to_day: "d'un jour à l'autre",
|
||||||
copy_range_from_day: "Copier les plages du ",
|
from_week_to_week: "d'une semaine à l'autre",
|
||||||
to_the_next_day: " au jour suivant",
|
|
||||||
copy_range_to_next_week: "Copier les plages de la semaine à la semaine suivante",
|
|
||||||
copy_range_how_to: "Créez les plages de disponibilités durant une journée et copiez-les facilement au jour suivant avec ce bouton. Si les week-ends sont cachés, le jour suivant un vendredi sera le lundi.",
|
copy_range_how_to: "Créez les plages de disponibilités durant une journée et copiez-les facilement au jour suivant avec ce bouton. Si les week-ends sont cachés, le jour suivant un vendredi sera le lundi.",
|
||||||
new_range_to_save: "Nouvelles plages à enregistrer",
|
new_range_to_save: "Nouvelles plages à enregistrer",
|
||||||
update_range_to_save: "Plages à modifier",
|
update_range_to_save: "Plages à modifier",
|
||||||
|
@@ -52,6 +52,23 @@ export default <Module<CalendarRangesState, State>>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return founds;
|
||||||
|
},
|
||||||
|
getRangesOnWeek: (state: CalendarRangesState) => (mondayDate: Date): EventInputCalendarRange[] => {
|
||||||
|
const founds = [];
|
||||||
|
for (let d of Array.from(Array(7).keys())) {
|
||||||
|
const dateOfWeek = new Date(mondayDate);
|
||||||
|
dateOfWeek.setDate(mondayDate.getDate() + d);
|
||||||
|
const dateStr = <string>dateToISO(dateOfWeek);
|
||||||
|
for (let range of state.ranges) {
|
||||||
|
if (isEventInputCalendarRange(range)
|
||||||
|
&& range.start.startsWith(dateStr)
|
||||||
|
) {
|
||||||
|
founds.push(range);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return founds;
|
return founds;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -238,7 +255,7 @@ export default <Module<CalendarRangesState, State>>{
|
|||||||
|
|
||||||
for (let r of rangesToCopy) {
|
for (let r of rangesToCopy) {
|
||||||
let start = new Date(<Date>ISOToDatetime(r.start));
|
let start = new Date(<Date>ISOToDatetime(r.start));
|
||||||
start.setFullYear(to.getFullYear(), to.getMonth(), to.getDate())
|
start.setFullYear(to.getFullYear(), to.getMonth(), to.getDate());
|
||||||
let end = new Date(<Date>ISOToDatetime(r.end));
|
let end = new Date(<Date>ISOToDatetime(r.end));
|
||||||
end.setFullYear(to.getFullYear(), to.getMonth(), to.getDate());
|
end.setFullYear(to.getFullYear(), to.getMonth(), to.getDate());
|
||||||
let location = ctx.rootGetters['locations/getLocationById'](r.locationId);
|
let location = ctx.rootGetters['locations/getLocationById'](r.locationId);
|
||||||
@@ -246,6 +263,23 @@ export default <Module<CalendarRangesState, State>>{
|
|||||||
promises.push(ctx.dispatch('createRange', {start, end, location}));
|
promises.push(ctx.dispatch('createRange', {start, end, location}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return Promise.all(promises).then(_ => Promise.resolve(null));
|
||||||
|
},
|
||||||
|
copyFromWeekToAnotherWeek(ctx, {fromMonday, toMonday}: {fromMonday: Date, toMonday: Date}): Promise<null> {
|
||||||
|
|
||||||
|
const rangesToCopy: EventInputCalendarRange[] = ctx.getters['getRangesOnWeek'](fromMonday);
|
||||||
|
const promises = [];
|
||||||
|
const diffTime = toMonday.getTime() - fromMonday.getTime();
|
||||||
|
for (let r of rangesToCopy) {
|
||||||
|
let start = new Date(<Date>ISOToDatetime(r.start));
|
||||||
|
let end = new Date(<Date>ISOToDatetime(r.end));
|
||||||
|
start.setTime(start.getTime() + diffTime);
|
||||||
|
end.setTime(end.getTime() + diffTime);
|
||||||
|
let location = ctx.rootGetters['locations/getLocationById'](r.locationId);
|
||||||
|
|
||||||
|
promises.push(ctx.dispatch('createRange', {start, end, location}));
|
||||||
|
}
|
||||||
|
|
||||||
return Promise.all(promises).then(_ => Promise.resolve(null));
|
return Promise.all(promises).then(_ => Promise.resolve(null));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -40,7 +40,7 @@ final readonly class CalendarContext implements CalendarContextInterface
|
|||||||
private PersonRepository $personRepository,
|
private PersonRepository $personRepository,
|
||||||
private ThirdPartyRender $thirdPartyRender,
|
private ThirdPartyRender $thirdPartyRender,
|
||||||
private ThirdPartyRepository $thirdPartyRepository,
|
private ThirdPartyRepository $thirdPartyRepository,
|
||||||
private TranslatableStringHelperInterface $translatableStringHelper
|
private TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function adminFormReverseTransform(array $data): array
|
public function adminFormReverseTransform(array $data): array
|
||||||
|
@@ -37,7 +37,7 @@ final readonly class AccompanyingPeriodCalendarGenericDocProvider implements Gen
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private Security $security,
|
private Security $security,
|
||||||
private EntityManagerInterface $em
|
private EntityManagerInterface $em,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -36,7 +36,7 @@ final readonly class PersonCalendarGenericDocProvider implements GenericDocForPe
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private Security $security,
|
private Security $security,
|
||||||
private EntityManagerInterface $em
|
private EntityManagerInterface $em,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
private function addWhereClausesToQuery(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
|
private function addWhereClausesToQuery(FetchQuery $query, ?\DateTimeImmutable $startDate = null, ?\DateTimeImmutable $endDate = null, ?string $content = null): FetchQuery
|
||||||
|
@@ -156,7 +156,7 @@ final class CalendarTypeTest extends TypeTestCase
|
|||||||
|
|
||||||
private function buildMultiToIdDataTransformer(
|
private function buildMultiToIdDataTransformer(
|
||||||
string $classTransformer,
|
string $classTransformer,
|
||||||
string $objClass
|
string $objClass,
|
||||||
) {
|
) {
|
||||||
$transformer = $this->prophesize($classTransformer);
|
$transformer = $this->prophesize($classTransformer);
|
||||||
$transformer->transform(Argument::type('array'))
|
$transformer->transform(Argument::type('array'))
|
||||||
@@ -195,7 +195,7 @@ final class CalendarTypeTest extends TypeTestCase
|
|||||||
|
|
||||||
private function buildSingleToIdDataTransformer(
|
private function buildSingleToIdDataTransformer(
|
||||||
string $classTransformer,
|
string $classTransformer,
|
||||||
string $class
|
string $class,
|
||||||
) {
|
) {
|
||||||
$transformer = $this->prophesize($classTransformer);
|
$transformer = $this->prophesize($classTransformer);
|
||||||
$transformer->transform(Argument::type('object'))
|
$transformer->transform(Argument::type('object'))
|
||||||
|
@@ -203,7 +203,7 @@ final class CalendarContextTest extends TestCase
|
|||||||
|
|
||||||
private function buildCalendarContext(
|
private function buildCalendarContext(
|
||||||
?EntityManagerInterface $entityManager = null,
|
?EntityManagerInterface $entityManager = null,
|
||||||
?NormalizerInterface $normalizer = null
|
?NormalizerInterface $normalizer = null,
|
||||||
): CalendarContext {
|
): CalendarContext {
|
||||||
$baseContext = $this->prophesize(BaseContextData::class);
|
$baseContext = $this->prophesize(BaseContextData::class);
|
||||||
$baseContext->getData(null)->willReturn(['base_context' => 'data']);
|
$baseContext->getData(null)->willReturn(['base_context' => 'data']);
|
||||||
|
@@ -44,7 +44,7 @@ class CreateFieldsOnGroupCommand extends Command
|
|||||||
private readonly EntityManager $entityManager,
|
private readonly EntityManager $entityManager,
|
||||||
private readonly ValidatorInterface $validator,
|
private readonly ValidatorInterface $validator,
|
||||||
private $availableLanguages,
|
private $availableLanguages,
|
||||||
private $customizablesEntities
|
private $customizablesEntities,
|
||||||
) {
|
) {
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
@@ -39,7 +39,7 @@ class CustomFieldsGroupController extends AbstractController
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly CustomFieldProvider $customFieldProvider,
|
private readonly CustomFieldProvider $customFieldProvider,
|
||||||
private readonly TranslatorInterface $translator,
|
private readonly TranslatorInterface $translator,
|
||||||
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry
|
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -42,7 +42,7 @@ class CustomFieldChoice extends AbstractCustomField
|
|||||||
/**
|
/**
|
||||||
* @var TranslatableStringHelper Helper that find the string in current locale from an array of translation
|
* @var TranslatableStringHelper Helper that find the string in current locale from an array of translation
|
||||||
*/
|
*/
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper
|
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function allowOtherChoice(CustomField $cf)
|
public function allowOtherChoice(CustomField $cf)
|
||||||
|
@@ -44,7 +44,7 @@ class CustomFieldDate extends AbstractCustomField
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly Environment $templating,
|
private readonly Environment $templating,
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper
|
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
|
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
|
||||||
|
@@ -42,8 +42,8 @@ class CustomFieldLongChoice extends AbstractCustomField
|
|||||||
$translatableStringHelper = $this->translatableStringHelper;
|
$translatableStringHelper = $this->translatableStringHelper;
|
||||||
$builder->add($customField->getSlug(), Select2ChoiceType::class, [
|
$builder->add($customField->getSlug(), Select2ChoiceType::class, [
|
||||||
'choices' => $entries,
|
'choices' => $entries,
|
||||||
'choice_label' => static fn (Option $option) => $translatableStringHelper->localize($option->getText()),
|
'choice_label' => static fn (?Option $option) => $translatableStringHelper->localize($option->getText()),
|
||||||
'choice_value' => static fn (Option $key): ?int => null === $key ? null : $key->getId(),
|
'choice_value' => static fn (?Option $key): ?int => $key?->getId(),
|
||||||
'multiple' => false,
|
'multiple' => false,
|
||||||
'expanded' => false,
|
'expanded' => false,
|
||||||
'required' => $customField->isRequired(),
|
'required' => $customField->isRequired(),
|
||||||
|
@@ -41,7 +41,7 @@ class CustomFieldNumber extends AbstractCustomField
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly Environment $templating,
|
private readonly Environment $templating,
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper
|
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
|
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
|
||||||
|
@@ -28,7 +28,7 @@ class CustomFieldText extends AbstractCustomField
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly Environment $templating,
|
private readonly Environment $templating,
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper
|
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -31,7 +31,7 @@ class CustomFieldTitle extends AbstractCustomField
|
|||||||
/**
|
/**
|
||||||
* @var TranslatableStringHelper Helper that find the string in current locale from an array of translation
|
* @var TranslatableStringHelper Helper that find the string in current locale from an array of translation
|
||||||
*/
|
*/
|
||||||
private readonly TranslatableStringHelper $translatableStringHelper
|
private readonly TranslatableStringHelper $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
|
public function buildForm(FormBuilderInterface $builder, CustomField $customField)
|
||||||
|
@@ -46,11 +46,8 @@ class CustomFieldsGroup
|
|||||||
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
#[ORM\GeneratedValue(strategy: 'AUTO')]
|
||||||
private ?int $id = null;
|
private ?int $id = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* @var array
|
|
||||||
*/
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||||
private $name;
|
private array|string $name;
|
||||||
|
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)]
|
||||||
private array $options = [];
|
private array $options = [];
|
||||||
@@ -181,7 +178,7 @@ class CustomFieldsGroup
|
|||||||
*
|
*
|
||||||
* @return CustomFieldsGroup
|
* @return CustomFieldsGroup
|
||||||
*/
|
*/
|
||||||
public function setName($name)
|
public function setName(array|string $name)
|
||||||
{
|
{
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@ class CustomFieldsGroupType extends AbstractType
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly array $customizableEntities,
|
private readonly array $customizableEntities,
|
||||||
// TODO : add comment about this variable
|
// TODO : add comment about this variable
|
||||||
private readonly TranslatorInterface $translator
|
private readonly TranslatorInterface $translator,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
// TODO : details about the function
|
// TODO : details about the function
|
||||||
|
@@ -48,7 +48,7 @@ final class DocGeneratorTemplateController extends AbstractController
|
|||||||
private readonly PaginatorFactory $paginatorFactory,
|
private readonly PaginatorFactory $paginatorFactory,
|
||||||
private readonly EntityManagerInterface $entityManager,
|
private readonly EntityManagerInterface $entityManager,
|
||||||
private readonly ClockInterface $clock,
|
private readonly ClockInterface $clock,
|
||||||
private readonly ChillSecurity $security
|
private readonly ChillSecurity $security,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
#[Route(path: '{_locale}/admin/doc/gen/generate/test/from/{template}/for/{entityClassName}/{entityId}', name: 'chill_docgenerator_test_generate_from_template')]
|
#[Route(path: '{_locale}/admin/doc/gen/generate/test/from/{template}/for/{entityClassName}/{entityId}', name: 'chill_docgenerator_test_generate_from_template')]
|
||||||
@@ -56,7 +56,7 @@ final class DocGeneratorTemplateController extends AbstractController
|
|||||||
DocGeneratorTemplate $template,
|
DocGeneratorTemplate $template,
|
||||||
string $entityClassName,
|
string $entityClassName,
|
||||||
int $entityId,
|
int $entityId,
|
||||||
Request $request
|
Request $request,
|
||||||
): Response {
|
): Response {
|
||||||
return $this->generateDocFromTemplate(
|
return $this->generateDocFromTemplate(
|
||||||
$template,
|
$template,
|
||||||
@@ -71,7 +71,7 @@ final class DocGeneratorTemplateController extends AbstractController
|
|||||||
DocGeneratorTemplate $template,
|
DocGeneratorTemplate $template,
|
||||||
string $entityClassName,
|
string $entityClassName,
|
||||||
int $entityId,
|
int $entityId,
|
||||||
Request $request
|
Request $request,
|
||||||
): Response {
|
): Response {
|
||||||
return $this->generateDocFromTemplate(
|
return $this->generateDocFromTemplate(
|
||||||
$template,
|
$template,
|
||||||
@@ -137,7 +137,7 @@ final class DocGeneratorTemplateController extends AbstractController
|
|||||||
DocGeneratorTemplate $template,
|
DocGeneratorTemplate $template,
|
||||||
int $entityId,
|
int $entityId,
|
||||||
Request $request,
|
Request $request,
|
||||||
bool $isTest
|
bool $isTest,
|
||||||
): Response {
|
): Response {
|
||||||
try {
|
try {
|
||||||
$context = $this->contextManager->getContextByDocGeneratorTemplate($template);
|
$context = $this->contextManager->getContextByDocGeneratorTemplate($template);
|
||||||
|
@@ -28,7 +28,7 @@ final readonly class RelatorioDriver implements DriverInterface
|
|||||||
public function __construct(
|
public function __construct(
|
||||||
private HttpClientInterface $client,
|
private HttpClientInterface $client,
|
||||||
ParameterBagInterface $parameterBag,
|
ParameterBagInterface $parameterBag,
|
||||||
private LoggerInterface $logger
|
private LoggerInterface $logger,
|
||||||
) {
|
) {
|
||||||
$this->url = $parameterBag->get('chill_doc_generator')['driver']['relatorio']['url'];
|
$this->url = $parameterBag->get('chill_doc_generator')['driver']['relatorio']['url'];
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,7 @@ class DocGenObjectNormalizer implements NormalizerAwareInterface, NormalizerInte
|
|||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly ClassMetadataFactoryInterface $classMetadataFactory,
|
private readonly ClassMetadataFactoryInterface $classMetadataFactory,
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {
|
) {
|
||||||
$this->propertyAccess = PropertyAccess::createPropertyAccessor();
|
$this->propertyAccess = PropertyAccess::createPropertyAccessor();
|
||||||
}
|
}
|
||||||
|
@@ -33,7 +33,7 @@ class Generator implements GeneratorInterface
|
|||||||
private readonly DriverInterface $driver,
|
private readonly DriverInterface $driver,
|
||||||
private readonly ManagerRegistry $objectManagerRegistry,
|
private readonly ManagerRegistry $objectManagerRegistry,
|
||||||
private readonly LoggerInterface $logger,
|
private readonly LoggerInterface $logger,
|
||||||
private readonly StoredObjectManagerInterface $storedObjectManager
|
private readonly StoredObjectManagerInterface $storedObjectManager,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function generateDataDump(
|
public function generateDataDump(
|
||||||
|
@@ -39,7 +39,7 @@ final readonly class OnGenerationFails implements EventSubscriberInterface
|
|||||||
private MailerInterface $mailer,
|
private MailerInterface $mailer,
|
||||||
private StoredObjectRepositoryInterface $storedObjectRepository,
|
private StoredObjectRepositoryInterface $storedObjectRepository,
|
||||||
private TranslatorInterface $translator,
|
private TranslatorInterface $translator,
|
||||||
private UserRepositoryInterface $userRepository
|
private UserRepositoryInterface $userRepository,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public static function getSubscribedEvents()
|
public static function getSubscribedEvents()
|
||||||
|
@@ -56,7 +56,7 @@ final class BaseContextDataTest extends KernelTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
private function buildBaseContext(
|
private function buildBaseContext(
|
||||||
?NormalizerInterface $normalizer = null
|
?NormalizerInterface $normalizer = null,
|
||||||
): BaseContextData {
|
): BaseContextData {
|
||||||
return new BaseContextData(
|
return new BaseContextData(
|
||||||
$normalizer ?? self::getContainer()->get(NormalizerInterface::class)
|
$normalizer ?? self::getContainer()->get(NormalizerInterface::class)
|
||||||
|
@@ -140,7 +140,7 @@ final readonly class TempUrlOpenstackGenerator implements TempUrlGeneratorInterf
|
|||||||
{
|
{
|
||||||
return match (str_ends_with($this->base_url, '/')) {
|
return match (str_ends_with($this->base_url, '/')) {
|
||||||
true => $this->base_url.$relative_path,
|
true => $this->base_url.$relative_path,
|
||||||
false => $this->base_url.'/'.$relative_path
|
false => $this->base_url.'/'.$relative_path,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@ interface TempUrlGeneratorInterface
|
|||||||
public function generatePost(
|
public function generatePost(
|
||||||
?int $expire_delay = null,
|
?int $expire_delay = null,
|
||||||
?int $submit_delay = null,
|
?int $submit_delay = null,
|
||||||
int $max_file_count = 1
|
int $max_file_count = 1,
|
||||||
): SignedUrlPost;
|
): SignedUrlPost;
|
||||||
|
|
||||||
public function generate(string $method, string $object_name, ?int $expire_delay = null): SignedUrl;
|
public function generate(string $method, string $object_name, ?int $expire_delay = null): SignedUrl;
|
||||||
|
@@ -25,7 +25,7 @@ class AsyncUploadExtension extends AbstractExtension
|
|||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly TempUrlGeneratorInterface $tempUrlGenerator,
|
private readonly TempUrlGeneratorInterface $tempUrlGenerator,
|
||||||
private readonly UrlGeneratorInterface $routingUrlGenerator
|
private readonly UrlGeneratorInterface $routingUrlGenerator,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function getFilters()
|
public function getFilters()
|
||||||
|
@@ -35,7 +35,7 @@ class DocumentAccompanyingCourseController extends AbstractController
|
|||||||
protected TranslatorInterface $translator,
|
protected TranslatorInterface $translator,
|
||||||
protected EventDispatcherInterface $eventDispatcher,
|
protected EventDispatcherInterface $eventDispatcher,
|
||||||
protected AuthorizationHelper $authorizationHelper,
|
protected AuthorizationHelper $authorizationHelper,
|
||||||
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry
|
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
#[Route(path: '/{id}/delete', name: 'chill_docstore_accompanying_course_document_delete')]
|
#[Route(path: '/{id}/delete', name: 'chill_docstore_accompanying_course_document_delete')]
|
||||||
|
@@ -40,7 +40,7 @@ class DocumentPersonController extends AbstractController
|
|||||||
protected TranslatorInterface $translator,
|
protected TranslatorInterface $translator,
|
||||||
protected EventDispatcherInterface $eventDispatcher,
|
protected EventDispatcherInterface $eventDispatcher,
|
||||||
protected AuthorizationHelper $authorizationHelper,
|
protected AuthorizationHelper $authorizationHelper,
|
||||||
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry
|
private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
#[Route(path: '/{id}/delete', name: 'chill_docstore_person_document_delete')]
|
#[Route(path: '/{id}/delete', name: 'chill_docstore_person_document_delete')]
|
||||||
|
@@ -42,7 +42,7 @@ class DocumentCategory
|
|||||||
*/
|
*/
|
||||||
#[ORM\Id]
|
#[ORM\Id]
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, name: 'id_inside_bundle')]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, name: 'id_inside_bundle')]
|
||||||
private $idInsideBundle
|
private $idInsideBundle,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function getBundleId() // ::class BundleClass (FQDN)
|
public function getBundleId() // ::class BundleClass (FQDN)
|
||||||
|
@@ -99,7 +99,7 @@ class StoredObject implements Document, TrackCreationInterface
|
|||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => 'ready'])]
|
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::TEXT, options: ['default' => 'ready'])]
|
||||||
private string $status = 'ready'
|
private string $status = 'ready',
|
||||||
) {
|
) {
|
||||||
$this->uuid = Uuid::uuid4();
|
$this->uuid = Uuid::uuid4();
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||||||
final class AccompanyingCourseDocumentType extends AbstractType
|
final class AccompanyingCourseDocumentType extends AbstractType
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly TranslatableStringHelperInterface $translatableStringHelper
|
private readonly TranslatableStringHelperInterface $translatableStringHelper,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||||
|
@@ -20,7 +20,7 @@ use Symfony\Component\Serializer\SerializerInterface;
|
|||||||
class StoredObjectDataTransformer implements DataTransformerInterface
|
class StoredObjectDataTransformer implements DataTransformerInterface
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
private readonly SerializerInterface $serializer
|
private readonly SerializerInterface $serializer,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
public function transform(mixed $value): mixed
|
public function transform(mixed $value): mixed
|
||||||
|
@@ -55,7 +55,7 @@ class AsyncUploaderType extends AbstractType
|
|||||||
public function buildView(
|
public function buildView(
|
||||||
FormView $view,
|
FormView $view,
|
||||||
FormInterface $form,
|
FormInterface $form,
|
||||||
array $options
|
array $options,
|
||||||
) {
|
) {
|
||||||
$view->vars['attr']['data-async-file-upload'] = true;
|
$view->vars['attr']['data-async-file-upload'] = true;
|
||||||
$view->vars['attr']['data-generate-temp-url-post'] = $this
|
$view->vars['attr']['data-generate-temp-url-post'] = $this
|
||||||
|
@@ -20,7 +20,7 @@ interface GenericDocForAccompanyingPeriodProviderInterface
|
|||||||
?\DateTimeImmutable $startDate = null,
|
?\DateTimeImmutable $startDate = null,
|
||||||
?\DateTimeImmutable $endDate = null,
|
?\DateTimeImmutable $endDate = null,
|
||||||
?string $content = null,
|
?string $content = null,
|
||||||
?string $origin = null
|
?string $origin = null,
|
||||||
): FetchQueryInterface;
|
): FetchQueryInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -20,7 +20,7 @@ interface GenericDocForPersonProviderInterface
|
|||||||
?\DateTimeImmutable $startDate = null,
|
?\DateTimeImmutable $startDate = null,
|
||||||
?\DateTimeImmutable $endDate = null,
|
?\DateTimeImmutable $endDate = null,
|
||||||
?string $content = null,
|
?string $content = null,
|
||||||
?string $origin = null
|
?string $origin = null,
|
||||||
): FetchQueryInterface;
|
): FetchQueryInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -46,7 +46,7 @@ final readonly class Manager
|
|||||||
?\DateTimeImmutable $startDate = null,
|
?\DateTimeImmutable $startDate = null,
|
||||||
?\DateTimeImmutable $endDate = null,
|
?\DateTimeImmutable $endDate = null,
|
||||||
?string $content = null,
|
?string $content = null,
|
||||||
array $places = []
|
array $places = [],
|
||||||
): int {
|
): int {
|
||||||
['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($accompanyingPeriod, $startDate, $endDate, $content, $places);
|
['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($accompanyingPeriod, $startDate, $endDate, $content, $places);
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ final readonly class Manager
|
|||||||
?\DateTimeImmutable $startDate = null,
|
?\DateTimeImmutable $startDate = null,
|
||||||
?\DateTimeImmutable $endDate = null,
|
?\DateTimeImmutable $endDate = null,
|
||||||
?string $content = null,
|
?string $content = null,
|
||||||
array $places = []
|
array $places = [],
|
||||||
): int {
|
): int {
|
||||||
['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($person, $startDate, $endDate, $content, $places);
|
['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($person, $startDate, $endDate, $content, $places);
|
||||||
|
|
||||||
@@ -97,7 +97,7 @@ final readonly class Manager
|
|||||||
?\DateTimeImmutable $startDate = null,
|
?\DateTimeImmutable $startDate = null,
|
||||||
?\DateTimeImmutable $endDate = null,
|
?\DateTimeImmutable $endDate = null,
|
||||||
?string $content = null,
|
?string $content = null,
|
||||||
array $places = []
|
array $places = [],
|
||||||
): iterable {
|
): iterable {
|
||||||
['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($accompanyingPeriod, $startDate, $endDate, $content, $places);
|
['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($accompanyingPeriod, $startDate, $endDate, $content, $places);
|
||||||
|
|
||||||
@@ -140,7 +140,7 @@ final readonly class Manager
|
|||||||
?\DateTimeImmutable $startDate = null,
|
?\DateTimeImmutable $startDate = null,
|
||||||
?\DateTimeImmutable $endDate = null,
|
?\DateTimeImmutable $endDate = null,
|
||||||
?string $content = null,
|
?string $content = null,
|
||||||
array $places = []
|
array $places = [],
|
||||||
): iterable {
|
): iterable {
|
||||||
['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($person, $startDate, $endDate, $content, $places);
|
['sql' => $sql, 'params' => $params, 'types' => $types] = $this->buildUnionQuery($person, $startDate, $endDate, $content, $places);
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user