diff --git a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig
index 633493104..b67ff08ef 100644
--- a/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig
+++ b/src/Bundle/ChillActivityBundle/Resources/views/Activity/show.html.twig
@@ -85,7 +85,7 @@
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
'context': context,
- 'with_display': 'bloc',
+ 'render': 'bloc',
'badge_person': 'true'
} %}
diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/listByAccompanyingCourse.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/listByAccompanyingCourse.html.twig
index 215b7bb55..6cf97a58d 100644
--- a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/listByAccompanyingCourse.html.twig
+++ b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/listByAccompanyingCourse.html.twig
@@ -94,7 +94,7 @@
{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {
'context': accompanyingCourse,
- 'with_display': 'row',
+ 'render': 'row',
'entity': calendar
} %}
diff --git a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/show.html.twig b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/show.html.twig
index 7c59996d2..3a1bf03d5 100644
--- a/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/show.html.twig
+++ b/src/Bundle/ChillCalendarBundle/Resources/views/Calendar/show.html.twig
@@ -6,7 +6,7 @@
{{ 'Concerned groups'|trans }}
-{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': context, 'with_display': 'bloc' } %}
+{% include 'ChillActivityBundle:Activity:concernedGroups.html.twig' with {'context': context, 'render': 'bloc' } %}
{{ 'Calendar data'|trans }}
@@ -108,13 +108,13 @@
{# TODO
{% if is_granted('CHILL_ACTIVITY_DELETE', entity) %}
#}
-
+
{{ 'Delete'|trans }}
-
+
{#
{% endif %}
#}
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue
index ed1d14633..ecc7b7e38 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/components/AddAddress.vue
@@ -359,8 +359,8 @@ export default {
//console.log('validFrom', this.validFrom);
//console.log('validTo', this.validTo);
//console.log('useDatePane', this.useDatePane);
+ //console.log('Mounted now !');
- console.log('Mounted now !');
if (this.context.edit) {
console.log('getInitialAddress', this.context.addressId);
this.getInitialAddress(this.context.addressId);
@@ -380,7 +380,7 @@ export default {
this.openEditPane();
} else {
this.flag.showPane = true;
- console.log('step0: open the Show Panel');
+ //console.log('step0: open the Show Panel');
}
},
closeShowPane() {
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/App.vue
index 48f68380b..05fed6671 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/App.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/App.vue
@@ -5,6 +5,7 @@
:action="context.action"
:buttonText="options.buttonText"
:displayBadge="options.displayBadge === 'true'"
+ :parent="options.parent"
@saveFormOnTheFly="saveFormOnTheFly">
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue
index d64ae274e..d4342fdee 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue
@@ -23,25 +23,37 @@
+
+
{{ $t('onthefly.resource_comment_title') }}
+
+ {{ parent.comment }}
+
+
+
+
{{ $t('onthefly.resource_comment_title') }}
+
+ {{ parent.comment }}
+
+
@@ -78,18 +90,25 @@ export default {
OnTheFlyThirdparty,
OnTheFlyCreate
},
- props: ['type', 'id', 'action', 'buttonText', 'displayBadge'],
+ props: ['type', 'id', 'action', 'buttonText', 'displayBadge', 'parent'],
emits: ['saveFormOnTheFly'],
data() {
return {
modal: {
showModal: false,
modalDialogClass: "modal-dialog-scrollable modal-xl"
- },
- //action: this.action
+ }
}
},
computed: {
+ hasResourceComment() {
+ //console.log('hasResourceComment', this.parent);
+ return (typeof this.parent !== 'undefined' && this.parent !== null)
+ && this.action === 'show'
+ && this.parent.type === 'accompanying_period_resource'
+ && (this.parent.comment !== null && this.parent.comment !== '')
+ ;
+ },
classAction() {
switch (this.action) {
case 'show':
@@ -145,8 +164,8 @@ export default {
},
methods: {
openModal() {
- console.log('## OPEN ON THE FLY MODAL');
- console.log('## type:', this.type, ', action:', this.action);
+ //console.log('## OPEN ON THE FLY MODAL');
+ //console.log('## type:', this.type, ', action:', this.action);
this.modal.showModal = true;
this.$nextTick(function() {
//this.$refs.search.focus();
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js
index 3cba67149..c619ef96b 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/i18n.js
@@ -17,6 +17,7 @@ const ontheflyMessages = {
person: "un nouvel usager",
thirdparty: "un nouveau tiers professionnel"
},
+ resource_comment_title: "Un commentaire est associé à cet interlocuteur"
}
}
}
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/index.js b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/index.js
index 88e6aad5e..479cc1248 100644
--- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/index.js
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/index.js
@@ -21,7 +21,8 @@ containers.forEach((container) => {
},
options: {
buttonText: container.dataset.buttonText || null,
- displayBadge: container.dataset.displayBadge || false
+ displayBadge: container.dataset.displayBadge || false,
+ parent: JSON.parse(container.dataset.parent) || null,
}
}
}
diff --git a/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig b/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig
index e63fd9ee0..666743fb2 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/OnTheFly/_insert_vue_onthefly.html.twig
@@ -10,6 +10,7 @@
* action string 'show', 'edit', 'create'
* buttonText string
* displayBadge boolean (default: false) replace button by badge, need to define buttonText for content
+ * parent object (optional) pass parent context of the targetEntity (used for course resource comment)
#}
{{ encore_entry_script_tags('vue_onthefly') }}
diff --git a/src/Bundle/ChillMainBundle/Resources/views/Util/confirmation_template.html.twig b/src/Bundle/ChillMainBundle/Resources/views/Util/confirmation_template.html.twig
index 1da31cfc7..119e213ef 100644
--- a/src/Bundle/ChillMainBundle/Resources/views/Util/confirmation_template.html.twig
+++ b/src/Bundle/ChillMainBundle/Resources/views/Util/confirmation_template.html.twig
@@ -6,7 +6,7 @@
{{ confirm_question }}
{% endif %}
-{% if display_content is not empty %}
+{% if display_content is defined and display_content is not empty %}
{{ display_content|raw }}
{% endif %}
diff --git a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php
index 000720a7f..5982fcebe 100644
--- a/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php
+++ b/src/Bundle/ChillPersonBundle/DependencyInjection/ChillPersonExtension.php
@@ -14,6 +14,7 @@ namespace Chill\PersonBundle\DependencyInjection;
use Chill\MainBundle\DependencyInjection\MissingBundleException;
use Chill\MainBundle\Security\Authorization\ChillExportVoter;
use Chill\PersonBundle\Doctrine\DQL\AddressPart;
+use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodResourceVoter;
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Exception;
@@ -413,6 +414,25 @@ class ChillPersonExtension extends Extension implements PrependExtensionInterfac
],
],
],
+ [
+ 'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Resource::class,
+ 'name' => 'accompanying_period_resource',
+ 'base_path' => '/api/1.0/person/accompanying-period/resource',
+ 'base_role' => 'ROLE_USER',
+ 'actions' => [
+ '_entity' => [
+ 'methods' => [
+ Request::METHOD_GET => false,
+ Request::METHOD_PATCH => true,
+ Request::METHOD_HEAD => false,
+ Request::METHOD_DELETE => false,
+ ],
+ 'roles' => [
+ Request::METHOD_PATCH => AccompanyingPeriodResourceVoter::EDIT,
+ ],
+ ],
+ ],
+ ],
[
'class' => \Chill\PersonBundle\Entity\AccompanyingPeriod\Origin::class,
'name' => 'accompanying_period_origin',
diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php
index a11dc9b3d..8f84f319a 100644
--- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php
+++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Resource.php
@@ -20,6 +20,8 @@ use Symfony\Component\Serializer\Annotation\Groups;
use UnexpectedValueException;
/**
+ * **About denormalization**: this operation is operated by @see{AccompanyingPeriodResourdeNormalizer}.
+ *
* @ORM\Entity
* @ORM\Table(
* name="chill_person_accompanying_period_resource",
@@ -44,9 +46,10 @@ class Resource
private ?AccompanyingPeriod $accompanyingPeriod = null;
/**
- * @ORM\ManyToOne(targetEntity=Comment::class)
+ * @ORM\Column(type="text", nullable=true)
+ * @Groups({"read"})
*/
- private $comment;
+ private ?string $comment = '';
/**
* @ORM\Id
@@ -75,7 +78,7 @@ class Resource
return $this->accompanyingPeriod;
}
- public function getComment(): ?Comment
+ public function getComment(): ?string
{
return $this->comment;
}
@@ -92,7 +95,7 @@ class Resource
/**
* @return Person|ThirdParty
- * @Groups({"read", "write"})
+ * @Groups({"read"})
*/
public function getResource()
{
@@ -111,9 +114,9 @@ class Resource
return $this;
}
- public function setComment(?Comment $comment): self
+ public function setComment(?string $comment = null): self
{
- $this->comment = $comment;
+ $this->comment = (string) $comment;
return $this;
}
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue
index e17555c6a..e7bc18371 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/components/Resources/ResourceItem.vue
@@ -14,8 +14,15 @@
}">
+ -
+
+
-
@@ -23,6 +30,7 @@
-
+ -
+
+
-
@@ -62,6 +76,7 @@
-
+
+
+
+
+
+
+
+
{{ $t('write_comment_about', { 'r': resource.resource.text }) }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ $t('action.save')}}
+
+
+
+
+
+
+
+
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js
index 3f26f5a8d..43400d8eb 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourse/store/index.js
@@ -124,6 +124,11 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
//console.log('### mutation: addResource', resource);
state.accompanyingCourse.resources.push(resource);
},
+ updateResource(state, payload) {
+ console.log('### mutation: updateResource', payload);
+ let i = state.accompanyingCourse.resources.findIndex(r => r.id === payload.id);
+ state.accompanyingCourse.resources[i] = payload;
+ },
updatePerson(state, payload) {
console.log('### mutation: updatePerson', payload);
let i = null;
@@ -360,6 +365,23 @@ let initPromise = Promise.all([scopesPromise, accompanyingCoursePromise])
throw error;
})
},
+ patchResource({ commit }, payload) {
+ const body = { type: "accompanying_period_resource" };
+ body['resource'] = {
+ type: payload.result.type,
+ id: payload.result.id
+ };
+ const url = `/api/1.0/person/accompanying-course/resource/${id}.json`;
+
+ return makeFetch('PATCH', url, body)
+ .then((response) => {
+ commit('patchResource', response);
+ })
+ .catch((error) => {
+ commit('catchError', error);
+ throw error;
+ })
+ },
/**
* On The Fly
*/
diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue
index c5f21a514..799e5651b 100644
--- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue
+++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/_components/OnTheFly/Person.vue
@@ -187,7 +187,7 @@ export default {
getPerson(this.id)
.then(person => new Promise((resolve, reject) => {
this.person = person;
- console.log('get person', this.person);
+ //console.log('get person', this.person);
resolve();
}));
},
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig
index 9071fdcfc..21e4a376e 100644
--- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig
+++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourse/index.html.twig
@@ -4,11 +4,12 @@
{{ 'Resume Accompanying Course'|trans }}
{% endblock %}
-{% macro insert_onthefly(type, entity) %}
+{% macro insert_onthefly(type, entity, parent = null) %}
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true,
targetEntity: { name: type, id: entity.id },
- buttonText: entity|chill_entity_render_string
+ buttonText: entity|chill_entity_render_string,
+ parent: parent
} %}
{% endmacro %}
@@ -55,6 +56,7 @@
{% endif %}
+ {% if accompanyingCourse.locationStatus != 'none' %}
+ {% endif %}
{% if accompanyingCourse.pinnedComment is not empty %}
@@ -107,11 +107,21 @@
{{ 'Resources'|trans }}
+
{% for r in accompanyingCourse.resources %}
+ {% set parent = {
+ 'type': 'accompanying_period_resource',
+ 'id': r.id,
+ 'comment': r.comment,
+ 'parent': {
+ 'type': 'accompanying_period',
+ 'id': accompanyingCourse.id
+ }
+ } %}
{% if r.person is not null %}
- {{ _self.insert_onthefly('person', r.person) }}
+ {{ _self.insert_onthefly('person', r.person, parent) }}
{% elseif r.thirdParty is not null %}
- {{ _self.insert_onthefly('thirdparty', r.thirdParty) }}
+ {{ _self.insert_onthefly('thirdparty', r.thirdParty, parent) }}
{% endif %}
{% endfor %}
diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig
index daa8864cb..a38aa913f 100644
--- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig
+++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/index.html.twig
@@ -87,7 +87,15 @@
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
action: 'show', displayBadge: true,
targetEntity: { name: 'thirdparty', id: w.handlingThierParty.id },
- buttonText: w.handlingThierParty|chill_entity_render_string
+ buttonText: w.handlingThierParty|chill_entity_render_string,
+ parent: {
+ 'type': 'accompanying_period_resource',
+ 'id': r.id,
+ 'comment': r.comment,
+ 'parent': {
+ 'type': 'accompanying_period',
+ 'id': accompanyingCourse.id
+ }
} %}
diff --git a/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php
new file mode 100644
index 000000000..d17a44dd3
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Security/Authorization/AccompanyingPeriodResourceVoter.php
@@ -0,0 +1,51 @@
+accessDecisionManager = $accessDecisionManager;
+ }
+
+ protected function supports($attribute, $subject)
+ {
+ return $subject instanceof Resource && self::EDIT === $attribute;
+ }
+
+ protected function voteOnAttribute($attribute, $subject, TokenInterface $token)
+ {
+ /** @var \Chill\PersonBundle\Entity\AccompanyingPeriod\Resource $subject */
+ switch ($attribute) {
+ case self::EDIT:
+ return $this->accessDecisionManager->decide(
+ $token,
+ [AccompanyingPeriodVoter::EDIT],
+ $subject->getAccompanyingPeriod()
+ );
+
+ default:
+ throw new UnexpectedValueException("attribute not supported: {$attribute}");
+ }
+ }
+}
diff --git a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php
index cb883542a..7ab284e44 100644
--- a/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php
+++ b/src/Bundle/ChillPersonBundle/Serializer/Normalizer/AccompanyingPeriodResourceNormalizer.php
@@ -84,9 +84,22 @@ class AccompanyingPeriodResourceNormalizer implements DenormalizerAwareInterface
$resource->setResource($res);
}
+ if (array_key_exists('comment', $data)) {
+ $resource->setComment($data['comment']);
+ }
+
return $resource;
}
+ public function normalize($resource, $format = null, array $context = [])
+ {
+ return [
+ 'type' => 'accompanying_period_resource',
+ 'id' => $resource->getId(),
+ 'comment' => $resource->getComment(),
+ ];
+ }
+
public function supportsDenormalization($data, $type, $format = null)
{
return Resource::class === $type;
diff --git a/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/ResourceJsonNormalizerTest.php b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/ResourceJsonNormalizerTest.php
new file mode 100644
index 000000000..4d2af31bf
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/Tests/Serializer/Normalizer/ResourceJsonNormalizerTest.php
@@ -0,0 +1,51 @@
+denormalizer = self::$container->get(DenormalizerInterface::class);
+ }
+
+ public function testDenormalize()
+ {
+ $resource = new Resource();
+
+ $context = [
+ AbstractNormalizer::GROUPS => ['write'],
+ AbstractNormalizer::OBJECT_TO_POPULATE => $resource,
+ ];
+
+ $json = [
+ 'comment' => 'bloup',
+ 'type' => 'accompanying_period_resource',
+ ];
+
+ $resource = $this->denormalizer->denormalize($json, Resource::class, 'json', $context);
+
+ $this->assertEquals('bloup', $resource->getComment());
+ }
+}
diff --git a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml
index 5d286b8d6..cd242e1c0 100644
--- a/src/Bundle/ChillPersonBundle/chill.api.specs.yaml
+++ b/src/Bundle/ChillPersonBundle/chill.api.specs.yaml
@@ -752,7 +752,6 @@ paths:
resource:
type: thirdparty
id: 100
-
responses:
401:
description: "Unauthorized"
@@ -1234,6 +1233,54 @@ paths:
404:
description: "Not found"
+ /1.0/person/accompanying-period/resource/{id}.json:
+ patch:
+ tags:
+ - accompanying-course-resource
+ summary: "Alter the resource"
+ parameters:
+ - name: id
+ in: path
+ required: true
+ description: The resource's id
+ schema:
+ type: integer
+ format: integer
+ minimum: 1
+ requestBody:
+ description: "A resource"
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ type:
+ type: string
+ enum:
+ - "accompanying_period_resource"
+ #id:
+ # type: integer
+ comment:
+ type: string
+ required:
+ - type
+ examples:
+ Set the resource comment:
+ value:
+ type: accompanying_period_resource
+ #id: 0
+ comment: my judicious comment
+ responses:
+ 401:
+ description: "Unauthorized"
+ 404:
+ description: "Not found"
+ 200:
+ description: "OK"
+ 422:
+ description: "object with validation errors"
+
/1.0/person/household.json:
get:
tags:
diff --git a/src/Bundle/ChillPersonBundle/config/services/security.yaml b/src/Bundle/ChillPersonBundle/config/services/security.yaml
index 1d88a0be2..f54d4cdfb 100644
--- a/src/Bundle/ChillPersonBundle/config/services/security.yaml
+++ b/src/Bundle/ChillPersonBundle/config/services/security.yaml
@@ -1,6 +1,7 @@
services:
chill.person.security.authorization.person:
autowire: true
+ autoconfigure: true
class: Chill\PersonBundle\Security\Authorization\PersonVoter
tags:
- { name: security.voter }
@@ -8,11 +9,19 @@ services:
Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter:
autowire: true
+ autoconfigure: true
tags:
- { name: security.voter }
- { name: chill.role }
Chill\PersonBundle\Security\Authorization\AccompanyingPeriodCommentVoter:
autowire: true
+ autoconfigure: true
+ tags:
+ - { name: security.voter }
+
+ Chill\PersonBundle\Security\Authorization\AccompanyingPeriodResourceVoter:
+ autowire: true
+ autoconfigure: true
tags:
- { name: security.voter }
diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20220104133334.php b/src/Bundle/ChillPersonBundle/migrations/Version20220104133334.php
new file mode 100644
index 000000000..ca65f8c1e
--- /dev/null
+++ b/src/Bundle/ChillPersonBundle/migrations/Version20220104133334.php
@@ -0,0 +1,42 @@
+addSql('ALTER TABLE chill_person_accompanying_period_resource ADD comment_id INT DEFAULT NULL');
+ $this->addSql('ALTER TABLE chill_person_accompanying_period_resource DROP comment');
+ $this->addSql('ALTER TABLE chill_person_accompanying_period_resource ADD CONSTRAINT fk_dc78989ff8697d13 FOREIGN KEY (comment_id) REFERENCES chill_person_accompanying_period_comment (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
+ $this->addSql('CREATE INDEX idx_dc78989ff8697d13 ON chill_person_accompanying_period_resource (comment_id)');
+ }
+
+ public function getDescription(): string
+ {
+ return 'Replace accompanyingCourse Resources comment by a string';
+ }
+
+ public function up(Schema $schema): void
+ {
+ $this->addSql('ALTER TABLE chill_person_accompanying_period_resource DROP CONSTRAINT fk_dc78989ff8697d13');
+ $this->addSql('DROP INDEX idx_dc78989ff8697d13');
+ $this->addSql('ALTER TABLE chill_person_accompanying_period_resource ADD comment TEXT DEFAULT NULL');
+ $this->addSql('ALTER TABLE chill_person_accompanying_period_resource DROP comment_id');
+ }
+}
diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
index 7c3e9f60a..95c930956 100644
--- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
+++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php
@@ -133,7 +133,6 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface
/**
* @ORM\Column(name="comment", type="text", nullable=true)
- * @Groups({"read"})
*/
private ?string $comment = null;
diff --git a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue
index c3584cace..fb466f929 100644
--- a/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue
+++ b/src/Bundle/ChillThirdPartyBundle/Resources/public/vuejs/_components/Entity/ThirdPartyRenderBox.vue
@@ -38,25 +38,9 @@
{{ $t('child_of') }}
{{ thirdparty.parent.text }}
-
@@ -91,9 +75,6 @@
{{ thirdparty.email }}
-
-
{{ thirdparty.comment }}
-