Browse Source

corretif apres refactoring

develop
Charly 3 years ago
parent
commit
083ff7528b
5 changed files with 20 additions and 22 deletions
  1. +18
    -18
      Controller/AbstractAdminController.php
  2. +1
    -1
      Controller/Dashboard/DashboardAdminController.php
  3. +1
    -1
      Controller/Ticket/TicketAdminController.php
  4. +0
    -1
      EventSubscriber/SiteSettingEventSubscriber.php
  5. +0
    -1
      Model/User/UserModel.php

+ 18
- 18
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);
{ {
$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)

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

// 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(),

+ 0
- 1
EventSubscriber/SiteSettingEventSubscriber.php View File

} }
} }



$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;

Loading…
Cancel
Save