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/edit-accompanying-period-social-work
This commit is contained in:
commit
4fd43310c0
@ -38,7 +38,7 @@ Required: Obligatoire
|
||||
Persons: Personnes
|
||||
Users: Utilisateurs
|
||||
Emergency: Urgent
|
||||
Sent received: Envoyer / Recevoir
|
||||
Sent received: Entrant / Sortant
|
||||
Sent: Envoyer
|
||||
Received: Recevoir
|
||||
by: 'Par '
|
||||
|
@ -51,7 +51,7 @@ class CommentType extends AbstractType
|
||||
|
||||
$builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) {
|
||||
$data = $event->getForm()->getData();
|
||||
$comment = $event->getData();
|
||||
$comment = $event->getData() ?? ['comment' => ''];
|
||||
|
||||
if ($data->getComment() !== $comment['comment']) {
|
||||
$data->setDate(new \DateTime());
|
||||
|
@ -26,6 +26,12 @@
|
||||
<div v-if="errors.length > 0">
|
||||
{{ errors }}
|
||||
</div>
|
||||
<div v-if="loading">
|
||||
{{ $t('loading') }}
|
||||
</div>
|
||||
<div v-if="success">
|
||||
{{ $t('person_address_creation_success') }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@ -68,6 +74,12 @@ export default {
|
||||
},
|
||||
errors() {
|
||||
return this.$store.state.errorMsg;
|
||||
},
|
||||
loading() {
|
||||
return this.$store.state.loading;
|
||||
},
|
||||
success() {
|
||||
return this.$store.state.success;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -26,7 +26,9 @@ const addressMessages = {
|
||||
date: 'Date de la nouvelle adresse',
|
||||
add_an_address_to_person: 'Ajouter l\'adresse à la personne',
|
||||
validFrom: 'Date de la nouvelle adresse',
|
||||
back_to_the_list: 'Retour à la liste'
|
||||
back_to_the_list: 'Retour à la liste',
|
||||
person_address_creation_success: 'La nouvelle adresse de la personne est enregistrée',
|
||||
loading: 'chargement en cours...'
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -11,7 +11,9 @@ const store = createStore({
|
||||
address: {},
|
||||
editAddress: {}, //TODO or should be address?
|
||||
person: {},
|
||||
errorMsg: []
|
||||
errorMsg: [],
|
||||
loading: false,
|
||||
success: false
|
||||
},
|
||||
getters: {
|
||||
},
|
||||
@ -39,11 +41,17 @@ const store = createStore({
|
||||
console.log('@M getEditAddress address', address);
|
||||
state.editAddress = address;
|
||||
},
|
||||
setLoading(state, b) {
|
||||
state.loading = b;
|
||||
},
|
||||
setSuccess(state, b) {
|
||||
state.success = b;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
addAddress({ commit }, payload) {
|
||||
console.log('@A addAddress payload', payload);
|
||||
|
||||
commit('setLoading', true);
|
||||
if('newPostalCode' in payload){
|
||||
let postalCodeBody = payload.newPostalCode;
|
||||
postalCodeBody = Object.assign(postalCodeBody, {'origin': 3});
|
||||
@ -55,9 +63,11 @@ const store = createStore({
|
||||
.then(address => new Promise((resolve, reject) => {
|
||||
commit('addAddress', address);
|
||||
resolve();
|
||||
commit('setLoading', false);
|
||||
}))
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
commit('setLoading', false);
|
||||
});
|
||||
})
|
||||
|
||||
@ -66,15 +76,17 @@ const store = createStore({
|
||||
.then(address => new Promise((resolve, reject) => {
|
||||
commit('addAddress', address);
|
||||
resolve();
|
||||
commit('setLoading', false);
|
||||
}))
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
commit('setLoading', false);
|
||||
});
|
||||
}
|
||||
},
|
||||
addDateToAddressAndAddressToPerson({ commit }, payload) {
|
||||
console.log('@A addDateToAddressAndAddressToPerson payload', payload);
|
||||
|
||||
commit('setLoading', true);
|
||||
patchAddress(payload.addressId, payload.body)
|
||||
.then(address => new Promise((resolve, reject) => {
|
||||
commit('addDateToAddress', address.validFrom);
|
||||
@ -84,13 +96,17 @@ const store = createStore({
|
||||
.then(person => new Promise((resolve, reject) => {
|
||||
commit('addAddressToPerson', person);
|
||||
resolve();
|
||||
commit('setLoading', false);
|
||||
commit('setSuccess', true);
|
||||
}))
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
commit('setLoading', false);
|
||||
})
|
||||
))
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
commit('setLoading', false);
|
||||
});
|
||||
},
|
||||
updateAddress({ commit }, payload) {
|
||||
|
@ -19,6 +19,10 @@
|
||||
<template v-slot:body>
|
||||
<div class="address_form">
|
||||
|
||||
<div v-if="loading">
|
||||
{{ $t('loading') }}
|
||||
</div>
|
||||
|
||||
<div class="address_form__header">
|
||||
<h4>{{ $t('select_an_address_title') }}</h4>
|
||||
</div>
|
||||
@ -110,6 +114,7 @@ export default {
|
||||
showModal: false,
|
||||
modalDialogClass: "modal-dialog-scrollable modal-xl"
|
||||
},
|
||||
loading: false,
|
||||
address: {
|
||||
writeNewAddress: false,
|
||||
writeNewPostalCode: false,
|
||||
@ -143,7 +148,7 @@ export default {
|
||||
extra: null,
|
||||
distribution: null,
|
||||
},
|
||||
errorMsg: {}
|
||||
errorMsg: {},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -170,33 +175,42 @@ export default {
|
||||
},
|
||||
getCountries() {
|
||||
console.log('getCountries');
|
||||
this.loading = true;
|
||||
fetchCountries().then(countries => new Promise((resolve, reject) => {
|
||||
this.address.loaded.countries = countries.results;
|
||||
resolve()
|
||||
this.loading = false;
|
||||
}))
|
||||
.catch((error) => {
|
||||
this.errorMsg.push(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getCities(country) {
|
||||
console.log('getCities for', country.name);
|
||||
this.loading = true;
|
||||
fetchCities(country).then(cities => new Promise((resolve, reject) => {
|
||||
this.address.loaded.cities = cities.results.filter(c => c.origin !== 3); // filter out user-defined cities
|
||||
resolve();
|
||||
this.loading = false;
|
||||
}))
|
||||
.catch((error) => {
|
||||
this.errorMsg.push(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
getReferenceAddresses(city) {
|
||||
this.loading = true;
|
||||
console.log('getReferenceAddresses for', city.name);
|
||||
fetchReferenceAddresses(city).then(addresses => new Promise((resolve, reject) => {
|
||||
console.log('addresses', addresses);
|
||||
this.address.loaded.addresses = addresses.results;
|
||||
resolve();
|
||||
this.loading = false;
|
||||
}))
|
||||
.catch((error) => {
|
||||
this.errorMsg.push(error.message);
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
updateMapCenter(point) {
|
||||
|
@ -23,7 +23,7 @@ export default {
|
||||
},
|
||||
methods:{
|
||||
init() {
|
||||
map = L.map('address_map').setView([48.8589, 2.3469], 12);
|
||||
map = L.map('address_map').setView([46.67059, -1.42683], 12);
|
||||
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||
|
@ -5,6 +5,7 @@
|
||||
<input
|
||||
type="text"
|
||||
name="floor"
|
||||
maxlength=16
|
||||
:placeholder="$t('floor')"
|
||||
v-model="floor"/>
|
||||
</div>
|
||||
@ -13,6 +14,7 @@
|
||||
<input
|
||||
type="text"
|
||||
name="corridor"
|
||||
maxlength=16
|
||||
:placeholder="$t('corridor')"
|
||||
v-model="corridor"/>
|
||||
</div>
|
||||
@ -21,6 +23,7 @@
|
||||
<input
|
||||
type="text"
|
||||
name="steps"
|
||||
maxlength=16
|
||||
:placeholder="$t('steps')"
|
||||
v-model="steps"/>
|
||||
</div>
|
||||
@ -29,6 +32,7 @@
|
||||
<input
|
||||
type="text"
|
||||
name="flat"
|
||||
maxlength=16
|
||||
:placeholder="$t('flat')"
|
||||
v-model="flat"/>
|
||||
</div>
|
||||
@ -37,6 +41,7 @@
|
||||
<input
|
||||
type="text"
|
||||
name="buildingName"
|
||||
maxlength=255
|
||||
:placeholder="$t('buildingName')"
|
||||
v-model="buildingName"/>
|
||||
</div>
|
||||
@ -45,6 +50,7 @@
|
||||
<input
|
||||
type="text"
|
||||
name="extra"
|
||||
maxlength=255
|
||||
:placeholder="$t('extra')"
|
||||
v-model="extra"/>
|
||||
</div>
|
||||
@ -53,6 +59,7 @@
|
||||
<input
|
||||
type="text"
|
||||
name="distribution"
|
||||
maxlength=255
|
||||
:placeholder="$t('distribution')"
|
||||
v-model="distribution"/>
|
||||
</div>
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace Chill\PersonBundle\Controller;
|
||||
|
||||
use Chill\ActivityBundle\Entity\Activity;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriodParticipation;
|
||||
use Chill\PersonBundle\Privacy\AccompanyingPeriodPrivacyEvent;
|
||||
@ -75,7 +76,7 @@ class AccompanyingCourseController extends Controller
|
||||
return $this->redirectToRoute('chill_person_accompanying_course_edit', [
|
||||
'accompanying_period_id' => $period->getId()
|
||||
]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -96,9 +97,15 @@ class AccompanyingCourseController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
$activities = $this->getDoctrine()->getManager()->getRepository(Activity::class)->findBy(
|
||||
['accompanyingPeriod' => $accompanyingCourse],
|
||||
['date' => 'DESC'],
|
||||
);
|
||||
|
||||
return $this->render('@ChillPerson/AccompanyingCourse/index.html.twig', [
|
||||
'accompanyingCourse' => $accompanyingCourse,
|
||||
'withoutHousehold' => $withoutHousehold
|
||||
'withoutHousehold' => $withoutHousehold,
|
||||
'activities' => $activities
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -297,18 +297,16 @@ class PersonAddressController extends AbstractController
|
||||
*/
|
||||
protected function findAddressById(Person $person, $address_id)
|
||||
{
|
||||
// filtering address
|
||||
$criteria = Criteria::create()
|
||||
->where(Criteria::expr()->eq('id', $address_id))
|
||||
->setMaxResults(1);
|
||||
$addresses = $person->getAddresses()->matching($criteria);
|
||||
$address = $this->getDoctrine()->getManager()
|
||||
->getRepository(Address::class)
|
||||
->find($address_id)
|
||||
;
|
||||
|
||||
if (count($addresses) === 0) {
|
||||
throw $this->createNotFoundException("Address with id $address_id "
|
||||
. "matching person $person_id not found ");
|
||||
if (!$person->getAddresses()->contains($address)) {
|
||||
throw $this->createAccessDeniedException("Not allowed to see this address");
|
||||
}
|
||||
|
||||
return $addresses->first();
|
||||
return $address;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -78,6 +78,7 @@ class Configuration implements ConfigurationInterface
|
||||
->append($this->addFieldNode('address'))
|
||||
->append($this->addFieldNode('accompanying_period'))
|
||||
->append($this->addFieldNode('memo'))
|
||||
->append($this->addFieldNode('number_of_children'))
|
||||
->arrayNode('alt_names')
|
||||
->defaultValue([])
|
||||
->arrayPrototype()
|
||||
@ -130,7 +131,7 @@ class Configuration implements ConfigurationInterface
|
||||
{
|
||||
$tree = new TreeBuilder($key,'enum');
|
||||
$node = $tree->getRootNode($key);
|
||||
|
||||
|
||||
switch($key) {
|
||||
case 'accompanying_period':
|
||||
$info = "If the accompanying periods are shown";
|
||||
|
@ -51,7 +51,7 @@ class Household
|
||||
* targetEntity=HouseholdMember::class,
|
||||
* mappedBy="household"
|
||||
* )
|
||||
* @Serializer\Groups({"write", "read"})
|
||||
* @Serializer\Groups({"read"})
|
||||
*/
|
||||
private Collection $members;
|
||||
|
||||
@ -225,7 +225,7 @@ class Household
|
||||
public function getCurrentMembersOrdered(?\DateTimeImmutable $now = null): Collection
|
||||
{
|
||||
$members = $this->getCurrentMembers($now);
|
||||
|
||||
|
||||
$members->getIterator()
|
||||
->uasort(
|
||||
function (HouseholdMember $a, HouseholdMember $b) {
|
||||
|
@ -23,13 +23,17 @@ namespace Chill\PersonBundle\Entity;
|
||||
*/
|
||||
|
||||
use ArrayIterator;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
|
||||
use Chill\MainBundle\Entity\Center;
|
||||
use Chill\MainBundle\Entity\Country;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\PersonBundle\Entity\Household\Household;
|
||||
use Chill\PersonBundle\Entity\MaritalStatus;
|
||||
use Chill\PersonBundle\Entity\Household\HouseholdMember;
|
||||
use Chill\MainBundle\Entity\HasCenterInterface;
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
use Chill\MainBundle\Entity\Embeddable\CommentEmbeddable;
|
||||
use DateTime;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
@ -53,7 +57,7 @@ use Chill\PersonBundle\Entity\Household\PersonHouseholdAddress;
|
||||
* "person"=Person::class
|
||||
* })
|
||||
*/
|
||||
class Person implements HasCenterInterface
|
||||
class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateInterface
|
||||
{
|
||||
/**
|
||||
* The person's id
|
||||
@ -100,6 +104,14 @@ class Person implements HasCenterInterface
|
||||
*/
|
||||
private $birthdate; //to change in birthdate
|
||||
|
||||
/**
|
||||
* The person's deathdate
|
||||
* @var \DateTimeImmutable
|
||||
*
|
||||
* @ORM\Column(type="date_immutable", nullable=true)
|
||||
*/
|
||||
private ?\DateTimeImmutable $deathdate;
|
||||
|
||||
/**
|
||||
* The person's place of birth
|
||||
* @var string
|
||||
@ -143,6 +155,14 @@ class Person implements HasCenterInterface
|
||||
const MALE_GENDER = 'man';
|
||||
const FEMALE_GENDER = 'woman';
|
||||
const BOTH_GENDER = 'both';
|
||||
const NO_INFORMATION = 'unknown';
|
||||
|
||||
/**
|
||||
* Comment on gender
|
||||
* @var CommentEmbeddable
|
||||
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="genderComment_")
|
||||
*/
|
||||
private CommentEmbeddable $genderComment;
|
||||
|
||||
/**
|
||||
* The marital status of the person
|
||||
@ -153,6 +173,21 @@ class Person implements HasCenterInterface
|
||||
*/
|
||||
private $maritalStatus;
|
||||
|
||||
/**
|
||||
* The date of the last marital status change of the person
|
||||
* @var \DateTime
|
||||
*
|
||||
* @ORM\Column(type="date", nullable=true)
|
||||
*/
|
||||
private $maritalStatusDate;
|
||||
|
||||
/**
|
||||
* Comment on marital status
|
||||
* @var CommentEmbeddable
|
||||
* @ORM\Embedded(class="Chill\MainBundle\Entity\Embeddable\CommentEmbeddable", columnPrefix="maritalStatusComment_")
|
||||
*/
|
||||
private CommentEmbeddable $maritalStatusComment;
|
||||
|
||||
/**
|
||||
* Contact information for contacting the person
|
||||
* @var string
|
||||
@ -240,6 +275,54 @@ class Person implements HasCenterInterface
|
||||
*/
|
||||
private $memo = ''; // TO-CHANGE in remark
|
||||
|
||||
|
||||
/**
|
||||
* Accept short text message (aka SMS)
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(type="boolean", options={"default" : false})
|
||||
*/
|
||||
private ?bool $acceptSMS = false;
|
||||
|
||||
/**
|
||||
* Accept receiving email
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(type="boolean", options={"default" : false})
|
||||
*/
|
||||
private ?bool $acceptEmail = false;
|
||||
|
||||
/**
|
||||
* Number of children
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(type="integer", nullable=true)
|
||||
*/
|
||||
private ?int $numberOfChildren = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity=User::class)
|
||||
* @ORM\JoinColumn(nullable=true)
|
||||
*/
|
||||
private $createdBy;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true, options={"default": NULL})
|
||||
*/
|
||||
private \DateTimeInterface $createdAt;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity=User::class
|
||||
* )
|
||||
*/
|
||||
private User $updatedBy;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="datetime", nullable=true, options={"default": NULL})
|
||||
*/
|
||||
private \DateTimeInterface $updatedAt;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
* @deprecated
|
||||
@ -316,8 +399,10 @@ class Person implements HasCenterInterface
|
||||
}
|
||||
|
||||
$this->open(new AccompanyingPeriod($opening));
|
||||
$this->genderComment = new CommentEmbeddable();
|
||||
$this->maritalStatusComment = new CommentEmbeddable();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This private function scan accompanyingPeriodParticipations Collection,
|
||||
* searching for a given AccompanyingPeriod
|
||||
@ -329,10 +414,10 @@ class Person implements HasCenterInterface
|
||||
if ($accompanyingPeriod === $participation->getAccompanyingPeriod()) {
|
||||
return $participation;
|
||||
}}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* This public function is the same but return only true or false
|
||||
*/
|
||||
@ -340,7 +425,7 @@ class Person implements HasCenterInterface
|
||||
{
|
||||
return ($this->participationsContainAccompanyingPeriod($accompanyingPeriod)) ? false : true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add AccompanyingPeriodParticipation
|
||||
*
|
||||
@ -350,7 +435,7 @@ class Person implements HasCenterInterface
|
||||
{
|
||||
$participation = new AccompanyingPeriodParticipation($accompanyingPeriod, $this);
|
||||
$this->accompanyingPeriodParticipations->add($participation);
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -360,7 +445,7 @@ class Person implements HasCenterInterface
|
||||
public function removeAccompanyingPeriod(AccompanyingPeriod $accompanyingPeriod) : void
|
||||
{
|
||||
$participation = $this->participationsContainAccompanyingPeriod($accompanyingPeriod);
|
||||
|
||||
|
||||
if (! null === $participation) {
|
||||
$participation->setEndDate(\DateTimeImmutable::class);
|
||||
$this->accompanyingPeriodParticipations->removeElement($participation);
|
||||
@ -438,7 +523,7 @@ class Person implements HasCenterInterface
|
||||
}
|
||||
return $accompanyingPeriods;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get AccompanyingPeriodParticipations Collection
|
||||
*/
|
||||
@ -447,7 +532,7 @@ class Person implements HasCenterInterface
|
||||
return $this->accompanyingPeriodParticipations;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Return a collection of participation, where the participation
|
||||
* is still opened, not a draft, and the period is still opened
|
||||
*/
|
||||
@ -465,9 +550,9 @@ class Person implements HasCenterInterface
|
||||
->filter(function (AccompanyingPeriodParticipation $app) {
|
||||
$period = $app->getAccompanyingPeriod();
|
||||
return (
|
||||
NULL === $period->getClosingDate()
|
||||
NULL === $period->getClosingDate()
|
||||
|| new \DateTime('now') < $period->getClosingDate()
|
||||
)
|
||||
)
|
||||
&& AccompanyingPeriod::STEP_DRAFT !== $period->getStep();
|
||||
});
|
||||
}
|
||||
@ -1195,12 +1280,12 @@ class Person implements HasCenterInterface
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public function getFullnameCanonical() : string
|
||||
{
|
||||
return $this->fullnameCanonical;
|
||||
}
|
||||
|
||||
|
||||
public function setFullnameCanonical($fullnameCanonical) : Person
|
||||
{
|
||||
$this->fullnameCanonical = $fullnameCanonical;
|
||||
@ -1341,4 +1426,122 @@ class Person implements HasCenterInterface
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public function getGenderComment(): CommentEmbeddable
|
||||
{
|
||||
return $this->genderComment;
|
||||
}
|
||||
|
||||
public function setGenderComment(CommentEmbeddable $genderComment): self
|
||||
{
|
||||
$this->genderComment = $genderComment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMaritalStatusComment(): CommentEmbeddable
|
||||
{
|
||||
return $this->maritalStatusComment;
|
||||
}
|
||||
|
||||
public function setMaritalStatusComment(CommentEmbeddable $maritalStatusComment): self
|
||||
{
|
||||
$this->maritalStatusComment = $maritalStatusComment;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getDeathdate(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->deathdate;
|
||||
}
|
||||
|
||||
public function setDeathdate(?\DateTimeInterface $deathdate): self
|
||||
{
|
||||
$this->deathdate = $deathdate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMaritalStatusDate(): ?\DateTimeInterface
|
||||
{
|
||||
return $this->maritalStatusDate;
|
||||
}
|
||||
|
||||
public function setMaritalStatusDate(?\DateTimeInterface $maritalStatusDate): self
|
||||
{
|
||||
$this->maritalStatusDate = $maritalStatusDate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAcceptSMS(): ?bool
|
||||
{
|
||||
return $this->acceptSMS;
|
||||
}
|
||||
|
||||
public function setAcceptSMS(bool $acceptSMS): self
|
||||
{
|
||||
$this->acceptSMS = $acceptSMS;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAcceptEmail(): ?bool
|
||||
{
|
||||
return $this->acceptEmail;
|
||||
}
|
||||
|
||||
public function setAcceptEmail(bool $acceptEmail): self
|
||||
{
|
||||
$this->acceptEmail = $acceptEmail;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNumberOfChildren(): ?int
|
||||
{
|
||||
return $this->numberOfChildren;
|
||||
}
|
||||
|
||||
public function setNumberOfChildren(int $numberOfChildren): self
|
||||
{
|
||||
$this->numberOfChildren = $numberOfChildren;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCreatedBy(): ?User
|
||||
{
|
||||
return $this->createdBy;
|
||||
}
|
||||
|
||||
public function setCreatedBy(User $createdBy): self
|
||||
{
|
||||
$this->createdBy = $createdBy;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCreatedAt(\DateTimeInterface $datetime): self
|
||||
{
|
||||
$this->createdAt = $datetime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUpdatedBy(User $user): self
|
||||
{
|
||||
$this->updatedBy = $user;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setUpdatedAt(\DateTimeInterface $datetime): self
|
||||
{
|
||||
$this->updatedAt = $datetime;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -34,9 +34,13 @@ use Chill\PersonBundle\Entity\PersonPhone;
|
||||
use Chill\PersonBundle\Form\Type\Select2MaritalStatusType;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Chill\MainBundle\Form\Type\ChillDateType;
|
||||
use Chill\MainBundle\Form\Type\CommentType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\EmailType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TelType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\DateType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
@ -82,8 +86,19 @@ class PersonType extends AbstractType
|
||||
->add('birthdate', ChillDateType::class, [
|
||||
'required' => false,
|
||||
])
|
||||
->add('deathdate', DateType::class, [
|
||||
'required' => false,
|
||||
'input' => 'datetime_immutable',
|
||||
'widget' => 'single_text'
|
||||
])
|
||||
->add('gender', GenderType::class, array(
|
||||
'required' => true
|
||||
))
|
||||
->add('genderComment', CommentType::class, array(
|
||||
'required' => false
|
||||
))
|
||||
->add('numberOfChildren', IntegerType::class, array(
|
||||
'required' => false
|
||||
));
|
||||
|
||||
if ($this->configAltNamesHelper->hasAltNames()) {
|
||||
@ -111,7 +126,12 @@ class PersonType extends AbstractType
|
||||
}
|
||||
|
||||
if ($this->config['mobilenumber'] === 'visible') {
|
||||
$builder->add('mobilenumber', TelType::class, array('required' => false));
|
||||
$builder
|
||||
->add('mobilenumber', TelType::class, array('required' => false))
|
||||
->add('acceptSMS', CheckboxType::class, array(
|
||||
'value' => false,
|
||||
'required' => true
|
||||
));
|
||||
}
|
||||
|
||||
$builder->add('otherPhoneNumbers', ChillCollectionType::class, [
|
||||
@ -130,7 +150,9 @@ class PersonType extends AbstractType
|
||||
]);
|
||||
|
||||
if ($this->config['email'] === 'visible') {
|
||||
$builder->add('email', EmailType::class, array('required' => false));
|
||||
$builder
|
||||
->add('email', EmailType::class, array('required' => false))
|
||||
->add('acceptEmail', CheckboxType::class, array('required' => false));
|
||||
}
|
||||
|
||||
if ($this->config['country_of_birth'] === 'visible') {
|
||||
@ -153,9 +175,16 @@ class PersonType extends AbstractType
|
||||
}
|
||||
|
||||
if ($this->config['marital_status'] === 'visible'){
|
||||
$builder->add('maritalStatus', Select2MaritalStatusType::class, array(
|
||||
'required' => false
|
||||
));
|
||||
$builder
|
||||
->add('maritalStatus', Select2MaritalStatusType::class, array(
|
||||
'required' => false
|
||||
))
|
||||
->add('maritalStatusDate', ChillDateType::class, array(
|
||||
'required' => false
|
||||
))
|
||||
->add('maritalStatusComment', CommentType::class, array(
|
||||
'required' => false
|
||||
));
|
||||
}
|
||||
|
||||
if($options['cFGroup']) {
|
||||
|
57
src/Bundle/ChillPersonBundle/Resources/public/js/person.js
Normal file
57
src/Bundle/ChillPersonBundle/Resources/public/js/person.js
Normal file
@ -0,0 +1,57 @@
|
||||
import { ShowHide } from 'ShowHide/show_hide.js';
|
||||
|
||||
const maritalStatus = document.getElementById("maritalStatus");
|
||||
const maritalStatusDate = document.getElementById("maritalStatusDate");
|
||||
const personEmail = document.getElementById("personEmail");
|
||||
const personAcceptEmail = document.getElementById("personAcceptEmail");
|
||||
const personPhoneNumber = document.getElementById("personPhoneNumber");
|
||||
const personAcceptSMS = document.getElementById("personAcceptSMS");
|
||||
|
||||
|
||||
new ShowHide({
|
||||
froms: [maritalStatus],
|
||||
container: [maritalStatusDate],
|
||||
test: function(froms) {
|
||||
for (let f of froms.values()) {
|
||||
for (let input of f.querySelectorAll('select').values()) {
|
||||
if (input.value) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
event_name: 'change'
|
||||
});
|
||||
|
||||
new ShowHide({
|
||||
froms: [personEmail],
|
||||
container: [personAcceptEmail],
|
||||
test: function(froms) {
|
||||
for (let f of froms.values()) {
|
||||
for (let input of f.querySelectorAll('input').values()) {
|
||||
if (input.value) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
event_name: 'input'
|
||||
});
|
||||
|
||||
new ShowHide({
|
||||
froms: [personPhoneNumber],
|
||||
container: [personAcceptSMS],
|
||||
test: function(froms) {
|
||||
for (let f of froms.values()) {
|
||||
for (let input of f.querySelectorAll('input').values()) {
|
||||
if (input.value) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
event_name: 'input'
|
||||
});
|
@ -24,6 +24,12 @@
|
||||
<div v-if="errors.length > 0">
|
||||
{{ errors }}
|
||||
</div>
|
||||
<div v-if="loading">
|
||||
{{ $t('loading') }}
|
||||
</div>
|
||||
<div v-if="success">
|
||||
{{ $t('household_address_move_success') }}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
@ -65,6 +71,12 @@ export default {
|
||||
},
|
||||
errors() {
|
||||
return this.$store.state.errorMsg;
|
||||
},
|
||||
loading() {
|
||||
return this.$store.state.loading;
|
||||
},
|
||||
success() {
|
||||
return this.$store.state.success;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -7,7 +7,9 @@ const appMessages = {
|
||||
add_an_address_to_household: 'Déménager le ménage',
|
||||
validFrom: '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',
|
||||
household_address_move_success: 'La nouvelle adresse du ménage est enregistrée',
|
||||
loading: 'chargement en cours...'
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -12,7 +12,9 @@ const store = createStore({
|
||||
newAddress: {},
|
||||
household: {},
|
||||
validFrom: {},
|
||||
errorMsg: []
|
||||
errorMsg: [],
|
||||
loading: false,
|
||||
success: false
|
||||
},
|
||||
getters: {
|
||||
},
|
||||
@ -31,12 +33,18 @@ const store = createStore({
|
||||
addDateToAddress(state, validFrom) {
|
||||
console.log('@M addDateToAddress address.validFrom', validFrom);
|
||||
state.validFrom = validFrom;
|
||||
},
|
||||
setLoading(state, b) {
|
||||
state.loading = b;
|
||||
},
|
||||
setSuccess(state, b) {
|
||||
state.success = b;
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
addAddress({ commit }, payload) {
|
||||
console.log('@A addAddress payload', payload);
|
||||
|
||||
commit('setLoading', true);
|
||||
if('newPostalCode' in payload){
|
||||
postPostalCode(payload.newPostalCode)
|
||||
.then(postalCode => {
|
||||
@ -46,9 +54,11 @@ const store = createStore({
|
||||
.then(address => new Promise((resolve, reject) => {
|
||||
commit('addAddress', address);
|
||||
resolve();
|
||||
commit('setLoading', false);
|
||||
}))
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
commit('setLoading', false);
|
||||
});
|
||||
})
|
||||
|
||||
@ -57,15 +67,17 @@ const store = createStore({
|
||||
.then(address => new Promise((resolve, reject) => {
|
||||
commit('addAddress', address);
|
||||
resolve();
|
||||
commit('setLoading', false);
|
||||
}))
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
commit('setLoading', false);
|
||||
});
|
||||
}
|
||||
},
|
||||
addDateToAddressAndAddressToHousehold({ commit }, payload) {
|
||||
console.log('@A addDateToAddressAndAddressToHousehold payload', payload);
|
||||
|
||||
commit('setLoading', true);
|
||||
patchAddress(payload.addressId, payload.body)
|
||||
.then(address => new Promise((resolve, reject) => {
|
||||
commit('addDateToAddress', address.validFrom);
|
||||
@ -74,14 +86,18 @@ const store = createStore({
|
||||
postAddressToHousehold(payload.householdId, payload.addressId)
|
||||
.then(household => new Promise((resolve, reject) => {
|
||||
commit('addAddressToHousehold', household);
|
||||
commit('setSuccess', true);
|
||||
commit('setLoading', false);
|
||||
resolve();
|
||||
}))
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
commit('setLoading', false);
|
||||
})
|
||||
))
|
||||
.catch((error) => {
|
||||
commit('catchError', error);
|
||||
commit('setLoading', false);
|
||||
});
|
||||
},
|
||||
}
|
||||
|
@ -67,9 +67,9 @@
|
||||
<h3>{{ p.person.firstname ~ ' ' ~ p.person.lastname }}</h3>
|
||||
<p>
|
||||
{% set born = (p.person.gender == 'woman') ? 'née': 'né' %}
|
||||
{% set gender = (p.person.gender == 'woman') ? 'fa-venus' :
|
||||
{% set gender = (p.person.gender == 'woman') ? 'fa-venus' :
|
||||
(p.person.gender == 'man') ? 'fa-mars' : 'fa-neuter' %}
|
||||
{% set genderTitle = (p.person.gender == 'woman') ? 'femme' :
|
||||
{% set genderTitle = (p.person.gender == 'woman') ? 'femme' :
|
||||
(p.person.gender == 'man') ? 'homme' : 'neutre' %}
|
||||
<i class="fa fa-fw {{ gender }}" title="{{ genderTitle }}"></i>{{ born ~ ' le ' ~ p.person.birthdate|format_date('short') }}
|
||||
</p>
|
||||
@ -103,9 +103,9 @@
|
||||
</li>
|
||||
{% if p.person.isSharingHousehold %}
|
||||
<li>
|
||||
<a
|
||||
<a
|
||||
href="{{ chill_path_add_return_path(
|
||||
'chill_person_household_summary',
|
||||
'chill_person_household_summary',
|
||||
{ 'household_id': p.person.getCurrentHousehold.id }
|
||||
) }}"
|
||||
class="sc-button">
|
||||
@ -128,7 +128,7 @@
|
||||
{% for r in accompanyingCourse.resources %}
|
||||
<div class="item-bloc">
|
||||
{% if r.person %}
|
||||
|
||||
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<h3>
|
||||
@ -137,9 +137,9 @@
|
||||
</h3>
|
||||
<p>
|
||||
{% set born = (r.person.gender == 'woman') ? 'née': 'né' %}
|
||||
{% set gender = (r.person.gender == 'woman') ? 'fa-venus' :
|
||||
{% set gender = (r.person.gender == 'woman') ? 'fa-venus' :
|
||||
(r.person.gender == 'man') ? 'fa-mars' : 'fa-neuter' %}
|
||||
{% set genderTitle = (r.person.gender == 'woman') ? 'femme' :
|
||||
{% set genderTitle = (r.person.gender == 'woman') ? 'femme' :
|
||||
(r.person.gender == 'homme') ? 'fa-mars' : 'neutre' %}
|
||||
<i class="fa fa-fw {{ gender }}" title="{{ genderTitle }}"></i>{{ born ~ ' le ' ~ r.person.birthdate|format_date('short') }}
|
||||
</p>
|
||||
@ -174,10 +174,10 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endif %}
|
||||
{% if r.thirdParty %}
|
||||
|
||||
|
||||
<div class="item-row">
|
||||
<div class="item-col">
|
||||
<h3>
|
||||
@ -214,7 +214,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
@ -222,9 +222,11 @@
|
||||
|
||||
<h2>{{ 'Social actions'|trans }}</h2>
|
||||
|
||||
<h2>{{ 'Last events on accompanying course'|trans }}</h2>
|
||||
|
||||
{% set person = null %}
|
||||
{% block contentActivity %}
|
||||
{% include 'ChillActivityBundle:Activity:list.html.twig' with {'context': 'accompanyingCourse', 'context': 'person'} %}
|
||||
{% endblock %}
|
||||
|
||||
{# ==> insert accompanyingCourse vue component #}
|
||||
<div id="accompanying-course"></div>
|
||||
<div id="accompanying-course"></div>
|
||||
{% endblock %}
|
||||
|
@ -43,6 +43,7 @@
|
||||
{{ form_widget(form.altNames, { 'label': 'Alternative names'}) }}
|
||||
{% endif %}
|
||||
{{ form_row(form.gender, {'label' : 'Gender'}) }}
|
||||
{{ form_row(form.genderComment, { 'label' : 'Comment on the gender'} ) }}
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
@ -54,9 +55,12 @@
|
||||
{%- if form.countryOfBirth is defined -%}
|
||||
{{ form_row(form.countryOfBirth, { 'label' : 'Country of birth' } ) }}
|
||||
{%- endif -%}
|
||||
{%- if form.deathdate is defined -%}
|
||||
{{ form_row(form.deathdate, { 'label' : 'Date of death' } ) }}
|
||||
{%- endif -%}
|
||||
</fieldset>
|
||||
|
||||
{%- if form.nationality is defined or form.spokenLanguages is defined or form.maritalStatus is defined -%}
|
||||
{%- if form.nationality is defined or form.spokenLanguages is defined -%}
|
||||
<fieldset>
|
||||
<legend><h2>{{ 'Administrative information'|trans }}</h2></legend>
|
||||
{%- if form.nationality is defined -%}
|
||||
@ -65,8 +69,21 @@
|
||||
{%- if form.spokenLanguages is defined -%}
|
||||
{{ form_row(form.spokenLanguages, {'label' : 'Spoken languages'}) }}
|
||||
{%- endif -%}
|
||||
</fieldset>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if form.numberOfChildren is defined or form.maritalStatus is defined -%}
|
||||
<fieldset>
|
||||
<legend><h2>{{ 'Marital status'|trans }}</h2></legend>
|
||||
{{ form_row(form.numberOfChildren, {'label' : 'Number of children'}) }}
|
||||
{%- if form.maritalStatus is defined -%}
|
||||
{{ form_row(form.maritalStatus, { 'label' : 'Marital status'} ) }}
|
||||
<div id="maritalStatus">
|
||||
{{ form_row(form.maritalStatus, { 'label' : 'Marital status'} ) }}
|
||||
</div>
|
||||
<div id="maritalStatusDate">
|
||||
{{ form_row(form.maritalStatusDate, { 'label' : 'Date of last marital status change'} ) }}
|
||||
{{ form_row(form.maritalStatusComment, { 'label' : 'Comment on the marital status'} ) }}
|
||||
</div>
|
||||
{%- endif -%}
|
||||
</fieldset>
|
||||
{%- endif -%}
|
||||
@ -75,13 +92,24 @@
|
||||
<fieldset>
|
||||
<legend><h2>{{ 'Contact information'|trans }}</h2></legend>
|
||||
{%- if form.email is defined -%}
|
||||
{{ form_row(form.email, {'label': 'Email'}) }}
|
||||
<div id="personEmail">
|
||||
{{ form_row(form.email, {'label': 'Email'}) }}
|
||||
</div>
|
||||
<div id="personAcceptEmail">
|
||||
{{ form_row(form.acceptEmail, {'label' : 'Accept emails ?'}) }}
|
||||
</div>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if form.phonenumber is defined -%}
|
||||
{{ form_row(form.phonenumber, {'label': 'Phonenumber'}) }}
|
||||
{%- endif -%}
|
||||
{%- if form.mobilenumber is defined -%}
|
||||
{{ form_row(form.mobilenumber, {'label': 'Mobilenumber'}) }}
|
||||
<div id="personPhoneNumber">
|
||||
{{ form_row(form.mobilenumber, {'label': 'Mobilenumber'}) }}
|
||||
</div>
|
||||
<div id="personAcceptSMS">
|
||||
{{ form_row(form.acceptSMS, {'label' : 'Accept short text message ?'}) }}
|
||||
</div>
|
||||
{%- endif -%}
|
||||
{%- if form.otherPhoneNumbers is defined -%}
|
||||
{{ form_widget(form.otherPhoneNumbers) }}
|
||||
@ -114,3 +142,8 @@
|
||||
|
||||
|
||||
{% endblock personcontent %}
|
||||
|
||||
|
||||
{% block js %}
|
||||
<script type="text/javascript" src="{{ asset('build/person.js') }}"></script>
|
||||
{% endblock js %}
|
||||
|
@ -73,12 +73,14 @@ This view should receive those arguments:
|
||||
|
||||
<dt>{{ 'Gender'|trans }} :</dt>
|
||||
<dd>{{ ( person.gender|default('Not given'))|trans }}</dd>
|
||||
|
||||
{% if not person.genderComment.isEmpty %}
|
||||
<dt>{{ 'Gender comment'|trans }} :</dt>
|
||||
<dd>{{ person.genderComment|chill_entity_render_box }}</dd>
|
||||
{% endif %}
|
||||
|
||||
</dl>
|
||||
|
||||
|
||||
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||
{{ include(edit_tmp_name, edit_tmp_args) }}
|
||||
{% endif %}
|
||||
</figure>
|
||||
</div>
|
||||
|
||||
@ -114,11 +116,14 @@ This view should receive those arguments:
|
||||
{% endif %}
|
||||
{% endapply %}</dd>
|
||||
{%- endif -%}
|
||||
|
||||
{% if person.deathdate is not null %}
|
||||
<dt>{{ 'Date of death'|trans }} :</dt>
|
||||
<dd>{{ person.deathdate|format_date('long') }}</dd>
|
||||
{% endif %}
|
||||
|
||||
</dl>
|
||||
|
||||
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||
{{ include(edit_tmp_name, edit_tmp_args) }}
|
||||
{% endif %}
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
@ -155,6 +160,21 @@ This view should receive those arguments:
|
||||
</dd>
|
||||
</dl>
|
||||
{%- endif -%}
|
||||
|
||||
|
||||
{%-if chill_person.fields.number_of_children == 'visible' -%}
|
||||
<dl>
|
||||
<dt>{{'Number of children'|trans}} :</dt>
|
||||
<dd>
|
||||
{% if person.numberOfChildren is not null %}
|
||||
{{ person.numberOfChildren }}
|
||||
{% else %}
|
||||
<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>
|
||||
{% endif %}
|
||||
</dd>
|
||||
</dl>
|
||||
{%- endif -%}
|
||||
|
||||
{%- if chill_person.fields.marital_status == 'visible' -%}
|
||||
<dl>
|
||||
<dt>{{'Marital status'|trans}} :</dt>
|
||||
@ -166,11 +186,24 @@ This view should receive those arguments:
|
||||
{% endif %}
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>{{'Date of last marital status change'|trans}} :</dt>
|
||||
{% if person.maritalStatusDate is not null %}
|
||||
<dd>
|
||||
{{ person.maritalStatusDate|format_date('long') }}
|
||||
</dd>
|
||||
{% endif %}
|
||||
</dl>
|
||||
<dl>
|
||||
{% if not person.maritalStatusComment.isEmpty %}
|
||||
<dt>{{'Comment on the marital status'|trans}} :</dt>
|
||||
<dd>
|
||||
{{ person.maritalStatusComment|chill_entity_render_box }}
|
||||
</dd>
|
||||
{% endif %}
|
||||
</dl>
|
||||
{%- endif -%}
|
||||
|
||||
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||
{{ include(edit_tmp_name, edit_tmp_args) }}
|
||||
{% endif %}
|
||||
</figure>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
@ -213,6 +246,13 @@ This view should receive those arguments:
|
||||
<dl>
|
||||
<dt>{{ 'Email'|trans }} :</dt>
|
||||
<dd>{% if person.email is not empty %}<a href="mailto:{{ person.email|escape('html_attr') }}">{{ person.email }}</a>{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}</span>{% endif %}</dd>
|
||||
{%- if person.email is not empty and person.acceptEmail -%}
|
||||
<dd>
|
||||
<span class="badge badge-secondary">
|
||||
{{- 'Accept emails'|trans -}}
|
||||
</span>
|
||||
</dd>
|
||||
{%- endif -%}
|
||||
</dl>
|
||||
{%- endif -%}
|
||||
{%- if chill_person.fields.phonenumber == 'visible' -%}
|
||||
@ -225,6 +265,13 @@ This view should receive those arguments:
|
||||
<dl>
|
||||
<dt>{{ 'Mobilenumber'|trans }} :</dt>
|
||||
<dd>{% if person.mobilenumber is not empty %}<a href="tel:{{ person.mobilenumber }}"><pre>{{ person.mobilenumber|chill_format_phonenumber }}</pre></a>{% else %}<span class="chill-no-data-statement">{{ 'No data given'|trans }}{% endif %}</dd>
|
||||
{%- if person.mobilenumber is not empty and person.acceptSMS -%}
|
||||
<dd>
|
||||
<span class="badge badge-secondary">
|
||||
{{- 'Accept short text message'|trans -}}
|
||||
</span>
|
||||
</dd>
|
||||
{%- endif -%}
|
||||
</dl>
|
||||
{% endif %}
|
||||
{% for pp in person.otherPhoneNumbers %}
|
||||
@ -253,9 +300,6 @@ This view should receive those arguments:
|
||||
</dl>
|
||||
{%- endif -%}
|
||||
|
||||
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||
{{ include(edit_tmp_name, edit_tmp_args) }}
|
||||
{% endif %}
|
||||
</figure>
|
||||
</div>
|
||||
{%- endif -%}
|
||||
@ -272,14 +316,21 @@ This view should receive those arguments:
|
||||
|
||||
<div class="grid-10 push-1 grid-mobile-12 grid-tablet-12 push-mobile-0 push-tablet-0 parent">
|
||||
<figure class="person-details">
|
||||
|
||||
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||
{{ include(edit_tmp_name, edit_tmp_args) }}
|
||||
{% endif %}
|
||||
</figure>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if is_granted('CHILL_PERSON_UPDATE', person) %}
|
||||
<ul class="grid-12 sticky-form-buttons record_actions ">
|
||||
<li>
|
||||
<a class="sc-button bt-update" href="{{ path('chill_person_general_edit', { 'person_id': person.id }) }}">
|
||||
{{ 'Edit'|trans }}
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
</div> <!-- end of div.person-view -->
|
||||
|
||||
{% endblock %}
|
||||
|
@ -16,4 +16,5 @@ module.exports = function(encore, entries)
|
||||
encore.addEntry('accompanying_course_work_create', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkCreate/index.js');
|
||||
encore.addEntry('accompanying_course_work_edit', __dirname + '/Resources/public/vuejs/AccompanyingCourseWorkEdit/index.js');
|
||||
encore.addEntry('accompanying_course_work_list', __dirname + '/Resources/public/modules/accompanying_course_work_list/index.js');
|
||||
encore.addEntry('person', __dirname + '/Resources/public/js/person.js');
|
||||
};
|
||||
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\Migrations\Person;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Add new fields to Person entity
|
||||
*/
|
||||
final class Version20210617073504 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add new fields to Person entity';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD deathdate DATE DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD maritalStatusDate DATE DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD acceptSMS BOOLEAN DEFAULT false NOT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD acceptEmail BOOLEAN DEFAULT false NOT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD numberOfChildren INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD genderComment_comment TEXT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD genderComment_userId INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD genderComment_date TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD maritalStatusComment_comment TEXT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD maritalStatusComment_userId INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD maritalStatusComment_date TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP deathdate');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP maritalStatusDate');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP acceptSMS');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP acceptEmail');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP numberOfChildren');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP genderComment_comment');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP genderComment_userId');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP genderComment_date');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP maritalStatusComment_comment');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP maritalStatusComment_userId');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP maritalStatusComment_date');
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\Migrations\Person;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Add createdAt, createdBy, updatedAt, updatedBy fields on Person
|
||||
*/
|
||||
final class Version20210618080702 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add createdAt, createdBy, updatedAt, updatedBy fields on Person';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD createdAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD updatedAt TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD createdBy_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD updatedBy_id INT DEFAULT NULL');
|
||||
$this->addSql('COMMENT ON COLUMN chill_person_person.deathdate IS \'(DC2Type:date_immutable)\'');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD CONSTRAINT FK_BF210A143174800F FOREIGN KEY (createdBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE chill_person_person ADD CONSTRAINT FK_BF210A1465FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX IDX_BF210A143174800F ON chill_person_person (createdBy_id)');
|
||||
$this->addSql('CREATE INDEX IDX_BF210A1465FF1AEC ON chill_person_person (updatedBy_id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP CONSTRAINT FK_BF210A143174800F');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP CONSTRAINT FK_BF210A1465FF1AEC');
|
||||
$this->addSql('DROP INDEX IDX_BF210A143174800F');
|
||||
$this->addSql('DROP INDEX IDX_BF210A1465FF1AEC');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP createdAt');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP updatedAt');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP createdBy_id');
|
||||
$this->addSql('ALTER TABLE chill_person_person DROP updatedBy_id');
|
||||
$this->addSql('COMMENT ON COLUMN chill_person_person.deathdate IS NULL');
|
||||
}
|
||||
}
|
@ -10,6 +10,8 @@ First name or Last name: Prénom ou nom
|
||||
id: identifiant
|
||||
Birthdate: 'Date de naissance'
|
||||
birthdate: date de naissance
|
||||
deathdate: date de décès
|
||||
Date of death: Date de décès
|
||||
'Date of birth': 'Date de naissance'
|
||||
dateOfBirth: date de naissance
|
||||
dateofbirth: date de naissance
|
||||
@ -21,6 +23,7 @@ nationality: nationalité
|
||||
'Without nationality': 'Sans nationalité'
|
||||
Gender: Genre
|
||||
gender: genre
|
||||
Gender comment: Remarque sur le genre
|
||||
'Creation date': 'Date d''ouverture'
|
||||
'Not given': 'Non renseigné'
|
||||
'Place of birth': 'Lieu de naissance'
|
||||
@ -30,16 +33,22 @@ placeOfBirth: lieu de naissance
|
||||
countryOfBirth: 'Pays de naissance'
|
||||
'Unknown country of birth': 'Pays inconnu'
|
||||
'Marital status': 'État civil'
|
||||
Date of last marital status change: État civil depuis le
|
||||
Comment on the marital status: Commentaires sur l'état civil
|
||||
'Number of children': 'Nombre d''enfants'
|
||||
'{0} No child|{1} One child | ]1,Inf] %nb% children': '{0} Aucun enfant|{1} Un enfant | ]1,Inf] %nb% enfants'
|
||||
'National number': 'Numéro national'
|
||||
Email: 'Courrier électronique'
|
||||
Accept emails ?: Accepte les courriels?
|
||||
Accept emails: Peut être contacté par email
|
||||
Address: Adresse
|
||||
Memo: Mémo
|
||||
Phonenumber: 'Numéro de téléphone'
|
||||
phonenumber: numéro de téléphone
|
||||
Mobilenumber: 'Numéro de téléphone portable'
|
||||
mobilenumber: numéro de téléphone portable
|
||||
Accept short text message ?: Accepte les SMS?
|
||||
Accept short text message: Accepte les SMS
|
||||
Other phonenumber: Autre numéro de téléphone
|
||||
Description: description
|
||||
Add new phone: Ajouter un numéro de téléphone
|
||||
|
Loading…
x
Reference in New Issue
Block a user