@@ -20,18 +20,10 @@ abstract class TaxRateAdminController extends AbstractAdminController | |||
public function configureFields(string $pageName): iterable | |||
{ | |||
$id = IntegerField::new('id', 'ID'); | |||
$title = TextField::new('title'); | |||
$value = NumberField::new('value'); | |||
if (Crud::PAGE_INDEX === $pageName) { | |||
return [$id, $title, $value]; | |||
} elseif (Crud::PAGE_DETAIL === $pageName) { | |||
return [$id, $title, $value]; | |||
} elseif (Crud::PAGE_NEW === $pageName) { | |||
return [$title, $value]; | |||
} elseif (Crud::PAGE_EDIT === $pageName) { | |||
return [$title, $value]; | |||
} | |||
return [ | |||
IntegerField::new('id', 'ID')->hideOnForm(), | |||
TextField::new('title'), | |||
NumberField::new('value') | |||
]; | |||
} | |||
} |
@@ -0,0 +1,29 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Controller\Config; | |||
use EasyCorp\Bundle\EasyAdminBundle\Config\Crud; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\IntegerField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
abstract class UnitAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
public function configureFields(string $pageName): iterable | |||
{ | |||
return [ | |||
IntegerField::new('id', 'ID')->hideOnForm(), | |||
TextField::new('unit'), | |||
TextField::new('wording'), | |||
TextField::new('wordingUnit'), | |||
TextField::new('wordingShort'), | |||
IntegerField::new('coefficient'), | |||
AssociationField::new('unitReference'), | |||
]; | |||
} | |||
} |
@@ -3,6 +3,7 @@ | |||
namespace Lc\CaracoleBundle\Repository\Config; | |||
use Lc\CaracoleBundle\Model\Config\TaxRateInterface; | |||
use Lc\CaracoleBundle\Repository\RepositoryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
/** | |||
@@ -13,6 +14,8 @@ use Lc\SovBundle\Repository\AbstractRepository; | |||
*/ | |||
class TaxRateRepository extends AbstractRepository | |||
{ | |||
use RepositoryTrait; | |||
public function getInterfaceClass() | |||
{ | |||
return TaxRateInterface::class; |
@@ -2,9 +2,10 @@ | |||
namespace Lc\CaracoleBundle\Repository\Config; | |||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; | |||
use Doctrine\Persistence\ManagerRegistry; | |||
use Lc\CaracoleBundle\Model\Config\TaxRateInterface; | |||
use Lc\CaracoleBundle\Model\Config\UnitInterface; | |||
use Lc\CaracoleBundle\Repository\RepositoryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
/** | |||
* @method UnitInterface|null find($id, $lockMode = null, $lockVersion = null) | |||
@@ -12,10 +13,14 @@ use Lc\CaracoleBundle\Model\Config\UnitInterface; | |||
* @method UnitInterface[] findAll() | |||
* @method UnitInterface[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) | |||
*/ | |||
class UnitRepository extends ServiceEntityRepository | |||
class UnitRepository extends AbstractRepository | |||
{ | |||
public function __construct(ManagerRegistry $registry) | |||
use RepositoryTrait; | |||
public function getInterfaceClass() | |||
{ | |||
parent::__construct($registry, UnitInterface::class); | |||
return UnitInterface::class; | |||
} | |||
} |
@@ -9,7 +9,7 @@ use Lc\CaracoleBundle\Resolver\MerchantResolver; | |||
use Lc\CaracoleBundle\Resolver\SectionResolver; | |||
use Lc\SovBundle\Repository\AbstractRepository as SovAbstractRepository; | |||
abstract class AbstractRepository extends SovAbstractRepository | |||
trait RepositoryTrait | |||
{ | |||
protected $merchantResolver; | |||
protected $sectionResolver; |
@@ -3,7 +3,8 @@ | |||
namespace Lc\CaracoleBundle\Repository\Section; | |||
use Lc\CaracoleBundle\Model\Section\SectionInterface; | |||
use Lc\CaracoleBundle\Repository\AbstractRepository; | |||
use Lc\CaracoleBundle\Repository\RepositoryTrait; | |||
use Lc\SovBundle\Repository\AbstractRepository; | |||
/** | |||
* @method SectionInterface|null find($id, $lockMode = null, $lockVersion = null) | |||
@@ -13,6 +14,8 @@ use Lc\CaracoleBundle\Repository\AbstractRepository; | |||
*/ | |||
class SectionRepository extends AbstractRepository | |||
{ | |||
use RepositoryTrait; | |||
public function getInterfaceClass() | |||
{ | |||
return SectionInterface::class; |
@@ -2,6 +2,7 @@ | |||
namespace Lc\CaracoleBundle\Repository\User; | |||
use Lc\CaracoleBundle\Repository\RepositoryTrait; | |||
use Lc\SovBundle\Model\User\GroupUserInterface; | |||
use Lc\SovBundle\Repository\User\GroupUserRepository as SovGroupUserRepository; | |||
@@ -13,8 +14,5 @@ use Lc\SovBundle\Repository\User\GroupUserRepository as SovGroupUserRepository; | |||
*/ | |||
class GroupUserRepository extends SovGroupUserRepository | |||
{ | |||
public function getInterfaceClass() | |||
{ | |||
return GroupUserInterface::class; | |||
} | |||
use RepositoryTrait; | |||
} |
@@ -7,9 +7,11 @@ menu: | |||
admin_merchant: Marchands | |||
admin_section: Sections | |||
admin_tva: TVA | |||
admin_unit: Unités | |||
user_merchant_index: Utilisateurs | |||
group_user_index: Groupes d'utilisateurs | |||
flash_message: | |||
settings_saved: Paramètres mis à jour | |||
@@ -52,6 +54,17 @@ entity: | |||
GroupUser: | |||
label: Groupe d'utilisateur | |||
label_plurial: Groupes d'utilisateurs | |||
Unit: | |||
label: Unité | |||
label_plurial: Unités | |||
fields: | |||
unit: Unité | |||
wording: Nom | |||
wordingUnit: Nom long | |||
wordingShort: Nom court | |||
coefficient: Coefficient | |||
unitReference: Unité de référence | |||
form: | |||
user_merchant: |