This commit is contained in:
2025-08-21 09:55:52 +02:00
parent d62dd4396e
commit 3abb76d268
14 changed files with 1029 additions and 940 deletions

View File

@@ -42,7 +42,7 @@ document.addEventListener("DOMContentLoaded", () => {
pickWork: function (payload: { work: AccompanyingPeriodWork }) { pickWork: function (payload: { work: AccompanyingPeriodWork }) {
console.log("payload", payload); console.log("payload", payload);
input.value = payload.work.id?.toString() ?? ''; input.value = payload.work.id?.toString() ?? "";
}, },
}, },
}); });

View File

@@ -6,11 +6,15 @@
class="item-bloc" class="item-bloc"
v-for="(d, i) in documents" v-for="(d, i) in documents"
:key="d.id" :key="d.id"
:class="[parseInt(docAnchorId) === d.id ? 'bg-blink' : 'nothing']" :class="[
parseInt(docAnchorId) === d.id ? 'bg-blink' : 'nothing',
]"
> >
<div :id="'document_' + d.id" class="item-row"> <div :id="'document_' + d.id" class="item-row">
<div class="input-group input-group-lg mb-3 row"> <div class="input-group input-group-lg mb-3 row">
<label class="col-sm-3 col-form-label">Titre du document:</label> <label class="col-sm-3 col-form-label"
>Titre du document:</label
>
<div class="col-sm-9"> <div class="col-sm-9">
<input <input
class="form-control document-title" class="form-control document-title"
@@ -27,7 +31,10 @@
<div class="item-col item-meta"> <div class="item-col item-meta">
<p v-if="d.createdBy" class="createdBy"> <p v-if="d.createdBy" class="createdBy">
Créé par {{ d.createdBy.text }}<br /> Créé par {{ d.createdBy.text }}<br />
Le {{ $d(ISOToDatetime(d.createdAt.datetime), "long") }} Le
{{
$d(ISOToDatetime(d.createdAt.datetime), "long")
}}
</p> </p>
</div> </div>
</div> </div>
@@ -36,7 +43,8 @@
<ul class="record_actions"> <ul class="record_actions">
<li <li
v-if=" v-if="
d.workflows_availables.length > 0 || d.workflows.length > 0 d.workflows_availables.length > 0 ||
d.workflows.length > 0
" "
> >
<list-workflow-modal <list-workflow-modal
@@ -44,7 +52,9 @@
:allowCreate="true" :allowCreate="true"
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument" relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument"
:relatedEntityId="d.id" :relatedEntityId="d.id"
:workflowsAvailables="d.workflows_availables" :workflowsAvailables="
d.workflows_availables
"
:preventDefaultMoveToGenerate="true" :preventDefaultMoveToGenerate="true"
:goToGenerateWorkflowPayload="{ doc: d }" :goToGenerateWorkflowPayload="{ doc: d }"
@go-to-generate-workflow=" @go-to-generate-workflow="
@@ -56,14 +66,22 @@
<button <button
v-if="AmIRefferer" v-if="AmIRefferer"
class="btn btn-notify" class="btn btn-notify"
@click="$emit('goToGenerateNotification', d, false)" @click="
$emit(
'goToGenerateNotification',
d,
false,
)
"
></button> ></button>
<template v-else> <template v-else>
<button <button
id="btnGroupNotifyButtons" id="btnGroupNotifyButtons"
type="button" type="button"
class="btn btn-notify dropdown-toggle" class="btn btn-notify dropdown-toggle"
:title="trans(EVALUATION_NOTIFICATION_SEND)" :title="
trans(EVALUATION_NOTIFICATION_SEND)
"
data-bs-toggle="dropdown" data-bs-toggle="dropdown"
aria-expanded="false" aria-expanded="false"
> >
@@ -76,17 +94,37 @@
<li> <li>
<a <a
class="dropdown-item" class="dropdown-item"
@click="$emit('goToGenerateNotification', d, true)" @click="
$emit(
'goToGenerateNotification',
d,
true,
)
"
> >
{{ trans(EVALUATION_NOTIFICATION_NOTIFY_REFERRER) }} {{
trans(
EVALUATION_NOTIFICATION_NOTIFY_REFERRER,
)
}}
</a> </a>
</li> </li>
<li> <li>
<a <a
class="dropdown-item" class="dropdown-item"
@click="$emit('goToGenerateNotification', d, false)" @click="
$emit(
'goToGenerateNotification',
d,
false,
)
"
> >
{{ trans(EVALUATION_NOTIFICATION_NOTIFY_ANY) }} {{
trans(
EVALUATION_NOTIFICATION_NOTIFY_ANY,
)
}}
</a> </a>
</li> </li>
</ul> </ul>
@@ -97,10 +135,15 @@
:stored-object="d.storedObject" :stored-object="d.storedObject"
:filename="d.title" :filename="d.title"
:can-edit="true" :can-edit="true"
:execute-before-leave="submitBeforeLeaveToEditor" :execute-before-leave="
:davLink="d.storedObject._links?.dav_link.href" submitBeforeLeaveToEditor
"
:davLink="
d.storedObject._links?.dav_link.href
"
:davLinkExpiration=" :davLinkExpiration="
d.storedObject._links?.dav_link.expiration d.storedObject._links?.dav_link
.expiration
" "
@on-stored-object-status-change=" @on-stored-object-status-change="
$emit('statusDocumentChanged', $event) $emit('statusDocumentChanged', $event)
@@ -115,20 +158,35 @@
data-bs-toggle="dropdown" data-bs-toggle="dropdown"
aria-expanded="false" aria-expanded="false"
> >
{{ trans(EVALUATION_DOCUMENT_DUPLICATE) }} {{
trans(EVALUATION_DOCUMENT_DUPLICATE)
}}
</button> </button>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li> <li>
<a <a
class="dropdown-item" class="dropdown-item"
@click="$emit('duplicateDocument', d)" @click="
>{{ trans(EVALUATION_DOCUMENT_DUPLICATE_HERE) }}</a $emit(
'duplicateDocument',
d,
)
"
>{{
trans(
EVALUATION_DOCUMENT_DUPLICATE_HERE,
)
}}</a
> >
</li> </li>
<li> <li>
<a <a
class="dropdown-item" class="dropdown-item"
@click="prepareDocumentDuplicationToWork(d)" @click="
prepareDocumentDuplicationToWork(
d,
)
"
>{{ >{{
trans( trans(
EVALUATION_DOCUMENT_DUPLICATE_TO_OTHER_EVALUATION, EVALUATION_DOCUMENT_DUPLICATE_TO_OTHER_EVALUATION,
@@ -155,7 +213,10 @@
></drop-file-modal> ></drop-file-modal>
</li> </li>
<li v-if="d.workflows.length === 0"> <li v-if="d.workflows.length === 0">
<a class="btn btn-delete" @click="$emit('removeDocument', d)"> <a
class="btn btn-delete"
@click="$emit('removeDocument', d)"
>
</a> </a>
</li> </li>
</ul> </ul>

View File

@@ -28,7 +28,9 @@
@inputDocumentTitle="onInputDocumentTitle" @inputDocumentTitle="onInputDocumentTitle"
@removeDocument="removeDocument" @removeDocument="removeDocument"
@duplicateDocument="duplicateDocument" @duplicateDocument="duplicateDocument"
@duplicate-document-to-evaluation="duplicateDocumentToEvaluation" @duplicate-document-to-evaluation="
duplicateDocumentToEvaluation
"
@statusDocumentChanged="onStatusDocumentChanged" @statusDocumentChanged="onStatusDocumentChanged"
@goToGenerateWorkflow="goToGenerateWorkflowEvaluationDocument" @goToGenerateWorkflow="goToGenerateWorkflowEvaluationDocument"
@goToGenerateNotification="goToGenerateDocumentNotification" @goToGenerateNotification="goToGenerateDocumentNotification"
@@ -52,10 +54,7 @@ import TimeSpentInput from "./TimeSpentInput.vue";
import CommentInput from "./CommentInput.vue"; import CommentInput from "./CommentInput.vue";
import DocumentsList from "./DocumentsList.vue"; import DocumentsList from "./DocumentsList.vue";
import DocumentActions from "./DocumentActions.vue"; import DocumentActions from "./DocumentActions.vue";
import { import { trans, EVALUATION_DOCUMENT_DUPLICATE_SUCCESS } from "translator";
trans,
EVALUATION_DOCUMENT_DUPLICATE_SUCCESS
} from "translator";
import { useToast } from "vue-toast-notification"; import { useToast } from "vue-toast-notification";
const props = defineProps(["evaluation", "docAnchorId"]); const props = defineProps(["evaluation", "docAnchorId"]);
@@ -241,16 +240,19 @@ function duplicateDocument(document) {
store.dispatch("duplicateDocument", { store.dispatch("duplicateDocument", {
evaluation_key: props.evaluation.key, evaluation_key: props.evaluation.key,
document: document, document: document,
}) });
} }
function duplicateDocumentToEvaluation({ evaluation, document }) { function duplicateDocumentToEvaluation({ evaluation, document }) {
store.dispatch("duplicateDocumentToEvaluation", { store
.dispatch("duplicateDocumentToEvaluation", {
evaluation: evaluation, evaluation: evaluation,
document: document, document: document,
}) })
.then(() => { .then(() => {
$toast.open({ message: trans(EVALUATION_DOCUMENT_DUPLICATE_SUCCESS) }); $toast.open({
message: trans(EVALUATION_DOCUMENT_DUPLICATE_SUCCESS),
});
}) })
.catch((e) => { .catch((e) => {
console.log(e); console.log(e);
@@ -299,7 +301,9 @@ function goToGenerateDocumentNotification(document, tos) {
buildLinkCreateNotification( buildLinkCreateNotification(
"Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument", "Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument",
updatedDocument.id, updatedDocument.id,
tos === true ? store.state.work.accompanyingPeriod.user.id : null, tos === true
? store.state.work.accompanyingPeriod.user.id
: null,
window.location.pathname + window.location.pathname +
window.location.search + window.location.search +
window.location.hash, window.location.hash,

View File

@@ -9,7 +9,9 @@
:value="timeSpent" :value="timeSpent"
@input="$emit('update:timeSpent', $event.target.value)" @input="$emit('update:timeSpent', $event.target.value)"
> >
<option disabled value="">{{ trans(EVALUATION_TIME_SPENT) }}</option> <option disabled value="">
{{ trans(EVALUATION_TIME_SPENT) }}
</option>
<option <option
v-for="time in timeSpentChoices" v-for="time in timeSpentChoices"
:value="time.value" :value="time.value"

View File

@@ -15,14 +15,22 @@
<ul class="small_in_title columns mt-1"> <ul class="small_in_title columns mt-1">
<li> <li>
<span class="item-key"> <span class="item-key">
{{ trans(ACCOMPANYING_COURSE_WORK_START_DATE) }} : {{
trans(
ACCOMPANYING_COURSE_WORK_START_DATE,
)
}}
:
</span> </span>
<b>{{ formatDate(eval.startDate) }}</b> <b>{{ formatDate(eval.startDate) }}</b>
</li> </li>
<li v-if="eval.endDate"> <li v-if="eval.endDate">
<span class="item-key"> <span class="item-key">
{{ trans(ACCOMPANYING_COURSE_WORK_END_DATE) }} : {{
trans(ACCOMPANYING_COURSE_WORK_END_DATE)
}}
:
</span> </span>
<b>{{ formatDate(eval.endDate) }}</b> <b>{{ formatDate(eval.endDate) }}</b>
</li> </li>
@@ -51,9 +59,9 @@ const formatDate = (dateObject: DateTime) => {
if (dateObject) { if (dateObject) {
const parsedDate = ISOToDate(dateObject.datetime); const parsedDate = ISOToDate(dateObject.datetime);
if (parsedDate) { if (parsedDate) {
return new Intl.DateTimeFormat("default", { dateStyle: "short" }).format( return new Intl.DateTimeFormat("default", {
parsedDate, dateStyle: "short",
); }).format(parsedDate);
} else { } else {
return ""; return "";
} }

View File

@@ -57,9 +57,9 @@ const formatDate = (dateObject: DateTime) => {
if (dateObject) { if (dateObject) {
const parsedDate = ISOToDate(dateObject.datetime); const parsedDate = ISOToDate(dateObject.datetime);
if (parsedDate) { if (parsedDate) {
return new Intl.DateTimeFormat("default", { dateStyle: "short" }).format( return new Intl.DateTimeFormat("default", {
parsedDate, dateStyle: "short",
); }).format(parsedDate);
} else { } else {
return ""; return "";
} }

View File

@@ -26,27 +26,28 @@ import AccompanyingPeriodWorkItem from "./AccompanyingPeriodWorkItem.vue";
import { AccompanyingPeriodWork } from "../../../types"; import { AccompanyingPeriodWork } from "../../../types";
import { defineProps, ref, watch } from "vue"; import { defineProps, ref, watch } from "vue";
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const props = defineProps<{ const props = defineProps<{
accompanyingPeriodWorks: AccompanyingPeriodWork[]; accompanyingPeriodWorks: AccompanyingPeriodWork[];
selectedAcpw?: AccompanyingPeriodWork | null; selectedAcpw?: AccompanyingPeriodWork | null;
}>(); }>();
const selectedAcpw = ref<AccompanyingPeriodWork | null>(props.selectedAcpw ?? null); const selectedAcpw = ref<AccompanyingPeriodWork | null>(
props.selectedAcpw ?? null,
);
// eslint-disable-next-line vue/valid-define-emits
const emit = defineEmits<{ const emit = defineEmits<{
'update:selectedAcpw': [value: AccompanyingPeriodWork | null]; "update:selectedAcpw": [value: AccompanyingPeriodWork | null];
}>(); }>();
watch(() => props.selectedAcpw, (val) => { watch(
() => props.selectedAcpw,
(val) => {
selectedAcpw.value = val ?? null; selectedAcpw.value = val ?? null;
}); },
);
watch(selectedAcpw, (newValue) => { watch(selectedAcpw, (newValue) => {
emit("update:selectedAcpw", newValue); emit("update:selectedAcpw", newValue);
}); });
</script> </script>
<style> <style>

View File

@@ -4,9 +4,11 @@
<div class="col-md-6 col-sm-10" v-if="selectedAcpw"> <div class="col-md-6 col-sm-10" v-if="selectedAcpw">
<ul class="list-suggest remove-items"> <ul class="list-suggest remove-items">
<li> <li>
<span @click="selectedAcpw = null" class="chill-denomination">{{ <span
selectedAcpw?.socialAction?.title.fr @click="selectedAcpw = null"
}}</span> class="chill-denomination"
>{{ selectedAcpw?.socialAction?.title.fr }}</span
>
</li> </li>
</ul> </ul>
</div> </div>
@@ -27,7 +29,13 @@
modal-dialog-class="modal-dialog-scrollable modal-xl" modal-dialog-class="modal-dialog-scrollable modal-xl"
> >
<template #header> <template #header>
<h3>{{ trans(ACPW_DUPLICATE_SELECT_ACCOMPANYING_PERIOD_WORK) }}</h3> <h3>
{{
trans(
ACPW_DUPLICATE_SELECT_ACCOMPANYING_PERIOD_WORK,
)
}}
</h3>
</template> </template>
<template #body> <template #body>
@@ -44,7 +52,11 @@
</template> </template>
<template #footer> <template #footer>
<button type="button" class="btn btn-save" @click="confirmSelection"> <button
type="button"
class="btn btn-save"
@click="confirmSelection"
>
{{ trans(CONFIRM) }} {{ trans(CONFIRM) }}
</button> </button>
</template> </template>
@@ -116,7 +128,7 @@ watch(selectedAcpw, (newValue) => {
"find_accompanying_period_work_acpw", "find_accompanying_period_work_acpw",
) as HTMLInputElement; ) as HTMLInputElement;
if (inputField) { if (inputField) {
inputField.value = String(newValue?.id || ''); inputField.value = String(newValue?.id || "");
} }
/* if (!props.isEvaluationSelector) { /* if (!props.isEvaluationSelector) {
@@ -136,20 +148,21 @@ const closeModal = () => {
}; };
const confirmSelection = () => { const confirmSelection = () => {
selectedAcpw.value = selectedAcpw.value; selectedAcpw.value = selectedAcpw.value;
console.log('selectedAcpw', selectedAcpw.value) console.log("selectedAcpw", selectedAcpw.value);
if (!props.isEvaluationSelector) { if (!props.isEvaluationSelector) {
if (selectedAcpw.value) { // only emit if something is actually selected! if (selectedAcpw.value) {
// only emit if something is actually selected!
emit("pickWork", { work: selectedAcpw.value }); emit("pickWork", { work: selectedAcpw.value });
closeModal(); closeModal();
} }
// optionally show some error or warning if not selected // optionally show some error or warning if not selected
return; return;
} }
if (selectedAcpw.value && props.isEvaluationSelector) { if (selectedAcpw.value && props.isEvaluationSelector) {
evaluations.value = selectedAcpw.value.accompanyingPeriodWorkEvaluations; evaluations.value =
selectedAcpw.value.accompanyingPeriodWorkEvaluations;
} }
if (selectedEvaluation.value && props.isEvaluationSelector) { if (selectedEvaluation.value && props.isEvaluationSelector) {