Pārlūkot izejas kodu

Correctif

feature/symfony6.1
Fabien Normand pirms 2 gadiem
vecāks
revīzija
82a7e0a969
4 mainītis faili ar 33 papildinājumiem un 3 dzēšanām
  1. +21
    -1
      Builder/User/UserBuilder.php
  2. +2
    -1
      Resources/translations/admin.fr.yaml
  3. +6
    -1
      Resources/views/adminlte/crud/form.html.twig
  4. +4
    -0
      Translation/TranslatorAdmin.php

+ 21
- 1
Builder/User/UserBuilder.php Parādīt failu

use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Lc\SovBundle\Doctrine\EntityInterface; use Lc\SovBundle\Doctrine\EntityInterface;
use Lc\SovBundle\Doctrine\Extension\BlameableInterface; use Lc\SovBundle\Doctrine\Extension\BlameableInterface;
use Lc\SovBundle\Factory\User\UserFactory;
use Lc\SovBundle\Model\Newsletter\NewsletterInterface; use Lc\SovBundle\Model\Newsletter\NewsletterInterface;
use Lc\SovBundle\Model\User\UserInterface; use Lc\SovBundle\Model\User\UserInterface;
use Lc\SovBundle\Repository\User\UserStore; use Lc\SovBundle\Repository\User\UserStore;
protected EntityManagerInterface $entityManager; protected EntityManagerInterface $entityManager;
protected UserStore $userStore; protected UserStore $userStore;
protected UserSolver $userSolver; protected UserSolver $userSolver;
public function __construct(EntityManagerInterface $entityManager, UserStore $userStore, UserSolver $userSolver)
protected UserFactory $userFactory;

public function __construct(EntityManagerInterface $entityManager, UserStore $userStore, UserSolver $userSolver, UserFactory $userFactory)
{ {
$this->entityManager = $entityManager; $this->entityManager = $entityManager;
$this->userStore = $userStore; $this->userStore = $userStore;
$this->userSolver = $userSolver; $this->userSolver = $userSolver;
$this->userFactory = $userFactory;
}


public function create( string $email, string $password, array $roles=[])
{
$user = $this->userFactory->create();
$user->setEmail($email);
$user->setPassword($password);

$user->setRoles($roles);
$this->entityManager->create($user);
$this->entityManager->flush();

return $user;

} }


public function setNewsletter(UserInterface $user, NewsletterInterface $newsletter, bool $subscribeNewsletter): void public function setNewsletter(UserInterface $user, NewsletterInterface $newsletter, bool $subscribeNewsletter): void


return $entity; return $entity;
} }

public function initBlameableUpdatedSystem(EntityInterface $entity) public function initBlameableUpdatedSystem(EntityInterface $entity)
{ {
$userSystem = $this->userStore->getOneByDevAlias('system'); $userSystem = $this->userStore->getOneByDevAlias('system');

+ 2
- 1
Resources/translations/admin.fr.yaml Parādīt failu

index: '%label_plurial%' index: '%label_plurial%'
sort: Ordonner "%label_plurial%" sort: Ordonner "%label_plurial%"
new: Ajouter "%label%" new: Ajouter "%label%"
edit: Modifier "%label%" (#%id%)
edit: 'Modifier "%label%" (#%id%)'
editWithTitle: 'Modifier "%label%" : %title% (#%id%)'
detail: Voir "%label%" (#%id%) detail: Voir "%label%" (#%id%)
un_titre: Un titre un_titre: Un titre
account: account:

+ 6
- 1
Resources/views/adminlte/crud/form.html.twig Parādīt failu



{% set body_id = 'ea-edit-' ~ translation_entity_name ~ '-' ~ entity.primaryKeyValue %} {% set body_id = 'ea-edit-' ~ translation_entity_name ~ '-' ~ entity.primaryKeyValue %}
{% set body_class = 'ea-edit ea-edit-' ~ translation_entity_name %} {% set body_class = 'ea-edit ea-edit-' ~ translation_entity_name %}
{% set content_title = 'edit'|sov_trans_admin_title(translation_entity_name, {id: ea.getEntity().getInstance().getId()}) %}
{% if attribute(ea.getEntity().getInstance(), 'getTitle') is defined %}
{% set content_title = 'editWithTitle'|sov_trans_admin_title(translation_entity_name, {id: ea.getEntity().getInstance().getId(), title: ea.getEntity().getInstance().getTitle()}) %}
{% else %}
{% set content_title = 'edit'|sov_trans_admin_title(translation_entity_name, {id: ea.getEntity().getInstance().getId()}) %}

{% endif %}
{% endif %} {% endif %}





+ 4
- 0
Translation/TranslatorAdmin.php Parādīt failu

$paramsTranslation['%id%'] = $params['id']; $paramsTranslation['%id%'] = $params['id'];
} }


if (isset($params['title'])) {
$paramsTranslation['%title%'] = $params['title'];
}

return $this->trans( return $this->trans(
'title.' . $pageName, 'title.' . $pageName,
$paramsTranslation $paramsTranslation

Notiek ielāde…
Atcelt
Saglabāt