mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Allow to dynamically create currencies in pricedetails
This fixes issue #413
This commit is contained in:
parent
388d26fa05
commit
b500fa82bb
1 changed files with 7 additions and 0 deletions
|
@ -27,12 +27,18 @@ use App\Entity\PriceInformations\Pricedetail;
|
|||
use App\Form\Type\BigDecimalNumberType;
|
||||
use App\Form\Type\CurrencyEntityType;
|
||||
use App\Form\Type\SIUnitType;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PricedetailType extends AbstractType
|
||||
{
|
||||
|
||||
public function __construct(private readonly Security $security)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
//No labels needed, we define translation in templates
|
||||
|
@ -63,6 +69,7 @@ class PricedetailType extends AbstractType
|
|||
'required' => false,
|
||||
'label' => false,
|
||||
'short' => true,
|
||||
'allow_add' => $this->security->isGranted('@currencies.create'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue