mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Testing to see what still works, minor changes
This commit is contained in:
parent
5a514cf2db
commit
67ae506bb5
@ -20,26 +20,18 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
|||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||||
|
|
||||||
use function get_class;
|
use function get_class;
|
||||||
|
|
||||||
abstract class AbstractElementController extends Controller
|
abstract class AbstractElementController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
protected LoggerInterface $chillMainLogger;
|
||||||
* @var LoggerInterface
|
|
||||||
*/
|
|
||||||
protected $chillMainLogger;
|
|
||||||
|
|
||||||
/**
|
protected EntityManagerInterface $em;
|
||||||
* @var EntityManagerInterface
|
|
||||||
*/
|
|
||||||
protected $em;
|
|
||||||
|
|
||||||
/**
|
protected TranslatorInterface $translator;
|
||||||
* @var TranslatorInterface
|
|
||||||
*/
|
|
||||||
protected $translator;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
EntityManagerInterface $em,
|
EntityManagerInterface $em,
|
||||||
@ -59,13 +51,11 @@ abstract class AbstractElementController extends Controller
|
|||||||
*
|
*
|
||||||
* @param mixed $template
|
* @param mixed $template
|
||||||
* @param mixed $flashMessage
|
* @param mixed $flashMessage
|
||||||
*
|
|
||||||
* @return \Symfony\Component\BrowserKit\Response
|
|
||||||
*/
|
*/
|
||||||
protected function _delete(AbstractElement $element, Request $request, $template, $flashMessage)
|
protected function _delete(AbstractElement $element, Request $request, $template, $flashMessage): Response
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted(BudgetElementVoter::DELETE, $element, 'You are not '
|
// $this->denyAccessUnlessGranted(BudgetElementVoter::DELETE, $element, 'You are not '
|
||||||
. 'allowed to delete this family membership');
|
// . 'allowed to delete this family membership');
|
||||||
|
|
||||||
$form = $this->createDeleteForm();
|
$form = $this->createDeleteForm();
|
||||||
|
|
||||||
@ -103,12 +93,10 @@ abstract class AbstractElementController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @param string $template
|
* @param string $template
|
||||||
* @param string $flashOnSuccess
|
* @param string $flashOnSuccess
|
||||||
*
|
|
||||||
* @return \Symfony\Component\HttpFoundation\Response
|
|
||||||
*/
|
*/
|
||||||
protected function _edit(AbstractElement $element, Request $request, $template, $flashOnSuccess)
|
protected function _edit(AbstractElement $element, Request $request, $template, $flashOnSuccess): Response
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted(BudgetElementVoter::UPDATE, $element);
|
// $this->denyAccessUnlessGranted(BudgetElementVoter::UPDATE, $element);
|
||||||
|
|
||||||
$form = $this->createForm($this->getType(), $element);
|
$form = $this->createForm($this->getType(), $element);
|
||||||
$form->add('submit', SubmitType::class);
|
$form->add('submit', SubmitType::class);
|
||||||
@ -139,11 +127,11 @@ abstract class AbstractElementController extends Controller
|
|||||||
*/
|
*/
|
||||||
protected function _new(Person $person, Request $request, $template, $flashMessageOnSuccess)
|
protected function _new(Person $person, Request $request, $template, $flashMessageOnSuccess)
|
||||||
{
|
{
|
||||||
/** @var \Chill\BudgetBundle\Entity\AbstractElement $element */
|
/** @var AbstractElement $element */
|
||||||
$element = $this->createNewElement()
|
$element = $this->createNewElement()
|
||||||
->setPerson($person);
|
->setPerson($person);
|
||||||
|
|
||||||
$this->denyAccessUnlessGranted(BudgetElementVoter::CREATE, $element);
|
// $this->denyAccessUnlessGranted(BudgetElementVoter::CREATE, $element);
|
||||||
|
|
||||||
$form = $this->createForm($this->getType(), $element);
|
$form = $this->createForm($this->getType(), $element);
|
||||||
$form->add('submit', SubmitType::class);
|
$form->add('submit', SubmitType::class);
|
||||||
@ -183,7 +171,7 @@ abstract class AbstractElementController extends Controller
|
|||||||
*/
|
*/
|
||||||
protected function _view(AbstractElement $element, $template)
|
protected function _view(AbstractElement $element, $template)
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted(BudgetElementVoter::SHOW, $element);
|
// $this->denyAccessUnlessGranted(BudgetElementVoter::SHOW, $element);
|
||||||
|
|
||||||
return $this->render($template, [
|
return $this->render($template, [
|
||||||
'element' => $element,
|
'element' => $element,
|
||||||
|
@ -68,7 +68,7 @@ class ElementController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function indexAction(Person $person)
|
public function indexAction(Person $person)
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted(BudgetElementVoter::SHOW, $person);
|
// $this->denyAccessUnlessGranted(BudgetElementVoter::SHOW, $person);
|
||||||
|
|
||||||
$charges = $this->em
|
$charges = $this->em
|
||||||
->getRepository(Charge::class)
|
->getRepository(Charge::class)
|
||||||
|
@ -16,6 +16,7 @@ use Chill\BudgetBundle\Form\ResourceType;
|
|||||||
use Chill\PersonBundle\Entity\Person;
|
use Chill\PersonBundle\Entity\Person;
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class ResourceController extends AbstractElementController
|
class ResourceController extends AbstractElementController
|
||||||
{
|
{
|
||||||
@ -24,8 +25,6 @@ class ResourceController extends AbstractElementController
|
|||||||
* "{_locale}/budget/resource/{id}/delete",
|
* "{_locale}/budget/resource/{id}/delete",
|
||||||
* name="chill_budget_resource_delete"
|
* name="chill_budget_resource_delete"
|
||||||
* )
|
* )
|
||||||
*
|
|
||||||
* @return \Symfony\Component\HttpFoundation\Response
|
|
||||||
*/
|
*/
|
||||||
public function deleteAction(Request $request, Resource $resource)
|
public function deleteAction(Request $request, Resource $resource)
|
||||||
{
|
{
|
||||||
@ -42,10 +41,8 @@ class ResourceController extends AbstractElementController
|
|||||||
* "{_locale}/budget/resource/{id}/edit",
|
* "{_locale}/budget/resource/{id}/edit",
|
||||||
* name="chill_budget_resource_edit"
|
* name="chill_budget_resource_edit"
|
||||||
* )
|
* )
|
||||||
*
|
|
||||||
* @return \Symfony\Component\HttpFoundation\Response
|
|
||||||
*/
|
*/
|
||||||
public function editAction(Request $request, Resource $resource)
|
public function editAction(Request $request, Resource $resource): Response
|
||||||
{
|
{
|
||||||
return $this->_edit(
|
return $this->_edit(
|
||||||
$resource,
|
$resource,
|
||||||
@ -60,10 +57,8 @@ class ResourceController extends AbstractElementController
|
|||||||
* "{_locale}/budget/resource/by-person/{id}/new",
|
* "{_locale}/budget/resource/by-person/{id}/new",
|
||||||
* name="chill_budget_resource_new"
|
* name="chill_budget_resource_new"
|
||||||
* )
|
* )
|
||||||
*
|
|
||||||
* @return \Symfony\Component\HttpFoundation\Response
|
|
||||||
*/
|
*/
|
||||||
public function newAction(Request $request, Person $person)
|
public function newAction(Request $request, Person $person): Response
|
||||||
{
|
{
|
||||||
return $this->_new(
|
return $this->_new(
|
||||||
$person,
|
$person,
|
||||||
@ -78,10 +73,8 @@ class ResourceController extends AbstractElementController
|
|||||||
* "{_locale}/budget/resource/{id}/view",
|
* "{_locale}/budget/resource/{id}/view",
|
||||||
* name="chill_budget_resource_view"
|
* name="chill_budget_resource_view"
|
||||||
* )
|
* )
|
||||||
*
|
|
||||||
* @return \Symfony\Component\HttpFoundation\Response
|
|
||||||
*/
|
*/
|
||||||
public function viewAction(Resource $resource)
|
public function viewAction(Resource $resource): Response
|
||||||
{
|
{
|
||||||
return $this->_view($resource, '@ChillBudget/Resource/view.html.twig');
|
return $this->_view($resource, '@ChillBudget/Resource/view.html.twig');
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\BudgetBundle\Entity;
|
namespace Chill\BudgetBundle\Entity;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Entity\Center;
|
||||||
use Chill\MainBundle\Entity\HasCenterInterface;
|
use Chill\MainBundle\Entity\HasCenterInterface;
|
||||||
use DateTimeImmutable;
|
use DateTimeImmutable;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
@ -58,7 +59,7 @@ class Charge extends AbstractElement implements HasCenterInterface
|
|||||||
$this->setStartDate(new DateTimeImmutable('today'));
|
$this->setStartDate(new DateTimeImmutable('today'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCenter(): \Chill\MainBundle\Entity\Center
|
public function getCenter(): ?Center
|
||||||
{
|
{
|
||||||
return $this->getPerson()->getCenter();
|
return $this->getPerson()->getCenter();
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Chill\BudgetBundle\Entity;
|
namespace Chill\BudgetBundle\Entity;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Entity\Center;
|
||||||
use Chill\MainBundle\Entity\HasCenterInterface;
|
use Chill\MainBundle\Entity\HasCenterInterface;
|
||||||
use DateTimeImmutable;
|
use DateTimeImmutable;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
@ -37,7 +38,7 @@ class Resource extends AbstractElement implements HasCenterInterface
|
|||||||
$this->setStartDate(new DateTimeImmutable('today'));
|
$this->setStartDate(new DateTimeImmutable('today'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCenter(): \Chill\MainBundle\Entity\Center
|
public function getCenter(): ?Center
|
||||||
{
|
{
|
||||||
return $this->getPerson()->getCenter();
|
return $this->getPerson()->getCenter();
|
||||||
}
|
}
|
||||||
|
@ -14,14 +14,14 @@
|
|||||||
<dd>{{ element.type|budget_element_type_display('charge') }}</dd>
|
<dd>{{ element.type|budget_element_type_display('charge') }}</dd>
|
||||||
|
|
||||||
<dt>{{ 'Amount'|trans }}</dt>
|
<dt>{{ 'Amount'|trans }}</dt>
|
||||||
<dd>{{ element.amount|localizedcurrency('EUR') }}</dd>
|
<dd>{{ element.amount|format_currency('EUR') }}</dd>
|
||||||
|
|
||||||
<dt>{{ 'Validity period'|trans }}</dt>
|
<dt>{{ 'Validity period'|trans }}</dt>
|
||||||
<dd>
|
<dd>
|
||||||
{% if element.endDate is not null %}
|
{% if element.endDate is not null %}
|
||||||
{{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': element.startDate|localizeddate('long', 'none'), '%endDate%': familyMember.endDate|localizeddate('long', 'none') } ) }}
|
{{ 'Valid since %startDate% until %endDate%'|trans( { '%startDate%': element.startDate|format_date('long'), '%endDate%': familyMember.endDate|format_date('long') } ) }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{{ 'Valid since %startDate%'|trans( { '%startDate%': element.startDate|localizeddate('long', 'none') } ) }}
|
{{ 'Valid since %startDate%'|trans( { '%startDate%': element.startDate|format_date('long') } ) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
@ -40,7 +40,7 @@
|
|||||||
<ul class="record_actions sticky-form-buttons">
|
<ul class="record_actions sticky-form-buttons">
|
||||||
<li class="cancel">
|
<li class="cancel">
|
||||||
<a href="{{ path("chill_budget_elements_index", { 'id': person.id } ) }}" class="btn btn-cancel">
|
<a href="{{ path("chill_budget_elements_index", { 'id': person.id } ) }}" class="btn btn-cancel">
|
||||||
{{ 'Back to the list'|trans }}
|
{{ 'Back to the list'|trans }}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), element) %}
|
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), element) %}
|
||||||
|
@ -3,8 +3,7 @@
|
|||||||
{% set activeRouteKey = '' %}
|
{% set activeRouteKey = '' %}
|
||||||
{% set title = 'Budget for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %}
|
{% set title = 'Budget for %name%'|trans({ '%name%' : person.firstName ~ " " ~ person.lastName } ) %}
|
||||||
{% block title title %}
|
{% block title title %}
|
||||||
|
|
||||||
|
|
||||||
{% set actualResources = [] %}
|
{% set actualResources = [] %}
|
||||||
{% set futureResources = [] %}
|
{% set futureResources = [] %}
|
||||||
{% set pastResources = [] %}
|
{% set pastResources = [] %}
|
||||||
@ -66,21 +65,21 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::SHOW'), f) %}
|
{# {% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::SHOW'), f) %} #}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_budget_' ~ family ~ '_view', { 'id': f.id } ) }}" class="btn btn-show"></a>
|
<a href="{{ path('chill_budget_' ~ family ~ '_view', { 'id': f.id } ) }}" class="btn btn-show"></a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{# {% endif %} #}
|
||||||
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), f) %}
|
{# {% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::UPDATE'), f) %} #}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_budget_' ~ family ~'_edit', { 'id': f.id } ) }}" class="btn btn-edit"></a>
|
<a href="{{ path('chill_budget_' ~ family ~'_edit', { 'id': f.id } ) }}" class="btn btn-edit"></a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{# {% endif %} #}
|
||||||
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::DELETE'), f) %}
|
{# {% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::DELETE'), f) %} #}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_budget_' ~ family ~ '_delete', { 'id': f.id } ) }}" class="btn btn-delete"></a>
|
<a href="{{ path('chill_budget_' ~ family ~ '_delete', { 'id': f.id } ) }}" class="btn btn-delete"></a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{# {% endif %} #}
|
||||||
</ul>
|
</ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -137,28 +136,28 @@
|
|||||||
<p><span class="chill-no-data-statement">{{ "There isn't any element recorded"|trans }}</span></p>
|
<p><span class="chill-no-data-statement">{{ "There isn't any element recorded"|trans }}</span></p>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h3>{{ 'Actual resources'|trans }}</h3>
|
<h3>{{ 'Actual resources'|trans }}</h3>
|
||||||
|
|
||||||
{% if actualResources|length > 0 %}
|
{% if actualResources|length > 0 %}
|
||||||
{{ m.table_elements(actualResources, 'resource') }}
|
{{ m.table_elements(actualResources, 'resource') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="chill-no-data-statement">{{ 'No resources registered'|trans }}</span>
|
<span class="chill-no-data-statement">{{ 'No resources registered'|trans }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<h3>{{ 'Actual charges'|trans }}</h3>
|
<h3>{{ 'Actual charges'|trans }}</h3>
|
||||||
|
|
||||||
{% if actualCharges|length > 0 %}
|
{% if actualCharges|length > 0 %}
|
||||||
{{ m.table_elements(actualCharges, 'charge') }}
|
{{ m.table_elements(actualCharges, 'charge') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="chill-no-data-statement">{{ 'No charges registered'|trans }}</span>
|
<span class="chill-no-data-statement">{{ 'No charges registered'|trans }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if results|length > 0 %}
|
{% if results|length > 0 %}
|
||||||
<h2>{{ 'Budget calculator'|trans }}</h2>
|
<h2>{{ 'Budget calculator'|trans }}</h2>
|
||||||
|
|
||||||
{{ m.table_results(results) }}
|
{{ m.table_results(results) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::CREATE'), person) %}
|
{# {% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::CREATE'), person) %} #}
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-create" href="{{ path('chill_budget_resource_new', { 'id': person.id} ) }}">{{ 'Create new resource'|trans }}</a>
|
<a class="btn btn-create" href="{{ path('chill_budget_resource_new', { 'id': person.id} ) }}">{{ 'Create new resource'|trans }}</a>
|
||||||
@ -167,52 +166,52 @@
|
|||||||
<a class="btn btn-create" href="{{ path('chill_budget_charge_new', { 'id': person.id} ) }}">{{ 'Create new charge'|trans }}</a>
|
<a class="btn btn-create" href="{{ path('chill_budget_charge_new', { 'id': person.id} ) }}">{{ 'Create new charge'|trans }}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{# {% endif %} #}
|
||||||
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if pastCharges|length > 0 or pastResources|length > 0 %}
|
{% if pastCharges|length > 0 or pastResources|length > 0 %}
|
||||||
<h2>{{ 'Past budget'|trans }}</h2>
|
<h2>{{ 'Past budget'|trans }}</h2>
|
||||||
|
|
||||||
<h3>{{ 'Past resources'|trans }}</h3>
|
<h3>{{ 'Past resources'|trans }}</h3>
|
||||||
|
|
||||||
{% if pastResources|length > 0 %}
|
{% if pastResources|length > 0 %}
|
||||||
{{ m.table_elements(pastResources, 'resource') }}
|
{{ m.table_elements(pastResources, 'resource') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="chill-no-data-statement">{{ 'No past resources registered'|trans }}</span>
|
<span class="chill-no-data-statement">{{ 'No past resources registered'|trans }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<h3>{{ 'Past charges'|trans }}</h3>
|
<h3>{{ 'Past charges'|trans }}</h3>
|
||||||
|
|
||||||
{% if pastCharges|length > 0 %}
|
{% if pastCharges|length > 0 %}
|
||||||
{{ m.table_elements(pastCharges, 'charge') }}
|
{{ m.table_elements(pastCharges, 'charge') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="chill-no-data-statement">{{ 'No past charges registered'|trans }}</span>
|
<span class="chill-no-data-statement">{{ 'No past charges registered'|trans }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if futureCharges|length > 0 or futureResources|length > 0 %}
|
{% if futureCharges|length > 0 or futureResources|length > 0 %}
|
||||||
<h2>{{ 'Future budget'|trans }}</h2>
|
<h2>{{ 'Future budget'|trans }}</h2>
|
||||||
|
|
||||||
<h3>{{ 'Future resources'|trans }}</h3>
|
<h3>{{ 'Future resources'|trans }}</h3>
|
||||||
|
|
||||||
{% if futureResources|length > 0 %}
|
{% if futureResources|length > 0 %}
|
||||||
{{ m.table_elements(futureResources, 'resource') }}
|
{{ m.table_elements(futureResources, 'resource') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="chill-no-data-statement">{{ 'No future resources registered'|trans }}</span>
|
<span class="chill-no-data-statement">{{ 'No future resources registered'|trans }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<h3>{{ 'Future charges'|trans }}</h3>
|
<h3>{{ 'Future charges'|trans }}</h3>
|
||||||
|
|
||||||
{% if futureCharges|length > 0 %}
|
{% if futureCharges|length > 0 %}
|
||||||
{{ m.table_elements(futureCharges, 'charge') }}
|
{{ m.table_elements(futureCharges, 'charge') }}
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="chill-no-data-statement">{{ 'No future charges registered'|trans }}</span>
|
<span class="chill-no-data-statement">{{ 'No future charges registered'|trans }}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if (resources|length + charges|length) == 0 or futureCharges|length > 0 or futureResources|length > 0 or pastCharges|length > 0 or pastResources|length > 0 %}
|
{% if (resources|length + charges|length) == 0 or futureCharges|length > 0 or futureResources|length > 0 or pastCharges|length > 0 or pastResources|length > 0 %}
|
||||||
{% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::CREATE'), person) %}
|
{# {% if is_granted(constant('Chill\\BudgetBundle\\Security\\Authorization\\BudgetElementVoter::CREATE'), person) %} #}
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a class="btn btn-create" href="{{ path('chill_budget_resource_new', { 'id': person.id} ) }}">{{ 'Create new resource'|trans }}</a>
|
<a class="btn btn-create" href="{{ path('chill_budget_resource_new', { 'id': person.id} ) }}">{{ 'Create new resource'|trans }}</a>
|
||||||
@ -221,7 +220,7 @@
|
|||||||
<a class="btn btn-create" href="{{ path('chill_budget_charge_new', { 'id': person.id} ) }}">{{ 'Create new charge'|trans }}</a>
|
<a class="btn btn-create" href="{{ path('chill_budget_charge_new', { 'id': person.id} ) }}">{{ 'Create new charge'|trans }}</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{# {% endif %} #}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user