mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
105 worflow
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Repository\AccompanyingPeriod;
|
||||
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
|
||||
class AccompanyingPeriodWorkEvaluationRepository implements ObjectRepository
|
||||
{
|
||||
private EntityRepository $repository;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager)
|
||||
{
|
||||
$this->repository = $entityManager->getRepository(AccompanyingPeriodWorkEvaluation::class);
|
||||
}
|
||||
|
||||
public function find($id): ?AccompanyingPeriodWorkEvaluation
|
||||
{
|
||||
return $this->repository->find($id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array|AccompanyingPeriodWorkEvaluation[]
|
||||
*/
|
||||
public function findAll(): array
|
||||
{
|
||||
return $this->repository->findAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|mixed $limit
|
||||
* @param null|mixed $offset
|
||||
*
|
||||
* @return array|AccompanyingPeriodWorkEvaluation[]
|
||||
*/
|
||||
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
|
||||
{
|
||||
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
||||
}
|
||||
|
||||
public function findOneBy(array $criteria): ?AccompanyingPeriodWorkEvaluation
|
||||
{
|
||||
return $this->findOneBy($criteria);
|
||||
}
|
||||
|
||||
public function getClassName()
|
||||
{
|
||||
return AccompanyingPeriodWorkEvaluation::class;
|
||||
}
|
||||
}
|
@@ -241,7 +241,17 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<!--
|
||||
FAIT REPETER tout le template de App.vue plusieurs fois
|
||||
<li>
|
||||
<pick-workflow
|
||||
relatedEntityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork"
|
||||
:relatedEntityId="this.work.id"
|
||||
:workflows="this.workflows"
|
||||
></pick-workflow>
|
||||
</li>
|
||||
-->
|
||||
|
||||
<li v-if="!isPosting">
|
||||
<button class="btn btn-save" @click="submit">
|
||||
@@ -270,6 +280,7 @@ import AddressRenderBox from 'ChillMainAssets/vuejs/_components/Entity/AddressRe
|
||||
import ThirdPartyRenderBox from 'ChillThirdPartyAssets/vuejs/_components/Entity/ThirdPartyRenderBox.vue';
|
||||
import PickTemplate from 'ChillDocGeneratorAssets/vuejs/_components/PickTemplate.vue';
|
||||
import OnTheFly from 'ChillMainAssets/vuejs/OnTheFly/components/OnTheFly.vue';
|
||||
import PickWorkflow from 'ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue';
|
||||
|
||||
const i18n = {
|
||||
messages: {
|
||||
@@ -317,6 +328,7 @@ export default {
|
||||
AddressRenderBox,
|
||||
ThirdPartyRenderBox,
|
||||
PickTemplate,
|
||||
PickWorkflow,
|
||||
OnTheFly
|
||||
},
|
||||
i18n,
|
||||
@@ -347,11 +359,11 @@ export default {
|
||||
display: false
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState([
|
||||
computed: {
|
||||
...mapState([
|
||||
'work',
|
||||
'resultsForAction',
|
||||
'evaluationsForAction',
|
||||
|
@@ -1,12 +1,21 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="item-title">
|
||||
<div class="item-title" :title="evaluation.id || 'no id yet'">
|
||||
<span>{{ evaluation.evaluation.title.fr }}</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<form-evaluation ref="FormEvaluation" :key="evaluation.key" :evaluation="evaluation"></form-evaluation>
|
||||
<ul class="record_actions">
|
||||
|
||||
<ul class="record_actions">
|
||||
<li v-if="evaluation.workflows_availables.length > 0">
|
||||
<pick-workflow
|
||||
relatedEntityClass="faked"
|
||||
:relatedEntityId="evaluation.id"
|
||||
:workflowsAvailables="evaluation.workflows_availables"
|
||||
@goToGenerateWorkflow="goToGenerateWorkflow"
|
||||
></pick-workflow>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-delete" @click="modal.showModal = true" :title="$t('action.delete')"></a>
|
||||
</li>
|
||||
@@ -34,6 +43,8 @@
|
||||
<script>
|
||||
import FormEvaluation from './FormEvaluation.vue';
|
||||
import Modal from 'ChillMainAssets/vuejs/_components/Modal';
|
||||
import PickWorkflow from 'ChillMainAssets/vuejs/_components/EntityWorkflow/PickWorkflow.vue';
|
||||
import {buildLinkCreate} from 'ChillMainAssets/lib/entity-workflow/api.js';
|
||||
|
||||
const i18n = {
|
||||
messages: {
|
||||
@@ -60,7 +71,8 @@ export default {
|
||||
name: "AddEvaluation",
|
||||
components: {
|
||||
FormEvaluation,
|
||||
Modal
|
||||
Modal,
|
||||
PickWorkflow,
|
||||
},
|
||||
props: ['evaluation'],
|
||||
i18n,
|
||||
@@ -88,10 +100,19 @@ export default {
|
||||
submitForm() {
|
||||
this.toggleEditEvaluation();
|
||||
},
|
||||
buildEditLink(storedObject) {
|
||||
return `/edit/${storedObject.uuid}?returnPath=` + encodeURIComponent(
|
||||
window.location.pathname + window.location.search + window.location.hash);
|
||||
},
|
||||
goToGenerateWorkflow({event, link, workflowName}) {
|
||||
event.preventDefault();
|
||||
console.log(event, link, workflowName);
|
||||
|
||||
const callback = (data) => {
|
||||
let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id;
|
||||
window.location.assign(buildLinkCreate(workflowName,
|
||||
'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluation', evaluationId));
|
||||
};
|
||||
|
||||
return this.$store.dispatch('submit', callback)
|
||||
.catch(e => { console.log(e); throw e; });
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@@ -61,6 +61,32 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<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 in evaluation.documents">
|
||||
<div class="item-row">
|
||||
<div class="item-col"><h6>{{ d.template.name.fr }}</h6></div>
|
||||
<div class="item-col">
|
||||
<p>Créé par {{ d.createdBy.text }}<br/>
|
||||
Le {{ $d(ISOToDatetime(d.createdAt.datetime), 'long') }}</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-row">
|
||||
<ul class="record_actions" >
|
||||
<li>
|
||||
<a :href="buildEditLink(d.storedObject)" class="btn btn-action btn-sm">
|
||||
<i class="fa fa-edit"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<pick-template
|
||||
entityClass="Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation"
|
||||
@@ -99,7 +125,8 @@ const i18n = {
|
||||
evaluation_generate_a_document: "Générer un document",
|
||||
evaluation_choose_a_template: "Choisir un gabarit",
|
||||
evaluation_add_a_document: "Ajouter un document",
|
||||
evaluation_add: "Ajouter une évaluation"
|
||||
evaluation_add: "Ajouter une évaluation",
|
||||
Documents: "Documents",
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -163,6 +190,7 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
ISOToDatetime,
|
||||
listAllStatus() {
|
||||
console.log('load all status');
|
||||
let url = `/api/`;
|
||||
@@ -175,7 +203,11 @@ export default {
|
||||
})
|
||||
;
|
||||
},
|
||||
submitBeforeGenerate() {
|
||||
buildEditLink(storedObject) {
|
||||
return `/wopi/edit/${storedObject.uuid}?returnPath=` + encodeURIComponent(
|
||||
window.location.pathname + window.location.search + window.location.hash);
|
||||
},
|
||||
submitBeforeGenerate() {
|
||||
const callback = (data) => {
|
||||
let evaluationId = data.accompanyingPeriodWorkEvaluations.find(e => e.key === this.evaluation.key).id;
|
||||
return Promise.resolve({entityId: evaluationId});
|
||||
|
@@ -205,6 +205,7 @@ const store = createStore({
|
||||
warningInterval: null,
|
||||
comment: "",
|
||||
editEvaluation: true,
|
||||
workflows_availables: state.work.workflows_availables_evaluation,
|
||||
};
|
||||
state.evaluationsPicked.push(e);
|
||||
},
|
||||
@@ -371,7 +372,8 @@ const store = createStore({
|
||||
if (typeof(callback) !== 'undefined') {
|
||||
return callback(data);
|
||||
} else {
|
||||
console.info('nothing to do here, bye bye');window.location.assign(`/fr/person/accompanying-period/${state.work.accompanyingPeriod.id}/work`);
|
||||
console.info('nothing to do here, bye bye');
|
||||
window.location.assign(`/fr/person/accompanying-period/${state.work.accompanyingPeriod.id}/work`);
|
||||
}
|
||||
}).catch(error => {
|
||||
console.log('error on submit', error);
|
||||
|
@@ -7,7 +7,7 @@
|
||||
{% import '@ChillPerson/AccompanyingCourse/Comment/macro_showItem.html.twig' as m %}
|
||||
|
||||
{% macro recordAction(comment, isPinned) %}
|
||||
{% if isPinned is defined and isPinned == 'true' %}
|
||||
{% if isPinned is defined and isPinned == true %}
|
||||
{% else %}
|
||||
<li>
|
||||
<form method="post" action="{{ chill_path_forward_return_path('chill_person_accompanying_period_comment_pin', {'id': comment.id}) }}">
|
||||
@@ -66,8 +66,8 @@
|
||||
{{ _self.form_comment('edit', edit_form) }}
|
||||
{% else %}
|
||||
{{ m.show_comment(accompanyingCourse.pinnedComment, {
|
||||
'pinned': 'true',
|
||||
'recordAction': _self.recordAction(accompanyingCourse.pinnedComment, 'true')
|
||||
'pinned': true,
|
||||
'recordAction': _self.recordAction(accompanyingCourse.pinnedComment, true)
|
||||
}) }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
@@ -212,16 +212,13 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block block_post_menu %}
|
||||
<div class="post-menu pt-4">
|
||||
|
||||
<div class="d-grid gap-2">
|
||||
<a class="btn btn-primary" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod', 'entityId': accompanyingCourse.id}) }}">
|
||||
<i class="fa fa-paper-plane fa-fw"></i>
|
||||
{{ 'notification.Notify'|trans }}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{ chill_list_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', accompanyingCourse.id) }}
|
||||
|
||||
<div class="post-menu pt-4">
|
||||
<div class="d-grid gap-2">
|
||||
<a class="btn btn-primary" href="{{ chill_path_add_return_path('chill_main_notification_create', {'entityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod', 'entityId': accompanyingCourse.id}) }}">
|
||||
<i class="fa fa-paper-plane fa-fw"></i>
|
||||
{{ 'notification.Notify'|trans }}
|
||||
</a>
|
||||
</div>
|
||||
{{ chill_list_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', accompanyingCourse.id) }}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@@ -0,0 +1,127 @@
|
||||
<div class="item-bloc accompanying_course_work-item{% if itemBlocClass is defined %} {{ itemBlocClass }}{% endif %}">
|
||||
|
||||
<div class="item-row">
|
||||
<h2 class="badge-title">
|
||||
<span class="title_label"></span>
|
||||
<span class="title_action">{{ w.socialAction|chill_entity_render_string }}
|
||||
|
||||
<ul class="small_in_title columns mt-1">
|
||||
<li>
|
||||
<span class="item-key">{{ 'accompanying_course_work.start_date'|trans ~ ' : ' }}</span>
|
||||
<b>{{ w.startDate|format_date('short') }}</b>
|
||||
</li>
|
||||
{% if w.endDate %}
|
||||
<li>
|
||||
<span class="item-key">{{ 'accompanying_course_work.end_date'|trans ~ ' : ' }}</span>
|
||||
<b>{{ w.endDate|format_date('short') }}</b>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
</span>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="item-row separator">
|
||||
<div class="wrap-list">
|
||||
|
||||
{% if w.createdBy %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Referrer'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<p class="wl-item">
|
||||
{{ w.createdBy|chill_entity_render_box }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{%- if w.persons -%}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Persons in accompanying course'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% for p in w.persons %}
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'person', id: p.id },
|
||||
buttonText: p|chill_entity_render_string,
|
||||
isDead: p.deathdate is not null
|
||||
} %}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{%- if w.handlingThierParty -%}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Thirdparty handling'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'thirdparty', id: w.handlingThierParty.id },
|
||||
buttonText: w.handlingThierParty|chill_entity_render_string
|
||||
} %}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{%- if w.socialAction.issue -%}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Social issue'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<p class="wl-item social-issues">
|
||||
{{ w.socialAction.issue|chill_entity_render_box }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-row column">
|
||||
{% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' %}
|
||||
</div>
|
||||
|
||||
<div class="item-row separator">
|
||||
<div class="item-col item-meta">
|
||||
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id) %}
|
||||
{% if notif_counter.total > 0 %}
|
||||
{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id) }}
|
||||
{% endif %}
|
||||
|
||||
{% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %}
|
||||
{{ macro.updatedBy(w) }}
|
||||
</div>
|
||||
|
||||
{% if displayAction is defined and displayAction == true %}
|
||||
<div class="item-col">
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a class="btn btn-edit" title="{{ 'Edit'|trans }}"
|
||||
href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_edit', { 'id': w.id }) }}"
|
||||
></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-delete" title="{{ 'Delete'|trans }}"
|
||||
href="{{ path('chill_person_accompanying_period_work_delete', { 'id': w.id } ) }}"
|
||||
></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
@@ -2,27 +2,34 @@
|
||||
|
||||
{% block title 'accompanying_course_work.Edit accompanying course work'|trans %}
|
||||
|
||||
{% block css %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_link_tags('vue_accourse_work_edit') }}
|
||||
{{ encore_entry_link_tags('mod_entity_workflow_pick') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="accompanying_course_work-edit">
|
||||
|
||||
<h1>{{ block('title') }}</h1>
|
||||
|
||||
<div id="accompanying_course_work_edit"></div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block block_post_menu %}
|
||||
<div class="post-menu pt-4">
|
||||
{% set workflows_frame = chill_entity_workflow_list('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', work.id) %}
|
||||
{% if workflows_frame is not empty %}
|
||||
{{ workflows_frame|raw }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block js %}
|
||||
{{ parent() }}
|
||||
<script type="text/javascript">
|
||||
window.accompanyingCourseWork = {{ json|json_encode|raw }};
|
||||
window.accompanyingCourseWork = {{ json|json_encode|raw }};
|
||||
</script>
|
||||
|
||||
{{ encore_entry_script_tags('vue_accourse_work_edit') }}
|
||||
{{ encore_entry_script_tags('mod_entity_workflow_pick') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block css %}
|
||||
{{ parent() }}
|
||||
{{ encore_entry_link_tags('vue_accourse_work_edit') }}
|
||||
{% endblock %}
|
||||
|
@@ -18,137 +18,7 @@
|
||||
{% else %}
|
||||
<div class="flex-table accompanying_course_work-list">
|
||||
{% for w in works %}
|
||||
<div class="item-bloc">
|
||||
|
||||
<div class="item-row">
|
||||
<h2 class="badge-title">
|
||||
<span class="title_label"></span>
|
||||
<span class="title_action">{{ w.socialAction|chill_entity_render_string }}
|
||||
|
||||
<ul class="small_in_title columns mt-1">
|
||||
<li>
|
||||
<span class="item-key">{{ 'accompanying_course_work.start_date'|trans ~ ' : ' }}</span>
|
||||
<b>{{ w.startDate|format_date('short') }}</b>
|
||||
</li>
|
||||
{% if w.endDate %}
|
||||
<li>
|
||||
<span class="item-key">{{ 'accompanying_course_work.end_date'|trans ~ ' : ' }}</span>
|
||||
<b>{{ w.endDate|format_date('short') }}</b>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
</span>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div class="item-row separator">
|
||||
<div class="wrap-list">
|
||||
|
||||
{% if w.createdBy %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Referrer'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<p class="wl-item">
|
||||
{{ w.createdBy|chill_entity_render_box }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{%- if w.persons -%}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Persons in accompanying course'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% for p in w.persons %}
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'person', id: p.id },
|
||||
buttonText: p|chill_entity_render_string,
|
||||
isDead: p.deathdate is not null
|
||||
} %}
|
||||
</span>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{%- if w.handlingThierParty -%}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Thirdparty handling'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<span class="wl-item">
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
action: 'show', displayBadge: true,
|
||||
targetEntity: { name: 'thirdparty', id: w.handlingThierParty.id },
|
||||
buttonText: w.handlingThierParty|chill_entity_render_string,
|
||||
parent: {
|
||||
'type': 'accompanying_period_resource',
|
||||
'id': r.id,
|
||||
'comment': r.comment,
|
||||
'parent': {
|
||||
'type': 'accompanying_period',
|
||||
'id': accompanyingCourse.id
|
||||
}
|
||||
}
|
||||
}
|
||||
%}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{%- if w.socialAction.issue -%}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Social issue'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<p class="wl-item social-issues">
|
||||
{{ w.socialAction.issue|chill_entity_render_box }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="item-row column">
|
||||
{% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with {} %}
|
||||
</div>
|
||||
|
||||
<div class="item-row separator">
|
||||
<div class="updatedBy">
|
||||
{{ 'Last updated by'|trans}} <b>{{ w.updatedBy|chill_entity_render_box }}</b>,<br>
|
||||
{{ 'le ' ~ w.updatedAt|format_datetime('long', 'short') }}
|
||||
</div>
|
||||
<ul class="record_actions">
|
||||
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id) %}
|
||||
{% if notif_counter.total > 0 %}
|
||||
<li>{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id) }}</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<a class="btn btn-edit" title="{{ 'Edit'|trans }}"
|
||||
href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_edit', { 'id': w.id }) }}"
|
||||
></a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-delete" title="{{ 'Delete'|trans }}"
|
||||
href="{{ path('chill_person_accompanying_period_work_delete', { 'id': w.id } ) }}"
|
||||
></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% include '@ChillPerson/AccompanyingCourseWork/_item.html.twig' with { 'displayAction': true } %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@@ -46,16 +46,15 @@
|
||||
{% include 'ChillPersonBundle:AccompanyingCourseWork:_objectifs_results_evaluations.html.twig' with {} %}
|
||||
</ul>
|
||||
|
||||
<div class="metadata text-end" style="font-size: 60%">
|
||||
{{ 'Last updated by'|trans }}
|
||||
<span class="user">{{ w.updatedBy|chill_entity_render_box }}</span>:
|
||||
<span class="date">{{ w.updatedAt|format_datetime('short', 'short') }}</span>
|
||||
<div class="metadata text-end">
|
||||
{% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %}
|
||||
{{ macro.updatedBy(w) }}
|
||||
</div>
|
||||
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</a>{# {{ dump(w) }} #}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
|
@@ -5,10 +5,6 @@
|
||||
|
||||
{% macro recordAction(period, contextEntity) %}
|
||||
{# TODO if enable_accompanying_course_with_multiple_persons is true ... #}
|
||||
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', period.id) %}
|
||||
{% if notif_counter.total > 0 %}
|
||||
<li>{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', period.id) }}</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': period.id }) }}"
|
||||
class="btn btn-show" title="{{ 'See accompanying period'|trans }}">{# {{ 'See this period'|trans }} #}</a>
|
||||
|
@@ -113,11 +113,19 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% if recordAction is defined %}
|
||||
<div class="item-row separator">
|
||||
<ul class="record_actions">
|
||||
{{ recordAction }}
|
||||
</ul>
|
||||
<div class="item-row separator">
|
||||
<div class="item-col item-meta">
|
||||
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', period.id) %}
|
||||
{% if notif_counter.total > 0 %}
|
||||
{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', period.id) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="item-col">
|
||||
{% if recordAction is defined %}
|
||||
<ul class="record_actions">
|
||||
{{ recordAction }}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -0,0 +1,12 @@
|
||||
{% macro updatedBy(entity) %}
|
||||
<div class="updatedBy">
|
||||
{{ 'Last updated on'|trans }}
|
||||
<span class="date">
|
||||
{{ entity.updatedAt|format_datetime('medium', 'short') }}
|
||||
</span>,
|
||||
{{ 'by_user'|trans }}
|
||||
<span class="user">
|
||||
{{ entity.updatedBy|chill_entity_render_box }}
|
||||
</span>
|
||||
</div>
|
||||
{% endmacro %}
|
@@ -125,7 +125,7 @@
|
||||
{% if not person.isSharingHousehold() %}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a class="btn btn-misc" href="{{chill_path_add_return_path('chill_person_household_members_editor', { 'persons': [ person.id ], 'followAfter': 'true'}) }}">
|
||||
<a class="btn btn-misc" href="{{chill_path_add_return_path('chill_person_household_members_editor', { 'persons': [ person.id ], 'followAfter': true}) }}">
|
||||
<i class="fa fa-sign-in fa-fw"></i>
|
||||
{{ 'household.Join'|trans }}
|
||||
</a>
|
||||
|
@@ -74,137 +74,158 @@
|
||||
{# add as requestor #}
|
||||
|
||||
{% if acps|length > 0 %}
|
||||
<div class="item-row">
|
||||
<div class="wrap-list periods-list">
|
||||
{% for acp in acps %}
|
||||
{% set app = person.findParticipationForPeriod(acp) %}
|
||||
<div class="wl-row separator">
|
||||
{% for acp in acps %}
|
||||
{% set app = person.findParticipationForPeriod(acp) %}
|
||||
<div class="item-row separator">
|
||||
<div class="wrap-list periods-list">
|
||||
|
||||
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<div>
|
||||
{% if acp.emergency %}
|
||||
<span class="badge rounded-pill bg-danger">{{- 'Emergency'|trans|upper -}}</span>
|
||||
{% endif %}
|
||||
{% if acp.confidential %}
|
||||
<span class="badge rounded-pill bg-confidential">{{- 'Confidential'|trans|upper -}}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if acp.step == 'DRAFT' %}
|
||||
<div class="is-draft">
|
||||
<span class="course-draft badge bg-secondary" title="{{ 'course.draft'|trans }}">{{ 'course.draft'|trans }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if acp.requestorPerson == person %}
|
||||
<div>
|
||||
<span class="as-requestor badge bg-info" title="{{ 'Requestor'|trans|e('html_attr') }}">
|
||||
{{ 'Requestor'|trans({'gender': person.gender}) }}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="date">
|
||||
<h3 class="courseid mb-2">
|
||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': acp.id }) }}"
|
||||
title="{{ 'See accompanying period'|trans }}" class="btn btn-outline-primary">
|
||||
<i class="fa fa-random fa-fw"></i>
|
||||
{{ 'File number'|trans }} {{ acp.id }}
|
||||
</a>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<div class="d-flex flex-column justify-content-center">
|
||||
{% if app != null %}
|
||||
{{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}
|
||||
<div class="date">
|
||||
{{ 'Since %date%'|trans({'%date%': app.startDate|format_date('medium') }) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) %}
|
||||
{% if notif_counter.total > 0 %}
|
||||
{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if acp.user is not null %}
|
||||
<div class="ms-auto">
|
||||
{% if acp.emergency %}
|
||||
<span class="badge rounded-pill bg-danger">{{- 'Emergency'|trans|upper -}}</span>
|
||||
{% endif %}
|
||||
|
||||
{% if acp.confidential %}
|
||||
<span class="badge rounded-pill bg-confidential">{{- 'Confidential'|trans|upper -}}</span>
|
||||
{% endif %}
|
||||
|
||||
{% if acp.step == 'DRAFT' %}
|
||||
<span class="badge bg-secondary" style="font-size: 85%;" title="{{ 'course.draft'|trans }}">{{ 'course.draft'|trans }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if acp.user is not null %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3 class="referrer">{{ 'Referrer'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<div class="user">
|
||||
<abbr class="referrer" title="{{ 'Referrer'|trans }}">ref:</abbr>
|
||||
{{ acp.user|chill_entity_render_box }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="courseid">
|
||||
{{ 'File number'|trans }} {{ acp.id }}
|
||||
</div>
|
||||
|
||||
{% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) %}
|
||||
{% if notif_counter.total > 0 %}
|
||||
<div class="counter">{{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod', acp.id) }}</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
|
||||
{% for issue in acp.socialIssues %}
|
||||
{{ issue|chill_entity_render_box }}
|
||||
{% endfor %}
|
||||
|
||||
<ul class="record_actions record_actions_column">
|
||||
<li>
|
||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': acp.id }) }}"
|
||||
class="btn btn-sm btn-outline-primary" title="{{ 'See accompanying period'|trans }}">
|
||||
<i class="fa fa-random fa-fw"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% if acp.currentParticipations|length > 1 %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<div class="participants">
|
||||
{{ 'Participants'|trans }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% set participating = false %}
|
||||
{% for part in acp.currentParticipations %}
|
||||
{% if part.person.id != person.id %}
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
targetEntity: { name: 'person', id: part.person.id },
|
||||
action: 'show',
|
||||
displayBadge: true,
|
||||
buttonText: part.person|chill_entity_render_string,
|
||||
isDead: part.person.deathdate is not null
|
||||
} %}
|
||||
{% else %}
|
||||
{% set participating = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if participating %}
|
||||
{{ 'person.and_himself'|trans({'gender': person.gender}) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if (acp.requestorPerson is not null and acp.requestorPerson.id != person.id) or acp.requestorThirdParty is not null %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<div>
|
||||
{% if acp.requestorPerson is not null %}
|
||||
{{ 'Requestor'|trans({'gender': acp.requestorPerson.gender}) }}
|
||||
{% else %}
|
||||
{{ 'Requestor'|trans({'gender': 'other'})}}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% if acp.requestorThirdParty is not null %}
|
||||
|
||||
{% if acp.socialIssues|length > 0 %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>{{ 'Social issues'|trans }}</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% for issue in acp.socialIssues %}
|
||||
{{ issue|chill_entity_render_box }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{# ????
|
||||
{% if acp.requestorPerson == person %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>
|
||||
|
||||
</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
<span class="as-requestor badge bg-info" title="{{ 'Requestor'|trans|e('html_attr') }}">
|
||||
{{ 'Requestor'|trans({'gender': person.gender}) }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
#}
|
||||
|
||||
{% if acp.currentParticipations|length > 1 %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3 class="participants">
|
||||
{{ 'Participants'|trans }}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% set participating = false %}
|
||||
{% for part in acp.currentParticipations %}
|
||||
{% if part.person.id != person.id %}
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
targetEntity: { name: 'person', id: part.person.id },
|
||||
action: 'show',
|
||||
displayBadge: true,
|
||||
buttonText: part.person|chill_entity_render_string,
|
||||
isDead: part.person.deathdate is not null
|
||||
} %}
|
||||
{% else %}
|
||||
{% set participating = true %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if participating %}
|
||||
{{ 'person.and_himself'|trans({'gender': person.gender}) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if (acp.requestorPerson is not null and acp.requestorPerson.id != person.id) or acp.requestorThirdParty is not null %}
|
||||
<div class="wl-row">
|
||||
<div class="wl-col title">
|
||||
<h3>
|
||||
{% if acp.requestorPerson is not null %}
|
||||
{{ 'Requestor'|trans({'gender': acp.requestorPerson.gender}) }}
|
||||
{% else %}
|
||||
{{ 'Requestor'|trans({'gender': 'other'})}}
|
||||
{% endif %}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="wl-col list">
|
||||
{% if acp.requestorThirdParty is not null %}
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
targetEntity: { name: 'thirdparty', id: acp.requestorThirdParty.id },
|
||||
action: 'show',
|
||||
displayBadge: true,
|
||||
buttonText: acp.requestorThirdParty|chill_entity_render_string
|
||||
} %}
|
||||
{% else %}
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
targetEntity: { name: 'person', id: acp.requestorPerson.id },
|
||||
action: 'show',
|
||||
displayBadge: true,
|
||||
buttonText: acp.requestorPerson|chill_entity_render_string,
|
||||
isDead: acp.requestorPerson.deathdate is not null
|
||||
} %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
{% include '@ChillMain/OnTheFly/_insert_vue_onthefly.html.twig' with {
|
||||
targetEntity: { name: 'person', id: acp.requestorPerson.id },
|
||||
action: 'show',
|
||||
displayBadge: true,
|
||||
buttonText: acp.requestorPerson|chill_entity_render_string,
|
||||
isDead: acp.requestorPerson.deathdate is not null
|
||||
} %}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
@@ -301,10 +301,8 @@ This view should receive those arguments:
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if person.updatedBy %}
|
||||
<div class="updatedBy">
|
||||
{{ 'Last updated by'|trans}}: <b>{{ person.updatedBy|chill_entity_render_box }}</b>,<br>
|
||||
{{ 'on'|trans ~ person.updatedAt|format_datetime('long', 'short') }}
|
||||
</div>
|
||||
{% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %}
|
||||
{{ macro.updatedBy(person) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
@@ -0,0 +1,17 @@
|
||||
<div class="flex-table accompanying_course_work-list">
|
||||
{% include '@ChillPerson/AccompanyingCourseWork/_item.html.twig' with {
|
||||
'w': work,
|
||||
'itemBlocClass': 'bg-chill-llight-gray'
|
||||
} %}
|
||||
</div>
|
||||
|
||||
{% if display_action is defined and display_action == true %}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a class="btn btn-update"
|
||||
href="{{ chill_path_add_return_path('chill_person_accompanying_period_work_edit', { 'id': work.id }) }}">
|
||||
{{ 'Edit'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
@@ -0,0 +1,19 @@
|
||||
{% import '@ChillMain/Workflow/macro_breadcrumb.html.twig' as m %}
|
||||
|
||||
<div class="flex-grow-1 {% if add_classes is defined %}{{ add_classes }}{% else %}h2{% endif %}">
|
||||
<div>
|
||||
{% if concerne is defined and concerne == true %}
|
||||
<span class="item-key">{{ 'Concerne'|trans }}: </span>
|
||||
{% endif %}
|
||||
|
||||
{{ 'workflow.Work (n°%w%)'|trans({'%w%': work.id }) }}
|
||||
|
||||
{% if description is defined and description == true %}
|
||||
{{ ' — ' ~ work.socialAction|chill_entity_render_string }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if breadcrumb is defined and breadcrumb == true %}
|
||||
{{ m.breadcrumb(_context) }}
|
||||
{% endif %}
|
||||
</div>
|
@@ -0,0 +1,99 @@
|
||||
<div class="flex-table accompanying_course_work-list">
|
||||
<div class="item-bloc evaluation-item bg-chill-llight-gray">
|
||||
<div class="item-row mb-2">
|
||||
<h2 class="badge-title">
|
||||
<span class="title_label"></span>
|
||||
<span class="title_action">
|
||||
{{ evaluation.accompanyingPeriodWork.socialAction|chill_entity_render_string }}
|
||||
<ul class="small_in_title columns mt-1">
|
||||
<li>
|
||||
<span class="item-key">{{ 'accompanying_course_work.start_date'|trans ~ ' : ' }}</span>
|
||||
<b>{{ evaluation.accompanyingPeriodWork.startDate|format_date('short') }}</b>
|
||||
</li>
|
||||
{% if evaluation.accompanyingPeriodWork.endDate %}
|
||||
<li>
|
||||
<span class="item-key">{{ 'accompanying_course_work.end_date'|trans ~ ' : ' }}</span>
|
||||
<b>{{ evaluation.accompanyingPeriodWork.endDate|format_date('short') }}</b>
|
||||
</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</span>
|
||||
</h2>
|
||||
</div>
|
||||
<div class="item-row column">
|
||||
<table class="obj-res-eval my-3" style="font-size: 110% !important;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="eval">
|
||||
<h4 class="title_label">
|
||||
{{ 'Évaluation'|trans }}
|
||||
</h4>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="eval">
|
||||
<ul class="eval_title">
|
||||
<li class="my-2">
|
||||
{{ evaluation.evaluation.title|localize_translatable_string }}
|
||||
<ul class="columns pt-2">
|
||||
<li>
|
||||
<span class="item-key">{{ 'accompanying_course_work.start_date'|trans ~ ' : ' }}</span>
|
||||
<b>{{ evaluation.startDate|format_date('short') }}</b>
|
||||
</li>
|
||||
{% if evaluation.endDate %}
|
||||
<li>
|
||||
<span class="item-key">{{ 'accompanying_course_work.end_date'|trans ~ ' : ' }}</span>
|
||||
<b>{{ evaluation.endDate|format_date('short') }}</b>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if evaluation.maxDate %}
|
||||
<li>
|
||||
<span class="item-key">{{ 'accompanying_course_work.max_date'|trans ~ ' : ' }}</span>
|
||||
<b>{{ evaluation.maxDate|format_date('short') }}</b>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% if evaluation.warningInterval and evaluation.warningInterval.d > 0 %}
|
||||
<li>
|
||||
{% set days = (evaluation.warningInterval.d + evaluation.warningInterval.m * 30) %}
|
||||
<span class="item-key">{{ 'accompanying_course_work.warning_interval'|trans ~ ' : ' }}</span>
|
||||
{{ 'accompanying_course_work.%days% days before max_date'|trans({'%days%': days }) }}
|
||||
</li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<span class="item-key">créé par</span>
|
||||
<b>{{ evaluation.createdBy.username }}</b>
|
||||
<span class="item-key">{{ 'le'|trans }}</span>
|
||||
<b>{{ evaluation.createdAt|format_date('short') }}</b>
|
||||
</li>
|
||||
</ul>
|
||||
{% if evaluation.comment %}
|
||||
<blockquote class="chill-user-quote" style="margin-left: 0;">
|
||||
{{ evaluation.comment }}
|
||||
</blockquote>
|
||||
{% endif %}
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="item-row">
|
||||
{% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %}
|
||||
{{ macro.updatedBy(evaluation) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if display_action is defined and display_action == true %}
|
||||
{# TODO add acl #}
|
||||
<ul class="record_actions">
|
||||
<li>
|
||||
<a class="btn btn-show" href="{{ path('chill_person_accompanying_period_work_edit', {'id': evaluation.accompanyingPeriodWork.id}) }}">
|
||||
{{ 'Show'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
@@ -0,0 +1,19 @@
|
||||
{% import '@ChillMain/Workflow/macro_breadcrumb.html.twig' as m %}
|
||||
|
||||
<div class="flex-grow-1 {% if add_classes is defined %}{{ add_classes }}{% else %}h2{% endif %}">
|
||||
<div>
|
||||
{% if concerne is defined and concerne == true %}
|
||||
<span class="item-key">{{ 'Concerne'|trans }}: </span>
|
||||
{% endif %}
|
||||
|
||||
{{ 'workflow.Evaluation (n°%eval%)'|trans({'%eval%': evaluation.id}) }}
|
||||
|
||||
{% if description is defined and description == true %}
|
||||
{{ ' — ' ~ evaluation.evaluation.title|localize_translatable_string }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if breadcrumb is defined and breadcrumb == true %}
|
||||
{{ m.breadcrumb(_context) }}
|
||||
{% endif %}
|
||||
</div>
|
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Security\Authorization;
|
||||
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use UnexpectedValueException;
|
||||
|
||||
class AccompanyingPeriodWorkEvaluationVoter extends Voter
|
||||
{
|
||||
public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_EVALUATION_SHOW';
|
||||
|
||||
private Security $security;
|
||||
|
||||
public function __construct(Security $security)
|
||||
{
|
||||
$this->security = $security;
|
||||
}
|
||||
|
||||
protected function supports($attribute, $subject)
|
||||
{
|
||||
return $subject instanceof AccompanyingPeriodWorkEvaluation
|
||||
&& self::SEE === $attribute;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $attribute
|
||||
* @param AccompanyingPeriodWorkEvaluation $subject
|
||||
*/
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
switch ($attribute) {
|
||||
case self::SEE:
|
||||
return $this->security->isGranted(AccompanyingPeriodWorkVoter::SEE, $subject->getAccompanyingPeriodWork());
|
||||
|
||||
default:
|
||||
throw new UnexpectedValueException("attribute {$attribute} is not supported");
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Security\Authorization;
|
||||
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
use UnexpectedValueException;
|
||||
use function in_array;
|
||||
|
||||
class AccompanyingPeriodWorkVoter extends Voter
|
||||
{
|
||||
public const SEE = 'CHILL_MAIN_ACCOMPANYING_PERIOD_WORK_SEE';
|
||||
|
||||
private Security $security;
|
||||
|
||||
public function __construct(Security $security)
|
||||
{
|
||||
$this->security = $security;
|
||||
}
|
||||
|
||||
protected function supports($attribute, $subject): bool
|
||||
{
|
||||
return $subject instanceof AccompanyingPeriodWork
|
||||
&& in_array($attribute, $this->getRoles(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $attribute
|
||||
* @param AccompanyingPeriodWork $subject
|
||||
*/
|
||||
protected function voteOnAttribute($attribute, $subject, TokenInterface $token): bool
|
||||
{
|
||||
switch ($attribute) {
|
||||
case self::SEE:
|
||||
return $this->security->isGranted(AccompanyingPeriodVoter::SEE, $subject->getAccompanyingPeriod());
|
||||
|
||||
default:
|
||||
throw new UnexpectedValueException("attribute {$attribute} is not supported");
|
||||
}
|
||||
}
|
||||
|
||||
private function getRoles(): array
|
||||
{
|
||||
return [self::SEE];
|
||||
}
|
||||
}
|
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Serializer\Normalizer;
|
||||
|
||||
use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository;
|
||||
use Chill\MainBundle\Workflow\Helper\MetadataExtractor;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
|
||||
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
|
||||
use Symfony\Component\Workflow\Registry;
|
||||
use function array_key_exists;
|
||||
|
||||
class AccompanyingPeriodWorkEvaluationNormalizer implements ContextAwareNormalizerInterface, NormalizerAwareInterface
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
private const IGNORE_EVALUATION = 'evaluation:ignore';
|
||||
|
||||
private EntityWorkflowRepository $entityWorkflowRepository;
|
||||
|
||||
private MetadataExtractor $metadataExtractor;
|
||||
|
||||
private Registry $registry;
|
||||
|
||||
public function __construct(Registry $registry, EntityWorkflowRepository $entityWorkflowRepository, MetadataExtractor $metadataExtractor)
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->entityWorkflowRepository = $entityWorkflowRepository;
|
||||
$this->metadataExtractor = $metadataExtractor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWorkEvaluation $object
|
||||
*/
|
||||
public function normalize($object, ?string $format = null, array $context = []): array
|
||||
{
|
||||
$initial = $this->normalizer->normalize($object, $format, array_merge(
|
||||
$context,
|
||||
[self::IGNORE_EVALUATION => spl_object_hash($object)]
|
||||
));
|
||||
|
||||
// then, we add normalization for things which are not into the entity
|
||||
|
||||
$initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor(
|
||||
AccompanyingPeriodWorkEvaluation::class,
|
||||
$object->getId()
|
||||
);
|
||||
|
||||
$workflows = $this->entityWorkflowRepository->findBy([
|
||||
'relatedEntityClass' => AccompanyingPeriodWorkEvaluation::class,
|
||||
'relatedEntityId' => $object->getId(),
|
||||
]);
|
||||
$initial['workflows'] = $this->normalizer->normalize($workflows, 'json', $context);
|
||||
|
||||
return $initial;
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, ?string $format = null, array $context = []): bool
|
||||
{
|
||||
return 'json' === $format
|
||||
&& $data instanceof AccompanyingPeriodWorkEvaluation
|
||||
&& !array_key_exists(self::IGNORE_EVALUATION, $context);
|
||||
}
|
||||
}
|
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Serializer\Normalizer;
|
||||
|
||||
use ArrayObject;
|
||||
use Chill\MainBundle\Repository\Workflow\EntityWorkflowRepository;
|
||||
use Chill\MainBundle\Workflow\Helper\MetadataExtractor;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
|
||||
use Symfony\Component\Serializer\Exception\ExceptionInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
|
||||
use Symfony\Component\Workflow\Registry;
|
||||
use function array_key_exists;
|
||||
|
||||
class AccompanyingPeriodWorkNormalizer implements ContextAwareNormalizerInterface, NormalizerAwareInterface
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
private const IGNORE_WORK = 'ignore:work';
|
||||
|
||||
private EntityWorkflowRepository $entityWorkflowRepository;
|
||||
|
||||
private MetadataExtractor $metadataExtractor;
|
||||
|
||||
private Registry $registry;
|
||||
|
||||
public function __construct(Registry $registry, EntityWorkflowRepository $entityWorkflowRepository, MetadataExtractor $metadataExtractor)
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->entityWorkflowRepository = $entityWorkflowRepository;
|
||||
$this->metadataExtractor = $metadataExtractor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param AccompanyingPeriodWork $object
|
||||
*
|
||||
* @throws ExceptionInterface
|
||||
*
|
||||
* @return array|ArrayObject|bool|float|int|string|null
|
||||
*/
|
||||
public function normalize($object, ?string $format = null, array $context = [])
|
||||
{
|
||||
$initial = $this->normalizer->normalize($object, $format, array_merge(
|
||||
$context,
|
||||
[self::IGNORE_WORK => spl_object_hash($object)]
|
||||
));
|
||||
|
||||
// then, we add normalization for things which are not into the entity
|
||||
|
||||
$initial['workflows_availables'] = $this->metadataExtractor->availableWorkflowFor(
|
||||
AccompanyingPeriodWork::class,
|
||||
$object->getId()
|
||||
);
|
||||
|
||||
$initial['workflows_availables_evaluation'] = $this->metadataExtractor->availableWorkflowFor(
|
||||
AccompanyingPeriodWorkEvaluation::class
|
||||
);
|
||||
|
||||
$workflows = $this->entityWorkflowRepository->findBy([
|
||||
'relatedEntityClass' => AccompanyingPeriodWork::class,
|
||||
'relatedEntityId' => $object->getId(),
|
||||
]);
|
||||
$initial['workflows'] = $this->normalizer->normalize($workflows, 'json', $context);
|
||||
|
||||
return $initial;
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, ?string $format = null, array $context = []): bool
|
||||
{
|
||||
return 'json' === $format
|
||||
&& $data instanceof AccompanyingPeriodWork
|
||||
&& !array_key_exists(self::IGNORE_WORK, $context);
|
||||
}
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Serializer\Normalizer;
|
||||
|
||||
use ArrayObject;
|
||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
||||
use Chill\MainBundle\Workflow\Helper\MetadataExtractor;
|
||||
use Symfony\Component\Serializer\Exception\ExceptionInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\ContextAwareNormalizerInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareInterface;
|
||||
use Symfony\Component\Serializer\Normalizer\NormalizerAwareTrait;
|
||||
use Symfony\Component\Workflow\Registry;
|
||||
use function array_key_exists;
|
||||
|
||||
class WorkflowNormalizer implements ContextAwareNormalizerInterface, NormalizerAwareInterface
|
||||
{
|
||||
use NormalizerAwareTrait;
|
||||
|
||||
private const IGNORE_ENTITY_WORKFLOW = 'ignore:entity_workflow';
|
||||
|
||||
private MetadataExtractor $metadataExtractor;
|
||||
|
||||
private Registry $registry;
|
||||
|
||||
public function __construct(Registry $registry, MetadataExtractor $metadataExtractor)
|
||||
{
|
||||
$this->registry = $registry;
|
||||
$this->metadataExtractor = $metadataExtractor;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param EntityWorkflow $object
|
||||
*
|
||||
* @throws ExceptionInterface
|
||||
*
|
||||
* @return array|ArrayObject|bool|float|int|string|void|null
|
||||
*/
|
||||
public function normalize($object, ?string $format = null, array $context = []): array
|
||||
{
|
||||
$data = $this->normalizer->normalize($object, $format, array_merge(
|
||||
$context,
|
||||
[self::IGNORE_ENTITY_WORKFLOW => spl_object_hash($object)]
|
||||
));
|
||||
|
||||
$workflow = $this->registry->get($object, $object->getWorkflowName());
|
||||
|
||||
$data['workflow'] = $this->metadataExtractor->buildArrayPresentationForWorkflow($workflow);
|
||||
$data['current_place'] = $this->metadataExtractor->buildArrayPresentationForPlace($object);
|
||||
$data['current_place_at'] = $this->normalizer->normalize($object->getCurrentStepCreatedAt(), 'json', ['groups' => ['read']]);
|
||||
$data['current_place_by'] = $this->normalizer->normalize($object->getCurrentStepCreatedBy(), 'json', ['groups' => ['read']]);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function supportsNormalization($data, ?string $format = null, array $context = []): bool
|
||||
{
|
||||
return 'json' === $format
|
||||
&& $data instanceof EntityWorkflow
|
||||
&& !array_key_exists(self::IGNORE_ENTITY_WORKFLOW, $context);
|
||||
}
|
||||
}
|
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Workflow;
|
||||
|
||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
||||
use Chill\MainBundle\Workflow\EntityWorkflowHandlerInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
|
||||
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationRepository;
|
||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodWorkEvaluationVoter;
|
||||
|
||||
class AccompanyingPeriodWorkEvaluationWorkflowHandler implements EntityWorkflowHandlerInterface
|
||||
{
|
||||
private AccompanyingPeriodWorkEvaluationRepository $repository;
|
||||
|
||||
public function __construct(AccompanyingPeriodWorkEvaluationRepository $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?AccompanyingPeriodWorkEvaluation
|
||||
{
|
||||
return $this->repository->find($entityWorkflow->getRelatedEntityId());
|
||||
}
|
||||
|
||||
public function getRoleShow(EntityWorkflow $entityWorkflow): ?string
|
||||
{
|
||||
return AccompanyingPeriodWorkEvaluationVoter::SEE;
|
||||
}
|
||||
|
||||
public function getTemplate(EntityWorkflow $entityWorkflow, array $options = []): string
|
||||
{
|
||||
return '@ChillPerson/Workflow/_evaluation.html.twig';
|
||||
}
|
||||
|
||||
public function getTemplateData(EntityWorkflow $entityWorkflow, array $options = []): array
|
||||
{
|
||||
return [
|
||||
'entity_workflow' => $entityWorkflow,
|
||||
'evaluation' => $this->getRelatedEntity($entityWorkflow),
|
||||
];
|
||||
}
|
||||
|
||||
public function getTemplateTitle(EntityWorkflow $entityWorkflow, array $options = []): string
|
||||
{
|
||||
return '@ChillPerson/Workflow/_evaluation.title.html.twig';
|
||||
}
|
||||
|
||||
public function getTemplateTitleData(EntityWorkflow $entityWorkflow, array $options = []): array
|
||||
{
|
||||
return $this->getTemplateData($entityWorkflow, $options);
|
||||
}
|
||||
|
||||
public function supports(EntityWorkflow $entityWorkflow, array $options = []): bool
|
||||
{
|
||||
return $entityWorkflow->getRelatedEntityClass() === AccompanyingPeriodWorkEvaluation::class;
|
||||
}
|
||||
|
||||
public function supportsFreeze(EntityWorkflow $entityWorkflow, array $options = []): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Workflow;
|
||||
|
||||
use Chill\MainBundle\Entity\Workflow\EntityWorkflow;
|
||||
use Chill\MainBundle\Workflow\EntityWorkflowHandlerInterface;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWork;
|
||||
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository;
|
||||
|
||||
class AccompanyingPeriodWorkWorkflowHandler implements EntityWorkflowHandlerInterface
|
||||
{
|
||||
private AccompanyingPeriodWorkRepository $repository;
|
||||
|
||||
public function __construct(AccompanyingPeriodWorkRepository $repository)
|
||||
{
|
||||
$this->repository = $repository;
|
||||
}
|
||||
|
||||
public function getRelatedEntity(EntityWorkflow $entityWorkflow): ?object
|
||||
{
|
||||
return $this->repository->find($entityWorkflow->getRelatedEntityId());
|
||||
}
|
||||
|
||||
public function getRoleShow(EntityWorkflow $entityWorkflow): ?string
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getTemplate(EntityWorkflow $entityWorkflow, array $options = []): string
|
||||
{
|
||||
return '@ChillPerson/Workflow/_accompanying_period_work.html.twig';
|
||||
}
|
||||
|
||||
public function getTemplateData(EntityWorkflow $entityWorkflow, array $options = []): array
|
||||
{
|
||||
return [
|
||||
'entity_workflow' => $entityWorkflow,
|
||||
'work' => $this->getRelatedEntity($entityWorkflow),
|
||||
];
|
||||
}
|
||||
|
||||
public function getTemplateTitle(EntityWorkflow $entityWorkflow, array $options = []): string
|
||||
{
|
||||
return '@ChillPerson/Workflow/_accompanying_period_work.title.html.twig';
|
||||
}
|
||||
|
||||
public function getTemplateTitleData(EntityWorkflow $entityWorkflow, array $options = []): array
|
||||
{
|
||||
return $this->getTemplateData($entityWorkflow, $options);
|
||||
}
|
||||
|
||||
public function supports(EntityWorkflow $entityWorkflow, array $options = []): bool
|
||||
{
|
||||
return $entityWorkflow->getRelatedEntityClass() === AccompanyingPeriodWork::class;
|
||||
}
|
||||
|
||||
public function supportsFreeze(EntityWorkflow $entityWorkflow, array $options = []): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
@@ -93,3 +93,8 @@ services:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
resource: '../Validator/Constraints/AccompanyingPeriod'
|
||||
|
||||
Chill\PersonBundle\Workflow\:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
resource: '../Workflow/'
|
||||
|
@@ -26,6 +26,14 @@ services:
|
||||
tags:
|
||||
- { name: security.voter }
|
||||
|
||||
Chill\PersonBundle\Security\Authorization\AccompanyingPeriodWorkVoter:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
||||
Chill\PersonBundle\Security\Authorization\AccompanyingPeriodWorkEvaluationVoter:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
||||
Chill\PersonBundle\Security\Authorization\HouseholdVoter:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
|
Reference in New Issue
Block a user