diff --git a/.changes/v3.11.0.md b/.changes/v3.11.0.md new file mode 100644 index 000000000..07f4d4a5f --- /dev/null +++ b/.changes/v3.11.0.md @@ -0,0 +1,19 @@ +## v3.11.0 - 2025-04-17 +### Feature +* ([#365](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/365)) Add counters of actions and activities, with 2 boxes to (1) show the number of active actions on total actions and (2) show the number of activities in a accompanying period, and pills in menus for showing the number of active actions and the number of activities. +* ([#364](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/364)) Added a second phone number "telephone2" to the thirdParty entity. Adapted twig templates and vuejs apps to handle this phone number + + **Schema Change**: Add columns or tables +* Signature: add a button to go directly to the signature zone, even if there is only one +### Fixed +* Fixed wrong translations in the on-the-fly for creation of thirdParty +* Fixed update of phone number in on-the-fly edition of thirdParty +* Fixed closing of modal when editing thirdParty in accompanying course works +* Shorten the delay between two execution of AccompanyingPeriodStepChangeCronjob, to ensure at least one execution in a day +* ([#102](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/102)) Fix display of title in document list +* When cleaning the old stored object versions, do not throw an error if the stored object is not found on disk +* Add consistent log prefix and key to logs when stale workflows are automatically canceled +* ([#380](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/380)) Remove the "not null" validation constraint on recently added properties on HouseholdComposition + +### DX +* Add new chill-col style for displaying title and aside in a flex table diff --git a/config/packages/workflow_chill.yaml b/config/packages/workflow_chill.yaml index 434625410..2e1506da5 100644 --- a/config/packages/workflow_chill.yaml +++ b/config/packages/workflow_chill.yaml @@ -220,6 +220,7 @@ framework: - attenteModification - attenteMiseEnForme - attenteValidationMiseEnForme + - attenteSignature - attenteVisa - postSignature - attenteTraitement diff --git a/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php index b4990c0e3..5ed606637 100644 --- a/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/AccompanyingCourseMenuBuilder.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace Chill\ActivityBundle\Menu; +use Chill\ActivityBundle\Entity\Activity; use Chill\ActivityBundle\Security\Authorization\ActivityVoter; use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Chill\PersonBundle\Entity\AccompanyingPeriod; @@ -23,22 +24,30 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(protected Security $security, protected TranslatorInterface $translator) {} + public function __construct( + protected Security $security, + protected TranslatorInterface $translator, + private readonly \Doctrine\Persistence\ManagerRegistry $managerRegistry, + ) {} public function buildMenu($menuId, MenuItem $menu, array $parameters) { $period = $parameters['accompanyingCourse']; + $activities = $this->managerRegistry->getManager()->getRepository(Activity::class)->findBy( + ['accompanyingPeriod' => $period] + ); + if ( AccompanyingPeriod::STEP_DRAFT !== $period->getStep() && $this->security->isGranted(ActivityVoter::SEE, $period) ) { - $menu->addChild($this->translator->trans('Activity'), [ + $menu->addChild($this->translator->trans('Activities'), [ 'route' => 'chill_activity_activity_list', 'routeParameters' => [ 'accompanying_period_id' => $period->getId(), ], ]) - ->setExtras(['order' => 40]); + ->setExtras(['order' => 40, 'counter' => count($activities) > 0 ? count($activities) : null]); } } diff --git a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php index 797d64eb6..5a13c5d65 100644 --- a/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php +++ b/src/Bundle/ChillActivityBundle/Menu/PersonMenuBuilder.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace Chill\ActivityBundle\Menu; +use Chill\ActivityBundle\Repository\ActivityACLAwareRepositoryInterface; use Chill\ActivityBundle\Security\Authorization\ActivityVoter; use Chill\MainBundle\Routing\LocalMenuBuilderInterface; use Chill\PersonBundle\Entity\Person; @@ -23,13 +24,20 @@ use Symfony\Contracts\Translation\TranslatorInterface; */ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface { - public function __construct(private AuthorizationCheckerInterface $authorizationChecker, private TranslatorInterface $translator) {} + public function __construct( + private readonly ActivityACLAwareRepositoryInterface $activityACLAwareRepository, + private AuthorizationCheckerInterface $authorizationChecker, + private TranslatorInterface $translator, + ) {} public function buildMenu($menuId, MenuItem $menu, array $parameters) { /** @var Person $person */ $person = $parameters['person']; + + $count = $this->activityACLAwareRepository->countByPerson($person, ActivityVoter::SEE); + if ($this->authorizationChecker->isGranted(ActivityVoter::SEE, $person)) { $menu->addChild( $this->translator->trans('Activities'), @@ -38,7 +46,7 @@ final readonly class PersonMenuBuilder implements LocalMenuBuilderInterface 'routeParameters' => ['person_id' => $person->getId()], ] ) - ->setExtra('order', 201); + ->setExtras(['order' => 201, 'counter' => $count > 0 ? $count : null]); } } diff --git a/src/Bundle/ChillActivityBundle/Resources/public/chill/chillactivity.scss b/src/Bundle/ChillActivityBundle/Resources/public/chill/chillactivity.scss index 13de8dfc0..6658656f9 100644 --- a/src/Bundle/ChillActivityBundle/Resources/public/chill/chillactivity.scss +++ b/src/Bundle/ChillActivityBundle/Resources/public/chill/chillactivity.scss @@ -120,3 +120,34 @@ li.document-list-item { vertical-align: baseline; } } + +.badge-activity-type-simple { + @extend .badge; + display: inline-block; + margin: 0.2rem 0; + padding-left: 0; + padding-right: 0.5rem; + + border-left: 20px groove #9acd32; + border-radius: $badge-border-radius; + + color: black; + font-weight: normal; + font-size: unset; + max-width: 100%; + background-color: $gray-100; + + overflow: hidden; + text-overflow: ellipsis; + text-indent: 5px hanging; + text-align: left; + + &::before { + margin-right: 3px; + position: relative; + left: -0.5px; + font-family: ForkAwesome; + content: '\f04b'; + color: #9acd32; + } +} diff --git a/src/Bundle/ChillActivityBundle/Resources/views/GenericDoc/activity_document_row.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/GenericDoc/activity_document_row.html.twig index 6ca871de1..93bb01f1e 100644 --- a/src/Bundle/ChillActivityBundle/Resources/views/GenericDoc/activity_document_row.html.twig +++ b/src/Bundle/ChillActivityBundle/Resources/views/GenericDoc/activity_document_row.html.twig @@ -13,44 +13,44 @@ {% endif %}
-
- {% if document.isPending %} -
{{ 'docgen.Doc generation is pending'|trans }}
- {% elseif document.isFailure %} -
{{ 'docgen.Doc generation failed'|trans }}
- {% endif %} - -
- {% if activity.accompanyingPeriod is not null and context == 'person' %} - - {{ activity.accompanyingPeriod.id }} -   +
+
+ {% if document.isPending %} +
{{ 'docgen.Doc generation is pending'|trans }}
+ {% elseif document.isFailure %} +
{{ 'docgen.Doc generation failed'|trans }}
{% endif %} -
- - - {{ activity.type.name | localize_translatable_string }} + +
+
+
+ {{ activity.type.name | localize_translatable_string }} +
{% if activity.emergency %} {{ 'Emergency'|trans|upper }} {% endif %} - +
-
-
- {{ document.title|chill_print_or_message("No title") }} -
- {% if document.hasTemplate %} -
-

{{ document.template.name|localize_translatable_string }}

+
+ {{ document.title|chill_print_or_message("No title") }}
- {% endif %} -
- -
-
+ {% if document.hasTemplate %} +
+

{{ document.template.name|localize_translatable_string }}

+
+ {% endif %} +
+
{{ document.createdAt|format_date('short') }}
+ {% if activity.accompanyingPeriod is not null and context == 'person' %} +
+ + {{ activity.accompanyingPeriod.id }} +   +
+ {% endif %}
diff --git a/src/Bundle/ChillCalendarBundle/Resources/public/chill/scss/badge.scss b/src/Bundle/ChillCalendarBundle/Resources/public/chill/scss/badge.scss index ffcda8f0f..04d22bfc5 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/public/chill/scss/badge.scss +++ b/src/Bundle/ChillCalendarBundle/Resources/public/chill/scss/badge.scss @@ -1,5 +1,6 @@ -@import '~ChillPersonAssets/chill/scss/mixins.scss'; @import '~ChillMainAssets/module/bootstrap/shared'; +@import '~ChillPersonAssets/chill/scss/mixins.scss'; +@import 'bootstrap/scss/_badge.scss'; .badge-calendar { display: inline-block; @@ -23,3 +24,35 @@ } } +.badge-calendar-simple { + @extend .badge; + display: inline-block; + margin: 0.2rem 0; + padding-left: 0; + padding-right: 0.5rem; + + border-left: 20px groove $chill-l-gray; + border-radius: $badge-border-radius; + + max-width: 100%; + background-color: $gray-100; + + color: black; + font-weight: normal; + overflow: hidden; + font-weight: normal; + font-size: unset; + text-overflow: ellipsis; + text-indent: 5px hanging; + text-align: left; + + &::before { + margin-right: 3px; + position: relative; + left: -0.5px; + font-family: ForkAwesome; + content: '\f04b'; + color: $chill-l-gray; + } +} + diff --git a/src/Bundle/ChillCalendarBundle/Resources/public/chill/scss/calendar-list.scss b/src/Bundle/ChillCalendarBundle/Resources/public/chill/scss/calendar-list.scss index c232b78e2..6fa84f15a 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/public/chill/scss/calendar-list.scss +++ b/src/Bundle/ChillCalendarBundle/Resources/public/chill/scss/calendar-list.scss @@ -16,7 +16,7 @@ div.calendar-list { } & > a.calendar-list__global { - display: inline-block;; + display: inline-block; padding: 0.2rem; min-width: 2rem; border: 1px solid var(--bs-chill-blue); diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/GenericDoc/calendar_document_row.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/GenericDoc/calendar_document_row.html.twig index 8cf5bc4ac..8015ac600 100644 --- a/src/Bundle/ChillCalendarBundle/Resources/views/GenericDoc/calendar_document_row.html.twig +++ b/src/Bundle/ChillCalendarBundle/Resources/views/GenericDoc/calendar_document_row.html.twig @@ -6,50 +6,48 @@
-
- {% if document.storedObject.isPending %} -
{{ 'docgen.Doc generation is pending'|trans }}
- {% elseif document.storedObject.isFailure %} -
{{ 'docgen.Doc generation failed'|trans }}
- {% endif %} - -
- {% if c.accompanyingPeriod is not null and context == 'person' %} - - {{ c.accompanyingPeriod.id }} -   +
+
+ {% if document.storedObject.isPending %} +
{{ 'docgen.Doc generation is pending'|trans }}
+ {% elseif document.storedObject.isFailure %} +
{{ 'docgen.Doc generation failed'|trans }}
{% endif %} - - - - {{ 'Calendar'|trans }} - {% if c.endDate.diff(c.startDate).days >= 1 %} - {{ c.startDate|format_datetime('short', 'short') }} - - {{ c.endDate|format_datetime('short', 'short') }} - {% else %} - {{ c.startDate|format_datetime('short', 'short') }} - - {{ c.endDate|format_datetime('none', 'short') }} - {% endif %} - - -
- -
- {{ document.storedObject.title|chill_print_or_message("No title") }} -
- {% if document.storedObject.hasTemplate %}
-

{{ document.storedObject.template.name|localize_translatable_string }}

-
- {% endif %} -
-
-
+ + {{ 'Calendar'|trans }} + {% if c.endDate.diff(c.startDate).days >= 1 %} + {{ c.startDate|format_datetime('short', 'short') }} + - {{ c.endDate|format_datetime('short', 'short') }} + {% else %} + {{ c.startDate|format_datetime('short', 'short') }} + - {{ c.endDate|format_datetime('none', 'short') }} + {% endif %} + +
+ +
+ {{ document.storedObject.title|chill_print_or_message("No title") }} +
+ {% if document.storedObject.hasTemplate %} +
+

{{ document.storedObject.template.name|localize_translatable_string }}

+
+ {% endif %} +
+
{{ document.storedObject.createdAt|format_date('short') }}
+ {% if c.accompanyingPeriod is not null and context == 'person' %} +
+ + {{ c.accompanyingPeriod.id }} +   +
+ {% endif %}
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue index 6392a2b49..3f1cdbe06 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentSignature/App.vue @@ -2,26 +2,28 @@ @@ -82,28 +84,39 @@ @change="toggleMultiPage" />
+
+
+ |
@@ -112,9 +125,9 @@ :hidden="!userSignatureZone" @click="undoSign" v-if="signature.zones.length > 1" - :title="$t('choose_another_signature')" + :title="trans(SIGNATURES_CHOOSE_ANOTHER_SIGNATURE)" > - {{ $t("another_zone") }} + {{ trans(SIGNATURES_ANOTHER_ZONE) }}
- | -
| +
+
+ +
+
+ + | +
@@ -237,7 +272,7 @@ @click="undoSign" v-if="signature.zones.length > 1" > - {{ $t("choose_another_signature") }} + {{ trans(SIGNATURES_CHOOSE_ANOTHER_SIGNATURE) }}