mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-24 11:59:31 +00:00
Organized parameters better.
Parameters can now be found in their own file config/parameters.yaml. They are prefixed with partdb. and structured into different sections.
This commit is contained in:
parent
ffdb721e38
commit
decc4e90fc
11 changed files with 86 additions and 57 deletions
|
|
@ -47,9 +47,18 @@ use App\Entity\PriceInformations\Currency;
|
|||
use App\Form\Type\StructuralEntityType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\MoneyType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
class SupplierForm extends CompanyForm
|
||||
{
|
||||
protected $default_currency;
|
||||
|
||||
public function __construct(Security $security, string $default_currency)
|
||||
{
|
||||
parent::__construct($security);
|
||||
$this->default_currency = $default_currency;
|
||||
}
|
||||
|
||||
protected function additionalFormElements(FormBuilderInterface $builder, array $options, AbstractNamedDBElement $entity): void
|
||||
{
|
||||
$is_new = null === $entity->getID();
|
||||
|
|
@ -66,7 +75,7 @@ class SupplierForm extends CompanyForm
|
|||
|
||||
$builder->add('shipping_costs', MoneyType::class, [
|
||||
'required' => false,
|
||||
'currency' => $this->params->get('default_currency'),
|
||||
'currency' => $this->default_currency,
|
||||
'scale' => 3,
|
||||
'label' => 'supplier.shipping_costs.label',
|
||||
'disabled' => ! $this->security->isGranted($is_new ? 'create' : 'move', $entity),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue