|
|
|
|
|
|
|
|
$entityClass = $this->getEntityFqcn(); |
|
|
$entityClass = $this->getEntityFqcn(); |
|
|
$paramListMaxResults = 'listMaxResults'; |
|
|
$paramListMaxResults = 'listMaxResults'; |
|
|
$paramSessionListMaxResults = $entityClass.'-'.$paramListMaxResults; |
|
|
$paramSessionListMaxResults = $entityClass.'-'.$paramListMaxResults; |
|
|
$requestListMaxResults = $this->get('request')->getCurrentRequest()->get($paramListMaxResults); |
|
|
|
|
|
|
|
|
$requestListMaxResults = $this->get(RequestStack::class)->getCurrentRequest()->get($paramListMaxResults); |
|
|
|
|
|
|
|
|
if ($requestListMaxResults) { |
|
|
if ($requestListMaxResults) { |
|
|
$this->get('session')->set($paramSessionListMaxResults, $requestListMaxResults); |
|
|
$this->get('session')->set($paramSessionListMaxResults, $requestListMaxResults); |
|
|
|
|
|
|
|
|
) |
|
|
) |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
$filterManager = $this->get('filter_manager'); |
|
|
|
|
|
|
|
|
$filterManager = $this->get(FilterManager::class); |
|
|
|
|
|
|
|
|
$this->filtersForm->handleRequest($searchDto->getRequest()); |
|
|
$this->filtersForm->handleRequest($searchDto->getRequest()); |
|
|
/*if (($this->filtersForm->isSubmitted() && $this->filtersForm->isValid())) { |
|
|
/*if (($this->filtersForm->isSubmitted() && $this->filtersForm->isValid())) { |
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
$duplicateAction = Action::new( |
|
|
$duplicateAction = Action::new( |
|
|
'duplicate', |
|
|
'duplicate', |
|
|
$this->get('translator_admin')->transAction('duplicate'), |
|
|
|
|
|
|
|
|
$this->get(TranslatorAdmin::class)->transAction('duplicate'), |
|
|
'fa fa-fw fa-copy' |
|
|
'fa fa-fw fa-copy' |
|
|
) |
|
|
) |
|
|
->linkToCrudAction('duplicate') |
|
|
->linkToCrudAction('duplicate') |
|
|
->setLabel($this->get('translator_admin')->transAction('duplicate')) |
|
|
|
|
|
|
|
|
->setLabel($this->get(TranslatorAdmin::class)->transAction('duplicate')) |
|
|
->setCssClass('in-dropdown text-info action-confirm'); |
|
|
->setCssClass('in-dropdown text-info action-confirm'); |
|
|
|
|
|
|
|
|
return $duplicateAction; |
|
|
return $duplicateAction; |
|
|
|
|
|
|
|
|
Action::NEW, |
|
|
Action::NEW, |
|
|
[ |
|
|
[ |
|
|
'icon' => 'plus', |
|
|
'icon' => 'plus', |
|
|
'label' => $this->get('translator_admin')->transAction('create'), |
|
|
|
|
|
|
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('create'), |
|
|
'add_class' => 'btn-sm', |
|
|
'add_class' => 'btn-sm', |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
'label' => false, |
|
|
'label' => false, |
|
|
'html_attributes' => array( |
|
|
'html_attributes' => array( |
|
|
'data-toggle' => 'tooltip', |
|
|
'data-toggle' => 'tooltip', |
|
|
'title' => $this->get('translator_admin')->transAction('edit'), |
|
|
|
|
|
|
|
|
'title' => $this->get(TranslatorAdmin::class)->transAction('edit'), |
|
|
), |
|
|
), |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
'label' => false, |
|
|
'label' => false, |
|
|
'html_attributes' => array( |
|
|
'html_attributes' => array( |
|
|
'data-toggle' => 'tooltip', |
|
|
'data-toggle' => 'tooltip', |
|
|
'title' => $this->get('translator_admin')->transAction('detail'), |
|
|
|
|
|
|
|
|
'title' => $this->get(TranslatorAdmin::class)->transAction('detail'), |
|
|
), |
|
|
), |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
[ |
|
|
[ |
|
|
'icon' => 'trash', |
|
|
'icon' => 'trash', |
|
|
'dropdown' => true, |
|
|
'dropdown' => true, |
|
|
'label' => $this->get('translator_admin')->transAction('delete'), |
|
|
|
|
|
|
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('delete'), |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ |
|
|
[ |
|
|
'class' => 'btn btn-sm btn-danger', |
|
|
'class' => 'btn btn-sm btn-danger', |
|
|
'icon' => 'trash', |
|
|
'icon' => 'trash', |
|
|
'label' => $this->get('translator_admin')->transAction('delete'), |
|
|
|
|
|
|
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('delete'), |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[ |
|
|
[ |
|
|
'add_class' => 'float-right', |
|
|
'add_class' => 'float-right', |
|
|
'icon' => 'check', |
|
|
'icon' => 'check', |
|
|
'label' => $this->get('translator_admin')->transAction('save_and_return'), |
|
|
|
|
|
|
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('save_and_return'), |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ |
|
|
[ |
|
|
'icon' => 'chevron-left', |
|
|
'icon' => 'chevron-left', |
|
|
'class' => 'btn btn-link', |
|
|
'class' => 'btn btn-link', |
|
|
'label' => $this->get('translator_admin')->transAction('back_index'), |
|
|
|
|
|
|
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('back_index'), |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Action::SAVE_AND_CONTINUE, |
|
|
Action::SAVE_AND_CONTINUE, |
|
|
[ |
|
|
[ |
|
|
'class' => 'btn btn-info float-right', |
|
|
'class' => 'btn btn-info float-right', |
|
|
'label' => $this->get('translator_admin')->transAction('save_and_continue'), |
|
|
|
|
|
|
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('save_and_continue'), |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ |
|
|
[ |
|
|
'icon' => 'trash', |
|
|
'icon' => 'trash', |
|
|
'class' => 'btn btn-outline-danger action-delete', |
|
|
'class' => 'btn btn-outline-danger action-delete', |
|
|
'label' => $this->get('translator_admin')->transAction('delete'), |
|
|
|
|
|
|
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('delete'), |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[ |
|
|
[ |
|
|
'add_class' => 'float-right', |
|
|
'add_class' => 'float-right', |
|
|
'icon' => 'check', |
|
|
'icon' => 'check', |
|
|
'label' => $this->get('translator_admin')->transAction('save_and_return'), |
|
|
|
|
|
|
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('save_and_return'), |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[ |
|
|
[ |
|
|
'icon' => 'chevron-left', |
|
|
'icon' => 'chevron-left', |
|
|
'class' => 'btn btn-link', |
|
|
'class' => 'btn btn-link', |
|
|
'label' => $this->get('translator_admin')->transAction('back_index'), |
|
|
|
|
|
|
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('back_index'), |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Action::SAVE_AND_ADD_ANOTHER, |
|
|
Action::SAVE_AND_ADD_ANOTHER, |
|
|
[ |
|
|
[ |
|
|
'class' => 'btn btn-info float-right', |
|
|
'class' => 'btn btn-info float-right', |
|
|
'label' => $this->get('translator_admin')->transAction('save_and_add_another'), |
|
|
|
|
|
|
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('save_and_add_another'), |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function handleSortableEntityActions(Actions $actions): void |
|
|
public function handleSortableEntityActions(Actions $actions): void |
|
|
{ |
|
|
{ |
|
|
if ($this->isInstanceOf(SortableInterface::class)) { |
|
|
if ($this->isInstanceOf(SortableInterface::class)) { |
|
|
$sortAction = Action::new('sort', $this->get('translator_admin')->transAction('sort'), 'fa fa-sort') |
|
|
|
|
|
|
|
|
$sortAction = Action::new('sort', $this->get(TranslatorAdmin::class)->transAction('sort'), 'fa fa-sort') |
|
|
->linkToCrudAction('sort') |
|
|
->linkToCrudAction('sort') |
|
|
->setCssClass('btn btn-sm btn-success') |
|
|
->setCssClass('btn btn-sm btn-success') |
|
|
->createAsGlobalAction(); |
|
|
->createAsGlobalAction(); |
|
|
|
|
|
|
|
|
if ($this->isInstanceOf(TreeInterface::class)) { |
|
|
if ($this->isInstanceOf(TreeInterface::class)) { |
|
|
$indexChildAction = Action::new( |
|
|
$indexChildAction = Action::new( |
|
|
'index_children', |
|
|
'index_children', |
|
|
$this->get('translator_admin')->transAction('index_children'), |
|
|
|
|
|
|
|
|
$this->get(TranslatorAdmin::class)->transAction('index_children'), |
|
|
'fa fa-list' |
|
|
'fa fa-list' |
|
|
) |
|
|
) |
|
|
->linkToCrudAction(Action::INDEX) |
|
|
->linkToCrudAction(Action::INDEX) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$backParentAction = Action::new( |
|
|
$backParentAction = Action::new( |
|
|
'index_parent', |
|
|
'index_parent', |
|
|
$this->get('translator_admin')->transAction('index_parent'), |
|
|
|
|
|
|
|
|
$this->get(TranslatorAdmin::class)->transAction('index_parent'), |
|
|
'fa fa-chevron-left' |
|
|
'fa fa-chevron-left' |
|
|
) |
|
|
) |
|
|
->linkToCrudAction(Action::INDEX) |
|
|
->linkToCrudAction(Action::INDEX) |
|
|
|
|
|
|
|
|
$controller->configureFields($autocompleteContext['originatingPage']) |
|
|
$controller->configureFields($autocompleteContext['originatingPage']) |
|
|
)->getByProperty($autocompleteContext['propertyName']); |
|
|
)->getByProperty($autocompleteContext['propertyName']); |
|
|
|
|
|
|
|
|
$filterManager = $this->get('filter_manager'); |
|
|
|
|
|
|
|
|
$filterManager = $this->get(FilterManager::class); |
|
|
|
|
|
|
|
|
$filterManager->applyFilter($queryBuilder, $field, $context->getRequest()->query->get('q')); |
|
|
$filterManager->applyFilter($queryBuilder, $field, $context->getRequest()->query->get('q')); |
|
|
if ($filterManager->isRelationField($field->getProperty())) { |
|
|
if ($filterManager->isRelationField($field->getProperty())) { |