diff --git a/.gitignore b/.gitignore
index 2b21a08ae..26802dca0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,6 +4,7 @@ composer.phar
composer.lock
docs/build/
node_modules/*
+.php_cs.cache
.cache/*
###> symfony/framework-bundle ###
diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php
index a1226ca6a..805386669 100644
--- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php
+++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadCalendarRange.php
@@ -61,7 +61,7 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere
->setEmail('centreA@test.chill.social')
->setLocationType($type = new LocationType())
->setPhonenumber1(PhoneNumberUtil::getInstance()->parse('+3287653812'));
- $type->setTitle('Service');
+ $type->setTitle(['fr' => 'Service']);
$address->setStreet('Rue des Épaules')->setStreetNumber('14')
->setPostcode($postCode = new PostalCode());
$postCode->setCode('4145')->setName('Houte-Si-Plout')->setCountry(
diff --git a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php
index 25b8ae8a8..ba325e296 100644
--- a/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php
+++ b/src/Bundle/ChillCalendarBundle/DataFixtures/ORM/LoadInvite.php
@@ -12,6 +12,8 @@ declare(strict_types=1);
namespace Chill\CalendarBundle\DataFixtures\ORM;
use Chill\CalendarBundle\Entity\Invite;
+use Chill\MainBundle\DataFixtures\ORM\LoadUsers;
+use Chill\MainBundle\Entity\User;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
use Doctrine\Persistence\ObjectManager;
@@ -33,14 +35,21 @@ class LoadInvite extends Fixture implements FixtureGroupInterface
public function load(ObjectManager $manager): void
{
$arr = [
- ['name' => ['fr' => 'Rendez-vous décliné']],
- ['name' => ['fr' => 'Rendez-vous accepté']],
+ [
+ 'name' => ['fr' => 'Rendez-vous décliné'],
+ 'status' => Invite::DECLINED,
+ ],
+ [
+ 'name' => ['fr' => 'Rendez-vous accepté'],
+ 'status' => Invite::ACCEPTED,
+ ],
];
foreach ($arr as $a) {
echo 'Creating calendar invite : ' . $a['name']['fr'] . "\n";
$invite = (new Invite())
- ->setStatus($a['name']);
+ ->setStatus($a['status'])
+ ->setUser($this->getRandomUser());
$manager->persist($invite);
$reference = 'Invite_' . $a['name']['fr'];
$this->addReference($reference, $invite);
@@ -49,4 +58,11 @@ class LoadInvite extends Fixture implements FixtureGroupInterface
$manager->flush();
}
+
+ private function getRandomUser(): User
+ {
+ $userRef = array_rand(LoadUsers::$refs);
+
+ return $this->getReference($userRef);
+ }
}
diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_documents.twig.html b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_documents.twig.html
index 499fb0a83..09824b5cc 100644
--- a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_documents.twig.html
+++ b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/_documents.twig.html
@@ -17,30 +17,20 @@
-
- {{ mm.mimeIcon(d.storedObject.type) }}
- {{ d.storedObject.title }}
- {% if d.dateTimeVersion < d.calendar.dateTimeVersion %}
- {{ 'chill_calendar.Document outdated'|trans }}
- {% endif %}
-
-
- {% if chill_document_is_editable(d.storedObject) and is_granted('CHILL_CALENDAR_DOC_EDIT', d) %}
- -
-
-
- -
- {{ d.storedObject|chill_document_edit_button }}
-
- {% endif %}
- {% if is_granted('CHILL_CALENDAR_DOC_EDIT', d) %}
- -
-
-
- {% endif %}
- -
- {{ m.download_button(d.storedObject, d.storedObject.title) }}
-
-
+
+
+ {{ d.storedObject.title }}
+ {% if d.dateTimeVersion < d.calendar.dateTimeVersion %}
+ {{ 'chill_calendar.Document outdated'|trans }}
+ {% endif %}
+
+
+ {{ mm.mimeIcon(d.storedObject.type) }}
+
+
+ {{ d.storedObject|chill_document_button_group(d.storedObject.title, is_granted('CHILL_CALENDAR_DOC_EDIT', d), {'small': true}) }}
+
+
|
diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/listByAccompanyingCourse.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/listByAccompanyingCourse.html.twig
index d85c5237e..7ce1003bc 100644
--- a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/listByAccompanyingCourse.html.twig
+++ b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/listByAccompanyingCourse.html.twig
@@ -10,13 +10,13 @@
{% block js %}
{{ parent() }}
{{ encore_entry_script_tags('mod_answer') }}
- {{ encore_entry_script_tags('mod_async_upload') }}
+ {{ encore_entry_script_tags('mod_document_action_buttons_group') }}
{% endblock %}
{% block css %}
{{ parent() }}
{{ encore_entry_link_tags('mod_answer') }}
- {{ encore_entry_link_tags('mod_async_upload') }}
+ {{ encore_entry_link_tags('mod_document_action_buttons_group') }}
{% endblock %}
{% block content %}
diff --git a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
index 5d20d3575..52509cbce 100644
--- a/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
+++ b/src/Bundle/ChillCalendarBundle/Service/DocGenerator/CalendarContext.php
@@ -240,6 +240,7 @@ final class CalendarContext implements CalendarContextInterface
public function contextGenerationDataNormalize(DocGeneratorTemplate $template, $entity, array $data): array
{
+ $normalized = [];
$normalized['title'] = $data['title'] ?? '';
foreach (['mainPerson', 'thirdParty'] as $k) {
@@ -253,6 +254,7 @@ final class CalendarContext implements CalendarContextInterface
public function contextGenerationDataDenormalize(DocGeneratorTemplate $template, $entity, array $data): array
{
+ $denormalized = [];
$denormalized['title'] = $data['title'];
if (null !== ($data['mainPerson'] ?? null)) {
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/module/document_action_buttons_group/index.ts b/src/Bundle/ChillDocStoreBundle/Resources/public/module/document_action_buttons_group/index.ts
index e5912d38a..4180808dd 100644
--- a/src/Bundle/ChillDocStoreBundle/Resources/public/module/document_action_buttons_group/index.ts
+++ b/src/Bundle/ChillDocStoreBundle/Resources/public/module/document_action_buttons_group/index.ts
@@ -16,14 +16,14 @@ window.addEventListener('DOMContentLoaded', function (e) {
filename: string,
canEdit: string,
storedObject: string,
- small: string,
+ buttonSmall: string,
};
const
storedObject = JSON.parse(datasets.storedObject) as StoredObject,
filename = datasets.filename,
canEdit = datasets.canEdit === '1',
- small = datasets.small === '1'
+ small = datasets.buttonSmall === '1'
;
return { storedObject, filename, canEdit, small };
diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentActionButtonsGroup.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentActionButtonsGroup.vue
index ac841f5cf..2cb5e64fe 100644
--- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentActionButtonsGroup.vue
+++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/DocumentActionButtonsGroup.vue
@@ -1,6 +1,6 @@
-