From bf4e036b7f147f350d4e3ec8550f39275662c4f8 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 10 Feb 2023 11:53:08 +0100 Subject: [PATCH 01/12] FEATURE [eval][duration] property added to an to save the time spent working on evaluation --- .../AccompanyingPeriodWorkEvaluation.php | 17 ++++++++++++ .../migrations/Version20230210104424.php | 26 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php index 078ef0c3c..39266b57e 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php @@ -160,6 +160,11 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU */ private ?DateInterval $warningInterval = null; + /** + * @ORM\Column(type="time", nullable=true) + */ + private ?DateTimeInterface $timeSpent = null; + public function __construct() { $this->documents = new ArrayCollection(); @@ -265,6 +270,11 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU return $this->warningInterval; } + public function getTimeSpent(): ?DateTimeInterface + { + return $this->timeSpent; + } + public function removeDocument(AccompanyingPeriodWorkEvaluationDocument $document): self { $this->documents->removeElement($document); @@ -322,6 +332,13 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU return $this; } + public function setTimeSpent(?DateTimeInterface $timeSpent): self + { + $this->timeSpent = $timeSpent; + + return $this; + } + public function setEvaluation(?Evaluation $evaluation): AccompanyingPeriodWorkEvaluation { if ( diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php b/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php new file mode 100644 index 000000000..ea18e9adf --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php @@ -0,0 +1,26 @@ +addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation ADD timeSpent TIME(0) WITHOUT TIME ZONE DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation DROP timeSpent'); + } +} From 8a6b2354bd413bc0c3472edff76cb3939edee181 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 10 Feb 2023 12:58:31 +0100 Subject: [PATCH 02/12] FEATURE [vue][form] incorporating the timeSpent field in the vue form --- .../components/FormEvaluation.vue | 34 +++++++++++++++++++ .../vuejs/AccompanyingCourseWorkEdit/store.js | 4 +++ 2 files changed, 38 insertions(+) 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 4bf9e1a8a..c8101b2ba 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -49,6 +49,19 @@ +
+ +
+ +
+
+
@@ -190,6 +203,7 @@ const i18n = { evaluation_choose_a_template: "Choisir un modèle", evaluation_add_a_document: "Ajouter un document", evaluation_add: "Ajouter une évaluation", + evaluation_time_spent: "Temps de rédaction", Documents: "Documents", document_add: "Générer ou téléverser un document", document_upload: "Téléverser un document", @@ -223,6 +237,22 @@ export default { maxPostSize: 15000000, required: false, }, + timeSpentChoices: [ + { text: '1 minute', value: 60 }, { text: '2 minutes', value: 120 }, + { text: '3 minutes', value: 180 }, { text: '4 minutes', value: 240 }, + { text: '5 minutes', value: 300 }, { text: '10 minutes', value: 600 }, + { text: '15 minutes', value: 900 },{ text: '20 minutes', value: 1200 }, + { text: '25 minutes', value: 1500 }, { text: '30 minutes', value: 1800 }, + { text: '45 minutes', value: 2700 },{ text: '1 hour', value: 3600 }, + { text: '1 hour 15 minutes', value: 4500 }, { text: '1 hour 30 minutes', value: 5400 }, + { text: '1 hour 45 minutes', value: 6300 }, { text: '2 hours', value: 7200 }, + { text: '2 hours 30 minutes', value: 9000 }, { text: '3 hours', value: 10800 }, + { text: '3 hours 30 minutes', value: 12600 },{ text: '4 hours', value: 14400 }, + { text: '4 hours 30 minutes', value: 16200 },{ text: '5 hours', value: 18000 }, + { text: '5 hours 30 minutes', value: 19800 },{ text: '6 hours', value: 21600 }, + { text: '6 hours 30 minutes', value: 23400 },{ text: '7 hours', value: 25200 }, + { text: '7 hours 30 minutes', value: 27000 },{ text: '8 hours', value: 28800 }, + ] } }, computed: { @@ -264,6 +294,10 @@ export default { get() { return this.evaluation.warningInterval; }, set(v) { this.$store.commit('setEvaluationWarningInterval', { key: this.evaluation.key, days: v }); } }, + timeSpent: { + get() { return this.timeSpentChoices }, + set(v) { this.$store.commit('setEvaluationTimeSpent', { key: this.evaluation.key, time: v}) } + }, comment: { get() { return this.evaluation.comment; }, set(v) { this.$store.commit('setEvaluationComment', { key: this.evaluation.key, comment: v }); } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index acbe51981..ee011ae28 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -286,6 +286,10 @@ const store = createStore({ state.evaluationsPicked.find(e => e.key === key) .warningInterval = days; }, + setEvaluationTimeSpent(state, {key, time}) { + state.evaluationsPicked.find(e => e.key === key) + .timeSpent = time; + }, setEvaluationComment(state, {key, comment}) { state.evaluationsPicked.find(e => e.key === key) .comment = comment; From 4a62c2e167063c6f00b2a463626cace282333a51 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 15 Feb 2023 11:17:59 +0100 Subject: [PATCH 03/12] FEATURE [evaluation][serialization] add new time spent property to serialization --- .../AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php index 39266b57e..9cb26b4c3 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php @@ -162,6 +162,9 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU /** * @ORM\Column(type="time", nullable=true) + * @Serializer\Groups({"read", "docgen:read"}) + * @Serializer\Groups({"write"}) + * @Serializer\Groups({"accompanying_period_work_evaluation:create"}) */ private ?DateTimeInterface $timeSpent = null; From 80a88fc00c533bc9282f3b1294200875a86a7acb Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 15 Feb 2023 11:28:05 +0100 Subject: [PATCH 04/12] FEATURE [timespent][type] change type of time spent to integer --- .../AccompanyingPeriodWorkEvaluation.php | 8 ++++---- .../migrations/Version20230210104424.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php index 9cb26b4c3..8780f7d17 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php @@ -161,12 +161,12 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU private ?DateInterval $warningInterval = null; /** - * @ORM\Column(type="time", nullable=true) + * @ORM\Column(type="integer", nullable=true) * @Serializer\Groups({"read", "docgen:read"}) * @Serializer\Groups({"write"}) * @Serializer\Groups({"accompanying_period_work_evaluation:create"}) */ - private ?DateTimeInterface $timeSpent = null; + private ?int $timeSpent = null; public function __construct() { @@ -273,7 +273,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU return $this->warningInterval; } - public function getTimeSpent(): ?DateTimeInterface + public function getTimeSpent(): ?int { return $this->timeSpent; } @@ -335,7 +335,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU return $this; } - public function setTimeSpent(?DateTimeInterface $timeSpent): self + public function setTimeSpent(?int $timeSpent): self { $this->timeSpent = $timeSpent; diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php b/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php index ea18e9adf..ec802a993 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php @@ -16,7 +16,7 @@ final class Version20230210104424 extends AbstractMigration public function up(Schema $schema): void { - $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation ADD timeSpent TIME(0) WITHOUT TIME ZONE DEFAULT NULL'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation ADD timeSpent INT DEFAULT NULL'); } public function down(Schema $schema): void From a5f4eabc341e149a1fb8239e8e5cf208dc59c28d Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 15 Feb 2023 11:50:05 +0100 Subject: [PATCH 05/12] FEATURE [store][component] final adjustments to methods to post time spent --- .../components/FormEvaluation.vue | 6 ++++-- .../public/vuejs/AccompanyingCourseWorkEdit/store.js | 5 ++++- 2 files changed, 8 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 c8101b2ba..13f02e4d6 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -55,7 +55,8 @@
@@ -204,6 +205,7 @@ const i18n = { evaluation_add_a_document: "Ajouter un document", evaluation_add: "Ajouter une évaluation", evaluation_time_spent: "Temps de rédaction", + select_time_spent: "Indiquez le temps de rédaction", Documents: "Documents", document_add: "Générer ou téléverser un document", document_upload: "Téléverser un document", @@ -295,7 +297,7 @@ export default { set(v) { this.$store.commit('setEvaluationWarningInterval', { key: this.evaluation.key, days: v }); } }, timeSpent: { - get() { return this.timeSpentChoices }, + get() { return this.evaluation.timeSpent }, set(v) { this.$store.commit('setEvaluationTimeSpent', { key: this.evaluation.key, time: v}) } }, comment: { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index ee011ae28..5c610fa50 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -116,6 +116,7 @@ const store = createStore({ endDate: e.endDate === null || e.endDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.endDate)) }, maxDate: e.maxDate === null || e.maxDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.maxDate)) }, warningInterval: intervalDaysToISO(e.warningInterval), + timeSpent: e.timeSpent, comment: e.comment, documents: e.documents }; @@ -138,6 +139,7 @@ const store = createStore({ endDate: e.endDate !== null ? dateToISO(new Date(e.endDate.datetime)) : null, maxDate: e.maxDate !== null ? dateToISO(new Date(e.maxDate.datetime)) : null, warningInterval: e.warningInterval !== null ? intervalISOToDays(e.warningInterval) : null, + timeSpent: e.timeSpent !== null ? e.timeSpent : null, documents: e.documents.map((d, docIndex) => { return Object.assign(d, { key: docIndex @@ -258,6 +260,7 @@ const store = createStore({ endDate: null, maxDate: null, warningInterval: null, + timeSpent: null, comment: "", editEvaluation: true, workflows_availables: state.work.workflows_availables_evaluation, @@ -471,7 +474,7 @@ const store = createStore({ ; commit('setIsPosting', true); - console.log('payload', payload); + console.log('the social action', payload); return makeFetch('PUT', url, payload) .then(data => { From f75f6719bc43839e81e150c81e02577f8bdc3b68 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 10 Feb 2023 11:53:08 +0100 Subject: [PATCH 06/12] FEATURE [eval][duration] property added to an to save the time spent working on evaluation --- .../AccompanyingPeriodWorkEvaluation.php | 17 ++++++++++++ .../migrations/Version20230210104424.php | 26 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php index 078ef0c3c..39266b57e 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php @@ -160,6 +160,11 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU */ private ?DateInterval $warningInterval = null; + /** + * @ORM\Column(type="time", nullable=true) + */ + private ?DateTimeInterface $timeSpent = null; + public function __construct() { $this->documents = new ArrayCollection(); @@ -265,6 +270,11 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU return $this->warningInterval; } + public function getTimeSpent(): ?DateTimeInterface + { + return $this->timeSpent; + } + public function removeDocument(AccompanyingPeriodWorkEvaluationDocument $document): self { $this->documents->removeElement($document); @@ -322,6 +332,13 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU return $this; } + public function setTimeSpent(?DateTimeInterface $timeSpent): self + { + $this->timeSpent = $timeSpent; + + return $this; + } + public function setEvaluation(?Evaluation $evaluation): AccompanyingPeriodWorkEvaluation { if ( diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php b/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php new file mode 100644 index 000000000..ea18e9adf --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php @@ -0,0 +1,26 @@ +addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation ADD timeSpent TIME(0) WITHOUT TIME ZONE DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation DROP timeSpent'); + } +} From 08b3d476a7cf1c973e1c129c6636e403f5b4a398 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Fri, 10 Feb 2023 12:58:31 +0100 Subject: [PATCH 07/12] FEATURE [vue][form] incorporating the timeSpent field in the vue form --- .../components/FormEvaluation.vue | 34 +++++++++++++++++++ .../vuejs/AccompanyingCourseWorkEdit/store.js | 4 +++ 2 files changed, 38 insertions(+) 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 4bf9e1a8a..c8101b2ba 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -49,6 +49,19 @@
+
+ +
+ +
+
+
@@ -190,6 +203,7 @@ const i18n = { evaluation_choose_a_template: "Choisir un modèle", evaluation_add_a_document: "Ajouter un document", evaluation_add: "Ajouter une évaluation", + evaluation_time_spent: "Temps de rédaction", Documents: "Documents", document_add: "Générer ou téléverser un document", document_upload: "Téléverser un document", @@ -223,6 +237,22 @@ export default { maxPostSize: 15000000, required: false, }, + timeSpentChoices: [ + { text: '1 minute', value: 60 }, { text: '2 minutes', value: 120 }, + { text: '3 minutes', value: 180 }, { text: '4 minutes', value: 240 }, + { text: '5 minutes', value: 300 }, { text: '10 minutes', value: 600 }, + { text: '15 minutes', value: 900 },{ text: '20 minutes', value: 1200 }, + { text: '25 minutes', value: 1500 }, { text: '30 minutes', value: 1800 }, + { text: '45 minutes', value: 2700 },{ text: '1 hour', value: 3600 }, + { text: '1 hour 15 minutes', value: 4500 }, { text: '1 hour 30 minutes', value: 5400 }, + { text: '1 hour 45 minutes', value: 6300 }, { text: '2 hours', value: 7200 }, + { text: '2 hours 30 minutes', value: 9000 }, { text: '3 hours', value: 10800 }, + { text: '3 hours 30 minutes', value: 12600 },{ text: '4 hours', value: 14400 }, + { text: '4 hours 30 minutes', value: 16200 },{ text: '5 hours', value: 18000 }, + { text: '5 hours 30 minutes', value: 19800 },{ text: '6 hours', value: 21600 }, + { text: '6 hours 30 minutes', value: 23400 },{ text: '7 hours', value: 25200 }, + { text: '7 hours 30 minutes', value: 27000 },{ text: '8 hours', value: 28800 }, + ] } }, computed: { @@ -264,6 +294,10 @@ export default { get() { return this.evaluation.warningInterval; }, set(v) { this.$store.commit('setEvaluationWarningInterval', { key: this.evaluation.key, days: v }); } }, + timeSpent: { + get() { return this.timeSpentChoices }, + set(v) { this.$store.commit('setEvaluationTimeSpent', { key: this.evaluation.key, time: v}) } + }, comment: { get() { return this.evaluation.comment; }, set(v) { this.$store.commit('setEvaluationComment', { key: this.evaluation.key, comment: v }); } diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index acbe51981..ee011ae28 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -286,6 +286,10 @@ const store = createStore({ state.evaluationsPicked.find(e => e.key === key) .warningInterval = days; }, + setEvaluationTimeSpent(state, {key, time}) { + state.evaluationsPicked.find(e => e.key === key) + .timeSpent = time; + }, setEvaluationComment(state, {key, comment}) { state.evaluationsPicked.find(e => e.key === key) .comment = comment; From 8957f3fed4c577e18a51508e16accc4cbb24d370 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 15 Feb 2023 11:17:59 +0100 Subject: [PATCH 08/12] FEATURE [evaluation][serialization] add new time spent property to serialization --- .../AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php index 39266b57e..9cb26b4c3 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php @@ -162,6 +162,9 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU /** * @ORM\Column(type="time", nullable=true) + * @Serializer\Groups({"read", "docgen:read"}) + * @Serializer\Groups({"write"}) + * @Serializer\Groups({"accompanying_period_work_evaluation:create"}) */ private ?DateTimeInterface $timeSpent = null; From e528e4f57ac04d9730607e315128ce72ffc809c6 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 15 Feb 2023 11:28:05 +0100 Subject: [PATCH 09/12] FEATURE [timespent][type] change type of time spent to integer --- .../AccompanyingPeriodWorkEvaluation.php | 8 ++++---- .../migrations/Version20230210104424.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php index 9cb26b4c3..8780f7d17 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/AccompanyingPeriodWorkEvaluation.php @@ -161,12 +161,12 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU private ?DateInterval $warningInterval = null; /** - * @ORM\Column(type="time", nullable=true) + * @ORM\Column(type="integer", nullable=true) * @Serializer\Groups({"read", "docgen:read"}) * @Serializer\Groups({"write"}) * @Serializer\Groups({"accompanying_period_work_evaluation:create"}) */ - private ?DateTimeInterface $timeSpent = null; + private ?int $timeSpent = null; public function __construct() { @@ -273,7 +273,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU return $this->warningInterval; } - public function getTimeSpent(): ?DateTimeInterface + public function getTimeSpent(): ?int { return $this->timeSpent; } @@ -335,7 +335,7 @@ class AccompanyingPeriodWorkEvaluation implements TrackCreationInterface, TrackU return $this; } - public function setTimeSpent(?DateTimeInterface $timeSpent): self + public function setTimeSpent(?int $timeSpent): self { $this->timeSpent = $timeSpent; diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php b/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php index ea18e9adf..ec802a993 100644 --- a/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php +++ b/src/Bundle/ChillPersonBundle/migrations/Version20230210104424.php @@ -16,7 +16,7 @@ final class Version20230210104424 extends AbstractMigration public function up(Schema $schema): void { - $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation ADD timeSpent TIME(0) WITHOUT TIME ZONE DEFAULT NULL'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_evaluation ADD timeSpent INT DEFAULT NULL'); } public function down(Schema $schema): void From 9ff116797acdfc8f81236b7ca858c9532cbd5a78 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 15 Feb 2023 11:50:05 +0100 Subject: [PATCH 10/12] FEATURE [store][component] final adjustments to methods to post time spent --- .../components/FormEvaluation.vue | 6 ++++-- .../public/vuejs/AccompanyingCourseWorkEdit/store.js | 5 ++++- 2 files changed, 8 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 c8101b2ba..13f02e4d6 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/components/FormEvaluation.vue @@ -55,7 +55,8 @@
@@ -204,6 +205,7 @@ const i18n = { evaluation_add_a_document: "Ajouter un document", evaluation_add: "Ajouter une évaluation", evaluation_time_spent: "Temps de rédaction", + select_time_spent: "Indiquez le temps de rédaction", Documents: "Documents", document_add: "Générer ou téléverser un document", document_upload: "Téléverser un document", @@ -295,7 +297,7 @@ export default { set(v) { this.$store.commit('setEvaluationWarningInterval', { key: this.evaluation.key, days: v }); } }, timeSpent: { - get() { return this.timeSpentChoices }, + get() { return this.evaluation.timeSpent }, set(v) { this.$store.commit('setEvaluationTimeSpent', { key: this.evaluation.key, time: v}) } }, comment: { diff --git a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js index ee011ae28..5c610fa50 100644 --- a/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js +++ b/src/Bundle/ChillPersonBundle/Resources/public/vuejs/AccompanyingCourseWorkEdit/store.js @@ -116,6 +116,7 @@ const store = createStore({ endDate: e.endDate === null || e.endDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.endDate)) }, maxDate: e.maxDate === null || e.maxDate === '' ? null : { datetime: datetimeToISO(ISOToDate(e.maxDate)) }, warningInterval: intervalDaysToISO(e.warningInterval), + timeSpent: e.timeSpent, comment: e.comment, documents: e.documents }; @@ -138,6 +139,7 @@ const store = createStore({ endDate: e.endDate !== null ? dateToISO(new Date(e.endDate.datetime)) : null, maxDate: e.maxDate !== null ? dateToISO(new Date(e.maxDate.datetime)) : null, warningInterval: e.warningInterval !== null ? intervalISOToDays(e.warningInterval) : null, + timeSpent: e.timeSpent !== null ? e.timeSpent : null, documents: e.documents.map((d, docIndex) => { return Object.assign(d, { key: docIndex @@ -258,6 +260,7 @@ const store = createStore({ endDate: null, maxDate: null, warningInterval: null, + timeSpent: null, comment: "", editEvaluation: true, workflows_availables: state.work.workflows_availables_evaluation, @@ -471,7 +474,7 @@ const store = createStore({ ; commit('setIsPosting', true); - console.log('payload', payload); + console.log('the social action', payload); return makeFetch('PUT', url, payload) .then(data => { From f07aaecc3dbcd4cd9fa1f807c1548a1a027aefd8 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Wed, 1 Mar 2023 17:54:36 +0100 Subject: [PATCH 11/12] FEATURE [export][eval] add timespent field to the list_evaluation export. Value in minutes --- src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php | 4 ++++ src/Bundle/ChillPersonBundle/translations/messages.fr.yml | 1 + 2 files changed, 5 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php index e7d1e5dfd..010618733 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListEvaluation.php @@ -47,6 +47,7 @@ class ListEvaluation implements ListInterface, GroupedExportInterface 'endDate', 'maxDate', 'warningInterval', + 'timeSpent', 'acpw_id', 'acpw_startDate', 'acpw_endDate', @@ -295,6 +296,9 @@ class ListEvaluation implements ListInterface, GroupedExportInterface $qb->addSelect(sprintf('workeval.%s AS %s', $field, $field)); } + // add the time spent field + $qb->addSelect('(workeval.timeSpent / 60) AS timeSpent'); + // those with identity foreach (['createdBy', 'updatedBy'] as $field) { $qb->addSelect(sprintf('IDENTITY(workeval.%s) AS %s', $field, $field)); diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 808ce5257..91347341f 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -1139,6 +1139,7 @@ export: updatedAt: Date de modification createdBy: Créé par updatedBy: Modifié par + timeSpent: Temps de rédaction (minutes) acpw: List of accompanying period works: Liste des actions List description: Génère une liste des actions d'accompagnement, filtrée sur différents paramètres. From 4319b0d8045a19dcea7e9e651acc388c99576dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Fri, 24 Mar 2023 18:16:44 +0100 Subject: [PATCH 12/12] Feature: add timespent on "show" page --- .../translations/messages+intl-icu.fr.yaml | 9 +++++++++ .../_objectifs_results_evaluations.html.twig | 14 +++++++++++++- .../ChillPersonBundle/translations/messages.fr.yml | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml index 4756ff4f7..263a57049 100644 --- a/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml +++ b/src/Bundle/ChillMainBundle/translations/messages+intl-icu.fr.yaml @@ -45,3 +45,12 @@ workflow: few {# workflows} other {# workflows} } + +duration: + minute: >- + {m, plural, + =0 {Aucune durée} + one {# minute} + few {# minutes} + other {# minutes} + } diff --git a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig index 0dd0cc84a..f4198a5c7 100644 --- a/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig +++ b/src/Bundle/ChillPersonBundle/Resources/views/AccompanyingCourseWork/_objectifs_results_evaluations.html.twig @@ -118,6 +118,18 @@ {% endif %} {% endif %} + + {% if e.timeSpent is not null and e.timeSpent > 0 %} +
  • + {% set minutes = (e.timeSpent / 60) %} + {{ 'accompanying_course_work.timeSpent'|trans ~ ' : ' }} {{ 'duration.minute'|trans({ '{m}' : minutes }) }} +
  • + {% elseif displayContent is defined and displayContent == 'long' %} +
  • + {{ 'accompanying_course_work.timeSpent'|trans ~ ' : ' }} + {{ 'Not given'|trans }} +
  • + {% endif %} @@ -143,7 +155,7 @@ {% else %} {{ 'No document found'|trans }} {% endif %} - + {% endif %} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 91347341f..090f35c1c 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -908,6 +908,7 @@ accompanying_course_work: remove: Supprimer une action d'accompagnement social_evaluation: Évaluation private_comment: Commentaire privé + timeSpent: Temps de rédaction #