mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-02 21:13:57 +00:00
Add person alt names in list & view
This commit is contained in:
@@ -35,6 +35,8 @@ use Chill\PersonBundle\Security\Authorization\PersonVoter;
|
||||
use Chill\PersonBundle\Search\SimilarPersonMatcher;
|
||||
use Symfony\Component\Translation\TranslatorInterface;
|
||||
use Chill\MainBundle\Search\SearchProvider;
|
||||
use Chill\PersonBundle\Repository\PersonRepository;
|
||||
use Chill\PersonBundle\Config\ConfigPersonAltNamesHelper;
|
||||
|
||||
class PersonController extends Controller
|
||||
{
|
||||
@@ -56,14 +58,31 @@ class PersonController extends Controller
|
||||
*/
|
||||
protected $eventDispatcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var PersonRepository;
|
||||
*/
|
||||
protected $personRepository;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var ConfigPersonAltNamesHelper
|
||||
*/
|
||||
protected $configPersonAltNameHelper;
|
||||
|
||||
public function __construct(
|
||||
SimilarPersonMatcher $similarPersonMatcher,
|
||||
TranslatorInterface $translator,
|
||||
EventDispatcherInterface $eventDispatcher
|
||||
EventDispatcherInterface $eventDispatcher,
|
||||
PersonRepository $personRepository,
|
||||
ConfigPersonAltNamesHelper $configPersonAltNameHelper
|
||||
|
||||
) {
|
||||
$this->similarPersonMatcher = $similarPersonMatcher;
|
||||
$this->translator = $translator;
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
$this->configPersonAltNameHelper = $configPersonAltNameHelper;
|
||||
$this->personRepository = $personRepository;
|
||||
}
|
||||
|
||||
public function getCFGroup()
|
||||
@@ -97,8 +116,11 @@ class PersonController extends Controller
|
||||
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $event);
|
||||
|
||||
return $this->render('ChillPersonBundle:Person:view.html.twig',
|
||||
array("person" => $person,
|
||||
"cFGroup" => $this->getCFGroup()));
|
||||
array(
|
||||
"person" => $person,
|
||||
"cFGroup" => $this->getCFGroup(),
|
||||
"alt_names" => $this->configPersonAltNameHelper->getChoices(),
|
||||
));
|
||||
}
|
||||
|
||||
public function editAction($person_id)
|
||||
@@ -373,10 +395,7 @@ class PersonController extends Controller
|
||||
*/
|
||||
private function _getPerson($id)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$person = $em->getRepository('ChillPersonBundle:Person')
|
||||
->find($id);
|
||||
$person = $this->personRepository->find($id);
|
||||
|
||||
return $person;
|
||||
}
|
||||
|
Reference in New Issue
Block a user