@@ -54,21 +54,23 @@ class AssociationFilter | |||
); | |||
} | |||
public function applyFilter(RepositoryQueryInterface $repositoryQuery, string $fieldProperty, $filteredValue = null) | |||
public function applyFilter(RepositoryQueryInterface $repositoryQuery, FieldDto $fieldDto, string $fieldProperty, $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); | |||
/* //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 { | |||
// } | |||
} | |||
} | |||
@@ -118,7 +118,7 @@ class FilterManager | |||
break; | |||
case EntityType::class: | |||
$textFilter = new AssociationFilter(); | |||
$textFilter->applyFilter($repositoryQuery, $this->getFieldProperty($fieldDto), $filteredValue['value']); | |||
$textFilter->applyFilter($repositoryQuery, $fieldDto, $this->getFieldProperty($fieldDto), $filteredValue['value']); | |||
break; | |||
case DateTimeType::class: | |||
case DateType::class: |
@@ -21,7 +21,7 @@ table.table { | |||
.table th input { | |||
width: 100%; | |||
} | |||
.card-table { | |||
.card-table, table { | |||
.badge { | |||
white-space: normal; | |||
} |
@@ -4,7 +4,7 @@ menu: | |||
news: Actualités | |||
newsletters: Bulletins d'informations | |||
user: Utilisateurs | |||
user_index: Liste | |||
user_index: Utilisateurs | |||
account: Mon compte | |||
account_profile: Informations personnelles | |||
account_password: Mot de passe |
@@ -1,10 +1,11 @@ | |||
{% 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' %} | |||
{{ 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' %} | |||
{{ 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' %} | |||
{{ macro.badge_danger(('entity.Ticket.fields.statusOptions.'~entity.instance.status)|trans({},'admin')) }} | |||
{% endif %} | |||
{{ macro.badge_danger(status|sov_trans_admin_choice('status','Ticket')) }} | |||
{% endif %} |
@@ -0,0 +1,33 @@ | |||
{% 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 %} |
@@ -0,0 +1,4 @@ | |||
{% if value is not defined %} | |||
{% set value = field.value %} | |||
{% endif %} | |||
{{ value|format_price|raw }} |
@@ -1,5 +1,8 @@ | |||
{% if field.value %} | |||
{% if value is not defined %} | |||
{% set value = field.value %} | |||
{% endif %} | |||
{% if value == 1 %} | |||
<span class="badge badge-success">Oui</span> | |||
{% else %} | |||
<span class="badge badge-danger">Non</span> | |||
{% endif %} | |||
{% endif %} |
@@ -1,5 +1,8 @@ | |||
{% 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> | |||
{% else %} | |||
<div class="badge badge-danger">Hors ligne</div> | |||
{% endif %} | |||
{% endif %} |
@@ -0,0 +1,11 @@ | |||
<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> |
@@ -10,4 +10,5 @@ | |||
{{ params.label|sov_trans_admin_action }} | |||
</span> | |||
</button> | |||
{% endmacro %} | |||
{% endmacro %} | |||
@@ -2,6 +2,7 @@ | |||
namespace Lc\SovBundle\Twig; | |||
use App\Controller\Ticket\TicketAdminController; | |||
use App\Repository\ReminderRepository; | |||
use Doctrine\ORM\EntityManagerInterface; | |||
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; | |||
@@ -187,15 +188,16 @@ class TwigExtension extends AbstractExtension | |||
public function generateEaUrl(string $controller =null, string $action=null, int $entityId=null, array $extraParam = array()): string | |||
{ | |||
$adminUrlGenerator = $this->adminUrlGenerator; | |||
if ($controller) { | |||
$adminUrlGenerator->setController($controller); | |||
} | |||
if ($action) { | |||
$adminUrlGenerator->setAction($action); | |||
} | |||
if ($entityId) { | |||
$adminUrlGenerator->setEntityId($entityId); | |||
} | |||
$adminUrlGenerator->setEntityId($entityId); | |||
if($extraParam){ | |||
foreach ($extraParam as $key=>$value) { | |||
$adminUrlGenerator->set($key, $value); |