first eslint corrections

This commit is contained in:
2024-10-31 17:28:02 +01:00
parent f90f1c7ef8
commit 27ecae4486
109 changed files with 6903 additions and 4637 deletions

View File

@@ -1,330 +1,515 @@
<template>
<div id="workEditor" class="my-4">
<div id="title" class="action-row">
<div>
<p class="wl-item social-issues">
<span class="chill-entity entity-social-issue">
<span class="badge bg-chill-l-gray text-dark">{{ work.socialAction.issue.text }}</span>
</span>
</p>
</div>
<h2 class="badge-title">
<span class="title_label"></span>
<span class="title_action">{{ work.socialAction.text }}</span>
</h2>
<div
id="workEditor"
class="my-4"
>
<div
id="title"
class="action-row"
>
<div>
<p class="wl-item social-issues">
<span class="chill-entity entity-social-issue">
<span class="badge bg-chill-l-gray text-dark">{{ work.socialAction.issue.text }}</span>
</span>
</p>
</div>
<h2 class="badge-title">
<span class="title_label" />
<span class="title_action">{{ work.socialAction.text }}</span>
</h2>
</div>
<div
id="startDate"
class="action-row"
>
<label class="col-form-label">{{ $t('startDate') }}</label>
<input
v-model="startDate"
type="date"
required="true"
class="form-control"
v-once
>
</div>
<div
id="endDate"
class="action-row"
>
<label class="col-form-label">{{ $t('endDate') }}</label>
<input
v-model="endDate"
type="date"
class="form-control"
>
</div>
<div
id="privateComment"
class="action-row"
>
<label class="col-form-label">{{ $t('private_comment') }}</label>
<ckeditor
v-model="privateComment"
:editor="editor"
tag-name="textarea"
/>
</div>
<div
id="comment"
class="action-row"
>
<label class="col-form-label">{{ $t('comments') }}</label>
<ckeditor
v-model="note"
:editor="editor"
tag-name="textarea"
/>
</div>
<div
id="objectives"
class="action-row"
>
<div
aria="hidden"
class="title"
>
<div><h3>{{ $t('goals_title') }}</h3></div>
<div><h3>{{ $t('results_title') }}</h3></div>
</div>
<div id="startDate" class="action-row">
<label class="col-form-label">{{ $t('startDate') }}</label>
<input v-model="startDate" type="date" required="true" class="form-control" v-once/>
<!-- results which are not attached to an objective -->
<div v-if="hasResultsForAction">
<div class="results_without_objective">
{{ $t('results_without_objective') }}
</div>
<div>
<add-result
:available-results="resultsForAction"
destination="action"
/>
</div>
</div>
<div id="endDate" class="action-row">
<label class="col-form-label">{{ $t('endDate') }}</label>
<input v-model="endDate" type="date" class="form-control" />
<!-- results which **are** attached to an objective -->
<div
v-for="g in goalsPicked"
:key="g.goal.id"
>
<div
class="item-title"
@click="removeGoal(g)"
>
<span class="removable">{{ g.goal.title.fr }}</span>
</div>
<div>
<add-result
:goal="g.goal"
destination="goal"
/>
</div>
</div>
<div
class="accordion"
id="expandedSuggestions"
>
<div
v-if="availableForCheckGoal.length > 0"
class="accordion-item"
>
<h2
class="accordion-header"
id="heading_expanded_suggestions"
>
<button
v-if="isExpanded"
class="accordion-button"
type="button"
data-bs-toggle="collapse"
aria-expanded="true"
@click="toggleSelect"
>
Masquer
</button>
<button
v-else
class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
aria-expanded="false"
@click="toggleSelect"
>
Motifs, objectifs et dispositfs disponibles
</button>
</h2>
<div
class="accordion-collapse"
id="collapse_expanded_suggestions"
aria-labelledby="heading_expanded_suggestions"
data-bs-parent="#expandedSuggestions"
>
<template v-if="isExpanded">
<ul class="list-suggest add-items">
<li
v-for="g in availableForCheckGoal"
@click="addGoal(g)"
:key="g.id"
>
<span>{{ g.title.fr }}</span>
</li>
</ul>
</template>
</div>
<p
v-if="goalsPicked.length ===0"
class="chill-no-data-statement"
>
Aucun objectif associé
</p>
</div>
<div v-else>
<span class="chill-no-data-statement">{{ $t('no_goals_available') }}</span>
</div>
</div>
</div>
<div
id="evaluations"
class="action-row"
>
<div
aria="hidden"
class="title"
>
<div><h3>{{ $t('Evaluations') }} - {{ $t('Forms') }} - {{ $t('Post') }}</h3></div>
</div>
<div id="privateComment" class="action-row">
<label class="col-form-label">{{ $t('private_comment') }}</label>
<ckeditor
v-model="privateComment"
:editor="editor"
tag-name="textarea"
></ckeditor>
</div>
<!-- list evaluations -->
<add-evaluation
v-for="e in pickedEvaluations"
:key="e.key"
:evaluation="e"
:doc-anchor-id="this.docAnchorId"
/>
<div id="comment" class="action-row">
<label class="col-form-label">{{ $t('comments') }}</label>
<ckeditor
v-model="note"
:editor="editor"
tag-name="textarea"
></ckeditor>
</div>
<div id="objectives" class="action-row">
<div aria="hidden" class="title">
<div><h3>{{ $t('goals_title') }}</h3></div>
<div><h3>{{ $t('results_title') }}</h3></div>
</div>
<!-- results which are not attached to an objective -->
<div v-if="hasResultsForAction">
<div class="results_without_objective">
{{ $t('results_without_objective') }}
</div>
<div>
<add-result :availableResults="resultsForAction" destination="action"></add-result>
</div>
</div>
<!-- results which **are** attached to an objective -->
<div v-for="g in goalsPicked" :key="g.goal.id">
<div class="item-title" @click="removeGoal(g)">
<span class="removable">{{ g.goal.title.fr }}</span>
</div>
<div>
<add-result :goal="g.goal" destination="goal"></add-result>
</div>
</div>
<div class="accordion" id="expandedSuggestions">
<div v-if="availableForCheckGoal.length > 0" class="accordion-item">
<h2 class="accordion-header" id="heading_expanded_suggestions">
<button v-if="isExpanded"
class="accordion-button"
type="button"
data-bs-toggle="collapse"
aria-expanded="true"
@click="toggleSelect">
Masquer
</button>
<button v-else
class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
aria-expanded="false"
@click="toggleSelect">
Motifs, objectifs et dispositfs disponibles
</button>
</h2>
<div class="accordion-collapse" id="collapse_expanded_suggestions"
aria-labelledby="heading_expanded_suggestions" data-bs-parent="#expandedSuggestions">
<template v-if="isExpanded">
<ul class="list-suggest add-items">
<li v-for="g in availableForCheckGoal" @click="addGoal(g)" :key="g.id">
<span>{{ g.title.fr }}</span>
</li>
</ul>
</template>
</div>
<p v-if="goalsPicked.length ===0" class="chill-no-data-statement">
Aucun objectif associé
</p>
</div>
<div v-else>
<span class="chill-no-data-statement">{{ $t('no_goals_available') }}</span>
</div>
</div>
</div>
<div id="evaluations" class="action-row">
<div aria="hidden" class="title">
<div><h3>{{ $t('Evaluations') }} - {{ $t('Forms') }} - {{ $t('Post') }}</h3></div>
</div>
<!-- list evaluations -->
<add-evaluation
v-for="e in pickedEvaluations"
v-bind:key="e.key"
v-bind:evaluation="e"
v-bind:docAnchorId="this.docAnchorId">
</add-evaluation>
<!-- box to add new evaluation -->
<div class="add_evaluation">
<div v-if="showAddEvaluation">
<p>{{ $t('available_evaluations_text') }}</p>
<ul class="list-suggest add-items">
<li v-for="e in evaluationsForAction" @click="addEvaluation(e)" :key="e.id">
<span>{{ e.title.fr }}</span>
</li>
</ul>
</div>
<ul class="record_actions" v-if="evaluationsForAction.length > 0">
<li>
<button :title="$t('add_an_evaluation')" class="btn btn-create" @click="toggleAddEvaluation">{{ $t('add_an_evaluation') }}</button>
</li>
</ul>
<div v-else>
<span class="chill-no-data-statement">{{ $t('no_evaluations_available') }}</span>
</div>
</div>
</div>
<div id="persons" class="action-row">
<h3 class="mb-3">{{ $t('persons_involved') }}</h3>
<ul class="list-unstyled">
<li v-for="p in personsReachables" :key="p.id">
<div class="form-check">
<input v-model="personsPicked" :value="p.id" type="checkbox" class="me-2 form-check-input" :id="'person_check'+p.id">
<label :for="'person_check'+p.id" class="form-check-label">
<person-text :person="p"></person-text>
</label>
</div>
<!-- box to add new evaluation -->
<div class="add_evaluation">
<div v-if="showAddEvaluation">
<p>{{ $t('available_evaluations_text') }}</p>
<ul class="list-suggest add-items">
<li
v-for="e in evaluationsForAction"
@click="addEvaluation(e)"
:key="e.id"
>
<span>{{ e.title.fr }}</span>
</li>
</ul>
</ul>
</div>
<ul
class="record_actions"
v-if="evaluationsForAction.length > 0"
>
<li>
<button
:title="$t('add_an_evaluation')"
class="btn btn-create"
@click="toggleAddEvaluation"
>
{{ $t('add_an_evaluation') }}
</button>
</li>
</ul>
<div v-else>
<span class="chill-no-data-statement">{{ $t('no_evaluations_available') }}</span>
</div>
</div>
</div>
<div
id="persons"
class="action-row"
>
<h3 class="mb-3">
{{ $t('persons_involved') }}
</h3>
<ul class="list-unstyled">
<li
v-for="p in personsReachables"
:key="p.id"
>
<div class="form-check">
<input
v-model="personsPicked"
:value="p.id"
type="checkbox"
class="me-2 form-check-input"
:id="'person_check'+p.id"
>
<label
:for="'person_check'+p.id"
class="form-check-label"
>
<person-text :person="p" />
</label>
</div>
</li>
</ul>
</div>
<div
id="referrers"
class="action-row"
>
<h3>{{ $t('referrers') }}</h3>
<div v-if="!hasReferrers">
<p class="chill-no-data-statement">
{{ $t('no_referrers') }}
</p>
</div>
<div id="referrers" class="action-row">
<h3>{{ $t('referrers') }}</h3>
<div v-if="!hasReferrers">
<p class="chill-no-data-statement">{{ $t('no_referrers') }}</p>
</div>
<div v-else>
<ul class="list-suggest remove-items inline">
<li v-for="u in referrers" :key="u.id" :title="$t('remove_referrer')" @click="removeReferrer(u)">
<span>
{{ u.text }}
</span>
</li>
</ul>
</div>
<ul class="record_actions">
<li class="add-persons">
<add-persons
ref="referrerPicker"
:key="referrerPicker.key"
:buttonTitle="$t('add_referrers')"
:modalTitle="$t('choose_referrers')"
:options="referrerPicker.options"
@addNewPersons="addReferrers">
</add-persons>
</li>
</ul>
<div v-else>
<ul class="list-suggest remove-items inline">
<li
v-for="u in referrers"
:key="u.id"
:title="$t('remove_referrer')"
@click="removeReferrer(u)"
>
<span>
{{ u.text }}
</span>
</li>
</ul>
</div>
<div id="handlingThirdParty" class="action-row">
<h3>{{ $t('handling_thirdparty') }}</h3>
<ul class="record_actions">
<li class="add-persons">
<add-persons
ref="referrerPicker"
:key="referrerPicker.key"
:button-title="$t('add_referrers')"
:modal-title="$t('choose_referrers')"
:options="referrerPicker.options"
@add-new-persons="addReferrers"
/>
</li>
</ul>
</div>
<div v-if="!hasHandlingThirdParty">
<p class="chill-no-data-statement">
{{ $t('no_handling_thirdparty') }}
</p>
<div
id="handlingThirdParty"
class="action-row"
>
<h3>{{ $t('handling_thirdparty') }}</h3>
<ul class="record_actions">
<li class="add-persons">
<add-persons
ref="handlingThirdPartyPicker"
v-bind:key="handlingThirdPartyPicker.key"
v-bind:buttonTitle="$t('precise_handling_thirdparty')"
v-bind:modalTitle="$t('choose_a_thirdparty')"
v-bind:options="handlingThirdPartyPicker.options"
@addNewPersons="setHandlingThirdParty"> <!-- to cast child method -->
</add-persons>
</li>
</ul>
</div>
<div v-else class="flex-table">
<third-party-render-box
:thirdparty="handlingThirdParty"
:options="{
addLink: false,
addId: false,
addEntity: true,
addInfo: false,
hLevel: 3,
isMultiline: true,
isConfidential: false
}"></third-party-render-box>
<ul class="record_actions">
<li>
<button :title="$t('remove_handling_thirdparty')" class="btn btn-remove" @click="removeHandlingThirdParty"/>
</li>
</ul>
</div>
<div v-if="!hasHandlingThirdParty">
<p class="chill-no-data-statement">
{{ $t('no_handling_thirdparty') }}
</p>
<ul class="record_actions">
<li class="add-persons">
<add-persons
ref="handlingThirdPartyPicker"
:key="handlingThirdPartyPicker.key"
:button-title="$t('precise_handling_thirdparty')"
:modal-title="$t('choose_a_thirdparty')"
:options="handlingThirdPartyPicker.options"
@add-new-persons="setHandlingThirdParty"
>
<!-- to cast child method -->
</add-persons>
</li>
</ul>
</div>
<div
v-else
class="flex-table"
>
<third-party-render-box
:thirdparty="handlingThirdParty"
:options="{
addLink: false,
addId: false,
addEntity: true,
addInfo: false,
hLevel: 3,
isMultiline: true,
isConfidential: false
}"
/>
<ul class="record_actions">
<li>
<button
:title="$t('remove_handling_thirdparty')"
class="btn btn-remove"
@click="removeHandlingThirdParty"
/>
</li>
</ul>
</div>
</div>
<div
id="thirdParties"
class="action-row"
>
<h3>{{ $t('thirdparty_intervener') }}</h3>
<div v-if="!hasThirdParties">
<p class="chill-no-data-statement">
{{ $t('no_thirdparty_intervener') }}
</p>
</div>
<div id="thirdParties" class="action-row">
<h3>{{ $t('thirdparty_intervener') }}</h3>
<div v-if="!hasThirdParties">
<p class="chill-no-data-statement">{{ $t('no_thirdparty_intervener') }}</p>
</div>
<div v-else>
<div class="flex-bloc mb-3">
<third-party-render-box
v-for="thirdparty in thirdParties"
:key="thirdparty.id"
:thirdparty="thirdparty"
:options="{ addLink : false, addId : false, addEntity: true, addInfo: false, hLevel: 3 }"
>
<template v-slot:record-actions>
<ul class="record_actions">
<li><on-the-fly :type="thirdparty.type" :id="thirdparty.id" action="show"></on-the-fly></li>
<li><on-the-fly :type="thirdparty.type" :id="thirdparty.id" action="edit" @saveFormOnTheFly="saveFormOnTheFly" ref="onTheFly"></on-the-fly></li>
<li>
<button :title="$t('remove_thirdparty')" class="btn btn-sm btn-remove" @click="removeThirdParty(thirdparty)" />
</li>
</ul>
</template>
</third-party-render-box>
</div>
</div>
<ul class="record_actions">
<li class="add-persons">
<add-persons
ref="thirdPartyPicker"
v-bind:key="thirdPartyPicker.key"
v-bind:buttonTitle="$t('add_thirdparties')"
v-bind:modalTitle="$t('choose_thirdparties')"
v-bind:options="thirdPartyPicker.options"
@addNewPersons="addThirdParties"> <!-- to cast child method -->
</add-persons>
</li>
</ul>
<div v-else>
<div class="flex-bloc mb-3">
<third-party-render-box
v-for="thirdparty in thirdParties"
:key="thirdparty.id"
:thirdparty="thirdparty"
:options="{ addLink : false, addId : false, addEntity: true, addInfo: false, hLevel: 3 }"
>
<template #record-actions>
<ul class="record_actions">
<li>
<on-the-fly
:type="thirdparty.type"
:id="thirdparty.id"
action="show"
/>
</li>
<li>
<on-the-fly
:type="thirdparty.type"
:id="thirdparty.id"
action="edit"
@save-form-on-the-fly="saveFormOnTheFly"
ref="onTheFly"
/>
</li>
<li>
<button
:title="$t('remove_thirdparty')"
class="btn btn-sm btn-remove"
@click="removeThirdParty(thirdparty)"
/>
</li>
</ul>
</template>
</third-party-render-box>
</div>
</div>
<div v-if="errors.length > 0" id="errors" class="alert alert-danger flashbag">
<p>{{ $t('fix_these_errors') }}</p>
<ul>
<li v-for="e in errors" :key="e.id">{{ e }}</li>
</ul>
</div>
<ul class="record_actions">
<li class="add-persons">
<add-persons
ref="thirdPartyPicker"
:key="thirdPartyPicker.key"
:button-title="$t('add_thirdparties')"
:modal-title="$t('choose_thirdparties')"
:options="thirdPartyPicker.options"
@add-new-persons="addThirdParties"
>
<!-- to cast child method -->
</add-persons>
</li>
</ul>
</div>
</div>
<ul class="record_actions sticky-form-buttons">
<li>
<list-workflow-modal
:workflows="this.work.workflows"
:allowCreate="true"
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork"
:relatedEntityId="this.work.id"
:workflowsAvailables="this.work.workflows_availables"
:preventDefaultMoveToGenerate="true"
@go-to-generate-workflow="goToGenerateWorkflow"
></list-workflow-modal>
</li>
<div
v-if="errors.length > 0"
id="errors"
class="alert alert-danger flashbag"
>
<p>{{ $t('fix_these_errors') }}</p>
<ul>
<li
v-for="e in errors"
:key="e.id"
>
{{ e }}
</li>
</ul>
</div>
</div>
<ul class="record_actions sticky-form-buttons">
<li>
<list-workflow-modal
:workflows="this.work.workflows"
:allow-create="true"
related-entity-class="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork"
:related-entity-id="this.work.id"
:workflows-availables="this.work.workflows_availables"
:prevent-default-move-to-generate="true"
@go-to-generate-workflow="goToGenerateWorkflow"
/>
</li>
<li>
<button v-if="AmIRefferer"
class="btn btn-notify"
@click="goToGenerateNotification(false)"
></button>
<template v-else>
<button id="btnGroupNotifyButtons" type="button" class="btn btn-notify dropdown-toggle" :title="$t('notification_send')" data-bs-toggle="dropdown" aria-expanded="false">&nbsp;</button>
<ul class="dropdown-menu" aria-labelledby="btnGroupNotifyButtons">
<li><a class="dropdown-item" @click="goToGenerateNotification(true)">{{ $t('notification_notify_referrer') }}</a></li>
<li><a class="dropdown-item" @click="goToGenerateNotification(false)">{{ $t('notification_notify_any') }}</a></li>
</ul>
</template>
</li>
<li>
<button
v-if="AmIRefferer"
class="btn btn-notify"
@click="goToGenerateNotification(false)"
/>
<template v-else>
<button
id="btnGroupNotifyButtons"
type="button"
class="btn btn-notify dropdown-toggle"
:title="$t('notification_send')"
data-bs-toggle="dropdown"
aria-expanded="false"
>
&nbsp;
</button>
<ul
class="dropdown-menu"
aria-labelledby="btnGroupNotifyButtons"
>
<li>
<a
class="dropdown-item"
@click="goToGenerateNotification(true)"
>{{ $t('notification_notify_referrer') }}</a>
</li>
<li>
<a
class="dropdown-item"
@click="goToGenerateNotification(false)"
>{{ $t('notification_notify_any') }}</a>
</li>
</ul>
</template>
</li>
<li v-if="!isPosting">
<button class="btn btn-save" @click="submit">
{{ $t('action.save') }}
</button>
</li>
<li v-if="!isPosting">
<button
class="btn btn-save"
@click="submit"
>
{{ $t('action.save') }}
</button>
</li>
<li v-if="isPosting">
<button class="btn btn-save" disabled>
{{ $t('action.save') }}
</button>
</li>
</ul>
<li v-if="isPosting">
<button
class="btn btn-save"
disabled
>
{{ $t('action.save') }}
</button>
</li>
</ul>
</template>
<script>

View File

@@ -1,53 +1,78 @@
<template>
<div>
<a id="evaluations"></a>
<div class="item-title" :title="evaluation.id || 'no id yet'">
<span>{{ evaluation.evaluation.title.fr }}</span>
</div>
<div>
<a id="evaluations" />
<div
class="item-title"
:title="evaluation.id || 'no id yet'"
>
<span>{{ evaluation.evaluation.title.fr }}</span>
</div>
<div class="item-url mt-3 mb-4" v-if="evaluation.evaluation.url">
<i class="fa fa-link fa-lg"></i>
<a :href="evaluation.evaluation.url" target="_blank">{{ evaluation.evaluation.url }}</a>
</div>
<div
class="item-url mt-3 mb-4"
v-if="evaluation.evaluation.url"
>
<i class="fa fa-link fa-lg" />
<a
:href="evaluation.evaluation.url"
target="_blank"
>{{ evaluation.evaluation.url }}</a>
</div>
<div>
<form-evaluation ref="FormEvaluation" :key="evaluation.key" :evaluation="evaluation" :docAnchorId="docAnchorId"></form-evaluation>
<div>
<form-evaluation
ref="FormEvaluation"
:key="evaluation.key"
:evaluation="evaluation"
:doc-anchor-id="docAnchorId"
/>
<ul class="record_actions">
<li v-if="evaluation.workflows_availables.length > 0">
<ul class="record_actions">
<li v-if="evaluation.workflows_availables.length > 0">
<list-workflow-modal
:workflows="evaluation.workflows"
:allow-create="true"
related-entity-class="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation"
:related-entity-id="evaluation.id"
:workflows-availables="evaluation.workflows_availables"
@go-to-generate-workflow="goToGenerateWorkflow"
/>
</li>
<li v-if="canDelete">
<a
class="btn btn-delete"
@click="modal.showModal = true"
:title="$t('action.delete')"
>{{ $t('delete_evaluation') }}</a>
</li>
</ul>
</div>
<list-workflow-modal
:workflows="evaluation.workflows"
:allowCreate="true"
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation"
:relatedEntityId="evaluation.id"
:workflowsAvailables="evaluation.workflows_availables"
@go-to-generate-workflow="goToGenerateWorkflow"
></list-workflow-modal>
</li>
<li v-if="canDelete">
<a class="btn btn-delete" @click="modal.showModal = true" :title="$t('action.delete')">{{ $t('delete_evaluation')}}</a>
</li>
</ul>
</div>
<teleport to="body">
<modal v-if="modal.showModal" :modalDialogClass="modal.modalDialogClass" @close="modal.showModal = false">
<template v-slot:header>
<h2 class="modal-title">{{ $t('delete.sure') }}</h2>
</template>
<template v-slot:body>
<p>{{ $t('delete.sure_description') }}</p>
</template>
<template v-slot:footer>
<button class="btn btn-danger" @click="removeEvaluation(evaluation)">
{{ $t('delete.ok') }}
</button>
</template>
</modal>
</teleport>
</div>
<teleport to="body">
<modal
v-if="modal.showModal"
:modal-dialog-class="modal.modalDialogClass"
@close="modal.showModal = false"
>
<template #header>
<h2 class="modal-title">
{{ $t('delete.sure') }}
</h2>
</template>
<template #body>
<p>{{ $t('delete.sure_description') }}</p>
</template>
<template #footer>
<button
class="btn btn-danger"
@click="removeEvaluation(evaluation)"
>
{{ $t('delete.ok') }}
</button>
</template>
</modal>
</teleport>
</div>
</template>
<script>

View File

@@ -1,62 +1,87 @@
<template>
<div v-if="hasResult" class="addResult">
<div
v-if="hasResult"
class="addResult"
>
<p
v-if="pickedResults.length ===0"
class="chill-no-data-statement"
>
Aucun résultat associé
</p>
<p v-if="pickedResults.length ===0" class="chill-no-data-statement">
Aucun résultat associé
</p>
<ul class="list-suggest remove-items">
<li
v-for="r in pickedResults"
@click="removeResult(r)"
:key="r.id"
>
<span>
{{ r.title.fr }}
</span>
</li>
</ul>
<ul class="list-suggest remove-items">
<li v-for="r in pickedResults" @click="removeResult(r)" :key="r.id">
<span>
{{ r.title.fr }}
</span>
</li>
</ul>
<div
class="accordion"
id="expandedSuggestions"
>
<div class="accordion-item">
<h2
class="accordion-header"
id="heading_expanded_suggestions"
>
<button
v-if="isExpanded"
class="accordion-button"
type="button"
data-bs-toggle="collapse"
aria-expanded="true"
@click="toggleSelect"
>
Masquer
</button>
<div class="accordion" id="expandedSuggestions">
<div class="accordion-item">
<h2 class="accordion-header" id="heading_expanded_suggestions">
<button v-if="isExpanded"
class="accordion-button"
type="button"
data-bs-toggle="collapse"
aria-expanded="true"
@click="toggleSelect">
Masquer
</button>
<button v-else
class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
aria-expanded="false"
@click="toggleSelect">
Résultats et orientations disponibles
</button>
</h2>
<div class="accordion-collapse" id="collapse_expanded_suggestions"
aria-labelledby="heading_expanded_suggestions" data-bs-parent="#expandedSuggestions">
<template v-if="isExpanded">
<ul class="list-suggest add-items">
<li v-for="r in availableForCheckResults" @click="addResult(r)" :key="r.id">
<span>{{ r.title.fr }}</span>
</li>
</ul>
</template>
</div>
</div>
<button
v-else
class="accordion-button collapsed"
type="button"
data-bs-toggle="collapse"
aria-expanded="false"
@click="toggleSelect"
>
Résultats et orientations disponibles
</button>
</h2>
<div
class="accordion-collapse"
id="collapse_expanded_suggestions"
aria-labelledby="heading_expanded_suggestions"
data-bs-parent="#expandedSuggestions"
>
<template v-if="isExpanded">
<ul class="list-suggest add-items">
<li
v-for="r in availableForCheckResults"
@click="addResult(r)"
:key="r.id"
>
<span>{{ r.title.fr }}</span>
</li>
</ul>
</template>
</div>
</div>
</div>
<div v-if="!hasResult" class="noResult">
<div class="chill-no-data-statement">
{{ $t('goal_has_no_result') }}
</div>
</div>
</div>
</div>
<div
v-if="!hasResult"
class="noResult"
>
<div class="chill-no-data-statement">
{{ $t('goal_has_no_result') }}
</div>
</div>
</template>
<script>

View File

@@ -1,10 +1,10 @@
<template>
<div>
<!--h2>
<div>
<!--h2>
{{ $t('evaluation_title') }}
</h2-->
<div class="m-md-3">
<div class="m-md-3">
<!--div class="row mb-3">
<label class="col-sm-4 col-form-label">{{ $t('evaluation_status') }}</label>
<div class="col-sm-8">
@@ -18,178 +18,244 @@
</div-->
<div class="row mb-3">
<label class="col-4 col-sm-2 col-md-4 col-lg-2 col-form-label">
{{ $t('evaluation_startdate') }}
</label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4">
<input class="form-control form-control-sm" type="date" v-model="startDate"/>
</div>
<label class="col-4 col-sm-2 col-md-4 col-lg-2 col-form-label">
{{ $t('evaluation_startdate') }}
</label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4">
<input
class="form-control form-control-sm"
type="date"
v-model="startDate"
>
</div>
<label class="col-4 col-sm-2 col-md-4 col-lg-2 col-form-label">
{{ $t('evaluation_enddate') }}
</label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4">
<input class="form-control form-control-sm" type="date" v-model="endDate"/>
</div>
<label class="col-4 col-sm-2 col-md-4 col-lg-2 col-form-label">
{{ $t('evaluation_enddate') }}
</label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4">
<input
class="form-control form-control-sm"
type="date"
v-model="endDate"
>
</div>
</div>
<div class="row mb-3">
<label class="col-4 col-sm-2 col-md-4 col-lg-2 col-form-label">
{{ $t('evaluation_maxdate') }}
</label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4">
<input class="form-control form-control-sm" type="date" v-model="maxDate"/>
</div>
<label class="col-4 col-sm-2 col-md-4 col-lg-2 col-form-label">
{{ $t('evaluation_maxdate') }}
</label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4">
<input
class="form-control form-control-sm"
type="date"
v-model="maxDate"
>
</div>
<label class="col-4 col-sm-2 col-md-4 col-lg-2 col-form-label">
{{ $t('evaluation_warning_interval') }}
</label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4">
<input class="form-control form-control-sm" type="number" v-model.number="warningInterval"/>
</div>
<label class="col-4 col-sm-2 col-md-4 col-lg-2 col-form-label">
{{ $t('evaluation_warning_interval') }}
</label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4">
<input
class="form-control form-control-sm"
type="number"
v-model.number="warningInterval"
>
</div>
</div>
<div class="row mb-3">
<label class="col-4 col-sm-2 col-md-4 col-lg-2 col-form-label">
{{ $t('evaluation_time_spent') }}
</label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4">
<select class="form-control form-control-sm" type="time" v-model="timeSpent">
<option disabled value="">{{ $t('select_time_spent') }}</option>
<option v-for="time in timeSpentChoices" :value="time.value">
{{ time.text }}
</option>
</select>
</div>
</div>
<div class="row mb-3">
<label class="col-sm-4 col-form-label visually-hidden">{{ $t('evaluation_public_comment') }}</label>
<div class="col-sm-12">
<ckeditor
:editor="editor"
:placeholder="$t('evaluation_comment_placeholder')"
v-model="comment"
tag-name="textarea"
></ckeditor>
</div>
<label class="col-4 col-sm-2 col-md-4 col-lg-2 col-form-label">
{{ $t('evaluation_time_spent') }}
</label>
<div class="col-8 col-sm-4 col-md-8 col-lg-4">
<select
class="form-control form-control-sm"
type="time"
v-model="timeSpent"
>
<option
disabled
value=""
>
{{ $t('select_time_spent') }}
</option>
<option
v-for="time in timeSpentChoices"
:value="time.value"
>
{{ time.text }}
</option>
</select>
</div>
</div>
<div v-if="evaluation.documents.length > 0" class="row mb-3">
<h5>{{ $t('Documents') }} :</h5>
<div class="row mb-3">
<label class="col-sm-4 col-form-label visually-hidden">{{ $t('evaluation_public_comment') }}</label>
<div class="col-sm-12">
<ckeditor
:editor="editor"
:placeholder="$t('evaluation_comment_placeholder')"
v-model="comment"
tag-name="textarea"
/>
</div>
</div>
<div class="flex-table">
<div class="item-bloc" v-for="(d, i) in evaluation.documents" :key="d.id" :class="[parseInt(this.docAnchorId) === d.id ? 'bg-blink' : 'nothing']">
<div :id="`document_${d.id}`" class="item-row">
<div class="input-group input-group-lg mb-3 row">
<label class="col-sm-3 col-form-label">Titre du document:</label>
<div class="col-sm-9">
<input
class="form-control document-title"
type="text"
:value="d.title"
:id="d.id"
:data-key="i"
@input="onInputDocumentTitle"/>
<div
v-if="evaluation.documents.length > 0"
class="row mb-3"
>
<h5>{{ $t('Documents') }} :</h5>
<div class="flex-table">
<div
class="item-bloc"
v-for="(d, i) in evaluation.documents"
:key="d.id"
:class="[parseInt(this.docAnchorId) === d.id ? 'bg-blink' : 'nothing']"
>
<div
:id="`document_${d.id}`"
class="item-row"
>
<div class="input-group input-group-lg mb-3 row">
<label class="col-sm-3 col-form-label">Titre du document:</label>
<div class="col-sm-9">
<input
class="form-control document-title"
type="text"
:value="d.title"
:id="d.id"
:data-key="i"
@input="onInputDocumentTitle"
>
</div>
</div>
</div>
<div class="item-row">
<div class="item-col item-meta">
<p v-if="d.createdBy" class="createdBy">Créé par {{ d.createdBy.text }}<br/>
Le {{ $d(ISOToDatetime(d.createdAt.datetime), 'long') }}</p>
</div>
</div>
</div>
<div class="item-row">
<div class="item-col">
<ul class="record_actions">
<li v-if="d.workflows_availables.length > 0">
<list-workflow-modal
:workflows="d.workflows"
:allowCreate="true"
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument"
:relatedEntityId="d.id"
:workflowsAvailables="d.workflows_availables"
:preventDefaultMoveToGenerate="true"
:goToGenerateWorkflowPayload="{doc: d}"
@go-to-generate-workflow="goToGenerateWorkflowEvaluationDocument"
></list-workflow-modal>
</li>
<li>
<div class="item-col item-meta">
<p
v-if="d.createdBy"
class="createdBy"
>
Créé par {{ d.createdBy.text }}<br>
Le {{ $d(ISOToDatetime(d.createdAt.datetime), 'long') }}
</p>
</div>
</div>
<div class="item-row">
<div class="item-col">
<ul class="record_actions">
<li v-if="d.workflows_availables.length > 0">
<list-workflow-modal
:workflows="d.workflows"
:allow-create="true"
related-entity-class="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationDocument"
:related-entity-id="d.id"
:workflows-availables="d.workflows_availables"
:prevent-default-move-to-generate="true"
:go-to-generate-workflow-payload="{doc: d}"
@go-to-generate-workflow="goToGenerateWorkflowEvaluationDocument"
/>
</li>
<li>
<button
v-if="AmIRefferer"
class="btn btn-notify"
@click="goToGenerateDocumentNotification(d, false)"
/>
<template v-else>
<button
v-if="AmIRefferer"
class="btn btn-notify"
@click="goToGenerateDocumentNotification(d, false)">
id="btnGroupNotifyButtons"
type="button"
class="btn btn-notify dropdown-toggle"
:title="$t('notification_send')"
data-bs-toggle="dropdown"
aria-expanded="false"
>
&nbsp;
</button>
<template v-else>
<button id="btnGroupNotifyButtons" type="button" class="btn btn-notify dropdown-toggle" :title="$t('notification_send')" data-bs-toggle="dropdown" aria-expanded="false">&nbsp;</button>
<ul class="dropdown-menu" aria-labelledby="btnGroupNotifyButtons">
<li><a class="dropdown-item" @click="goToGenerateDocumentNotification(d, true)">{{ $t('notification_notify_referrer') }}</a></li>
<li><a class="dropdown-item" @click="goToGenerateDocumentNotification(d, false)">{{ $t('notification_notify_any') }}</a></li>
</ul>
</template>
</li>
<li>
<document-action-buttons-group
:stored-object="d.storedObject"
:filename="d.title"
:can-edit="true"
:execute-before-leave="submitBeforeLeaveToEditor"
:davLink="d.storedObject._links?.dav_link.href"
:davLinkExpiration="d.storedObject._links?.dav_link.expiration"
@on-stored-object-status-change="onStatusDocumentChanged"
></document-action-buttons-group>
</li>
<li>
<add-async-upload
:buttonTitle="$t('replace')"
:options="asyncUploadOptions"
:btnClasses="{'btn': true, 'btn-edit': true}"
@addDocument="(arg) => replaceDocument(d, arg)"
>
</add-async-upload>
</li>
<li v-if="d.workflows.length === 0">
<a class="btn btn-delete" @click="removeDocument(d)">
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-3">
<h6>{{ $t('document_add') }} :</h6>
<pick-template
entityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation"
:id="evaluation.id"
:templates="getTemplatesAvailables"
:preventDefaultMoveToGenerate="true"
@go-to-generate-document="submitBeforeGenerate"
>
<template v-slot:title>
<label class="col-form-label">{{ $t('evaluation_generate_a_document') }}</label>
</template>
</pick-template>
<div>
<label class="col-form-label">{{ $t('document_upload') }}</label>
<ul class="record_actions document-upload">
<li>
<add-async-upload
:buttonTitle="$t('browse')"
:options="asyncUploadOptions"
@addDocument="addDocument"
>
</add-async-upload>
</li>
</ul>
<ul
class="dropdown-menu"
aria-labelledby="btnGroupNotifyButtons"
>
<li>
<a
class="dropdown-item"
@click="goToGenerateDocumentNotification(d, true)"
>{{ $t('notification_notify_referrer') }}</a>
</li>
<li>
<a
class="dropdown-item"
@click="goToGenerateDocumentNotification(d, false)"
>{{ $t('notification_notify_any') }}</a>
</li>
</ul>
</template>
</li>
<li>
<document-action-buttons-group
:stored-object="d.storedObject"
:filename="d.title"
:can-edit="true"
:execute-before-leave="submitBeforeLeaveToEditor"
:dav-link="d.storedObject._links?.dav_link.href"
:dav-link-expiration="d.storedObject._links?.dav_link.expiration"
@on-stored-object-status-change="onStatusDocumentChanged"
/>
</li>
<li>
<add-async-upload
:button-title="$t('replace')"
:options="asyncUploadOptions"
:btn-classes="{'btn': true, 'btn-edit': true}"
@add-document="(arg) => replaceDocument(d, arg)"
/>
</li>
<li v-if="d.workflows.length === 0">
<a
class="btn btn-delete"
@click="removeDocument(d)"
/>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row mb-3">
<h6>{{ $t('document_add') }} :</h6>
<pick-template
entity-class="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation"
:id="evaluation.id"
:templates="getTemplatesAvailables"
:prevent-default-move-to-generate="true"
@go-to-generate-document="submitBeforeGenerate"
>
<template #title>
<label class="col-form-label">{{ $t('evaluation_generate_a_document') }}</label>
</template>
</pick-template>
<div>
<label class="col-form-label">{{ $t('document_upload') }}</label>
<ul class="record_actions document-upload">
<li>
<add-async-upload
:button-title="$t('browse')"
:options="asyncUploadOptions"
@add-document="addDocument"
/>
</li>
</ul>
</div>
</div>
</div>
</div>
</template>
<script>