|
|
@@ -326,7 +326,7 @@ abstract class AbstractAdminController extends EaAbstractCrudController |
|
|
|
) { |
|
|
|
if (!$this->isGranted( |
|
|
|
Permission::EA_EXECUTE_ACTION, |
|
|
|
['action' => "duplicate", 'entity' => $context->getEntity()] |
|
|
|
['action' =>ActionDefinition::DUPLICATE, 'entity' => $context->getEntity()] |
|
|
|
)) { |
|
|
|
throw new ForbiddenActionException($context); |
|
|
|
} |
|
|
@@ -344,7 +344,7 @@ abstract class AbstractAdminController extends EaAbstractCrudController |
|
|
|
->setEntityId($newEntity->getId()) |
|
|
|
->generateUrl(); |
|
|
|
|
|
|
|
$this->addFlashTranslator('success', 'duplicated'); |
|
|
|
$this->addFlashTranslator('success', ActionDefinition::DUPLICATE); |
|
|
|
|
|
|
|
return $this->redirect($url); |
|
|
|
} |
|
|
@@ -407,7 +407,12 @@ abstract class AbstractAdminController extends EaAbstractCrudController |
|
|
|
FieldCollection $fields, |
|
|
|
FilterCollection $filters |
|
|
|
): RepositoryQueryInterface { |
|
|
|
return $this->createIndexRepositoryQuery($searchDto,$entityDto, $fields, $filters); |
|
|
|
$repositoryQuery = $this->createIndexRepositoryQuery($searchDto,$entityDto, $fields, $filters); |
|
|
|
if($this->isInstanceOf(StatusInterface::class)) { |
|
|
|
$repositoryQuery->filterIsOnline(); |
|
|
|
} |
|
|
|
$repositoryQuery->orderBy('position', 'asc'); |
|
|
|
return $repositoryQuery; |
|
|
|
} |
|
|
|
public function createIndexQueryBuilder( |
|
|
|
SearchDto $searchDto, |