mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Allow to put parameters in different groups.
This commit is contained in:
parent
43857ce985
commit
2899db0206
31 changed files with 114 additions and 23 deletions
|
@ -64,6 +64,7 @@ class AttachmentType extends AbstractStructuralDBElement
|
||||||
|
|
||||||
/** @var AttachmentTypeParameter[]
|
/** @var AttachmentTypeParameter[]
|
||||||
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\AttachmentTypeParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\AttachmentTypeParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||||
|
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
protected $parameters;
|
protected $parameters;
|
||||||
|
|
|
@ -100,6 +100,7 @@ class Device extends AbstractPartsContainingDBElement
|
||||||
|
|
||||||
/** @var DeviceParameter[]
|
/** @var DeviceParameter[]
|
||||||
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\DeviceParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\DeviceParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||||
|
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
|
||||||
*/
|
*/
|
||||||
protected $parameters;
|
protected $parameters;
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ use App\Entity\Base\AbstractNamedDBElement;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use LogicException;
|
use LogicException;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
use Symfony\Component\Validator\Constraints as Assert;
|
use Symfony\Component\Validator\Constraints as Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -211,6 +212,26 @@ abstract class AbstractParameter extends AbstractNamedDBElement
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the name of the group this parameter is associated to (e.g. Technical Parameters)
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getGroup(): string
|
||||||
|
{
|
||||||
|
return $this->group;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the name of the group this parameter is associated to.
|
||||||
|
* @param string $group
|
||||||
|
* @return $this
|
||||||
|
*/
|
||||||
|
public function setGroup(string $group): self
|
||||||
|
{
|
||||||
|
$this->group = $group;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the mathematical symbol for this specification (e.g. "V_CB").
|
* Returns the mathematical symbol for this specification (e.g. "V_CB").
|
||||||
*
|
*
|
||||||
|
|
|
@ -25,9 +25,11 @@ namespace App\Entity\Parameters;
|
||||||
|
|
||||||
use App\Entity\Attachments\AttachmentType;
|
use App\Entity\Attachments\AttachmentType;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity()
|
* @ORM\Entity()
|
||||||
|
* @UniqueEntity(fields={"name", "group", "element"})
|
||||||
*/
|
*/
|
||||||
class AttachmentTypeParameter extends AbstractParameter
|
class AttachmentTypeParameter extends AbstractParameter
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,9 +25,11 @@ namespace App\Entity\Parameters;
|
||||||
|
|
||||||
use App\Entity\Parts\Category;
|
use App\Entity\Parts\Category;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity()
|
* @ORM\Entity()
|
||||||
|
* @UniqueEntity(fields={"name", "group", "element"})
|
||||||
*/
|
*/
|
||||||
class CategoryParameter extends AbstractParameter
|
class CategoryParameter extends AbstractParameter
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,11 +25,13 @@ namespace App\Entity\Parameters;
|
||||||
|
|
||||||
use App\Entity\PriceInformations\Currency;
|
use App\Entity\PriceInformations\Currency;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A attachment attached to a category element.
|
* A attachment attached to a category element.
|
||||||
*
|
*
|
||||||
* @ORM\Entity()
|
* @ORM\Entity()
|
||||||
|
* @UniqueEntity(fields={"name", "group", "element"})
|
||||||
*/
|
*/
|
||||||
class CurrencyParameter extends AbstractParameter
|
class CurrencyParameter extends AbstractParameter
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,9 +25,11 @@ namespace App\Entity\Parameters;
|
||||||
|
|
||||||
use App\Entity\Devices\Device;
|
use App\Entity\Devices\Device;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity()
|
* @ORM\Entity()
|
||||||
|
* @UniqueEntity(fields={"name", "group", "element"})
|
||||||
*/
|
*/
|
||||||
class DeviceParameter extends AbstractParameter
|
class DeviceParameter extends AbstractParameter
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,9 +25,11 @@ namespace App\Entity\Parameters;
|
||||||
|
|
||||||
use App\Entity\Parts\Footprint;
|
use App\Entity\Parts\Footprint;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity()
|
* @ORM\Entity()
|
||||||
|
* @UniqueEntity(fields={"name", "group", "element"})
|
||||||
*/
|
*/
|
||||||
class FootprintParameter extends AbstractParameter
|
class FootprintParameter extends AbstractParameter
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,9 +25,11 @@ namespace App\Entity\Parameters;
|
||||||
|
|
||||||
use App\Entity\UserSystem\Group;
|
use App\Entity\UserSystem\Group;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity()
|
* @ORM\Entity()
|
||||||
|
* @UniqueEntity(fields={"name", "group", "element"})
|
||||||
*/
|
*/
|
||||||
class GroupParameter extends AbstractParameter
|
class GroupParameter extends AbstractParameter
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,9 +25,11 @@ namespace App\Entity\Parameters;
|
||||||
|
|
||||||
use App\Entity\Parts\Manufacturer;
|
use App\Entity\Parts\Manufacturer;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity()
|
* @ORM\Entity()
|
||||||
|
* @UniqueEntity(fields={"name", "group", "element"})
|
||||||
*/
|
*/
|
||||||
class ManufacturerParameter extends AbstractParameter
|
class ManufacturerParameter extends AbstractParameter
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,9 +25,11 @@ namespace App\Entity\Parameters;
|
||||||
|
|
||||||
use App\Entity\Parts\MeasurementUnit;
|
use App\Entity\Parts\MeasurementUnit;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity()
|
* @ORM\Entity()
|
||||||
|
* @UniqueEntity(fields={"name", "group", "element"})
|
||||||
*/
|
*/
|
||||||
class MeasurementUnitParameter extends AbstractParameter
|
class MeasurementUnitParameter extends AbstractParameter
|
||||||
{
|
{
|
||||||
|
|
|
@ -65,4 +65,14 @@ trait ParametersTrait
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getGroupedParameters(): array
|
||||||
|
{
|
||||||
|
$tmp = [];
|
||||||
|
|
||||||
|
foreach ($this->parameters as $parameter) {
|
||||||
|
$tmp[$parameter->getGroup()][] = $parameter;
|
||||||
|
}
|
||||||
|
return $tmp;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,9 +25,11 @@ namespace App\Entity\Parameters;
|
||||||
|
|
||||||
use App\Entity\Parts\Part;
|
use App\Entity\Parts\Part;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity()
|
* @ORM\Entity()
|
||||||
|
* @UniqueEntity(fields={"name", "group", "element"})
|
||||||
*/
|
*/
|
||||||
class PartParameter extends AbstractParameter
|
class PartParameter extends AbstractParameter
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,9 +25,11 @@ namespace App\Entity\Parameters;
|
||||||
|
|
||||||
use App\Entity\Parts\Storelocation;
|
use App\Entity\Parts\Storelocation;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity()
|
* @ORM\Entity()
|
||||||
|
* @UniqueEntity(fields={"name", "group", "element"})
|
||||||
*/
|
*/
|
||||||
class StorelocationParameter extends AbstractParameter
|
class StorelocationParameter extends AbstractParameter
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,9 +25,11 @@ namespace App\Entity\Parameters;
|
||||||
|
|
||||||
use App\Entity\Parts\Supplier;
|
use App\Entity\Parts\Supplier;
|
||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Entity()
|
* @ORM\Entity()
|
||||||
|
* @UniqueEntity(fields={"name", "group", "element"})
|
||||||
*/
|
*/
|
||||||
class SupplierParameter extends AbstractParameter
|
class SupplierParameter extends AbstractParameter
|
||||||
{
|
{
|
||||||
|
|
|
@ -109,6 +109,7 @@ class Category extends AbstractPartsContainingDBElement
|
||||||
|
|
||||||
/** @var CategoryParameter[]
|
/** @var CategoryParameter[]
|
||||||
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\CategoryParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\CategoryParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||||
|
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
protected $parameters;
|
protected $parameters;
|
||||||
|
|
|
@ -96,6 +96,7 @@ class Footprint extends AbstractPartsContainingDBElement
|
||||||
|
|
||||||
/** @var FootprintParameter[]
|
/** @var FootprintParameter[]
|
||||||
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\FootprintParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\FootprintParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||||
|
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})@ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
protected $parameters;
|
protected $parameters;
|
||||||
|
|
|
@ -89,6 +89,7 @@ class Manufacturer extends AbstractCompany
|
||||||
|
|
||||||
/** @var ManufacturerParameter[]
|
/** @var ManufacturerParameter[]
|
||||||
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\ManufacturerParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\ManufacturerParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||||
|
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
protected $parameters;
|
protected $parameters;
|
||||||
|
|
|
@ -106,6 +106,7 @@ class MeasurementUnit extends AbstractPartsContainingDBElement
|
||||||
|
|
||||||
/** @var MeasurementUnitParameter[]
|
/** @var MeasurementUnitParameter[]
|
||||||
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\MeasurementUnitParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\MeasurementUnitParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||||
|
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
protected $parameters;
|
protected $parameters;
|
||||||
|
|
|
@ -93,6 +93,8 @@ class Part extends AttachmentContainingDBElement
|
||||||
/** @var PartParameter[]
|
/** @var PartParameter[]
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\PartParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\PartParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||||
|
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
|
||||||
|
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
|
||||||
*/
|
*/
|
||||||
protected $parameters;
|
protected $parameters;
|
||||||
|
|
||||||
|
|
|
@ -94,6 +94,7 @@ class Storelocation extends AbstractPartsContainingDBElement
|
||||||
|
|
||||||
/** @var StorelocationParameter[]
|
/** @var StorelocationParameter[]
|
||||||
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\StorelocationParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\StorelocationParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||||
|
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
protected $parameters;
|
protected $parameters;
|
||||||
|
|
|
@ -116,6 +116,7 @@ class Supplier extends AbstractCompany
|
||||||
|
|
||||||
/** @var SupplierParameter[]
|
/** @var SupplierParameter[]
|
||||||
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\SupplierParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\SupplierParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||||
|
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
protected $parameters;
|
protected $parameters;
|
||||||
|
|
|
@ -96,6 +96,7 @@ class Currency extends AbstractStructuralDBElement
|
||||||
|
|
||||||
/** @var CurrencyParameter[]
|
/** @var CurrencyParameter[]
|
||||||
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\CurrencyParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\CurrencyParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||||
|
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
protected $parameters;
|
protected $parameters;
|
||||||
|
|
|
@ -95,6 +95,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
|
||||||
|
|
||||||
/** @var GroupParameter[]
|
/** @var GroupParameter[]
|
||||||
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\GroupParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
* @ORM\OneToMany(targetEntity="App\Entity\Parameters\GroupParameter", mappedBy="element", cascade={"persist", "remove"}, orphanRemoval=true)
|
||||||
|
* @ORM\OrderBy({"group" = "ASC" ,"name" = "ASC"})
|
||||||
* @Assert\Valid()
|
* @Assert\Valid()
|
||||||
*/
|
*/
|
||||||
protected $parameters;
|
protected $parameters;
|
||||||
|
|
|
@ -47,7 +47,7 @@ class ParameterType extends AbstractType
|
||||||
'attr' => [
|
'attr' => [
|
||||||
'placeholder' => 'parameters.symbol.placeholder',
|
'placeholder' => 'parameters.symbol.placeholder',
|
||||||
'class' => 'form-control-sm',
|
'class' => 'form-control-sm',
|
||||||
'style' => 'max-width: 15ch;',
|
'style' => 'max-width: 12ch;',
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
$builder->add('value_text', TextType::class, [
|
$builder->add('value_text', TextType::class, [
|
||||||
|
@ -66,7 +66,7 @@ class ParameterType extends AbstractType
|
||||||
'step' => 'any',
|
'step' => 'any',
|
||||||
'placeholder' => 'parameters.max.placeholder',
|
'placeholder' => 'parameters.max.placeholder',
|
||||||
'class' => 'form-control-sm',
|
'class' => 'form-control-sm',
|
||||||
'style' => 'max-width: 15ch;',
|
'style' => 'max-width: 12ch;',
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
$builder->add('value_min', NumberType::class, [
|
$builder->add('value_min', NumberType::class, [
|
||||||
|
@ -76,7 +76,7 @@ class ParameterType extends AbstractType
|
||||||
'step' => 'any',
|
'step' => 'any',
|
||||||
'placeholder' => 'parameters.min.placeholder',
|
'placeholder' => 'parameters.min.placeholder',
|
||||||
'class' => 'form-control-sm',
|
'class' => 'form-control-sm',
|
||||||
'style' => 'max-width: 15ch;',
|
'style' => 'max-width: 12ch;',
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
$builder->add('value_typical', NumberType::class, [
|
$builder->add('value_typical', NumberType::class, [
|
||||||
|
@ -86,7 +86,7 @@ class ParameterType extends AbstractType
|
||||||
'step' => 'any',
|
'step' => 'any',
|
||||||
'placeholder' => 'parameters.typical.placeholder',
|
'placeholder' => 'parameters.typical.placeholder',
|
||||||
'class' => 'form-control-sm',
|
'class' => 'form-control-sm',
|
||||||
'style' => 'max-width: 15ch;',
|
'style' => 'max-width: 12ch;',
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
$builder->add('unit', TextType::class, [
|
$builder->add('unit', TextType::class, [
|
||||||
|
@ -98,12 +98,21 @@ class ParameterType extends AbstractType
|
||||||
'style' => 'max-width: 8ch;',
|
'style' => 'max-width: 8ch;',
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$builder->add('group', TextType::class, [
|
||||||
|
'required' => false,
|
||||||
|
'empty_data' => '',
|
||||||
|
'attr' => [
|
||||||
|
'placeholder' => 'parameter.group.placeholder',
|
||||||
|
'class' => 'form-control-sm',
|
||||||
|
]
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configureOptions(OptionsResolver $resolver): void
|
public function configureOptions(OptionsResolver $resolver): void
|
||||||
{
|
{
|
||||||
$resolver->setDefaults([
|
$resolver->setDefaults([
|
||||||
'data_class' => AbstractParameter::class,
|
'data_class' => AbstractParameter::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ use App\Entity\Parts\MeasurementUnit;
|
||||||
use App\Entity\Parts\Part;
|
use App\Entity\Parts\Part;
|
||||||
use App\Entity\PriceInformations\Orderdetail;
|
use App\Entity\PriceInformations\Orderdetail;
|
||||||
use App\Form\AttachmentFormType;
|
use App\Form\AttachmentFormType;
|
||||||
|
use App\Form\ParameterGroupType;
|
||||||
use App\Form\ParameterType;
|
use App\Form\ParameterType;
|
||||||
use App\Form\Type\MasterPictureAttachmentType;
|
use App\Form\Type\MasterPictureAttachmentType;
|
||||||
use App\Form\Type\SIUnitType;
|
use App\Form\Type\SIUnitType;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
<th>{% trans %}specifications.value_max{% endtrans %}</th>
|
<th>{% trans %}specifications.value_max{% endtrans %}</th>
|
||||||
<th>{% trans %}specifications.unit{% endtrans %}</th>
|
<th>{% trans %}specifications.unit{% endtrans %}</th>
|
||||||
<th>{% trans %}specifications.text{% endtrans %}</th>
|
<th>{% trans %}specifications.text{% endtrans %}</th>
|
||||||
|
<th>{% trans %}specifications.group{% endtrans %}</th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
|
@ -73,6 +73,7 @@
|
||||||
<td>{{ form_widget(form.value_max) }}{{ form_errors(form.value_max) }}</td>
|
<td>{{ form_widget(form.value_max) }}{{ form_errors(form.value_max) }}</td>
|
||||||
<td>{{ form_widget(form.unit) }}{{ form_errors(form.unit) }}</td>
|
<td>{{ form_widget(form.unit) }}{{ form_errors(form.unit) }}</td>
|
||||||
<td>{{ form_widget(form.value_text) }}{{ form_errors(form.value_text) }}</td>
|
<td>{{ form_widget(form.value_text) }}{{ form_errors(form.value_text) }}</td>
|
||||||
|
<td>{{ form_widget(form.group) }}{{ form_errors(form.group) }}</td>
|
||||||
<td>
|
<td>
|
||||||
<button type="button" class="btn btn-danger btn-sm order_btn_delete" onclick="delete_specification_entry(this);" title="{% trans %}orderdetail.delete{% endtrans %}">
|
<button type="button" class="btn btn-danger btn-sm order_btn_delete" onclick="delete_specification_entry(this);" title="{% trans %}orderdetail.delete{% endtrans %}">
|
||||||
<i class="fas fa-trash-alt fa-fw"></i>
|
<i class="fas fa-trash-alt fa-fw"></i>
|
||||||
|
|
|
@ -1,18 +1,7 @@
|
||||||
{# var \App\Entity\Parts\Part part #}
|
{# var \App\Entity\Parts\Part part #}
|
||||||
|
{% import "helper.twig" as helper %}
|
||||||
|
|
||||||
<table class="table table-hover table-striped table-sm">
|
{% for name, parameters in part.groupedParameters %}
|
||||||
<thead>
|
{% if name is not empty %}<h5 class="mt-1">{{ name }}</h5>{% endif %}
|
||||||
<tr>
|
{{ helper.parameters_table(parameters) }}
|
||||||
<th>{% trans %}specifications.property{% endtrans %}</th>
|
{% endfor %}
|
||||||
<th>{% trans %}specifications.value{% endtrans %}</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{% for param in part.parameters %}
|
|
||||||
<tr>
|
|
||||||
<td>{{ param.name }} {% if param.symbol is not empty %}<span class="latex">${{ param.symbol }}$</span>{% endif %}</td>
|
|
||||||
<td>{{ param.formattedValue }}</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
|
@ -111,4 +111,23 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro parameters_table(parameters) %}
|
||||||
|
<table class="table table-hover table-striped table-sm">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{% trans %}specifications.property{% endtrans %}</th>
|
||||||
|
<th>{% trans %}specifications.value{% endtrans %}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for param in parameters %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ param.name }} {% if param.symbol is not empty %}<span class="latex">${{ param.symbol }}$</span>{% endif %}</td>
|
||||||
|
<td>{{ param.formattedValue }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
{% endmacro parameters_table %}
|
|
@ -7994,5 +7994,11 @@ Element 3</target>
|
||||||
<target>Text</target>
|
<target>Text</target>
|
||||||
</segment>
|
</segment>
|
||||||
</unit>
|
</unit>
|
||||||
|
<unit id="t9lgp3U" name="specifications.group">
|
||||||
|
<segment>
|
||||||
|
<source>specifications.group</source>
|
||||||
|
<target>Group</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue