Browse Source

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

develop
Guillaume 3 years ago
parent
commit
cb995e9503
6 changed files with 27 additions and 30 deletions
  1. +20
    -20
      Controller/AbstractAdminController.php
  2. +2
    -1
      Controller/Dashboard/DashboardAdminController.php
  3. +1
    -1
      Controller/Ticket/TicketAdminController.php
  4. +2
    -2
      EventSubscriber/SiteSettingEventSubscriber.php
  5. +0
    -1
      Model/User/UserModel.php
  6. +2
    -5
      Twig/StoreTwigExtension.php

+ 20
- 20
Controller/AbstractAdminController.php View File

$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())) {

+ 2
- 1
Controller/Dashboard/DashboardAdminController.php View File



class DashboardAdminController extends AbstractDashboardController class DashboardAdminController extends AbstractDashboardController
{ {

public function index(): Response public function index(): Response
{ {
return $this->render('@LcSov/adminlte/dashboard.html.twig'); return $this->render('@LcSov/adminlte/dashboard.html.twig');
// if you prefer to create the user menu from scratch, use: return UserMenu::new()->... // if you prefer to create the user menu from scratch, use: return UserMenu::new()->...
return parent::configureUserMenu($user) return parent::configureUserMenu($user)
// use the given $user object to get the user name // use the given $user object to get the user name
->setName($user->getName())
->setName($user->getFirstName())
// use this method if you don't want to display the name of the user // use this method if you don't want to display the name of the user
//->displayUserName(false) //->displayUserName(false)
->displayUserAvatar(false) ->displayUserAvatar(false)

+ 1
- 1
Controller/Ticket/TicketAdminController.php View File



public function configureFields(string $pageName): iterable public function configureFields(string $pageName): iterable
{ {
$translatorAdmin = $this->get('translator_admin');
$translatorAdmin = $this->get(TranslatorAdmin::class);
return [ return [
IntegerField::new('id') IntegerField::new('id')
->hideOnForm(), ->hideOnForm(),

+ 2
- 2
EventSubscriber/SiteSettingEventSubscriber.php View File



$this->em->persist($entitySetting); $this->em->persist($entitySetting);
} else { } else {
if ($entitySetting->getValue() === null
$methodGetValue = 'get' . ucfirst($setting['field']);
if ($entitySetting->$methodGetValue() === null
&& isset($setting['default']) && isset($setting['default'])
&& $setting['default'] !== null) { && $setting['default'] !== null) {
$methodSetValue = 'set' . ucfirst($setting['field']); $methodSetValue = 'set' . ucfirst($setting['field']);
} }
} }



$this->em->flush(); $this->em->flush();
} }



+ 0
- 1
Model/User/UserModel.php View File

} }





public function getEmail(): ?string public function getEmail(): ?string
{ {
return $this->email; return $this->email;

+ 2
- 5
Twig/StoreTwigExtension.php View File



public function getReminders($params) public function getReminders($params)
{ {
return $this->reminderStore->get(array_merge(
[
'user' => $this->security->getUser()
], $params)
);
//TODO !!!!!!
return array();
} }


} }

Loading…
Cancel
Save