mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-12-09 20:03:56 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
d80661e479
|
|||
|
473c5a9fa3
|
|||
| acceeeaa2a | |||
| 53b02a0ced | |||
| 387bf55b11 |
6
.changes/v4.10.0.md
Normal file
6
.changes/v4.10.0.md
Normal file
@@ -0,0 +1,6 @@
|
||||
## v4.10.0 - 2025-12-09
|
||||
### Feature
|
||||
* [MR 928](https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/928) [#462](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/462) Add the future appointments for the person in search results
|
||||
### Fixed
|
||||
* Remove dependency to package @symfony/ux-translator
|
||||
|
||||
@@ -6,6 +6,13 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html),
|
||||
and is generated by [Changie](https://github.com/miniscruff/changie).
|
||||
|
||||
|
||||
## v4.10.0 - 2025-12-09
|
||||
### Feature
|
||||
* [MR 928](https://gitlab.com/Chill-Projet/chill-bundles/-/merge_requests/928) [#462](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/462) Add the future appointments for the person in search results
|
||||
### Fixed
|
||||
* Remove dependency to package @symfony/ux-translator
|
||||
|
||||
|
||||
## v4.9.0 - 2025-12-05
|
||||
### Feature
|
||||
* ([#459](https://gitlab.com/Chill-Projet/chill-bundles/-/issues/459)) Add a counter for invitations awaiting reply
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
"@hotwired/stimulus": "^3.0.0",
|
||||
"@luminateone/eslint-baseline": "^1.0.9",
|
||||
"@symfony/stimulus-bridge": "^3.2.0",
|
||||
"@symfony/ux-translator": "file:vendor/symfony/ux-translator/assets",
|
||||
"@symfony/webpack-encore": "^4.1.0",
|
||||
"@tsconfig/node20": "^20.1.4",
|
||||
"@types/dompurify": "^3.0.5",
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
"social worker"
|
||||
],
|
||||
"require": {
|
||||
"chill-project/chill-bundles": "dev-master as v4.6.1",
|
||||
"chill-project/chill-bundles": "^4.9.0",
|
||||
"zimbra-api/soap-api": "^3.2.2",
|
||||
"psr/http-client": "^1.0",
|
||||
"nyholm/psr7": "^1.0"
|
||||
|
||||
@@ -43,6 +43,7 @@ use DateTime;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\Common\Collections\Criteria;
|
||||
use Doctrine\Common\Collections\Order;
|
||||
use Doctrine\Common\Collections\ReadableCollection;
|
||||
use Doctrine\Common\Collections\Selectable;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@@ -139,6 +140,12 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
#[ORM\ManyToMany(targetEntity: Calendar::class, mappedBy: 'persons')]
|
||||
private Collection $calendars;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Calendar>&Selectable<int, Calendar>
|
||||
*/
|
||||
#[ORM\OneToMany(mappedBy: 'person', targetEntity: Calendar::class)]
|
||||
private Collection $directCalendars;
|
||||
|
||||
/**
|
||||
* The person's center.
|
||||
*
|
||||
@@ -406,6 +413,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
public function __construct()
|
||||
{
|
||||
$this->calendars = new ArrayCollection();
|
||||
$this->directCalendars = new ArrayCollection();
|
||||
$this->accompanyingPeriodParticipations = new ArrayCollection();
|
||||
$this->spokenLanguages = new ArrayCollection();
|
||||
$this->addresses = new ArrayCollection();
|
||||
@@ -866,6 +874,30 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this->calendars;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get next calendars for this person (calendars with start date after today).
|
||||
* Only returns calendars that are directly linked to this person via the person property,
|
||||
* not those linked through AccompanyingPeriods.
|
||||
*
|
||||
* @param int|null $limit Optional limit for the number of results
|
||||
*
|
||||
* @return array<Calendar>
|
||||
*/
|
||||
public function getNextCalendarsForPerson(?int $limit = null): array
|
||||
{
|
||||
$today = new \DateTimeImmutable('today');
|
||||
|
||||
$criteria = Criteria::create()
|
||||
->where(Criteria::expr()->gte('startDate', $today))
|
||||
->orderBy(['startDate' => Order::Ascending]);
|
||||
|
||||
if (null !== $limit) {
|
||||
$criteria->setMaxResults($limit);
|
||||
}
|
||||
|
||||
return $this->directCalendars->matching($criteria)->toArray();
|
||||
}
|
||||
|
||||
public function getCenter(): ?Center
|
||||
{
|
||||
if (null !== $this->centerCurrent) {
|
||||
@@ -1119,7 +1151,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
->where(
|
||||
$expr->eq('shareHousehold', false)
|
||||
)
|
||||
->orderBy(['startDate' => \Doctrine\Common\Collections\Order::Descending]);
|
||||
->orderBy(['startDate' => Order::Descending]);
|
||||
|
||||
return $this->getHouseholdParticipations()
|
||||
->matching($criteria);
|
||||
@@ -1141,7 +1173,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
->where(
|
||||
$expr->eq('shareHousehold', true)
|
||||
)
|
||||
->orderBy(['startDate' => \Doctrine\Common\Collections\Order::Descending, 'id' => \Doctrine\Common\Collections\Order::Descending]);
|
||||
->orderBy(['startDate' => Order::Descending, 'id' => Order::Descending]);
|
||||
|
||||
return $this->getHouseholdParticipations()
|
||||
->matching($criteria);
|
||||
|
||||
@@ -212,4 +212,3 @@
|
||||
</div>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
|
||||
|
||||
@@ -301,6 +301,47 @@
|
||||
'customButtons': { 'after': _self.button_person_after(person), 'before': _self.button_person_before((person)) }
|
||||
}) }}
|
||||
|
||||
{% set calendars = [] %}
|
||||
{% for c in person.getNextCalendarsForPerson(10) %}
|
||||
{% if is_granted('CHILL_CALENDAR_CALENDAR_SEE', c) %}
|
||||
{% set calendars = calendars|merge([c]) %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{% if calendars|length > 0 %}
|
||||
<div class="wrap-list periods-list">
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'chill_calendar.Next calendars'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<div class="calendar-list">
|
||||
<ul class="calendar-list">
|
||||
{% for c in calendars %}
|
||||
<li>
|
||||
{% if is_granted('CHILL_CALENDAR_CALENDAR_EDIT', c) %}
|
||||
<a href="{{ chill_path_add_return_path('chill_calendar_calendar_edit', { id: c.id }) }}">
|
||||
<span class="badge bg-secondary">
|
||||
{{ c.startDate|format_datetime('long', 'short') }}
|
||||
</span>
|
||||
</a>
|
||||
{% else %}
|
||||
<span class="badge bg-secondary">
|
||||
{{ c.startDate|format_datetime('long', 'short') }}
|
||||
</span>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% if is_granted('CHILL_CALENDAR_CALENDAR_SEE', person) %}
|
||||
<a href="{{ chill_path_add_return_path('chill_calendar_calendar_list_by_person', {'id': person.id}) }}" class="calendar-list__global"><i class="fa fa-list"></i></a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{#- 'acps' is for AcCompanyingPeriodS #}
|
||||
{%- set acps = [] %}
|
||||
{%- set acpsClosed = [] %}
|
||||
|
||||
Reference in New Issue
Block a user