mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Merge branch 'master' of gitlab.com:Chill-Projet/chill-bundles
This commit is contained in:
@@ -12,6 +12,8 @@ declare(strict_types=1);
|
||||
namespace Chill\PersonBundle\Entity;
|
||||
|
||||
use ArrayIterator;
|
||||
use Chill\BudgetBundle\Entity\Charge;
|
||||
use Chill\BudgetBundle\Entity\Resource;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackCreationInterface;
|
||||
use Chill\MainBundle\Doctrine\Model\TrackUpdateInterface;
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
@@ -158,6 +160,22 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
*/
|
||||
private $birthdate;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity=Charge::class,
|
||||
* mappedBy="person"
|
||||
* )
|
||||
*/
|
||||
private Collection $budgetCharges;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(
|
||||
* targetEntity=Resource::class,
|
||||
* mappedBy="person"
|
||||
* )
|
||||
*/
|
||||
private Collection $budgetResources;
|
||||
|
||||
/**
|
||||
* The person's center.
|
||||
*
|
||||
@@ -501,6 +519,8 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
$this->maritalStatusComment = new CommentEmbeddable();
|
||||
$this->periodLocatedOn = new ArrayCollection();
|
||||
$this->accompanyingPeriodRequested = new ArrayCollection();
|
||||
$this->budgetResources = new ArrayCollection();
|
||||
$this->budgetCharges = new ArrayCollection();
|
||||
$this->resources = new ArrayCollection();
|
||||
}
|
||||
|
||||
@@ -525,20 +545,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function addAddress(Address $address)
|
||||
public function addAddress(Address $address): self
|
||||
{
|
||||
$this->addresses[] = $address;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function addAltName(PersonAltName $altName)
|
||||
public function addAltName(PersonAltName $altName): self
|
||||
{
|
||||
if (false === $this->altNames->contains($altName)) {
|
||||
$this->altNames->add($altName);
|
||||
@@ -548,6 +562,20 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addBudgetCharge(Charge $budgetCharge): self
|
||||
{
|
||||
$this->budgetCharges[] = $budgetCharge;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addBudgetResource(Resource $budgetResource): self
|
||||
{
|
||||
$this->budgetResources[] = $budgetResource;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addHouseholdParticipation(HouseholdMember $member): self
|
||||
{
|
||||
$this->householdParticipations[] = $member;
|
||||
@@ -639,8 +667,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
*
|
||||
* Used in template, to find the participation when iterating on a list
|
||||
* of period.
|
||||
*
|
||||
* @return AccompanyingPeriodParticipation
|
||||
*/
|
||||
public function findParticipationForPeriod(AccompanyingPeriod $period): ?AccompanyingPeriodParticipation
|
||||
{
|
||||
@@ -847,32 +873,33 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this->altNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get birthdate.
|
||||
*
|
||||
* @return DateTime
|
||||
*/
|
||||
public function getBirthdate()
|
||||
public function getBirthdate(): ?DateTime
|
||||
{
|
||||
return $this->birthdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get center.
|
||||
*
|
||||
* @return Center
|
||||
* @return Collection|BudgetCharges[]
|
||||
*/
|
||||
public function getCenter()
|
||||
public function getBudgetCharges(): Collection
|
||||
{
|
||||
return $this->budgetCharges;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection|BudgetResources[]
|
||||
*/
|
||||
public function getBudgetResources(): Collection
|
||||
{
|
||||
return $this->budgetResources;
|
||||
}
|
||||
|
||||
public function getCenter(): ?Center
|
||||
{
|
||||
return $this->center;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cFData.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getCFData()
|
||||
public function getCFData(): ?array
|
||||
{
|
||||
if (null === $this->cFData) {
|
||||
$this->cFData = [];
|
||||
@@ -881,32 +908,17 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this->cFData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get civility.
|
||||
*
|
||||
* @return Civility
|
||||
*/
|
||||
public function getCivility()
|
||||
public function getCivility(): ?Civility
|
||||
{
|
||||
return $this->civility;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get contactInfo.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getcontactInfo()
|
||||
public function getcontactInfo(): ?string
|
||||
{
|
||||
return $this->contactInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get countryOfBirth.
|
||||
*
|
||||
* @return Chill\MainBundle\Entity\Country
|
||||
*/
|
||||
public function getCountryOfBirth()
|
||||
public function getCountryOfBirth(): ?Country
|
||||
{
|
||||
return $this->countryOfBirth;
|
||||
}
|
||||
@@ -1050,22 +1062,12 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this->deathdate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get email.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEmail()
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get firstName.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFirstName()
|
||||
public function getFirstName(): string
|
||||
{
|
||||
return $this->firstName;
|
||||
}
|
||||
@@ -1075,17 +1077,12 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this->fullnameCanonical;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get gender.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getGender()
|
||||
public function getGender(): ?string
|
||||
{
|
||||
return $this->gender;
|
||||
}
|
||||
|
||||
public function getGenderComment(): CommentEmbeddable
|
||||
public function getGenderComment(): ?CommentEmbeddable
|
||||
{
|
||||
return $this->genderComment;
|
||||
}
|
||||
@@ -1190,22 +1187,12 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this->getCurrentPersonAddress();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get lastName.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getLastName()
|
||||
public function getLastName(): string
|
||||
{
|
||||
return $this->lastName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get maritalStatus.
|
||||
*
|
||||
* @return MaritalStatus
|
||||
*/
|
||||
public function getMaritalStatus()
|
||||
public function getMaritalStatus(): ?MaritalStatus
|
||||
{
|
||||
return $this->maritalStatus;
|
||||
}
|
||||
@@ -1220,12 +1207,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this->maritalStatusDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get memo.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMemo()
|
||||
public function getMemo(): ?string
|
||||
{
|
||||
return $this->memo;
|
||||
}
|
||||
@@ -1235,11 +1217,6 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this->mobilenumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get nationality.
|
||||
*
|
||||
* @return Country
|
||||
*/
|
||||
public function getNationality(): ?Country
|
||||
{
|
||||
return $this->nationality;
|
||||
@@ -1300,12 +1277,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this->phonenumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get placeOfBirth.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPlaceOfBirth()
|
||||
public function getPlaceOfBirth(): ?string
|
||||
{
|
||||
return $this->placeOfBirth;
|
||||
}
|
||||
@@ -1464,10 +1436,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
$this->addresses->removeElement($address);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function removeAltName(PersonAltName $altName)
|
||||
public function removeAltName(PersonAltName $altName): self
|
||||
{
|
||||
if ($this->altNames->contains($altName)) {
|
||||
$altName->setPerson(null);
|
||||
@@ -1477,10 +1446,21 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function removeOtherPhoneNumber(PersonPhone $otherPhoneNumber)
|
||||
public function removeBudgetCharge(Charge $budgetCharge): self
|
||||
{
|
||||
$this->budgetCharges->removeElement($budgetCharge);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeBudgetResource(Resource $budgetResource): self
|
||||
{
|
||||
$this->budgetResources->removeElement($budgetResource);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeOtherPhoneNumber(PersonPhone $otherPhoneNumber): self
|
||||
{
|
||||
if ($this->otherPhoneNumbers->contains($otherPhoneNumber)) {
|
||||
$this->otherPhoneNumbers->removeElement($otherPhoneNumber);
|
||||
@@ -1503,10 +1483,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setAltNames(Collection $altNames)
|
||||
public function setAltNames(Collection $altNames): self
|
||||
{
|
||||
$this->altNames = $altNames;
|
||||
|
||||
@@ -1514,25 +1491,16 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
}
|
||||
|
||||
/**
|
||||
* Set birthdate.
|
||||
*
|
||||
* @param DateTime $birthdate
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public function setBirthdate($birthdate)
|
||||
public function setBirthdate($birthdate): self
|
||||
{
|
||||
$this->birthdate = $birthdate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the center.
|
||||
*
|
||||
* @return \Chill\PersonBundle\Entity\Person
|
||||
*/
|
||||
public function setCenter(Center $center)
|
||||
public function setCenter(Center $center): self
|
||||
{
|
||||
$this->center = $center;
|
||||
|
||||
@@ -1540,41 +1508,23 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cFData.
|
||||
*
|
||||
* @param array $cFData
|
||||
*
|
||||
* @return Report
|
||||
*/
|
||||
public function setCFData($cFData)
|
||||
public function setCFData(?array $cFData)
|
||||
{
|
||||
$this->cFData = $cFData;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set civility.
|
||||
*
|
||||
* @param Civility $civility
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public function setCivility(?Civility $civility = null)
|
||||
public function setCivility(?Civility $civility = null): self
|
||||
{
|
||||
$this->civility = $civility;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set contactInfo.
|
||||
*
|
||||
* @param string $contactInfo
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public function setcontactInfo($contactInfo)
|
||||
public function setcontactInfo($contactInfo): self
|
||||
{
|
||||
if (null === $contactInfo) {
|
||||
$contactInfo = '';
|
||||
@@ -1585,14 +1535,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set countryOfBirth.
|
||||
*
|
||||
* @param Chill\MainBundle\Entity\Country $countryOfBirth
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public function setCountryOfBirth(?Country $countryOfBirth = null)
|
||||
public function setCountryOfBirth(?Country $countryOfBirth = null): self
|
||||
{
|
||||
$this->countryOfBirth = $countryOfBirth;
|
||||
|
||||
@@ -1620,14 +1563,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set email.
|
||||
*
|
||||
* @param string $email
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public function setEmail($email)
|
||||
public function setEmail(?string $email): self
|
||||
{
|
||||
if (null === $email) {
|
||||
$email = '';
|
||||
@@ -1638,35 +1574,21 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set firstName.
|
||||
*
|
||||
* @param string $firstName
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public function setFirstName($firstName)
|
||||
public function setFirstName(string $firstName): self
|
||||
{
|
||||
$this->firstName = $firstName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setFullnameCanonical($fullnameCanonical): Person
|
||||
public function setFullnameCanonical($fullnameCanonical): self
|
||||
{
|
||||
$this->fullnameCanonical = $fullnameCanonical;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set gender.
|
||||
*
|
||||
* @param string $gender
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public function setGender($gender)
|
||||
public function setGender(?string $gender): self
|
||||
{
|
||||
$this->gender = $gender;
|
||||
|
||||
@@ -1680,28 +1602,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set lastName.
|
||||
*
|
||||
* @param string $lastName
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public function setLastName($lastName)
|
||||
public function setLastName(string $lastName): self
|
||||
{
|
||||
$this->lastName = $lastName;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set maritalStatus.
|
||||
*
|
||||
* @param MaritalStatus $maritalStatus
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public function setMaritalStatus(?MaritalStatus $maritalStatus = null)
|
||||
public function setMaritalStatus(?MaritalStatus $maritalStatus = null): self
|
||||
{
|
||||
$this->maritalStatus = $maritalStatus;
|
||||
|
||||
@@ -1722,14 +1630,7 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set memo.
|
||||
*
|
||||
* @param string $memo
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public function setMemo($memo)
|
||||
public function setMemo(?string $memo): self
|
||||
{
|
||||
if (null === $memo) {
|
||||
$memo = '';
|
||||
@@ -1742,21 +1643,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setMobilenumber(?PhoneNumber $mobilenumber)
|
||||
public function setMobilenumber(?PhoneNumber $mobilenumber): self
|
||||
{
|
||||
$this->mobilenumber = $mobilenumber;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set nationality.
|
||||
*
|
||||
* @param Chill\MainBundle\Entity\Country $nationality
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public function setNationality(?Country $nationality = null)
|
||||
public function setNationality(?Country $nationality = null): self
|
||||
{
|
||||
$this->nationality = $nationality;
|
||||
|
||||
@@ -1770,31 +1664,21 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function setOtherPhoneNumbers(Collection $otherPhoneNumbers)
|
||||
public function setOtherPhoneNumbers(Collection $otherPhoneNumbers): self
|
||||
{
|
||||
$this->otherPhoneNumbers = $otherPhoneNumbers;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setPhonenumber(?PhoneNumber $phonenumber)
|
||||
public function setPhonenumber(?PhoneNumber $phonenumber): self
|
||||
{
|
||||
$this->phonenumber = $phonenumber;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set placeOfBirth.
|
||||
*
|
||||
* @param string $placeOfBirth
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public function setPlaceOfBirth($placeOfBirth)
|
||||
public function setPlaceOfBirth(?string $placeOfBirth): self
|
||||
{
|
||||
if (null === $placeOfBirth) {
|
||||
$placeOfBirth = '';
|
||||
@@ -1806,13 +1690,9 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
}
|
||||
|
||||
/**
|
||||
* Set spokenLanguages.
|
||||
*
|
||||
* @param type $spokenLanguages
|
||||
*
|
||||
* @return Person
|
||||
*/
|
||||
public function setSpokenLanguages($spokenLanguages)
|
||||
public function setSpokenLanguages($spokenLanguages): self
|
||||
{
|
||||
$this->spokenLanguages = $spokenLanguages;
|
||||
|
||||
|
@@ -33,10 +33,7 @@ class PersonMenuBuilder implements LocalMenuBuilderInterface
|
||||
*/
|
||||
protected $showAccompanyingPeriod;
|
||||
|
||||
/**
|
||||
* @var TranslatorInterface
|
||||
*/
|
||||
protected $translator;
|
||||
protected TranslatorInterface $translator;
|
||||
|
||||
private Security $security;
|
||||
|
||||
|
@@ -13,7 +13,6 @@ namespace Chill\PersonBundle\Menu;
|
||||
|
||||
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
||||
use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use Doctrine\ORM\Query\Parameter;
|
||||
use Knp\Menu\MenuItem;
|
||||
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
@@ -26,10 +25,10 @@ class SectionMenuBuilder implements LocalMenuBuilderInterface
|
||||
{
|
||||
protected AuthorizationCheckerInterface $authorizationChecker;
|
||||
|
||||
protected TranslatorInterface $translator;
|
||||
|
||||
protected ParameterBagInterface $parameterBag;
|
||||
|
||||
protected TranslatorInterface $translator;
|
||||
|
||||
/**
|
||||
* SectionMenuBuilder constructor.
|
||||
*/
|
||||
|
@@ -176,6 +176,47 @@ div[class*='activity-'] {
|
||||
}
|
||||
}
|
||||
|
||||
div[class*='budget-'] {
|
||||
div.dashboard,
|
||||
h4.badge-title,
|
||||
h3.badge-title,
|
||||
h2.badge-title {
|
||||
span.title_label {
|
||||
// Calculate same color then border:groove
|
||||
&_resource {
|
||||
background-color: shade-color($budget-resource-color, 34%);
|
||||
}
|
||||
&_charge {
|
||||
background-color: shade-color($budget-charge-color, 34%);
|
||||
}
|
||||
h3 {
|
||||
color: $white;
|
||||
}
|
||||
}
|
||||
span.title_action {
|
||||
&_resource {
|
||||
@include dashboard_like_badge($budget-resource-color);
|
||||
}
|
||||
&_charge {
|
||||
@include dashboard_like_badge($budget-charge-color);
|
||||
}
|
||||
}
|
||||
span.title_label {
|
||||
div.duration {
|
||||
font-size: 70%;
|
||||
font-weight: 500;
|
||||
p {
|
||||
margin-bottom: 0;
|
||||
text-align: right;
|
||||
abbr {
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Pill badge by entity
|
||||
*/
|
||||
|
@@ -137,7 +137,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
saveFormOnTheFly(payload) {
|
||||
console.log('saveFormOnTheFly: type', payload.type, ', data', payload.data);
|
||||
// console.log('saveFormOnTheFly: type', payload.type, ', data', payload.data);
|
||||
payload.target = 'resource';
|
||||
|
||||
let body = { type: payload.type };
|
||||
@@ -167,13 +167,19 @@ export default {
|
||||
})
|
||||
}
|
||||
else if (payload.type === 'thirdparty') {
|
||||
console.log('data', payload.data)
|
||||
// console.log('data', payload.data)
|
||||
body.firstname = payload.data.firstname;
|
||||
body.name = payload.data.name;
|
||||
body.email = payload.data.email;
|
||||
body.telephone = payload.data.telephone;
|
||||
body.civility = payload.data.civility;
|
||||
body.profession = payload.data.profession;
|
||||
body.address = payload.data.address ? { id: payload.data.address.address_id } : null;
|
||||
if (null !== payload.data.civility) {
|
||||
body.civility = {type: 'chill_main_civility', id: payload.data.civility.id};
|
||||
}
|
||||
if (null !== payload.data.profession) {
|
||||
body.profession = {type: 'third_party_profession', id: payload.data.profession.id};
|
||||
}
|
||||
// console.log('body', body);
|
||||
|
||||
makeFetch('PATCH', `/api/1.0/thirdparty/thirdparty/${payload.data.id}.json`, body)
|
||||
.then(response => {
|
||||
|
@@ -67,17 +67,14 @@
|
||||
<div class="flex-table">
|
||||
<div class="item-bloc" v-for="(d, i) in evaluation.documents" :key="d.id">
|
||||
<div class="item-row">
|
||||
<div class="input-group input-group-lg mb-3">
|
||||
<div>
|
||||
<input
|
||||
class="form-control"
|
||||
style="font-weight: bold;"
|
||||
type="text"
|
||||
:value="d.title"
|
||||
:id="d.id"
|
||||
:data-key="i"
|
||||
@input="onInputDocumentTitle"/>
|
||||
</div>
|
||||
<div class="input-group input-group-lg mb-3">
|
||||
<input
|
||||
class="form-control document-title"
|
||||
type="text"
|
||||
:value="d.title"
|
||||
:id="d.id"
|
||||
:data-key="i"
|
||||
@input="onInputDocumentTitle"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-row">
|
||||
@@ -337,3 +334,10 @@ export default {
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
input.document-title{
|
||||
font-weight: bold;
|
||||
font-size: 1rem;
|
||||
}
|
||||
</style>
|
@@ -113,7 +113,18 @@
|
||||
</template>
|
||||
</modal>
|
||||
</teleport>
|
||||
|
||||
<ul class="record_actions sticky-form-buttons">
|
||||
<li>
|
||||
<add-persons
|
||||
buttonTitle="visgraph.add_person"
|
||||
modalTitle="visgraph.add_person"
|
||||
v-bind:key="addPersons.key"
|
||||
v-bind:options="addPersons.options"
|
||||
@addNewPersons="addNewPersons"
|
||||
ref="addPersons">
|
||||
</add-persons>
|
||||
</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -124,12 +135,14 @@ import VueMultiselect from 'vue-multiselect'
|
||||
import { getRelationsList, postRelationship, patchRelationship, deleteRelationship } from "./api"
|
||||
import { splitId, getAge } from "./vis-network"
|
||||
import { visMessages } from "./i18n";
|
||||
import AddPersons from 'ChillPersonAssets/vuejs/_components/AddPersons.vue';
|
||||
|
||||
export default {
|
||||
name: "App",
|
||||
components: {
|
||||
Modal,
|
||||
VueMultiselect
|
||||
VueMultiselect,
|
||||
AddPersons
|
||||
},
|
||||
props: ['household_id'],
|
||||
data() {
|
||||
@@ -159,6 +172,14 @@ export default {
|
||||
},
|
||||
canvas: null,
|
||||
link: null,
|
||||
addPersons: {
|
||||
key: 'filiation',
|
||||
options: {
|
||||
type: ['person'],
|
||||
priority: null,
|
||||
uniq: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -235,12 +256,28 @@ export default {
|
||||
this.initGraph()
|
||||
this.listenOnGraph()
|
||||
this.getRelationsList()
|
||||
console.log(this.persons);
|
||||
|
||||
this.canvas = document.getElementById('visgraph').querySelector('canvas')
|
||||
this.link = document.getElementById('exportCanvasBtn')
|
||||
},
|
||||
methods: {
|
||||
|
||||
addNewPersons({ selected, modal }) {
|
||||
// console.log('@@@ CLICK button addNewPersons', selected);
|
||||
selected.forEach(function(item) {
|
||||
this.$store.dispatch('addMorePerson', item.result)
|
||||
.catch(({name, violations}) => {
|
||||
if (name === 'ValidationException' || name === 'AccessException') {
|
||||
violations.forEach((violation) => this.$toast.open({message: violation}));
|
||||
} else {
|
||||
this.$toast.open({message: violations})
|
||||
}
|
||||
});
|
||||
}, this
|
||||
);
|
||||
this.$refs.addPersons.resetSearch(); // to cast child method
|
||||
modal.showModal = false;
|
||||
},
|
||||
initGraph() {
|
||||
this.container = document.getElementById('visgraph')
|
||||
// Instanciate vis objects in separate window variables, see vis-network.js
|
||||
|
@@ -1,5 +1,11 @@
|
||||
const visMessages = {
|
||||
fr: {
|
||||
add_persons: {
|
||||
title: "Ajouter des usagers",
|
||||
suggested_counter: "Pas de résultats | 1 résultat | {count} résultats",
|
||||
selected_counter: " 1 sélectionné | {count} sélectionnés",
|
||||
search_some_persons: "Rechercher des personnes..",
|
||||
},
|
||||
visgraph: {
|
||||
Course: 'Parcours',
|
||||
Household: 'Ménage',
|
||||
@@ -21,12 +27,48 @@ const visMessages = {
|
||||
between: "entre",
|
||||
and: "et",
|
||||
add_link: "Créer un lien de filiation",
|
||||
add_person: "Ajouter une personne",
|
||||
create_link_help: "Pour créer un lien de filiation, cliquez d'abord sur un usager, puis sur un second ; précisez ensuite la nature du lien dans le formulaire d'édition.",
|
||||
refresh: "Rafraîchir",
|
||||
screenshot: "Prendre une photo",
|
||||
choose_relation: "Choisissez le lien de parenté",
|
||||
relationship_household: "Filiation du ménage",
|
||||
},
|
||||
item: {
|
||||
type_person: "Usager",
|
||||
type_user: "TMS",
|
||||
type_thirdparty: "Tiers professionnel",
|
||||
type_household: "Ménage"
|
||||
},
|
||||
person: {
|
||||
firstname: "Prénom",
|
||||
lastname: "Nom",
|
||||
born: (ctx) => {
|
||||
if (ctx.gender === 'man') {
|
||||
return 'Né le';
|
||||
} else if (ctx.gender === 'woman') {
|
||||
return 'Née le';
|
||||
} else {
|
||||
return 'Né·e le';
|
||||
}
|
||||
},
|
||||
center_id: "Identifiant du centre",
|
||||
center_type: "Type de centre",
|
||||
center_name: "Territoire", // vendée
|
||||
phonenumber: "Téléphone",
|
||||
mobilenumber: "Mobile",
|
||||
altnames: "Autres noms",
|
||||
email: "Courriel",
|
||||
gender: {
|
||||
title: "Genre",
|
||||
placeholder: "Choisissez le genre de l'usager",
|
||||
woman: "Féminin",
|
||||
man: "Masculin",
|
||||
neuter: "Neutre, non binaire",
|
||||
undefined: "Non renseigné"
|
||||
}
|
||||
},
|
||||
error_only_one_person: "Une seule personne peut être sélectionnée !",
|
||||
edit: 'Éditer',
|
||||
del: 'Supprimer',
|
||||
back: 'Revenir en arrière',
|
||||
|
@@ -117,10 +117,27 @@ const store = createStore({
|
||||
return group
|
||||
},
|
||||
|
||||
getPersonById: (state) => (person_id) => {
|
||||
return state.persons.find(p => p._id === person_id);
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
mutations: {
|
||||
addPerson(state, [person, options]) {
|
||||
if (!'_id' in person) {
|
||||
person._id = person.id
|
||||
person.id = `person_${person.id}`
|
||||
}
|
||||
|
||||
let existing = state.persons.find(p => p._id === person._id);
|
||||
|
||||
if (typeof existing !== 'undefined') {
|
||||
if (!options.folded && person.folded) {
|
||||
// unfold
|
||||
}
|
||||
return;
|
||||
}
|
||||
let age = getAge(person)
|
||||
age = (age === '')? '' : ' - ' + age
|
||||
|
||||
@@ -232,6 +249,9 @@ const store = createStore({
|
||||
|
||||
//// unfold
|
||||
unfoldPerson(state, person) {
|
||||
if (!person.folded) {
|
||||
return;
|
||||
}
|
||||
//console.log('unfoldPerson', person)
|
||||
person.label = person._label
|
||||
delete person._label
|
||||
@@ -261,6 +281,31 @@ const store = createStore({
|
||||
dispatch('fetchInfoForPerson', person)
|
||||
},
|
||||
|
||||
/**
|
||||
* Add a person manually
|
||||
*
|
||||
* @param commit
|
||||
* @param dispatch
|
||||
* @param person
|
||||
*/
|
||||
addMorePerson({ commit, dispatch, getters }, person) {
|
||||
let nodeId = `person_${person.id}`;
|
||||
if (getters.isPersonLoaded(person.id)) {
|
||||
if (getters.isExcludedNode(nodeId)) {
|
||||
commit('removeExcludedNode', nodeId);
|
||||
let p = getters.getPersonById(person.id);
|
||||
if (typeof p !== 'undefined') {
|
||||
commit('unfoldPerson', p);
|
||||
} else {
|
||||
throw 'a person loaded was not found';
|
||||
}
|
||||
commit('updateHack');
|
||||
}
|
||||
} else {
|
||||
return dispatch('addPerson', person);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 2) Fetch infos for this person (hub)
|
||||
* @param object
|
||||
@@ -287,7 +332,7 @@ const store = createStore({
|
||||
//console.log(' isHouseholdLoading ?', getters.isHouseholdLoading(person.current_household_id))
|
||||
if (! getters.isHouseholdLoading(person.current_household_id)) {
|
||||
commit('markHouseholdLoading', person.current_household_id)
|
||||
getHouseholdByPerson(person)
|
||||
return getHouseholdByPerson(person)
|
||||
.then(household => new Promise(resolve => {
|
||||
commit('addHousehold', household)
|
||||
// DISABLED: in init or expand loop, layer is uncheck when added
|
||||
@@ -295,7 +340,7 @@ const store = createStore({
|
||||
//commit('updateHack')
|
||||
dispatch('addLinkFromPersonsToHousehold', household)
|
||||
commit('updateHack')
|
||||
resolve()
|
||||
resolve();
|
||||
})
|
||||
).catch( () => {
|
||||
commit('unmarkHouseholdLoading', person.current_household_id)
|
||||
@@ -335,7 +380,7 @@ const store = createStore({
|
||||
* @param person
|
||||
*/
|
||||
fetchCoursesByPerson({ commit, dispatch }, person) {
|
||||
getCoursesByPerson(person)
|
||||
return getCoursesByPerson(person)
|
||||
.then(courses => new Promise(resolve => {
|
||||
dispatch('addCourses', courses)
|
||||
resolve()
|
||||
@@ -383,6 +428,8 @@ const store = createStore({
|
||||
dispatch('addMissingPerson', [p.person, course])
|
||||
}
|
||||
})
|
||||
|
||||
return Promise.resolve();
|
||||
},
|
||||
|
||||
/**
|
||||
|
@@ -164,14 +164,8 @@ const getGender = (gender) => {
|
||||
* @returns {string|null}
|
||||
*/
|
||||
const getAge = (person) => {
|
||||
if (person.birthdate) {
|
||||
let birthdate = new Date(person.birthdate.datetime)
|
||||
if (person.deathdate) {
|
||||
let deathdate = new Date(person.deathdate.datetime)
|
||||
return (deathdate.getFullYear() - birthdate.getFullYear()) + visMessages.fr.visgraph.years
|
||||
}
|
||||
let now = new Date()
|
||||
return (now.getFullYear() - birthdate.getFullYear()) + visMessages.fr.visgraph.years
|
||||
if (person.age) {
|
||||
return person.age + ' ' + visMessages.fr.visgraph.years;
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
@@ -24,11 +24,11 @@
|
||||
|
||||
<div class="form-floating mb-3">
|
||||
<input
|
||||
class="form-control form-control-lg"
|
||||
id="lastname"
|
||||
v-model="lastName"
|
||||
:placeholder="$t('person.lastname')"
|
||||
@change="checkErrors"
|
||||
class="form-control form-control-lg"
|
||||
id="lastname"
|
||||
v-model="lastName"
|
||||
:placeholder="$t('person.lastname')"
|
||||
@change="checkErrors"
|
||||
/>
|
||||
<label for="lastname">{{ $t('person.lastname') }}</label>
|
||||
</div>
|
||||
@@ -43,11 +43,11 @@
|
||||
|
||||
<div class="form-floating mb-3">
|
||||
<input
|
||||
class="form-control form-control-lg"
|
||||
id="firstname"
|
||||
v-model="firstName"
|
||||
:placeholder="$t('person.firstname')"
|
||||
@change="checkErrors"
|
||||
class="form-control form-control-lg"
|
||||
id="firstname"
|
||||
v-model="firstName"
|
||||
:placeholder="$t('person.firstname')"
|
||||
@change="checkErrors"
|
||||
/>
|
||||
<label for="firstname">{{ $t('person.firstname') }}</label>
|
||||
</div>
|
||||
@@ -62,10 +62,10 @@
|
||||
|
||||
<div v-for="(a, i) in config.altNames" :key="a.key" class="form-floating mb-3">
|
||||
<input
|
||||
class="form-control form-control-lg"
|
||||
:id="a.key"
|
||||
:value="personAltNamesLabels[i]"
|
||||
@input="onAltNameInput"
|
||||
class="form-control form-control-lg"
|
||||
:id="a.key"
|
||||
:value="personAltNamesLabels[i]"
|
||||
@input="onAltNameInput"
|
||||
/>
|
||||
<label :for="a.key">{{ a.labels.fr }}</label>
|
||||
</div>
|
||||
@@ -125,9 +125,9 @@
|
||||
</div>
|
||||
|
||||
<div class="alert alert-warning" v-if="errors.length">
|
||||
<ul>
|
||||
<li v-for="(e, i) in errors" :key="i">{{ e }}</li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li v-for="(e, i) in errors" :key="i">{{ e }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -238,13 +238,13 @@ export default {
|
||||
checkErrors(e) {
|
||||
this.errors = [];
|
||||
if (!this.person.lastName) {
|
||||
this.errors.push("Le nom ne doit pas être vide.");
|
||||
this.errors.push("Le nom ne doit pas être vide.");
|
||||
}
|
||||
if (!this.person.firstName) {
|
||||
this.errors.push("Le prénom ne doit pas être vide.");
|
||||
this.errors.push("Le prénom ne doit pas être vide.");
|
||||
}
|
||||
if (!this.person.gender) {
|
||||
this.errors.push("Le genre doit être renseigné");
|
||||
this.errors.push("Le genre doit être renseigné");
|
||||
}
|
||||
},
|
||||
loadData() {
|
||||
|
@@ -18,7 +18,7 @@
|
||||
{% block title page_title %}
|
||||
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
|
||||
<h1>{{ page_title }}</h1>
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
{% block title %}{{ 'Accompanying period list for person'|trans }}{% endblock title %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="person-accompanyingperiods">
|
||||
|
||||
<h1>{{ 'Accompanying period list'|trans }}</h1>
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
{% block title 'Re-Open a period'|trans %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
|
||||
<h1>{{ 'Re-Open a period'|trans }}</h1>
|
||||
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
{% block title 'Edit an address'|trans %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="address-edit">
|
||||
|
||||
{% block content %}
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
{% block title %}{{ 'Addresses history for %name%'|trans({ '%name%': person.firstName ~ ' ' ~ person.lastName } ) }}{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="person-address">
|
||||
|
||||
<h1>{{ 'Addresses history'|trans }}</h1>
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
{% block title %}{{ 'New address'|trans }}{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="address-new">
|
||||
|
||||
{% block content %}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
{% set person = entity.person %}
|
||||
{% set activeRouteKey = '' %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
{% embed '@ChillMain/CRUD/_delete_content.html.twig' %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
@@ -7,7 +7,7 @@
|
||||
{% include('@ChillMain/CRUD/_edit_title.html.twig') %}
|
||||
{% endblock title %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
{% embed '@ChillMain/CRUD/_edit_content.html.twig' %}
|
||||
{% endembed %}
|
||||
{% endblock %}
|
@@ -4,7 +4,7 @@
|
||||
|
||||
{% block title %}{{ ('crud.' ~ crud_name ~ '.index.title')|trans({'%crud_name%': crud_name}) }}{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
{% embed '@ChillPerson/CRUD/_index.html.twig' %}
|
||||
{% block add_new %}
|
||||
<li>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
{% embed('@ChillPerson/CRUD/_new_title.html.twig') %}{% endembed %}
|
||||
{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
{% embed '@ChillPerson/CRUD/_new_content.html.twig' %}
|
||||
{% block crud_content_header %}
|
||||
<h1>{{ ('crud.'~crud_name~'.title_new')|trans({'%person%': person|chill_entity_render_string }) }}</h1>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
{% include('@ChillPerson/CRUD/_view_title.html.twig') %}
|
||||
{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
{% embed '@ChillPerson/CRUD/_view_content.html.twig' %}
|
||||
{% block crud_content_header %}
|
||||
<h1>{{ ('crud.' ~ crud_name ~ '.title_view')|trans({'%person%': person|chill_entity_render_string }) }}</h1>
|
||||
|
@@ -20,7 +20,7 @@
|
||||
|
||||
{% block title %}{{ 'Update details for %name%'|trans({ '%name%': person|chill_entity_render_string } ) }}{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="person-edit">
|
||||
|
||||
<h1>{{ block('title') }}</h1>
|
||||
|
@@ -84,7 +84,7 @@
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="person-household">
|
||||
<h1>{{ 'household.Household history'|trans }}</h1>
|
||||
|
||||
|
@@ -25,7 +25,7 @@
|
||||
{% block layout_wvm_content %}
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-10 col-xxl">
|
||||
{% block personcontent %}{# block personcontent empty #}{% endblock %}
|
||||
{% block content %}{# block content empty #}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@@ -32,7 +32,7 @@ This view should receive those arguments:
|
||||
{% set edit_tmp_args = { 'form_path_args' : { 'person_id': person.id },
|
||||
'form_path_key' : 'chill_person_general_edit' } %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="person-view">
|
||||
|
||||
<div class="row">
|
||||
|
@@ -6,7 +6,7 @@
|
||||
' ' ~ person.lastName }}{% endblock %}
|
||||
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="person-duplicate">
|
||||
|
||||
<h1>{{ 'Désigner un dossier doublon'|trans }}</h1>
|
||||
|
@@ -5,7 +5,7 @@
|
||||
{% block title %}{{ 'Person duplicate'|trans|capitalize ~ ' ' ~ person.firstName|capitalize ~
|
||||
' ' ~ person.lastName }}{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="person-duplicate">
|
||||
|
||||
<h1>{{ title|default('Person duplicate')|trans }}</h1>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
{{ encore_entry_link_tags('mod_pickentity_type') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
|
||||
<h1 style="margin-bottom: 2rem;">{{ 'Add a person resource'|trans }}</h1>
|
||||
|
||||
@@ -22,4 +22,4 @@
|
||||
<h3 style="margin-bottom: 2rem;">{{ 'Add a person resource'|trans }}</h3>
|
||||
{% include "@ChillPerson/PersonResource/form.html.twig" %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
{% block title 'Remove resource'|trans %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
{{ include('@ChillMain/Util/confirmation_template.html.twig',
|
||||
{
|
||||
'title' : 'Remove resource'|trans,
|
||||
|
@@ -14,7 +14,7 @@
|
||||
|
||||
{% block title %}{{ 'edit resource'|trans|capitalize }}{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
|
||||
<h1 style="margin-bottom: 2rem;">{{ 'edit resource'|trans }}</h1>
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
{{ encore_entry_link_tags('mod_pickentity_type') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
|
||||
<h1>{{ 'List of resources'|trans }}</h1>
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
{% block title %}{{ 'Delete residential address'|trans }}{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="address-new">
|
||||
|
||||
<h1>{{ block('title') }}</h1>
|
||||
|
@@ -4,10 +4,9 @@
|
||||
|
||||
{% block title 'Edit a residential address'|trans %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="address-edit">
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ block('title') }}</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
@@ -45,7 +44,6 @@
|
||||
|
||||
{{ form_end(form) }}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
{% block title %}{{ 'Residential addresses history for %name%'|trans({ '%name%': person.firstName ~ ' ' ~ person.lastName } ) }}{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="person-address">
|
||||
|
||||
<h1>{{ 'Residential addresses history'|trans }}</h1>
|
||||
|
@@ -4,10 +4,9 @@
|
||||
|
||||
{% block title %}{{ 'New residential address'|trans }}{% endblock %}
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="address-new">
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ block('title') }}</h1>
|
||||
|
||||
{# TODO #}
|
||||
@@ -15,8 +14,6 @@
|
||||
{% include '@ChillPerson/ResidentialAddress/_form.html.twig' %}
|
||||
{% endblock %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
@@ -26,7 +26,7 @@ This view should receive those arguments:
|
||||
{% block title %}{{ 'Timeline for %name%'|trans({'%name%': person }) }}{% endblock %}
|
||||
|
||||
|
||||
{% block personcontent %}
|
||||
{% block content %}
|
||||
<div class="timeline">
|
||||
|
||||
{{ timeline|raw }}
|
||||
|
@@ -130,6 +130,14 @@ class AccompanyingPeriodVoter extends AbstractChillVoter implements ProvideRoleH
|
||||
return false;
|
||||
}
|
||||
|
||||
if (in_array($attribute, [
|
||||
self::SEE, self::SEE_DETAILS, self::EDIT
|
||||
])) {
|
||||
if ($subject->getUser() === $token->getUser()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (self::TOGGLE_CONFIDENTIAL === $attribute) {
|
||||
if (null !== $subject->getUser() && ($subject->getUser() === $token->getUser())) {
|
||||
return true;
|
||||
|
@@ -11,6 +11,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\Serializer\Normalizer;
|
||||
|
||||
use Chill\BudgetBundle\Service\Summary\SummaryBudget;
|
||||
use Chill\DocGeneratorBundle\Serializer\Helper\NormalizeNullValueHelper;
|
||||
use Chill\MainBundle\Entity\Address;
|
||||
use Chill\MainBundle\Entity\Civility;
|
||||
@@ -44,6 +45,8 @@ class PersonDocGenNormalizer implements
|
||||
|
||||
private RelationshipRepository $relationshipRepository;
|
||||
|
||||
private SummaryBudget $summaryBudget;
|
||||
|
||||
private TranslatableStringHelper $translatableStringHelper;
|
||||
|
||||
private TranslatorInterface $translator;
|
||||
@@ -52,12 +55,14 @@ class PersonDocGenNormalizer implements
|
||||
PersonRenderInterface $personRender,
|
||||
RelationshipRepository $relationshipRepository,
|
||||
TranslatorInterface $translator,
|
||||
TranslatableStringHelper $translatableStringHelper
|
||||
TranslatableStringHelper $translatableStringHelper,
|
||||
SummaryBudget $summaryBudget
|
||||
) {
|
||||
$this->personRender = $personRender;
|
||||
$this->relationshipRepository = $relationshipRepository;
|
||||
$this->translator = $translator;
|
||||
$this->translatableStringHelper = $translatableStringHelper;
|
||||
$this->summaryBudget = $summaryBudget;
|
||||
}
|
||||
|
||||
public function normalize($person, $format = null, array $context = [])
|
||||
@@ -127,6 +132,7 @@ class PersonDocGenNormalizer implements
|
||||
'docgen:expects' => Household::class,
|
||||
'docgen:person:with-household' => false,
|
||||
'docgen:person:with-relations' => false,
|
||||
'docgen:person:with-budget' => false,
|
||||
])
|
||||
);
|
||||
}
|
||||
@@ -139,10 +145,19 @@ class PersonDocGenNormalizer implements
|
||||
'docgen:person:with-household' => false,
|
||||
'docgen:person:with-relation' => false,
|
||||
'docgen:relationship:counterpart' => $person,
|
||||
'docgen:person:with-budget' => false,
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
if ($context['docgen:person:with-budget'] ?? false) {
|
||||
$data['budget']['person'] = $this->summaryBudget->getSummaryForPerson($person);
|
||||
|
||||
if ($context['docgen:person:with-household'] ?? false) {
|
||||
$data['budget']['household'] = $this->summaryBudget->getSummaryForHousehold($person->getCurrentHousehold());
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
@@ -191,6 +191,7 @@ class AccompanyingPeriodContext implements
|
||||
'groups' => 'docgen:read',
|
||||
'docgen:person:with-household' => true,
|
||||
'docgen:person:with-relations' => true,
|
||||
'docgen:person:with-budget' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@@ -114,7 +114,10 @@ class PersonContext implements DocGeneratorContextWithAdminFormInterface
|
||||
$data = array_merge($data, $this->baseContextData->getData());
|
||||
$data['person'] = $this->normalizer->normalize($entity, 'docgen', [
|
||||
'docgen:expects' => Person::class,
|
||||
'groups' => ['docgen:read', 'docgen:person:with-household', 'docgen:person:with-relations'],
|
||||
'groups' => ['docgen:read'],
|
||||
'docgen:person:with-household' => true,
|
||||
'docgen:person:with-relations' => true,
|
||||
'docgen:person:with-budget' => true,
|
||||
]);
|
||||
|
||||
return $data;
|
||||
|
@@ -67,6 +67,7 @@ household:
|
||||
Accompanying period: Parcours d'accompagnement
|
||||
Addresses: Historique adresse
|
||||
Relationship: Filiation
|
||||
Budget: Budget
|
||||
Household relationships: Filiations dans le ménage
|
||||
Current address: Adresse actuelle
|
||||
Household does not have any address currently: Le ménage n'a pas d'adresse renseignée actuellement
|
||||
|
@@ -496,6 +496,7 @@ Remove household composition: Supprimer composition familiale
|
||||
Are you sure you want to remove this composition?: Etes-vous sûr de vouloir supprimer cette composition familiale ?
|
||||
Concerns household n°%id%: Concerne le ménage n°%id%
|
||||
Composition: Composition
|
||||
Budget: Budget
|
||||
The composition has been successfully removed.: La composition a été supprimée.
|
||||
|
||||
# accompanying course work
|
||||
|
Reference in New Issue
Block a user