wip render box person thirdparty display bloc

This commit is contained in:
2021-07-27 23:15:52 +02:00
parent 89dfea74b3
commit df3d32c653
12 changed files with 412 additions and 264 deletions

View File

@@ -2,7 +2,7 @@
/*
* Chill is a software for social workers
*
* Copyright (C) 2014-2020 , Champs Libres Cooperative SCRLFS,
* Copyright (C) 2014-2020 , Champs Libres Cooperative SCRLFS,
* <http://www.champs-libres.coop>
*
* This program is free software: you can redistribute it and/or modify
@@ -25,7 +25,7 @@ use Chill\ThirdPartyBundle\Entity\ThirdParty;
use Symfony\Bridge\Twig\TwigEngine;
/**
*
*
*
*/
class ThirdPartyRender extends AbstractChillEntityRender
@@ -35,37 +35,36 @@ class ThirdPartyRender extends AbstractChillEntityRender
* @var TwigEngine
*/
protected $templating;
public function __construct(TwigEngine $templating)
{
$this->templating = $templating;
}
/**
*
*
* @param ThirdParty $entity
* @param array $options
* @return string
*/
public function renderBox($entity, array $options): string
{
$params = \array_merge(
[ 'with_valid_from' => true ],
$options
);
return
$this->getDefaultOpeningBox('_3party').
$this->templating->render('@ChillThirdParty/ThirdParty/_render.html.twig', [
'contact' => $entity,
'options' => $params
$this->templating->render('@ChillThirdParty/Entity/thirdparty.html.twig', [
'thirdparty' => $entity,
'with_valid_from' => $options['with_valid_from'] ?? true,
'addLink' => $options['addLink'] ?? false,
'addEntity' => $options['addEntity'] ?? false,
'addInfo' => $options['addInfo'] ?? false,
'display' => $options['display'] ?? 'raw',
'options' => $options
]).
$this->getDefaultClosingBox();
}
/**
*
*
* @param ThirdParty $entity
* @param array $options
* @return string