Parcourir la source

Merge branch 'develop' of https://forge.laclic.fr/Laclic/SovBundle into develop

develop
Guillaume il y a 3 ans
Parent
révision
f1889887fc
12 fichiers modifiés avec 88 ajouts et 28 suppressions
  1. +13
    -11
      Field/Filter/AssociationFilter.php
  2. +1
    -1
      Field/Filter/FilterManager.php
  3. +1
    -1
      Resources/assets/app/adminlte/index/index.scss
  4. +1
    -1
      Resources/translations/admin.fr.yaml
  5. +7
    -6
      Resources/views/admin/ticket/field/status.html.twig
  6. +33
    -0
      Resources/views/admin/ticket/macro.html.twig
  7. +4
    -0
      Resources/views/adminlte/crud/field/amount.html.twig
  8. +5
    -2
      Resources/views/adminlte/crud/field/boolean.html.twig
  9. +5
    -2
      Resources/views/adminlte/crud/field/status.html.twig
  10. +11
    -0
      Resources/views/adminlte/embed/smallbox.html.twig
  11. +2
    -1
      Resources/views/adminlte/macro/button.html.twig
  12. +5
    -3
      Twig/TwigExtension.php

+ 13
- 11
Field/Filter/AssociationFilter.php Voir le fichier

@@ -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 {
// }
}
}


+ 1
- 1
Field/Filter/FilterManager.php Voir le fichier

@@ -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:

+ 1
- 1
Resources/assets/app/adminlte/index/index.scss Voir le fichier

@@ -21,7 +21,7 @@ table.table {
.table th input {
width: 100%;
}
.card-table {
.card-table, table {
.badge {
white-space: normal;
}

+ 1
- 1
Resources/translations/admin.fr.yaml Voir le fichier

@@ -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

+ 7
- 6
Resources/views/admin/ticket/field/status.html.twig Voir le fichier

@@ -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 %}

+ 33
- 0
Resources/views/admin/ticket/macro.html.twig Voir le fichier

@@ -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 %}

+ 4
- 0
Resources/views/adminlte/crud/field/amount.html.twig Voir le fichier

@@ -0,0 +1,4 @@
{% if value is not defined %}
{% set value = field.value %}
{% endif %}
{{ value|format_price|raw }}

+ 5
- 2
Resources/views/adminlte/crud/field/boolean.html.twig Voir le fichier

@@ -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 %}

+ 5
- 2
Resources/views/adminlte/crud/field/status.html.twig Voir le fichier

@@ -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 %}

+ 11
- 0
Resources/views/adminlte/embed/smallbox.html.twig Voir le fichier

@@ -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>

+ 2
- 1
Resources/views/adminlte/macro/button.html.twig Voir le fichier

@@ -10,4 +10,5 @@
{{ params.label|sov_trans_admin_action }}
</span>
</button>
{% endmacro %}
{% endmacro %}


+ 5
- 3
Twig/TwigExtension.php Voir le fichier

@@ -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);

Chargement…
Annuler
Enregistrer