@@ -104,8 +104,12 @@ abstract class AbstractAdminController extends EaAbstractCrudController | |||
public function configureResponseParameters(KeyValueStore $responseParameters): KeyValueStore | |||
{ | |||
$this->overrideGlobalActions($responseParameters->get('global_actions')); | |||
$this->overrideEntitiesActions($responseParameters->get('entities')); | |||
if($responseParameters->get('global_actions')){ | |||
$this->overrideGlobalActions($responseParameters->get('global_actions')); | |||
} | |||
if($responseParameters->get('entities')){ | |||
$this->overrideEntitiesActions($responseParameters->get('entities')); | |||
} | |||
if (Crud::PAGE_INDEX === $responseParameters->get('pageName')) { | |||
$responseParameters->set('fields', $this->configureFields('index')); | |||
@@ -292,7 +296,7 @@ abstract class AbstractAdminController extends EaAbstractCrudController | |||
$url = $this->get(AdminUrlGenerator::class) | |||
->setAction(Action::INDEX) | |||
->generateUrl(); | |||
$this->addFlash('success', $this->translatorAdmin->transFlashMessage('sort'), array()); | |||
$this->addFlash('success', $this->get(TranslatorAdmin::class)->transFlashMessage('sort'), array()); | |||
return $this->redirect($url); | |||
} |
@@ -105,16 +105,29 @@ abstract class AbstractRepositoryQuery implements RepositoryQueryInterface | |||
public function groupBy(string $field): self | |||
{ | |||
if (substr($field, 0, 1) === '.') { | |||
return $this->groupBy($field) ; | |||
if (strpos($field, '.')!==false) { | |||
$this->addGroupBy($field) ; | |||
} else { | |||
return $this->groupBy('.'.$field) ; | |||
$this->addGroupBy('.'.$field) ; | |||
} | |||
return $this; | |||
} | |||
/* | |||
public function addGroupBy(string $field): self | |||
{ | |||
if (strpos($field, '.')!==false) { | |||
$this->query->addGroupBy($field) ; | |||
} else { | |||
$this->query->addGroupBy('.'.$field) ; | |||
} | |||
return $this; | |||
}*/ | |||
public function orderBy(string $field, string $sort = 'ASC'): self | |||
{ | |||
if (substr($field, 0, 1) === '.') { | |||
if (strpos($field, '.')!==false) { | |||
return $this->addOrderBy($field, $sort); | |||
} else { | |||
return $this->addOrderBy('.' . $field, $sort); |
@@ -23,8 +23,6 @@ interface RepositoryQueryInterface | |||
public function getRepository(): ServiceEntityRepository; | |||
public function groupBy(string $field):self; | |||
public function orderBy(string $field, string $sort = 'ASC'):self; | |||
public function filterById(int $id):self; |
@@ -87,8 +87,8 @@ | |||
dir="{{ ea.i18n.textDirection }}"> | |||
{% if field.isSortable %} | |||
<a href="{{ ea_url({ page: 1, sort: { (field.property): next_sort_direction } }).includeReferrer() }}"> | |||
{{ field.label ? field.label|raw : field.getProperty|raw }} <i | |||
class="fa fa-fw {{ column_icon }}"></i> | |||
{{ field.getProperty|sov_trans_admin_field(ea.getEntity().getFqcn()) }} | |||
<i class="fa fa-fw {{ column_icon }}"></i> | |||
</a> | |||
{% else %} | |||
<span>{{ field.getProperty|sov_trans_admin_field(ea.getEntity().getFqcn()) }}</span> |
@@ -49,7 +49,7 @@ | |||
<div class="table-responsive"> | |||
<table class="table table-bordered table-hover table-striped sov-sortable" | |||
data-parent-position="{{ entity is defined and entity is not null ? entity.position : '' }}"> | |||
data-parent-position="{{ ea.entity is defined and ea.entity.instance is not null ? ea.entity.instance.position : '' }}"> | |||
<thead> | |||
{% block table_head %} | |||
<tr> |
@@ -128,6 +128,7 @@ class TwigExtension extends AbstractExtension | |||
} | |||
if ($path) { | |||
$fileManagerFolder = substr($this->getFileManagerFolder(), 1); | |||
if (strpos($path, $fileManagerFolder) === false) { |