); | ); | ||||
} | } | ||||
public function applyFilter(RepositoryQueryInterface $repositoryQuery, string $fieldProperty, $filteredValue = null) | |||||
public function applyFilter(RepositoryQueryInterface $repositoryQuery, FieldDto $fieldDto, string $fieldProperty, $filteredValue = null) | |||||
{ | { | ||||
if ($filteredValue !== null) { | if ($filteredValue !== null) { | ||||
$repositoryQuery->andWhere('.' . $fieldProperty . ' = :' . $fieldProperty . ''); | |||||
if ($fieldDto->getFormTypeOption('multiple')) { | |||||
$repositoryQuery->andWhere(':' . $fieldProperty . ' MEMBER OF .' . $fieldProperty . ''); | |||||
} else { | |||||
$repositoryQuery->andWhere('.' . $fieldProperty . ' = :' . $fieldProperty . ''); | |||||
} | |||||
$repositoryQuery->setParameter($fieldProperty, $filteredValue); | $repositoryQuery->setParameter($fieldProperty, $filteredValue); | ||||
/* //TODO Faut généraliser avec TreeInterface, ça ne doit pas être ici | |||||
if ($field['type_options']['multiple']) { | |||||
$repositoryQuery->andWhere(':' . $field['property'] . ' MEMBER OF entity.' . $field['property'] . ''); | |||||
} else { | |||||
} | |||||
if ($filter instanceof TreeInterface && $filter->getParent() == null) { | |||||
$repositoryQuery->setParameter($field['property'], array_merge(array($filter), $filter->getChildrens()->toArray())); | |||||
} else { | |||||
}*/ | |||||
// | |||||
// if ($filter instanceof TreeInterface && $filter->getParent() == null) { | |||||
// $repositoryQuery->setParameter($field['property'], array_merge(array($filter), $filter->getChildrens()->toArray())); | |||||
// } else { | |||||
// } | |||||
} | } | ||||
} | } | ||||
break; | break; | ||||
case EntityType::class: | case EntityType::class: | ||||
$textFilter = new AssociationFilter(); | $textFilter = new AssociationFilter(); | ||||
$textFilter->applyFilter($repositoryQuery, $this->getFieldProperty($fieldDto), $filteredValue['value']); | |||||
$textFilter->applyFilter($repositoryQuery, $fieldDto, $this->getFieldProperty($fieldDto), $filteredValue['value']); | |||||
break; | break; | ||||
case DateTimeType::class: | case DateTimeType::class: | ||||
case DateType::class: | case DateType::class: |
.table th input { | .table th input { | ||||
width: 100%; | width: 100%; | ||||
} | } | ||||
.card-table { | |||||
.card-table, table { | |||||
.badge { | .badge { | ||||
white-space: normal; | white-space: normal; | ||||
} | } |
news: Actualités | news: Actualités | ||||
newsletters: Bulletins d'informations | newsletters: Bulletins d'informations | ||||
user: Utilisateurs | user: Utilisateurs | ||||
user_index: Liste | |||||
user_index: Utilisateurs | |||||
account: Mon compte | account: Mon compte | ||||
account_profile: Informations personnelles | account_profile: Informations personnelles | ||||
account_password: Mot de passe | account_password: Mot de passe |
{% import "@LcSov/adminlte/macro/badge.html.twig" as macro %} | {% import "@LcSov/adminlte/macro/badge.html.twig" as macro %} | ||||
{% set status = entity.instance.status %} | |||||
{% if status is not defined %} | |||||
{% set status = entity.instance.status %} | |||||
{% endif %} | |||||
{% if status == 'open' %} | {% if status == 'open' %} | ||||
{{ macro.badge_success(('entity.Ticket.fields.statusOptions.'~entity.instance.status)|trans({},'admin')) }} | |||||
{{ macro.badge_success(status|sov_trans_admin_choice('status','Ticket')) }} | |||||
{% elseif status == 'being-processed' %} | {% elseif status == 'being-processed' %} | ||||
{{ macro.badge_warning(('entity.Ticket.fields.statusOptions.'~entity.instance.status)|trans({},'admin')) }} | |||||
{{ macro.badge_warning(status|sov_trans_admin_choice('status','Ticket')) }} | |||||
{% elseif status == 'closed' %} | {% elseif status == 'closed' %} | ||||
{{ macro.badge_danger(('entity.Ticket.fields.statusOptions.'~entity.instance.status)|trans({},'admin')) }} | |||||
{% endif %} | |||||
{{ macro.badge_danger(status|sov_trans_admin_choice('status','Ticket')) }} | |||||
{% endif %} |
{% macro list_tickets(tickets) %} | |||||
<table class="table table-condensed"> | |||||
<thead> | |||||
<tr> | |||||
<th>Sujet</th> | |||||
<th>Statut</th> | |||||
<th>Dernier message</th> | |||||
<th></th> | |||||
</tr> | |||||
</thead> | |||||
<tbody> | |||||
{% for ticket in tickets %} | |||||
<tr> | |||||
<td>{{ ticket.subject }}</td> | |||||
<td> | |||||
{% set value = ticket.status %} | |||||
{% include '@LcSov/admin/ticket/field/status.html.twig' with {status: ticket.status}%} | |||||
</td> | |||||
<td> | |||||
{% set item = ticket %} | |||||
{% include '@LcSov/admin/ticket/field/lastmessage.html.twig' %} | |||||
</td> | |||||
<td> | |||||
<a class="btn-sm btn-success" data-toggle="tooltip" title="{{ 'detail'|sov_trans_admin_action('Ticket') }}" | |||||
href="{{ ea_url_short("App\\Controller\\Ticket\\TicketAdminController", 'detail', ticket.id) }}"> | |||||
<i class="fas fa-eye"></i> | |||||
</a> | |||||
</td> | |||||
</tr> | |||||
{% endfor %} | |||||
</tbody> | |||||
</table> | |||||
{% endmacro list_tickets %} |
{% if value is not defined %} | |||||
{% set value = field.value %} | |||||
{% endif %} | |||||
{{ value|format_price|raw }} |
{% if field.value %} | |||||
{% if value is not defined %} | |||||
{% set value = field.value %} | |||||
{% endif %} | |||||
{% if value == 1 %} | |||||
<span class="badge badge-success">Oui</span> | <span class="badge badge-success">Oui</span> | ||||
{% else %} | {% else %} | ||||
<span class="badge badge-danger">Non</span> | <span class="badge badge-danger">Non</span> | ||||
{% endif %} | |||||
{% endif %} |
{% if field.value == 1 %} | |||||
{% if value is not defined %} | |||||
{% set value = field.value %} | |||||
{% endif %} | |||||
{% if value == 1 %} | |||||
<div class="badge badge-success">En ligne</div> | <div class="badge badge-success">En ligne</div> | ||||
{% else %} | {% else %} | ||||
<div class="badge badge-danger">Hors ligne</div> | <div class="badge badge-danger">Hors ligne</div> | ||||
{% endif %} | |||||
{% endif %} |
<div class="small-box bg-{% block color %}{% endblock %}"> | |||||
<div class="inner"> | |||||
<h3>{% block title %}{% endblock %}</h3> | |||||
<p>{% block content %}{% endblock %}</p> | |||||
<div class="icon"> | |||||
<i class="fa fa-{% block icon %}bg-info{% endblock %}"></i> | |||||
</div> | |||||
</div> | |||||
</div> |
{{ params.label|sov_trans_admin_action }} | {{ params.label|sov_trans_admin_action }} | ||||
</span> | </span> | ||||
</button> | </button> | ||||
{% endmacro %} | |||||
{% endmacro %} | |||||
namespace Lc\SovBundle\Twig; | namespace Lc\SovBundle\Twig; | ||||
use App\Controller\Ticket\TicketAdminController; | |||||
use App\Repository\ReminderRepository; | use App\Repository\ReminderRepository; | ||||
use Doctrine\ORM\EntityManagerInterface; | use Doctrine\ORM\EntityManagerInterface; | ||||
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; | use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; | ||||
public function generateEaUrl(string $controller =null, string $action=null, int $entityId=null, array $extraParam = array()): string | public function generateEaUrl(string $controller =null, string $action=null, int $entityId=null, array $extraParam = array()): string | ||||
{ | { | ||||
$adminUrlGenerator = $this->adminUrlGenerator; | $adminUrlGenerator = $this->adminUrlGenerator; | ||||
if ($controller) { | if ($controller) { | ||||
$adminUrlGenerator->setController($controller); | $adminUrlGenerator->setController($controller); | ||||
} | } | ||||
if ($action) { | if ($action) { | ||||
$adminUrlGenerator->setAction($action); | $adminUrlGenerator->setAction($action); | ||||
} | } | ||||
if ($entityId) { | |||||
$adminUrlGenerator->setEntityId($entityId); | |||||
} | |||||
$adminUrlGenerator->setEntityId($entityId); | |||||
if($extraParam){ | if($extraParam){ | ||||
foreach ($extraParam as $key=>$value) { | foreach ($extraParam as $key=>$value) { | ||||
$adminUrlGenerator->set($key, $value); | $adminUrlGenerator->set($key, $value); |