use Symfony\Component\HttpFoundation\RequestStack; | use Symfony\Component\HttpFoundation\RequestStack; | ||||
use Symfony\Component\HttpFoundation\Session\SessionInterface; | use Symfony\Component\HttpFoundation\Session\SessionInterface; | ||||
use function Symfony\Component\Translation\t; | |||||
abstract class UserAdminController extends AbstractAdminController | abstract class UserAdminController extends AbstractAdminController | ||||
{ | { | ||||
protected $rolesDefinition; | protected $rolesDefinition; |
$this->_em->flush(); | $this->_em->flush(); | ||||
} | } | ||||
public function findByRole($role) { | |||||
return $this->createQueryBuilder('u') | |||||
->andWhere('u.roles LIKE :role') | |||||
->setParameter('role', '%'.$role.'%') | |||||
->getQuery() | |||||
->getResult(); | |||||
} | |||||
// /** | // /** | ||||
// * @return User[] Returns an array of User objects | // * @return User[] Returns an array of User objects | ||||
// */ | // */ |
{% if ea.entity.instance is not null %} | |||||
{% if ea.entity.instance is not null and ea.entity.instance.parent is defined %} | |||||
<nav aria-label="breadcrumb"> | <nav aria-label="breadcrumb"> | ||||
<ol class="breadcrumb"> | <ol class="breadcrumb"> | ||||
<li class="breadcrumb-item"><a href="{{ ea_url().unset('entityId').generateUrl() }}">Index</a></li> | <li class="breadcrumb-item"><a href="{{ ea_url().unset('entityId').generateUrl() }}">Index</a></li> | ||||
{% set parent = ea.entity.instance.parent %} | {% set parent = ea.entity.instance.parent %} | ||||
{% if parent is not null %} | {% if parent is not null %} | ||||
<li class="breadcrumb-item"><a href="{{ ea_url({ entityId: parent.id }).generateUrl() }}">{{ parent.title }}</a></li> | |||||
<li class="breadcrumb-item"><a | |||||
href="{{ ea_url({ entityId: parent.id }).generateUrl() }}">{{ parent.title }}</a></li> | |||||
{% set grand_parent = parent.parent %} | {% set grand_parent = parent.parent %} | ||||
{% if grand_parent is not null %} | {% if grand_parent is not null %} | ||||
<li class="breadcrumb-item"><a href="{{ ea_url({ entityId: grand_parent.id }).generateUrl() }}">{{ grand_parent.title }}</a></li> | |||||
<li class="breadcrumb-item"><a | |||||
href="{{ ea_url({ entityId: grand_parent.id }).generateUrl() }}">{{ grand_parent.title }}</a> | |||||
</li> | |||||
{% endif %} | {% endif %} | ||||
{% endif %} | {% endif %} | ||||
<li class="breadcrumb-item active" aria-current="page">{{ ea.entity.instance.title }}</li> | <li class="breadcrumb-item active" aria-current="page">{{ ea.entity.instance.title }}</li> | ||||
</ol> | </ol> |
{% macro infoboxprogressbar(title, number, color, icon, percentage, description) %} | |||||
<div class="info-box bg-{{ color }}"> | |||||
<span class="info-box-icon"><i class="{{ icon }}"></i></span> | |||||
<div class="info-box-content"> | |||||
<span class="info-box-text">{{ title }}</span> | |||||
<span class="info-box-number">{{ number }}</span> | |||||
<!-- The progress section is optional --> | |||||
<div class="progress"> | |||||
<div class="progress-bar" style="width: {{ percentage }}%"></div> | |||||
</div> | |||||
<span class="progress-description">{{ description }}</span> | |||||
</div> | |||||
<!-- /.info-box-content --> | |||||
</div> | |||||
{% endmacro %} |
{% macro infobox(title, number, color, icon) %} | |||||
<div class="info-box"> | |||||
<!-- Apply any bg-* class to to the icon to color it --> | |||||
<span class="info-box-icon bg-{{ color }}"><i class="{{ icon }}"></i></span> | |||||
<div class="info-box-content"> | |||||
<span class="info-box-text">{{ title }}</span> | |||||
<span class="info-box-number">{{ number }}</span> | |||||
</div> | |||||
<!-- /.info-box-content --> | |||||
</div> | |||||
<!-- /.info-box --> | |||||
{% endmacro %} |