From dbe186547f1c61a06db779491dc40bfd2e99705f Mon Sep 17 00:00:00 2001 From: nobohan Date: Sun, 13 Mar 2022 22:31:26 +0100 Subject: [PATCH 01/12] AccompanyingCourseWorkEdit: replace document by a new one --- .../components/FormEvaluation.vue | 25 ++++++++++++++++++- .../vuejs/AccompanyingCourseWorkEdit/store.js | 17 +++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index 24e1c202f..2e31c0669 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -84,6 +84,8 @@

Créé par {{ d.createdBy.text }}
Le {{ $d(ISOToDatetime(d.createdAt.datetime), 'long') }}

+ +
  • @@ -98,6 +100,14 @@ @go-to-generate-workflow="goToGenerateWorkflowEvaluationDocument" >
  • +
  • + + +
  • @@ -176,7 +186,8 @@ const i18n = { document_upload: "Téléverser un document", document_title: "Titre du document", template_title: "Nom du template", - browse: "Ajouter un document" + browse: "Ajouter un document", + replace: "Remplacer" } } }; @@ -285,6 +296,18 @@ export default { }; this.$store.commit('addDocument', {key: this.evaluation.key, document: document}); }, + replaceDocument(oldDocument, storedObject) { + + console.log(oldDocument); + console.log(storedObject); + //console.log(oldDocument) how to get the old document? + let document = { + type: 'accompanying_period_work_evaluation_document', + storedObject: storedObject, + title: oldDocument.title + }; + this.$store.commit('replaceDocument', {key: this.evaluation.key, document: document, oldDocument: oldDocument}); + }, removeDocument(document) { if (window.confirm("Êtes-vous sûr·e de vouloir supprimer le document qui a pour titre \"" + document.title +"\" ?")) { this.$store.commit('removeDocument', {key: this.evaluation.key, document: document}); diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index 7f96843e5..18d6847f1 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -221,6 +221,20 @@ const store = createStore({ evaluations.documents = evaluations.documents.filter(d => d.key !== document.key); }, + replaceDocument(state, payload) { + console.log('payload', payload) + console.log(state.evaluationsPicked) + let evaluations = state.evaluationsPicked.find(e => e.key === payload.key); + console.log(evaluations) + if (evaluations === undefined) { + return; + } + + //Add document with map + evaluations.documents = evaluations.documents.map(d => d.key === payload.oldDocument.key ? payload.document : d); //TODO no key on documents! + console.log(evaluations) + + }, addEvaluation(state, evaluation) { let e = { type: "accompanying_period_work_evaluation", @@ -408,6 +422,9 @@ const store = createStore({ removeDocument({commit}, payload) { commit('removeDocument', payload); }, + replaceDocument({commit}, payload) { + commit('replaceDocument', payload); + }, submit({ getters, state, commit }, callback) { let payload = getters.buildPayload, From 6eac6044cd6a69147abe51149db24ef68eb912f4 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 14 Mar 2022 10:42:16 +0100 Subject: [PATCH 02/12] AccompanyingCourseWorkEdit: replace document by a new one (working now) --- .../components/FormEvaluation.vue | 4 --- .../vuejs/AccompanyingCourseWorkEdit/store.js | 25 ++++++++++--------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index 2e31c0669..7fe9bd278 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -297,10 +297,6 @@ export default { this.$store.commit('addDocument', {key: this.evaluation.key, document: document}); }, replaceDocument(oldDocument, storedObject) { - - console.log(oldDocument); - console.log(storedObject); - //console.log(oldDocument) how to get the old document? let document = { type: 'accompanying_period_work_evaluation_document', storedObject: storedObject, diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index 18d6847f1..893d3663a 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -213,27 +213,28 @@ const store = createStore({ })); }, removeDocument(state, {key, document}) { - let evaluations = state.evaluationsPicked.find(e => e.key === key); + let evaluation = state.evaluationsPicked.find(e => e.key === key); - if (evaluations === undefined) { + if (evaluation === undefined) { return; } - evaluations.documents = evaluations.documents.filter(d => d.key !== document.key); + evaluation.documents = evaluation.documents.filter(d => d.key !== document.key); }, replaceDocument(state, payload) { - console.log('payload', payload) - console.log(state.evaluationsPicked) - let evaluations = state.evaluationsPicked.find(e => e.key === payload.key); - console.log(evaluations) - if (evaluations === undefined) { + let evaluation = state.evaluationsPicked.find(e => e.key === payload.key); + if (evaluation === undefined) { return; } - //Add document with map - evaluations.documents = evaluations.documents.map(d => d.key === payload.oldDocument.key ? payload.document : d); //TODO no key on documents! - console.log(evaluations) - + let newDocument = Object.assign( + payload.document, { + key: evaluation.documents.length + 1, + workflows_availables: state.work.workflows_availables_evaluation_documents, + workflows: [], + } + ); + evaluation.documents = evaluation.documents.map(d => d.id === payload.oldDocument.id ? newDocument : d); }, addEvaluation(state, evaluation) { let e = { From 9f0ab5aee74c21d9138539b7259452e0ef60f4c1 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 14 Mar 2022 10:43:28 +0100 Subject: [PATCH 03/12] upd CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 885068bc0..fa50b6389 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to ## Unreleased +* [person] AccompanyingCourseWorkEdit: replace document by a new one (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/511) + * [main] filter user job in undispatch acc period to assign (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/472) * [person] Add url in accompanying period work evaluations entity and form (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/476) * [person] Add document generation in admin and in person/{id}/document (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/464) From 1beae4d7135b67ebcf32b2edc41132d4b754e291 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 14 Mar 2022 14:42:04 +0100 Subject: [PATCH 04/12] AccompanyingCourseWorkEdit: download existing documents --- .../Entity/StoredObject.php | 4 +- .../public/module/async_upload/downloader.js | 3 +- .../public/module/async_upload/uploader.js | 4 +- .../_components/AddAsyncUploadDownloader.vue | 45 +++++++++++++++++++ .../components/FormEvaluation.vue | 13 +++++- 5 files changed, 63 insertions(+), 6 deletions(-) create mode 100644 src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/_components/AddAsyncUploadDownloader.vue diff --git a/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php b/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php index c512dba73..78387e7fe 100644 --- a/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php +++ b/src/Bundle/ChillDocStoreBundle/Entity/StoredObject.php @@ -61,13 +61,13 @@ class StoredObject implements AsyncFileInterface, Document /** * @var int[] * @ORM\Column(type="json", name="iv") - * @Serializer\Groups({"write"}) + * @Serializer\Groups({"read", "write"}) */ private array $iv = []; /** * @ORM\Column(type="json", name="key") - * @Serializer\Groups({"write"}) + * @Serializer\Groups({"read", "write"}) */ private array $keyInfos = []; diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/downloader.js b/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/downloader.js index 4c82a8e4b..0e889c373 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/downloader.js +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/downloader.js @@ -73,6 +73,7 @@ var download = (button) => { button.type = mimeType; button.textContent = labelReady; if (hasFilename) { + button.download = filename; if (extension !== false) { button.download = button.download + '.' + extension; @@ -92,4 +93,4 @@ window.addEventListener('load', function(e) { initializeButtons(e.target); }); -module.exports = initializeButtons; +export { initializeButtons, download }; \ No newline at end of file diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/uploader.js b/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/uploader.js index 35871245b..5def6a0b2 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/uploader.js +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/module/async_upload/uploader.js @@ -1,6 +1,6 @@ var algo = 'AES-CBC'; import Dropzone from 'dropzone'; -var initializeDownload = require('./downloader.js'); +import { initializeButtons } from './downloader.js'; /** @@ -359,7 +359,7 @@ var insertDownloadButton = (zone, zoneData) => { addBelowButton(newButton, zone, zoneData); //zone.appendChild(newButton); - initializeDownload(zone); + initializeButtons(zone); }; window.addEventListener('load', function(e) { diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/_components/AddAsyncUploadDownloader.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/_components/AddAsyncUploadDownloader.vue new file mode 100644 index 000000000..781c47d6f --- /dev/null +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/_components/AddAsyncUploadDownloader.vue @@ -0,0 +1,45 @@ + + + diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index 7fe9bd278..ec412842e 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -108,6 +108,14 @@ > +
  • + + + +
  • @@ -162,6 +170,7 @@ import { mapGetters, mapState } from 'vuex'; import PickTemplate from 'ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue'; import {buildLink} from 'ChillDocGeneratorAssets/lib/document-generator'; import AddAsyncUpload from 'ChillDocStoreAssets/vuejs/_components/AddAsyncUpload.vue'; +import AddAsyncUploadDownloader from 'ChillDocStoreAssets/vuejs/_components/AddAsyncUploadDownloader.vue'; import ListWorkflowModal from 'ChillMainAssets/vuejs/_components/EntityWorkflow/ListWorkflowModal.vue'; import {buildLinkCreate} from 'ChillMainAssets/lib/entity-workflow/api.js'; @@ -187,7 +196,8 @@ const i18n = { document_title: "Titre du document", template_title: "Nom du template", browse: "Ajouter un document", - replace: "Remplacer" + replace: "Remplacer", + download: "Télécharger le fichier existant" } } }; @@ -199,6 +209,7 @@ export default { ckeditor: CKEditor.component, PickTemplate, AddAsyncUpload, + AddAsyncUploadDownloader, ListWorkflowModal, }, i18n, From 369397bf4f6649e47bed54e32d2273cff583aed0 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 14 Mar 2022 14:42:53 +0100 Subject: [PATCH 05/12] upd CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa50b6389..13ae858ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to ## Unreleased +* [person] AccompanyingCourseWorkEdit: download existing documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/512) * [person] AccompanyingCourseWorkEdit: replace document by a new one (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/511) * [main] filter user job in undispatch acc period to assign (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/472) From 82052f5d70b557b6c1438c1eaaa3328b6bf0dce0 Mon Sep 17 00:00:00 2001 From: nobohan Date: Mon, 14 Mar 2022 15:13:21 +0100 Subject: [PATCH 06/12] AccompanyingCourseWorkEdit: fix setting title of document with a fresh upload --- .../components/FormEvaluation.vue | 6 ++++-- .../public/vuejs/AccompanyingCourseWorkEdit/store.js | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue index ec412842e..2b380a7ec 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -65,7 +65,7 @@
    {{ $t('Documents') }} :
    -
    +
    @@ -75,6 +75,7 @@ type="text" :value="d.title" :id="d.id" + :data-key="i" @input="onInputDocumentTitle"/>
    @@ -296,8 +297,9 @@ export default { }, onInputDocumentTitle(event) { const id = Number(event.target.id); + const key = Number(event.target.dataset.key) + 1; const title = event.target.value; - this.$store.commit('updateDocumentTitle', {id: id, evaluationKey: this.evaluation.key, title: title}); + this.$store.commit('updateDocumentTitle', {id: id, key: key, evaluationKey: this.evaluation.key, title: title}); }, addDocument(storedObject) { let document = { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index 893d3663a..2ea9b48e0 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -324,8 +324,13 @@ const store = createStore({ state.isPosting = st; }, updateDocumentTitle(state, payload) { - state.evaluationsPicked.find(e => e.key === payload.evaluationKey) + if (payload.id === 0) { + state.evaluationsPicked.find(e => e.key === payload.evaluationKey) + .documents.find(d => d.key === payload.key).title = payload.title; + } else { + state.evaluationsPicked.find(e => e.key === payload.evaluationKey) .documents.find(d => d.id === payload.id).title = payload.title; + } } }, actions: { From dbc604d84a1b61b761ff5a78c8ddb96b241aab04 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 18 Mar 2022 17:02:35 +0100 Subject: [PATCH 07/12] AccompanyingCourseWorkEdit: download existing documents --- CHANGELOG.md | 2 ++ .../public/vuejs/AccompanyingCourseWorkEdit/store.js | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13ae858ba..885af7493 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to ## Unreleased + +* [person] AccompanyingCourseWorkEdit: fix deleting evaluation documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/546) * [person] AccompanyingCourseWorkEdit: download existing documents (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/512) * [person] AccompanyingCourseWorkEdit: replace document by a new one (https://gitlab.com/champs-libres/departement-de-la-vendee/chill/-/issues/511) diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index 2ea9b48e0..359e7afad 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -131,9 +131,9 @@ const store = createStore({ endDate: e.endDate !== null ? ISOToDatetime(e.endDate.datetime) : null, maxDate: e.maxDate !== null ? ISOToDatetime(e.maxDate.datetime) : null, warningInterval: e.warningInterval !== null ? intervalISOToDays(e.warningInterval) : null, - documents: e.documents.map((d, dindex) => { + documents: e.documents.map((d, docIndex) => { return Object.assign(d, { - key: index + key: docIndex }); }), }); @@ -214,11 +214,9 @@ const store = createStore({ }, removeDocument(state, {key, document}) { let evaluation = state.evaluationsPicked.find(e => e.key === key); - if (evaluation === undefined) { return; } - evaluation.documents = evaluation.documents.filter(d => d.key !== document.key); }, replaceDocument(state, payload) { From efeda81e05e148e48c103402a9ec5d227b10e279 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 21 Mar 2022 15:17:33 +0100 Subject: [PATCH 08/12] do not add referrer if user is null --- .../EventListener/AccompanyingPeriodWorkEventListener.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php b/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php index c9b11ea71..95ab71d4b 100644 --- a/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php +++ b/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php @@ -25,6 +25,8 @@ class AccompanyingPeriodWorkEventListener public function prePersistAccompanyingPeriodWork(AccompanyingPeriodWork $work): void { - $work->addReferrer($this->security->getUser()); + if (null !== $this->security->getUser()) { + $work->addReferrer($this->security->getUser()); + } } } From 704392a729471bf2ed0b363e4b670710f8eb5fa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 21 Mar 2022 15:21:29 +0100 Subject: [PATCH 09/12] do not add referrer if user is null (fix condition) --- .../EventListener/AccompanyingPeriodWorkEventListener.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php b/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php index 95ab71d4b..83f9ca460 100644 --- a/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php +++ b/src/Bundle/ChillPersonBundle/EventListener/AccompanyingPeriodWorkEventListener.php @@ -11,6 +11,7 @@ declare(strict_types=1); namespace Chill\PersonBundle\EventListener; +use Chill\MainBundle\Entity\User; use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork; use Symfony\Component\Security\Core\Security; @@ -25,7 +26,7 @@ class AccompanyingPeriodWorkEventListener public function prePersistAccompanyingPeriodWork(AccompanyingPeriodWork $work): void { - if (null !== $this->security->getUser()) { + if ($this->security->getUser() instanceof User) { $work->addReferrer($this->security->getUser()); } } From 11d57094e80919d371d44880d44f7aedc035230b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 21 Mar 2022 15:22:40 +0100 Subject: [PATCH 10/12] fix cs --- .../Controller/ReassignAccompanyingPeriodController.php | 1 - .../Repository/AccompanyingPeriodACLAwareRepository.php | 7 ++++--- .../AccompanyingPeriodACLAwareRepositoryInterface.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php index ac5b6dfab..4abf5e93c 100644 --- a/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php +++ b/src/Bundle/ChillPersonBundle/Controller/ReassignAccompanyingPeriodController.php @@ -15,7 +15,6 @@ use Chill\MainBundle\Entity\User; use Chill\MainBundle\Pagination\PaginatorFactory; use Chill\MainBundle\Repository\UserRepository; use Chill\MainBundle\Templating\Entity\UserRender; -use Chill\PersonBundle\Repository\AccompanyingPeriodACLAwareRepository; use Chill\PersonBundle\Repository\AccompanyingPeriodACLAwareRepositoryInterface; use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php index f4c9a52a3..8efd60e58 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepository.php @@ -16,8 +16,9 @@ use Chill\MainBundle\Security\Authorization\AuthorizationHelper; use Chill\MainBundle\Security\Resolver\CenterResolverDispatcherInterface; use Chill\PersonBundle\Entity\AccompanyingPeriod; use Chill\PersonBundle\Entity\Person; -use Symfony\Component\Security\Core\Security; +use DateTime; +use Symfony\Component\Security\Core\Security; use function count; final class AccompanyingPeriodACLAwareRepository implements AccompanyingPeriodACLAwareRepositoryInterface @@ -55,7 +56,7 @@ final class AccompanyingPeriodACLAwareRepository implements AccompanyingPeriodAC ) ) ->setParameter('user', $user) - ->setParameter('now', new \DateTime('now')) + ->setParameter('now', new DateTime('now')) ->setParameter('draft', AccompanyingPeriod::STEP_DRAFT); return $qb; @@ -140,7 +141,7 @@ final class AccompanyingPeriodACLAwareRepository implements AccompanyingPeriodAC ->setMaxResults($limit); foreach ($orderBy as $field => $direction) { - $qb->addOrderBy('ap.'.$field, $direction); + $qb->addOrderBy('ap.' . $field, $direction); } return $qb->getQuery()->getResult(); diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepositoryInterface.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepositoryInterface.php index 0c5af217f..a02ec27c6 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepositoryInterface.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriodACLAwareRepositoryInterface.php @@ -16,6 +16,8 @@ use Chill\PersonBundle\Entity\Person; interface AccompanyingPeriodACLAwareRepositoryInterface { + public function countByUserOpenedAccompanyingPeriod(?User $user): int; + public function findByPerson( Person $person, string $role, @@ -25,6 +27,4 @@ interface AccompanyingPeriodACLAwareRepositoryInterface ): array; public function findByUserOpenedAccompanyingPeriod(?User $user, array $orderBy = [], int $limit = 0, int $offset = 50): array; - - public function countByUserOpenedAccompanyingPeriod(?User $user): int; } From 2ce8b1110dc69c7c11001a3b666b192b0d1618f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Mon, 21 Mar 2022 16:13:02 +0100 Subject: [PATCH 11/12] allow to change color for asyncupload button --- .../vuejs/_components/AddAsyncUpload.vue | 27 +++++++++++++++---- .../vuejs/AccompanyingCourseWorkEdit/App.vue | 2 +- .../components/AddEvaluation.vue | 5 ++-- .../components/FormEvaluation.vue | 1 + 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/_components/AddAsyncUpload.vue b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/_components/AddAsyncUpload.vue index ebd2ab4b4..634e9ed45 100644 --- a/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/_components/AddAsyncUpload.vue +++ b/src/Bundle/ChillDocStoreBundle/Resources/public/vuejs/_components/AddAsyncUpload.vue @@ -1,5 +1,5 @@