mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Merge remote-tracking branch 'origin/master' into features/improve-activity
This commit is contained in:
commit
b5a78fa341
@ -4,6 +4,7 @@ namespace Chill\ActivityBundle\Menu;
|
|||||||
|
|
||||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||||
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
use Chill\MainBundle\Security\Authorization\AuthorizationHelper;
|
||||||
|
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||||
use Knp\Menu\MenuItem;
|
use Knp\Menu\MenuItem;
|
||||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
@ -34,21 +35,13 @@ class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
{
|
{
|
||||||
$period = $parameters['accompanyingCourse'];
|
$period = $parameters['accompanyingCourse'];
|
||||||
|
|
||||||
$menu->addChild($this->translator->trans('Activity list'), [
|
if (AccompanyingPeriod::STEP_DRAFT !== $period->getStep()) {
|
||||||
'route' => 'chill_activity_activity_list',
|
$menu->addChild($this->translator->trans('Activity list'), [
|
||||||
'routeParameters' => [
|
'route' => 'chill_activity_activity_list',
|
||||||
'accompanying_period_id' => $period->getId(),
|
'routeParameters' => [
|
||||||
]])
|
'accompanying_period_id' => $period->getId(),
|
||||||
->setExtras(['order' => 40]);
|
]])
|
||||||
|
->setExtras(['order' => 40]);
|
||||||
$menu->addChild($this->translator->trans('Add a new activity'), [
|
}
|
||||||
'route' => 'chill_activity_activity_select_type',
|
|
||||||
'routeParameters' => [
|
|
||||||
'accompanying_period_id' => $period->getId(),
|
|
||||||
]])
|
|
||||||
->setExtras(['order' => 41]);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,6 +132,7 @@ class Address
|
|||||||
/**
|
/**
|
||||||
* True if the address is a "no address", aka homeless person, ...
|
* True if the address is a "no address", aka homeless person, ...
|
||||||
* @groups({"write"})
|
* @groups({"write"})
|
||||||
|
* @ORM\Column(type="boolean")
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
@ -298,7 +299,7 @@ class Address
|
|||||||
* @param bool $isNoAddress
|
* @param bool $isNoAddress
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setIsNoAddress(bool $isNoAddress)
|
public function setIsNoAddress(bool $isNoAddress): self
|
||||||
{
|
{
|
||||||
$this->isNoAddress = $isNoAddress;
|
$this->isNoAddress = $isNoAddress;
|
||||||
return $this;
|
return $this;
|
||||||
|
@ -35,6 +35,7 @@ $table-body-td-text-align: left;
|
|||||||
// Tabs
|
// Tabs
|
||||||
$tabs-nav-margin-bottom: 0.2em;
|
$tabs-nav-margin-bottom: 0.2em;
|
||||||
$tabs-nav-bg-color: $yellow;
|
$tabs-nav-bg-color: $yellow;
|
||||||
|
$tabs-nav-bg-color-light: lighten($yellow, 10%);
|
||||||
$tabs-nav-text-color: $blue;
|
$tabs-nav-text-color: $blue;
|
||||||
$tabs-new-border: none;
|
$tabs-new-border: none;
|
||||||
$tabs-nav-hover-border: none;
|
$tabs-nav-hover-border: none;
|
||||||
|
@ -26,7 +26,13 @@ $global-bg-color: $yellow;
|
|||||||
color: $tabs-nav-title-text-color;
|
color: $tabs-nav-title-text-color;
|
||||||
}
|
}
|
||||||
|
|
||||||
> a {
|
&.sub-menu {
|
||||||
|
padding-left: 20px;
|
||||||
|
> a {
|
||||||
|
background-color: $tabs-nav-bg-color-light;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
> a {
|
||||||
display: block;
|
display: block;
|
||||||
width: auto;
|
width: auto;
|
||||||
padding: $tabs-nav-padding;
|
padding: $tabs-nav-padding;
|
||||||
@ -38,11 +44,11 @@ $global-bg-color: $yellow;
|
|||||||
@include border-top-radius($base-border-radius);
|
@include border-top-radius($base-border-radius);
|
||||||
@include border-bottom-radius($base-border-radius);
|
@include border-bottom-radius($base-border-radius);
|
||||||
|
|
||||||
&:hover, &:active {
|
&:hover, &:active {
|
||||||
border: $tabs-nav-hover-border;
|
border: $tabs-nav-hover-border;
|
||||||
color: $tabs-nav-hover-text-color;
|
color: $tabs-nav-hover-text-color;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
|
|
||||||
<city-selection
|
<city-selection
|
||||||
v-bind:address="address"
|
v-bind:address="address"
|
||||||
|
v-bind:focusOnAddress="focusOnAddress"
|
||||||
v-bind:getReferenceAddresses="getReferenceAddresses">
|
v-bind:getReferenceAddresses="getReferenceAddresses">
|
||||||
</city-selection>
|
</city-selection>
|
||||||
|
|
||||||
@ -173,6 +174,14 @@ export default {
|
|||||||
// this.$refs.search.focus(); // positionner le curseur à l'ouverture de la modale
|
// this.$refs.search.focus(); // positionner le curseur à l'ouverture de la modale
|
||||||
//})
|
//})
|
||||||
},
|
},
|
||||||
|
focusOnCity() {
|
||||||
|
const citySelector = document.getElementById('citySelector');
|
||||||
|
citySelector.focus();
|
||||||
|
},
|
||||||
|
focusOnAddress() {
|
||||||
|
const addressSelector = document.getElementById('addressSelector');
|
||||||
|
addressSelector.focus();
|
||||||
|
},
|
||||||
getCountries() {
|
getCountries() {
|
||||||
console.log('getCountries');
|
console.log('getCountries');
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<VueMultiselect
|
<VueMultiselect
|
||||||
|
id="addressSelector"
|
||||||
v-model="value"
|
v-model="value"
|
||||||
@select="selectAddress"
|
@select="selectAddress"
|
||||||
name="field"
|
name="field"
|
||||||
@ -70,7 +71,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
transName(value) {
|
transName(value) {
|
||||||
return value.streetNumber === undefined ? value.street : `${value.street}, ${value.streetNumber}`
|
return value.streetNumber === undefined ? value.street : `${value.streetNumber}, ${value.street}`
|
||||||
},
|
},
|
||||||
selectAddress(value) {
|
selectAddress(value) {
|
||||||
this.address.selected.address = value;
|
this.address.selected.address = value;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<VueMultiselect
|
<VueMultiselect
|
||||||
|
id="citySelector"
|
||||||
v-model="value"
|
v-model="value"
|
||||||
@select="selectCity"
|
@select="selectCity"
|
||||||
name="field"
|
name="field"
|
||||||
@ -35,7 +36,7 @@ import VueMultiselect from 'vue-multiselect';
|
|||||||
export default {
|
export default {
|
||||||
name: 'CitySelection',
|
name: 'CitySelection',
|
||||||
components: { VueMultiselect },
|
components: { VueMultiselect },
|
||||||
props: ['address', 'getReferenceAddresses'],
|
props: ['address', 'getReferenceAddresses', 'focusOnAddress'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
value: null
|
value: null
|
||||||
@ -74,6 +75,7 @@ export default {
|
|||||||
this.address.newPostalCode.name = value.name;
|
this.address.newPostalCode.name = value.name;
|
||||||
this.address.newPostalCode.code = value.code;
|
this.address.newPostalCode.code = value.code;
|
||||||
this.getReferenceAddresses(value);
|
this.getReferenceAddresses(value);
|
||||||
|
this.focusOnAddress();
|
||||||
},
|
},
|
||||||
addPostalCode() {
|
addPostalCode() {
|
||||||
this.address.writeNewPostalCode = true;
|
this.address.writeNewPostalCode = true;
|
||||||
|
@ -40,7 +40,6 @@ export default {
|
|||||||
return name.fr //TODO multilang
|
return name.fr //TODO multilang
|
||||||
},
|
},
|
||||||
selectCountry(value) {
|
selectCountry(value) {
|
||||||
console.log(value);
|
|
||||||
this.address.selected.country = value;
|
this.address.selected.country = value;
|
||||||
this.getCities(value);
|
this.getCities(value);
|
||||||
},
|
},
|
||||||
|
@ -14,7 +14,7 @@ class AddressNormalizer implements NormalizerAwareInterface, NormalizerInterface
|
|||||||
public function normalize($address, string $format = null, array $context = [])
|
public function normalize($address, string $format = null, array $context = [])
|
||||||
{
|
{
|
||||||
$data['address_id'] = $address->getId();
|
$data['address_id'] = $address->getId();
|
||||||
$data['text'] = $address->getStreet().', '.$address->getStreetNumber();
|
$data['text'] = $address->isNoAddress() ? '' : $address->getStreetNumber().', '.$address->getStreet();
|
||||||
$data['street'] = $address->getStreet();
|
$data['street'] = $address->getStreet();
|
||||||
$data['streetNumber'] = $address->getStreetNumber();
|
$data['streetNumber'] = $address->getStreetNumber();
|
||||||
$data['postcode']['name'] = $address->getPostCode()->getName();
|
$data['postcode']['name'] = $address->getPostCode()->getName();
|
||||||
|
@ -7,6 +7,7 @@ use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
|||||||
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
||||||
use Chill\PersonBundle\Privacy\AccompanyingPeriodPrivacyEvent;
|
use Chill\PersonBundle\Privacy\AccompanyingPeriodPrivacyEvent;
|
||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
|
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository;
|
||||||
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
use Chill\PersonBundle\Security\Authorization\AccompanyingPeriodVoter;
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
@ -35,14 +36,18 @@ class AccompanyingCourseController extends Controller
|
|||||||
|
|
||||||
protected ValidatorInterface $validator;
|
protected ValidatorInterface $validator;
|
||||||
|
|
||||||
|
private AccompanyingPeriodWorkRepository $workRepository;
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
SerializerInterface $serializer,
|
SerializerInterface $serializer,
|
||||||
EventDispatcherInterface $dispatcher,
|
EventDispatcherInterface $dispatcher,
|
||||||
ValidatorInterface $validator
|
ValidatorInterface $validator,
|
||||||
|
AccompanyingPeriodWorkRepository $workRepository
|
||||||
) {
|
) {
|
||||||
$this->serializer = $serializer;
|
$this->serializer = $serializer;
|
||||||
$this->dispatcher = $dispatcher;
|
$this->dispatcher = $dispatcher;
|
||||||
$this->validator = $validator;
|
$this->validator = $validator;
|
||||||
|
$this->workRepository = $workRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -102,9 +107,16 @@ class AccompanyingCourseController extends Controller
|
|||||||
['date' => 'DESC'],
|
['date' => 'DESC'],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$works = $this->workRepository->findByAccompanyingPeriod(
|
||||||
|
$accompanyingCourse,
|
||||||
|
['startDate' => 'DESC', 'endDate' => 'DESC'],
|
||||||
|
3
|
||||||
|
);
|
||||||
|
|
||||||
return $this->render('@ChillPerson/AccompanyingCourse/index.html.twig', [
|
return $this->render('@ChillPerson/AccompanyingCourse/index.html.twig', [
|
||||||
'accompanyingCourse' => $accompanyingCourse,
|
'accompanyingCourse' => $accompanyingCourse,
|
||||||
'withoutHousehold' => $withoutHousehold,
|
'withoutHousehold' => $withoutHousehold,
|
||||||
|
'works' => $works,
|
||||||
'activities' => $activities
|
'activities' => $activities
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -47,12 +47,12 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
* @var EventDispatcherInterface
|
* @var EventDispatcherInterface
|
||||||
*/
|
*/
|
||||||
protected $eventDispatcher;
|
protected $eventDispatcher;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var ValidatorInterface
|
* @var ValidatorInterface
|
||||||
*/
|
*/
|
||||||
protected $validator;
|
protected $validator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AccompanyingPeriodController constructor.
|
* AccompanyingPeriodController constructor.
|
||||||
*
|
*
|
||||||
@ -64,23 +64,25 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
$this->eventDispatcher = $eventDispatcher;
|
$this->eventDispatcher = $eventDispatcher;
|
||||||
$this->validator = $validator;
|
$this->validator = $validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function listAction(int $person_id): Response
|
public function listAction(int $person_id): Response
|
||||||
{
|
{
|
||||||
$person = $this->_getPerson($person_id);
|
$person = $this->_getPerson($person_id);
|
||||||
|
|
||||||
$event = new PrivacyEvent($person, [
|
$event = new PrivacyEvent($person, [
|
||||||
'element_class' => AccompanyingPeriod::class,
|
'element_class' => AccompanyingPeriod::class,
|
||||||
'action' => 'list'
|
'action' => 'list'
|
||||||
]);
|
]);
|
||||||
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||||
|
|
||||||
|
$accompanyingPeriods = $person->getAccompanyingPeriodsOrdered();
|
||||||
|
|
||||||
return $this->render('ChillPersonBundle:AccompanyingPeriod:list.html.twig', [
|
return $this->render('ChillPersonBundle:AccompanyingPeriod:list.html.twig', [
|
||||||
'accompanying_periods' => $person->getAccompanyingPeriodsOrdered(),
|
'accompanying_periods' => $accompanyingPeriods,
|
||||||
'person' => $person
|
'person' => $person
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createAction(int $person_id, Request $request): Response
|
public function createAction(int $person_id, Request $request): Response
|
||||||
{
|
{
|
||||||
$person = $this->_getPerson($person_id);
|
$person = $this->_getPerson($person_id);
|
||||||
@ -90,17 +92,17 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
|
|
||||||
$accompanyingPeriod = new AccompanyingPeriod(new \DateTime('now'));
|
$accompanyingPeriod = new AccompanyingPeriod(new \DateTime('now'));
|
||||||
$accompanyingPeriod->setClosingDate(new \DateTime('now'));
|
$accompanyingPeriod->setClosingDate(new \DateTime('now'));
|
||||||
|
|
||||||
$accompanyingPeriod->addPerson($person);
|
$accompanyingPeriod->addPerson($person);
|
||||||
//or $person->addAccompanyingPeriod($accompanyingPeriod);
|
//or $person->addAccompanyingPeriod($accompanyingPeriod);
|
||||||
|
|
||||||
$form = $this->createForm(
|
$form = $this->createForm(
|
||||||
AccompanyingPeriodType::class,
|
AccompanyingPeriodType::class,
|
||||||
$accompanyingPeriod, [
|
$accompanyingPeriod, [
|
||||||
'period_action' => 'create',
|
'period_action' => 'create',
|
||||||
'center' => $person->getCenter()
|
'center' => $person->getCenter()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($request->getMethod() === 'POST') {
|
if ($request->getMethod() === 'POST') {
|
||||||
$form->handleRequest($request);
|
$form->handleRequest($request);
|
||||||
$errors = $this->_validatePerson($person);
|
$errors = $this->_validatePerson($person);
|
||||||
@ -120,7 +122,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
$this->generateUrl('chill_person_accompanying_period_list', [
|
$this->generateUrl('chill_person_accompanying_period_list', [
|
||||||
'person_id' => $person->getId()
|
'person_id' => $person->getId()
|
||||||
]));
|
]));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$flashBag->add('error', $this->get('translator')
|
$flashBag->add('error', $this->get('translator')
|
||||||
->trans('Error! Period not created!'));
|
->trans('Error! Period not created!'));
|
||||||
@ -137,7 +139,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
'accompanying_period' => $accompanyingPeriod
|
'accompanying_period' => $accompanyingPeriod
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
@ -154,7 +156,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
|
|
||||||
/** @var Person $person */
|
/** @var Person $person */
|
||||||
$person = $this->_getPerson($person_id);
|
$person = $this->_getPerson($person_id);
|
||||||
|
|
||||||
// CHECK
|
// CHECK
|
||||||
if (! $accompanyingPeriod->containsPerson($person)) {
|
if (! $accompanyingPeriod->containsPerson($person)) {
|
||||||
throw new Exception("Accompanying period " . $period_id . " does not contain person " . $person_id);
|
throw new Exception("Accompanying period " . $period_id . " does not contain person " . $person_id);
|
||||||
@ -176,7 +178,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
|
|
||||||
if ($form->isValid(['Default', 'closed'])
|
if ($form->isValid(['Default', 'closed'])
|
||||||
&& count($errors) === 0) {
|
&& count($errors) === 0) {
|
||||||
|
|
||||||
$em->flush();
|
$em->flush();
|
||||||
|
|
||||||
$flashBag->add('success',
|
$flashBag->add('success',
|
||||||
@ -186,9 +188,9 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
$this->generateUrl('chill_person_accompanying_period_list', [
|
$this->generateUrl('chill_person_accompanying_period_list', [
|
||||||
'person_id' => $person->getId()
|
'person_id' => $person->getId()
|
||||||
]));
|
]));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$flashBag->add('error', $this->get('translator')
|
$flashBag->add('error', $this->get('translator')
|
||||||
->trans('Error when updating the period'));
|
->trans('Error when updating the period'));
|
||||||
|
|
||||||
@ -204,19 +206,19 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
'accompanying_period' => $accompanyingPeriod
|
'accompanying_period' => $accompanyingPeriod
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function closeAction(int $person_id, Request $request): Response
|
public function closeAction(int $person_id, Request $request): Response
|
||||||
{
|
{
|
||||||
|
|
||||||
$person = $this->_getPerson($person_id);
|
$person = $this->_getPerson($person_id);
|
||||||
|
|
||||||
$this->denyAccessUnlessGranted(PersonVoter::UPDATE, $person, 'You are not allowed to update this person');
|
$this->denyAccessUnlessGranted(PersonVoter::UPDATE, $person, 'You are not allowed to update this person');
|
||||||
|
|
||||||
if ($person->isOpen() === false) {
|
if ($person->isOpen() === false) {
|
||||||
|
|
||||||
$this->get('session')->getFlashBag()
|
$this->get('session')->getFlashBag()
|
||||||
->add('error', $this->get('translator')
|
->add('error', $this->get('translator')
|
||||||
->trans('Beware period is closed', ['%name%' => $person->__toString()]
|
->trans('Beware period is closed', ['%name%' => $person->__toString()]
|
||||||
@ -229,7 +231,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$current = $person->getCurrentAccompanyingPeriod();
|
$current = $person->getCurrentAccompanyingPeriod();
|
||||||
|
|
||||||
$form = $this->createForm(AccompanyingPeriodType::class, $current, [
|
$form = $this->createForm(AccompanyingPeriodType::class, $current, [
|
||||||
'period_action' => 'close',
|
'period_action' => 'close',
|
||||||
'center' => $person->getCenter()
|
'center' => $person->getCenter()
|
||||||
@ -256,7 +258,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
'person_id' => $person->getId()
|
'person_id' => $person->getId()
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$this->get('session')->getFlashBag()
|
$this->get('session')->getFlashBag()
|
||||||
->add('error', $this->get('translator')
|
->add('error', $this->get('translator')
|
||||||
@ -267,7 +269,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
->add('info', $error->getMessage());
|
->add('info', $error->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else { //if form is not valid
|
} else { //if form is not valid
|
||||||
$this->get('session')->getFlashBag()
|
$this->get('session')->getFlashBag()
|
||||||
->add('error',
|
->add('error',
|
||||||
@ -288,7 +290,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
'accompanying_period' => $current
|
'accompanying_period' => $current
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function _validatePerson(Person $person): ConstraintViolationListInterface
|
private function _validatePerson(Person $person): ConstraintViolationListInterface
|
||||||
{
|
{
|
||||||
$errors = $this->validator->validate($person, null,
|
$errors = $this->validator->validate($person, null,
|
||||||
@ -296,10 +298,10 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
|
|
||||||
// Can be disabled with config
|
// Can be disabled with config
|
||||||
if (false === $this->container->getParameter('chill_person.allow_multiple_simultaneous_accompanying_periods')) {
|
if (false === $this->container->getParameter('chill_person.allow_multiple_simultaneous_accompanying_periods')) {
|
||||||
|
|
||||||
$errors_accompanying_period = $this->validator->validate($person, null,
|
$errors_accompanying_period = $this->validator->validate($person, null,
|
||||||
['accompanying_period_consistent']);
|
['accompanying_period_consistent']);
|
||||||
|
|
||||||
foreach($errors_accompanying_period as $error ) {
|
foreach($errors_accompanying_period as $error ) {
|
||||||
$errors->add($error);
|
$errors->add($error);
|
||||||
}
|
}
|
||||||
@ -307,7 +309,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
|
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function openAction(int $person_id, Request $request): Response
|
public function openAction(int $person_id, Request $request): Response
|
||||||
{
|
{
|
||||||
$person = $this->_getPerson($person_id);
|
$person = $this->_getPerson($person_id);
|
||||||
@ -384,7 +386,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
'accompanying_period' => $accompanyingPeriod
|
'accompanying_period' => $accompanyingPeriod
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reOpenAction(int $person_id, int $period_id, Request $request): Response
|
public function reOpenAction(int $person_id, int $period_id, Request $request): Response
|
||||||
{
|
{
|
||||||
/** @var Person $person */
|
/** @var Person $person */
|
||||||
@ -392,7 +394,7 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
|
|
||||||
/* @var $period AccompanyingPeriod */
|
/* @var $period AccompanyingPeriod */
|
||||||
$period = \array_filter(
|
$period = \array_filter(
|
||||||
$person->getAccompanyingPeriods(),
|
$person->getAccompanyingPeriods(),
|
||||||
function (AccompanyingPeriod $p) use ($period_id) {
|
function (AccompanyingPeriod $p) use ($period_id) {
|
||||||
return $p->getId() === ($period_id);
|
return $p->getId() === ($period_id);
|
||||||
}
|
}
|
||||||
@ -417,13 +419,13 @@ class AccompanyingPeriodController extends AbstractController
|
|||||||
return $this->redirectToRoute('chill_person_accompanying_period_list', [
|
return $this->redirectToRoute('chill_person_accompanying_period_list', [
|
||||||
'person_id' => $person->getId()
|
'person_id' => $person->getId()
|
||||||
]);
|
]);
|
||||||
|
|
||||||
} elseif ($confirm === false && $period->canBeReOpened($person)) {
|
} elseif ($confirm === false && $period->canBeReOpened($person)) {
|
||||||
return $this->render('ChillPersonBundle:AccompanyingPeriod:re_open.html.twig', [
|
return $this->render('ChillPersonBundle:AccompanyingPeriod:re_open.html.twig', [
|
||||||
'period' => $period,
|
'period' => $period,
|
||||||
'person' => $person
|
'person' => $person
|
||||||
]);
|
]);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return (new Response())
|
return (new Response())
|
||||||
->setStatusCode(Response::HTTP_BAD_REQUEST)
|
->setStatusCode(Response::HTTP_BAD_REQUEST)
|
||||||
|
@ -30,7 +30,7 @@ class HouseholdController extends AbstractController
|
|||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
$this->positionRepository = $positionRepository;
|
$this->positionRepository = $positionRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route(
|
* @Route(
|
||||||
* "/{household_id}/summary",
|
* "/{household_id}/summary",
|
||||||
@ -47,7 +47,7 @@ class HouseholdController extends AbstractController
|
|||||||
->findByActiveOrdered()
|
->findByActiveOrdered()
|
||||||
;
|
;
|
||||||
|
|
||||||
// little performance improvement:
|
// little performance improvement:
|
||||||
// initialize members collection, which will avoid
|
// initialize members collection, which will avoid
|
||||||
// some queries
|
// some queries
|
||||||
$household->getMembers()->initialize();
|
$household->getMembers()->initialize();
|
||||||
@ -67,6 +67,31 @@ class HouseholdController extends AbstractController
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Route(
|
||||||
|
* "/{household_id}/accompanying-period",
|
||||||
|
* name="chill_person_household_accompanying_period",
|
||||||
|
* methods={"GET", "HEAD"}
|
||||||
|
* )
|
||||||
|
* @ParamConverter("household", options={"id" = "household_id"})
|
||||||
|
*/
|
||||||
|
public function accompanyingPeriod(Request $request, Household $household)
|
||||||
|
{
|
||||||
|
// TODO ACL
|
||||||
|
|
||||||
|
$members = $household->getMembers();
|
||||||
|
foreach($members as $m) {
|
||||||
|
$accompanyingPeriods = $m->getPerson()->getAccompanyingPeriods();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->render('@ChillPerson/Household/accompanying_period.html.twig',
|
||||||
|
[
|
||||||
|
'household' => $household,
|
||||||
|
'accompanying_periods' => $accompanyingPeriods
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Route(
|
* @Route(
|
||||||
* "/{household_id}/addresses",
|
* "/{household_id}/addresses",
|
||||||
|
@ -9,22 +9,22 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||||||
|
|
||||||
class HouseholdMenuBuilder implements LocalMenuBuilderInterface
|
class HouseholdMenuBuilder implements LocalMenuBuilderInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var TranslatorInterface
|
* @var TranslatorInterface
|
||||||
*/
|
*/
|
||||||
protected $translator;
|
protected $translator;
|
||||||
|
|
||||||
public function __construct(TranslatorInterface $translator)
|
public function __construct(TranslatorInterface $translator)
|
||||||
{
|
{
|
||||||
$this->translator = $translator;
|
$this->translator = $translator;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getMenuIds(): array
|
public static function getMenuIds(): array
|
||||||
{
|
{
|
||||||
return [ 'household' ];
|
return [ 'household' ];
|
||||||
}
|
}
|
||||||
|
|
||||||
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
||||||
{
|
{
|
||||||
$household = $parameters['household'];
|
$household = $parameters['household'];
|
||||||
@ -35,15 +35,22 @@ class HouseholdMenuBuilder implements LocalMenuBuilderInterface
|
|||||||
'household_id' => $household->getId()
|
'household_id' => $household->getId()
|
||||||
]])
|
]])
|
||||||
->setExtras(['order' => 10]);
|
->setExtras(['order' => 10]);
|
||||||
|
|
||||||
|
$menu->addChild($this->translator->trans('household.Accompanying period'), [
|
||||||
|
'route' => 'chill_person_household_accompanying_period',
|
||||||
|
'routeParameters' => [
|
||||||
|
'household_id' => $household->getId()
|
||||||
|
]])
|
||||||
|
->setExtras(['order' => 20]);
|
||||||
|
|
||||||
$menu->addChild($this->translator->trans('household.Addresses'), [
|
$menu->addChild($this->translator->trans('household.Addresses'), [
|
||||||
'route' => 'chill_person_household_addresses',
|
'route' => 'chill_person_household_addresses',
|
||||||
'routeParameters' => [
|
'routeParameters' => [
|
||||||
'household_id' => $household->getId()
|
'household_id' => $household->getId()
|
||||||
]])
|
]])
|
||||||
->setExtras(['order' => 30]);
|
->setExtras(['order' => 30]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -118,11 +118,12 @@ export default {
|
|||||||
modal.showModal = false;
|
modal.showModal = false;
|
||||||
},
|
},
|
||||||
addToHousehold() {
|
addToHousehold() {
|
||||||
this.$store.dispatch('addDateToAddressAndAddressToHousehold', {
|
this.$store.dispatch('addDateToAddressAndAddressToHousehold', {
|
||||||
householdId: this.householdId,
|
householdId: this.householdId,
|
||||||
addressId: this.$store.state.newAddress.address_id,
|
addressId: this.$store.state.newAddress.address_id,
|
||||||
body: { validFrom: {datetime: `${this.validFrom}T00:00:00+0100`}}
|
body: { validFrom: {datetime: `${this.validFrom}T00:00:00+0100`}}
|
||||||
})
|
})
|
||||||
|
window.location.assign(this.backUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -4,7 +4,7 @@ const appMessages = {
|
|||||||
fr: {
|
fr: {
|
||||||
select_a_existing_address: 'Sélectionner une adresse existante',
|
select_a_existing_address: 'Sélectionner une adresse existante',
|
||||||
create_a_new_address: 'Créer une nouvelle adresse',
|
create_a_new_address: 'Créer une nouvelle adresse',
|
||||||
add_an_address_to_household: 'Déménager le ménage',
|
add_an_address_to_household: 'Enregistrer',
|
||||||
validFrom: 'Date du déménagement',
|
validFrom: 'Date du déménagement',
|
||||||
move_date: 'Date du déménagement',
|
move_date: 'Date du déménagement',
|
||||||
back_to_the_list: 'Retour à la liste',
|
back_to_the_list: 'Retour à la liste',
|
||||||
|
@ -222,11 +222,107 @@
|
|||||||
|
|
||||||
<h2>{{ 'Social actions'|trans }}</h2>
|
<h2>{{ 'Social actions'|trans }}</h2>
|
||||||
|
|
||||||
{% set person = null %}
|
<div id="accompanying_course_work_list">
|
||||||
|
{% for w in works %}
|
||||||
|
<div class="item">
|
||||||
|
<div class="title">
|
||||||
|
<h2 class="action_title">
|
||||||
|
{{ w.socialAction|chill_entity_render_box({ 'no-badge': false }) }}
|
||||||
|
</h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="timeline">
|
||||||
|
<ul class="timeline">
|
||||||
|
<li class="completed">
|
||||||
|
<div class="date">
|
||||||
|
<span>{{ w.createdAt|format_date('long') }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="label">
|
||||||
|
<span>{{ 'accompanying_course_work.create_date'|trans }}</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="completed">
|
||||||
|
<div class="date">
|
||||||
|
<span>{{ w.startDate|format_date('long') }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="label">
|
||||||
|
<span>{{ 'accompanying_course_work.start_date'|trans }}</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<li class="{%if date(w.endDate) < date('now') %}completed{% endif %}">
|
||||||
|
<div class="date">
|
||||||
|
<span>{{ w.endDate|format_date('long') }}</span>
|
||||||
|
</div>
|
||||||
|
<div class="label">
|
||||||
|
<span>{{ 'accompanying_course_work.end_date'|trans }}</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% if w.results|length > 0 %}
|
||||||
|
<div class="objective_results objective_results__without-objectives">
|
||||||
|
<div class="obj without_objective">
|
||||||
|
<p class="title_label">{{ 'accompanying_course_work.goal'|trans }}</p>
|
||||||
|
<p class="chill-no-data-statement">{{ 'accompanying_course_work.results without objective'|trans }}</p>
|
||||||
|
</div>
|
||||||
|
<div class="res results">
|
||||||
|
<p class="title_label">{{ 'accompanying_course_work.results'|trans }}</p>
|
||||||
|
<ul class="result_list">
|
||||||
|
{% for r in w.results %}
|
||||||
|
<li class="badge badge-primary">{{ r.title|localize_translatable_string }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if w.goals|length > 0 %}
|
||||||
|
{% for g in w.goals %}
|
||||||
|
<div class="objective_results objective_results--with-objectives">
|
||||||
|
<div class="objective obj">
|
||||||
|
<p class="title_label">{{ 'accompanying_course_work.goal'|trans }}</p>
|
||||||
|
<h3 class="goal_title">{{ g.goal.title|localize_translatable_string }}</h3>
|
||||||
|
</div>
|
||||||
|
<div class="results res">
|
||||||
|
{% if g.results|length == 0 %}
|
||||||
|
<p class="title_label">{{ 'accompanying_course_work.results'|trans }}</p>
|
||||||
|
<p class="chill-no-data-statement">{{ 'accompanying_course_work.no_results'|trans }}</p>
|
||||||
|
{% else %}
|
||||||
|
<p class="title_label">{{ 'accompanying_course_work.results'|trans }}</p>
|
||||||
|
<ul class="result_list">
|
||||||
|
{% for r in g.results %}
|
||||||
|
<li class="badge badge-primary">{{ r.title|localize_translatable_string }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
<div class="updatedBy">
|
||||||
|
{{ 'Last updated by'|trans}}: {{ w.updatedBy|chill_entity_render_box }}, {{ w.updatedAt|format_datetime('long', 'short') }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<p class="chill-no-data-statement">{{ 'accompanying_course_work.Any work'|trans }}</p>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{% block contentActivity %}
|
{% block contentActivity %}
|
||||||
|
{% set person = null %}
|
||||||
{% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'accompanyingCourse', 'context': 'person'} %}
|
{% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'accompanyingCourse', 'context': 'person'} %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{# ==> insert accompanyingCourse vue component #}
|
{# ==> insert accompanyingCourse vue component #}
|
||||||
<div id="accompanying-course"></div>
|
<div id="accompanying-course"></div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
{% block css %}
|
||||||
|
{{ parent() }}
|
||||||
|
{{ encore_entry_link_tags('accompanying_course_work_list') }}
|
||||||
|
{% endblock %}
|
||||||
|
@ -102,7 +102,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<p class="chill-no-data-statement">{{ 'accompanying_course_work.No work'|trans }}</p>
|
<p class="chill-no-data-statement">{{ 'accompanying_course_work.Any work'|trans }}</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -0,0 +1,136 @@
|
|||||||
|
{% block content %}
|
||||||
|
|
||||||
|
{% for accompanying_period in accompanying_periods %}
|
||||||
|
<div class="flex-table">
|
||||||
|
<div class="item-bloc">
|
||||||
|
<div class="item-row">
|
||||||
|
<div class="item-col">
|
||||||
|
{{'period'|trans}} <b>#{{ accompanying_period.id }}</b>
|
||||||
|
{% if accompanying_period.emergency %}
|
||||||
|
|
||||||
|
<span class="badge badge-primary">
|
||||||
|
{{- 'Emergency'|trans|upper -}}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
{% if accompanying_period.confidential %}
|
||||||
|
|
||||||
|
<span class="badge badge-primary">
|
||||||
|
{{- 'Confidential'|trans|upper -}}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
{% if accompanying_period.step == 'DRAFT' %}
|
||||||
|
|
||||||
|
<span class="badge badge-primary">
|
||||||
|
{{- 'Draft'|trans|upper -}}
|
||||||
|
</span>
|
||||||
|
{% else %}
|
||||||
|
<span class="badge badge-primary">
|
||||||
|
{{- 'Confirmed'|trans|upper -}}
|
||||||
|
</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="item-col">
|
||||||
|
{% if chill_accompanying_periods.fields.user == 'visible' %}
|
||||||
|
{% if accompanying_period.user %}
|
||||||
|
{{ accompanying_period.user.username }}
|
||||||
|
{% else %}
|
||||||
|
<span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="item-row">
|
||||||
|
{% if accompanying_period.closingDate == null %}
|
||||||
|
{{ 'accompanying_period.dates_from_%opening_date%'|trans({ '%opening_date%': accompanying_period.openingDate|format_date('long') } ) }}
|
||||||
|
{% else %}
|
||||||
|
{{ 'accompanying_period.dates_from_%opening_date%_to_%closing_date%'|trans({
|
||||||
|
'%opening_date%': accompanying_period.openingDate|format_date('long'),
|
||||||
|
'%closing_date%': accompanying_period.closingDate|format_date('long')}
|
||||||
|
) }}
|
||||||
|
|
||||||
|
{% if accompanying_period.isOpen == false %}
|
||||||
|
<dl class="chill_view_data">
|
||||||
|
<dt>{{ 'Closing motive'|trans }} :</dt>
|
||||||
|
<dd>{{ accompanying_period.closingMotive|chill_entity_render_box }}</dd>
|
||||||
|
</dl>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="item-col">
|
||||||
|
<h3>{{ 'Participants'|trans }}</h3>
|
||||||
|
{% if accompanying_period.participations.count > 0 %}
|
||||||
|
{% for p in accompanying_period.participations %}
|
||||||
|
<p>
|
||||||
|
<a href="{{ path('chill_person_accompanying_period_list', { person_id: p.person.id }) }}">
|
||||||
|
{{ p.person.firstname ~ ' ' ~ p.person.lastname }}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
<div class="item-col">
|
||||||
|
<h3>{{ 'Requestor'|trans }}</h3>
|
||||||
|
{% if accompanying_period.requestorPerson is not null or accompanying_period.requestorThirdParty is not null %}
|
||||||
|
{% if accompanying_period.requestorPerson is not null %}
|
||||||
|
<p>{{ accompanying_period.requestorPerson.firstname ~ ' ' ~ accompanying_period.requestorPerson.lastname }}</p>
|
||||||
|
{% endif %}
|
||||||
|
{% if accompanying_period.requestorThirdParty is not null %}
|
||||||
|
<p>{{ accompanying_period.requestorThirdParty.name }}</p>
|
||||||
|
{% endif %}
|
||||||
|
{% else %}
|
||||||
|
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="item-col">
|
||||||
|
<h3>{{ 'Social issues'|trans }}</h3>
|
||||||
|
{% if accompanying_period.socialIssues.count > 0 %}
|
||||||
|
{% for si in accompanying_period.socialIssues %}
|
||||||
|
<p>{{ si.title|localize_translatable_string }}</p>
|
||||||
|
{% endfor %}
|
||||||
|
{% else %}
|
||||||
|
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="item-row">
|
||||||
|
<ul class="record_actions">
|
||||||
|
{# TODO if enable_accompanying_course_with_multiple_persons is true ... #}
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': accompanying_period.id }) }}" class="sc-button bt-show"></a>
|
||||||
|
</li>
|
||||||
|
{#
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_person_accompanying_period_update', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}" class="sc-button bt-update no-content"></a>
|
||||||
|
</li>
|
||||||
|
{% if accompanying_period.isOpen == true %}
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_person_accompanying_period_close', {'person_id' : person.id}) }}" class="sc-button bt-update has-hidden change-icon">
|
||||||
|
<i class="fa fa-lock" aria-hidden="true"></i><span class="show-on-hover">{{'Close accompanying period'|trans }}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% if accompanying_period.canBeReOpened(person) == true %}
|
||||||
|
<li>
|
||||||
|
<a href="{{ path('chill_person_accompanying_period_re_open', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}" class="sc-button bt-create change-icon has-hidden">
|
||||||
|
<i class="fa fa-unlock" aria-hidden="true"></i><span class="show-on-hover">{{'Re-open accompanying period'|trans }}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
#}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p></p>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
|
||||||
|
{% endblock content %}
|
@ -5,92 +5,9 @@
|
|||||||
{% block title %}{{ 'Person accompanying period - %name%'|trans({ '%name%' : person.__toString}) }}{% endblock title %}
|
{% block title %}{{ 'Person accompanying period - %name%'|trans({ '%name%' : person.__toString}) }}{% endblock title %}
|
||||||
|
|
||||||
{% block personcontent %}
|
{% block personcontent %}
|
||||||
|
|
||||||
<h1>{{ 'Accompanying period list'|trans }}</h1>
|
<h1>{{ 'Accompanying period list'|trans }}</h1>
|
||||||
|
|
||||||
<table class="rounded">
|
{% include 'ChillPersonBundle:AccompanyingPeriod:_list.html.twig' %}
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="chill-red">{{ 'accompanying_period.dates'|trans }}</th>
|
|
||||||
{% if chill_accompanying_periods.fields.user == 'visible' %}
|
|
||||||
<th class="chill-blue">{{ 'Accompanying user'|trans }}</th>
|
|
||||||
{% endif %}
|
|
||||||
<th class="chill-orange">{{ 'Remark'|trans }}</th>
|
|
||||||
<th> </th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for accompanying_period in accompanying_periods %}
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
{% if accompanying_period.closingDate == null %}
|
|
||||||
{{ 'accompanying_period.dates_from_%opening_date%'|trans({ '%opening_date%': accompanying_period.openingDate|format_date('long') } ) }}
|
|
||||||
{% else %}
|
|
||||||
{{ 'accompanying_period.dates_from_%opening_date%_to_%closing_date%'|trans({
|
|
||||||
'%opening_date%': accompanying_period.openingDate|format_date('long'),
|
|
||||||
'%closing_date%': accompanying_period.closingDate|format_date('long')}
|
|
||||||
) }}
|
|
||||||
|
|
||||||
{% if accompanying_period.isOpen == false %}
|
|
||||||
<dl class="chill_view_data">
|
|
||||||
<dt>{{ 'Closing motive'|trans }} :</dt>
|
|
||||||
<dd>{{ accompanying_period.closingMotive|chill_entity_render_box }}</dd>
|
|
||||||
</dl>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
{% if chill_accompanying_periods.fields.user == 'visible' %}
|
|
||||||
<td>
|
|
||||||
{% if accompanying_period.user %}
|
|
||||||
{{ accompanying_period.user.username }}
|
|
||||||
{% else %}
|
|
||||||
<span class="chill-no-data-statement">{{ 'No accompanying user'|trans }}</span>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
{% endif %}
|
|
||||||
<td>
|
|
||||||
{% if accompanying_period is not empty %}
|
|
||||||
<blockquote class="chill-user-quote">
|
|
||||||
{{ accompanying_period.remark|chill_markdown_to_html }}
|
|
||||||
</blockquote>
|
|
||||||
{% else %}
|
|
||||||
{{ null|chill_print_or_message('No remark', 'blockquote') }}
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<ul class="record_actions">
|
|
||||||
|
|
||||||
{# TODO if enable_accompanying_course_with_multiple_persons is true ... #}
|
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_person_accompanying_course_index', { 'accompanying_period_id': accompanying_period.id }) }}" class="sc-button bt-show"></a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_person_accompanying_period_update', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}" class="sc-button bt-update no-content"></a>
|
|
||||||
</li>
|
|
||||||
{% if accompanying_period.isOpen == true %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_person_accompanying_period_close', {'person_id' : person.id}) }}" class="sc-button bt-update has-hidden change-icon">
|
|
||||||
<i class="fa fa-lock" aria-hidden="true"></i><span class="show-on-hover">{{'Close accompanying period'|trans }}</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% if accompanying_period.canBeReOpened(person) == true %}
|
|
||||||
<li>
|
|
||||||
<a href="{{ path('chill_person_accompanying_period_re_open', {'person_id' : person.id, 'period_id' : accompanying_period.id } ) }}" class="sc-button bt-create change-icon has-hidden">
|
|
||||||
<i class="fa fa-unlock" aria-hidden="true"></i><span class="show-on-hover">{{'Re-open accompanying period'|trans }}</span>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<div class="form_control">
|
<div class="form_control">
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
@ -99,6 +16,12 @@
|
|||||||
{{ 'Person details'|trans }}
|
{{ 'Person details'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="{{ path ('chill_person_accompanying_course_new', {'person_id' : [ person.id ] } ) }}" class="sc-button bt-create">
|
||||||
|
{{ 'Create an accompanying period'|trans }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{#
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path ('chill_person_accompanying_period_create', {'person_id' : person.id } ) }}" class="sc-button bt-create has-hidden">
|
<a href="{{ path ('chill_person_accompanying_period_create', {'person_id' : person.id } ) }}" class="sc-button bt-create has-hidden">
|
||||||
<span class="show-on-hover">{{ 'Add an accompanying period in the past'|trans }}</span>
|
<span class="show-on-hover">{{ 'Add an accompanying period in the past'|trans }}</span>
|
||||||
@ -112,7 +35,8 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
#}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock personcontent %}
|
{% endblock %}
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
{% extends '@ChillPerson/Household/layout.html.twig' %}
|
||||||
|
|
||||||
|
{% block title 'Household accompanying period'|trans %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
<h1>{{ block('title') }}</h1>
|
||||||
|
|
||||||
|
{% include 'ChillPersonBundle:AccompanyingPeriod:_list.html.twig' %}
|
||||||
|
|
||||||
|
<div class="form_control">
|
||||||
|
<ul class="record_actions">
|
||||||
|
<li class="cancel">
|
||||||
|
<a href="{{ path ('chill_person_household_summary', {'household_id' : household.id } ) }}" class="sc-button bt-cancel">
|
||||||
|
{{ 'Household summary'|trans }}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
{#<li>
|
||||||
|
<a href="{{ path ('chill_person_household_accompanying_course_new', {'household_id' : [ household.id ] } ) }}" class="sc-button bt-create">
|
||||||
|
{{ 'Create an accompanying period'|trans }}
|
||||||
|
</a>
|
||||||
|
</li>#}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{% endblock %}
|
@ -12,11 +12,11 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<div class="top"><i class="fa fa-caret-up fa-3x"></i></div>
|
<div class="top"><i class="fa fa-caret-up fa-3x"></i></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% for address in household.addresses %}
|
{% for address in household.addresses %}
|
||||||
|
|
||||||
<div class="col-b"></div>
|
<div class="col-b"></div>
|
||||||
|
|
||||||
<div class="col-c content{{ ' row' ~ loop.index }}">
|
<div class="col-c content{{ ' row' ~ loop.index }}">
|
||||||
<div class="address">
|
<div class="address">
|
||||||
{% if address.isNoAddress == true %}
|
{% if address.isNoAddress == true %}
|
||||||
@ -39,22 +39,22 @@
|
|||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="record_actions">
|
{#<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_person_household_address_edit', { 'household_id': household.id, 'address_id' : address.id } ) }}" class="sc-button bt-edit"></a>
|
<a href="{{ path('chill_person_household_address_edit', { 'household_id': household.id, 'address_id' : address.id } ) }}" class="sc-button bt-edit"></a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul> #}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="date">
|
<div class="date">
|
||||||
{% if address.validFrom is not empty %}
|
{% if address.validFrom is not empty %}
|
||||||
{{ address.validFrom|format_date('long') }}
|
{{ address.validFrom|format_date('long') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
|
@ -16,8 +16,8 @@
|
|||||||
#}
|
#}
|
||||||
<ul class="tab-nav">
|
<ul class="tab-nav">
|
||||||
{% for menu in menus %}
|
{% for menu in menus %}
|
||||||
<li class="">
|
<li class="{{ menu.extra('class') }}">
|
||||||
<a href="{{ menu.uri }}" >{{ menu.label|upper }}</a>
|
<a href="{{ menu.uri }}" >{{ menu.label|upper }}</a>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -46,6 +46,7 @@ services:
|
|||||||
$serializer: '@Symfony\Component\Serializer\SerializerInterface'
|
$serializer: '@Symfony\Component\Serializer\SerializerInterface'
|
||||||
$dispatcher: '@Symfony\Contracts\EventDispatcher\EventDispatcherInterface'
|
$dispatcher: '@Symfony\Contracts\EventDispatcher\EventDispatcherInterface'
|
||||||
$validator: '@Symfony\Component\Validator\Validator\ValidatorInterface'
|
$validator: '@Symfony\Component\Validator\Validator\ValidatorInterface'
|
||||||
|
$workRepository: '@Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkRepository'
|
||||||
tags: ['controller.service_arguments']
|
tags: ['controller.service_arguments']
|
||||||
|
|
||||||
Chill\PersonBundle\Controller\AccompanyingCourseApiController:
|
Chill\PersonBundle\Controller\AccompanyingCourseApiController:
|
||||||
|
@ -38,12 +38,13 @@ household:
|
|||||||
Edit member household: Modifier l'appartenance au ménage
|
Edit member household: Modifier l'appartenance au ménage
|
||||||
Current household members: Membres actuels
|
Current household members: Membres actuels
|
||||||
Household summary: Résumé
|
Household summary: Résumé
|
||||||
|
Accompanying period: Parcours d'accompagnement
|
||||||
Addresses: Adresses
|
Addresses: Adresses
|
||||||
Current address: Adresse actuelle
|
Current address: Adresse actuelle
|
||||||
Household does not have any address currently: Le ménage n'a pas d'adresse renseignée actuellement
|
Household does not have any address currently: Le ménage n'a pas d'adresse renseignée actuellement
|
||||||
Edit household members: Modifier l'appartenance au ménage
|
Edit household members: Modifier l'appartenance au ménage
|
||||||
and x other persons: >-
|
and x other persons: >-
|
||||||
{x, plural,
|
{x, plural,
|
||||||
one {et une autre personne}
|
one {et une autre personne}
|
||||||
many {et # autres personnes}
|
many {et # autres personnes}
|
||||||
other {et # autres personnes}
|
other {et # autres personnes}
|
||||||
@ -59,7 +60,7 @@ household:
|
|||||||
data_saved: Données enregistrées
|
data_saved: Données enregistrées
|
||||||
Household history for %name%: Historique des ménages pour {name}
|
Household history for %name%: Historique des ménages pour {name}
|
||||||
Household shared: Ménages domiciliés
|
Household shared: Ménages domiciliés
|
||||||
Household not shared: Ménage non domiciliés
|
Household not shared: Ménage non domiciliés
|
||||||
Never in any household: Membre d'aucun ménage
|
Never in any household: Membre d'aucun ménage
|
||||||
Membership currently running: En cours
|
Membership currently running: En cours
|
||||||
from: Depuis
|
from: Depuis
|
||||||
|
@ -165,6 +165,8 @@ An accompanying period starts: Une période d'accompagnement est ouverte
|
|||||||
Any accompanying periods are open: Aucune période d'accompagnement ouverte
|
Any accompanying periods are open: Aucune période d'accompagnement ouverte
|
||||||
An accompanying period is open: Une période d'accompagnement est ouverte
|
An accompanying period is open: Une période d'accompagnement est ouverte
|
||||||
Accompanying period list: Périodes d'accompagnement
|
Accompanying period list: Périodes d'accompagnement
|
||||||
|
Accompanying period: Parcours d'accompagnement
|
||||||
|
period: Parcours
|
||||||
New accompanying course: Nouveau parcours d'accompagnement
|
New accompanying course: Nouveau parcours d'accompagnement
|
||||||
Choose a motive: Motif de fermeture
|
Choose a motive: Motif de fermeture
|
||||||
Re-open accompanying period: Ré-ouvrir
|
Re-open accompanying period: Ré-ouvrir
|
||||||
@ -189,6 +191,8 @@ See accompanying period: Voir cette période d'accompagnement
|
|||||||
Referrer: Référent
|
Referrer: Référent
|
||||||
Some peoples does not belong to any household currently. Add them to an household soon: Certaines personnes n'appartiennent à aucun ménage actuellement. Renseignez leur appartenance à un ménage dès que possible.
|
Some peoples does not belong to any household currently. Add them to an household soon: Certaines personnes n'appartiennent à aucun ménage actuellement. Renseignez leur appartenance à un ménage dès que possible.
|
||||||
Add to household now: Ajouter à un ménage
|
Add to household now: Ajouter à un ménage
|
||||||
|
Requestor: Demandeur
|
||||||
|
|
||||||
|
|
||||||
# pickAPersonType
|
# pickAPersonType
|
||||||
Pick a person: Choisir une personne
|
Pick a person: Choisir une personne
|
||||||
@ -320,6 +324,9 @@ accompanying_period:
|
|||||||
dates_from_%opening_date%_to_%closing_date%: Ouvert du %opening_date% au %closing_date%
|
dates_from_%opening_date%_to_%closing_date%: Ouvert du %opening_date% au %closing_date%
|
||||||
occasional: ponctuel
|
occasional: ponctuel
|
||||||
regular: régulier
|
regular: régulier
|
||||||
|
Confidential: confidentiel
|
||||||
|
Draft: brouillon
|
||||||
|
Confirmed: en file active
|
||||||
|
|
||||||
# Accompanying Course
|
# Accompanying Course
|
||||||
Accompanying Course: Parcours d'accompagnement
|
Accompanying Course: Parcours d'accompagnement
|
||||||
@ -337,6 +344,8 @@ Members: Membres
|
|||||||
Addresses: Adresses
|
Addresses: Adresses
|
||||||
Move household: Nouveau déménagement
|
Move household: Nouveau déménagement
|
||||||
Addresses history for household: Historique des adresses
|
Addresses history for household: Historique des adresses
|
||||||
|
Household accompanying period: Parcours d'accompagnement du ménage
|
||||||
|
Household summary: Résumé du ménage
|
||||||
|
|
||||||
# accompanying course work
|
# accompanying course work
|
||||||
Accompanying Course Actions: Actions d'accompagnements
|
Accompanying Course Actions: Actions d'accompagnements
|
||||||
@ -353,4 +362,5 @@ accompanying_course_work:
|
|||||||
no_results: Aucun résultat - orientation
|
no_results: Aucun résultat - orientation
|
||||||
results: Résultats - orientations
|
results: Résultats - orientations
|
||||||
goal: Objectif - motif - dispositif
|
goal: Objectif - motif - dispositif
|
||||||
|
Any work: Aucune action d'accompagnement
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user