mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Merge remote-tracking branch 'origin/master' into features/edit-accompanying-period-social-work
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user