diff --git a/.env b/.env
index 2b98255f..f23afe8b 100644
--- a/.env
+++ b/.env
@@ -35,9 +35,6 @@ DATABASE_EMULATE_NATURAL_SORT=0
# This must end with a slash!
DEFAULT_URI="https://partdb.changeme.invalid/"
-# Use an %%ipn%% placeholder in the name of a assembly. Placeholder is replaced with the ipn input while saving.
-CREATE_ASSEMBLY_USE_IPN_PLACEHOLDER_IN_NAME=0
-
###################################################################################
# Email settings
###################################################################################
diff --git a/config/services.yaml b/config/services.yaml
index c119d1ef..ed063b49 100644
--- a/config/services.yaml
+++ b/config/services.yaml
@@ -164,10 +164,6 @@ services:
arguments:
$saml_enabled: '%partdb.saml.enabled%'
- App\Form\AdminPages\AssemblyAdminForm:
- arguments:
- $useAssemblyIpnPlaceholder: '%partdb.create_assembly_use_ipn_placeholder_in_name%'
-
App\Validator\Constraints\AssemblySystem\AssemblyCycleValidator:
tags: [ 'validator.constraint_validator' ]
@@ -183,12 +179,6 @@ services:
App\DataTables\Helpers\ColumnSortHelper:
shared: false # Service has a state so not share it between different tables
- App\DataTables\AssemblyDataTable:
- arguments:
- $visible_columns: '%partdb.table.assemblies.default_columns%'
- App\DataTables\AssemblyBomEntriesDataTable:
- arguments:
- $visible_columns: '%partdb.table.assemblies_bom.default_columns%'
####################################################################################################################
# Label system
diff --git a/migrations/Version20250627130848.php b/migrations/Version20250627130848.php
index 16a6f318..6223de13 100644
--- a/migrations/Version20250627130848.php
+++ b/migrations/Version20250627130848.php
@@ -17,7 +17,7 @@ final class Version20250627130848 extends AbstractMultiPlatformMigration
public function mySQLUp(Schema $schema): void
{
$this->addSql(<<<'SQL'
- ALTER TABLE assembly_bom_entries ADD id_referenced_assembly INT DEFAULT NULL AFTER id_project
+ ALTER TABLE assembly_bom_entries ADD id_referenced_assembly INT DEFAULT NULL AFTER id_part
SQL);
$this->addSql(<<<'SQL'
ALTER TABLE assembly_bom_entries ADD CONSTRAINT FK_8C74887E22522999 FOREIGN KEY (id_referenced_assembly) REFERENCES assemblies (id) ON DELETE SET NULL
diff --git a/migrations/Version20250910113423.php b/migrations/Version20250910113423.php
new file mode 100644
index 00000000..0e65e4ab
--- /dev/null
+++ b/migrations/Version20250910113423.php
@@ -0,0 +1,51 @@
+addSql('ALTER TABLE assembly_bom_entries DROP FOREIGN KEY `FK_8C74887EF12E799E`');
+ $this->addSql('DROP INDEX IDX_8C74887EF12E799E ON assembly_bom_entries');
+ $this->addSql('ALTER TABLE assembly_bom_entries DROP id_project');
+ }
+
+ public function mySQLDown(Schema $schema): void
+ {
+ $this->addSql('ALTER TABLE assembly_bom_entries ADD id_project INT DEFAULT NULL');
+ $this->addSql('ALTER TABLE assembly_bom_entries ADD CONSTRAINT `FK_8C74887EF12E799E` FOREIGN KEY (id_project) REFERENCES projects (id)');
+ $this->addSql('CREATE INDEX IDX_8C74887EF12E799E ON assembly_bom_entries (id_project)');
+ }
+
+ public function sqLiteUp(Schema $schema): void
+ {
+ //nothing to do. Already removed from AssemblyBOMEntry and Version20250304081039
+ }
+
+ public function sqLiteDown(Schema $schema): void
+ {
+ //nothing to do.
+ }
+
+ public function postgreSQLUp(Schema $schema): void
+ {
+ //nothing to do. Already removed from AssemblyBOMEntry and Version20250304081039
+ }
+
+ public function postgreSQLDown(Schema $schema): void
+ {
+ //nothing to do.
+ }
+}
diff --git a/src/Controller/AssemblyController.php b/src/Controller/AssemblyController.php
index 94e12964..520bc52d 100644
--- a/src/Controller/AssemblyController.php
+++ b/src/Controller/AssemblyController.php
@@ -216,6 +216,7 @@ class AssemblyController extends AbstractController
'assembly.bom_import.type.json' => 'json',
'assembly.bom_import.type.csv' => 'csv',
'assembly.bom_import.type.kicad_pcbnew' => 'kicad_pcbnew',
+ 'assembly.bom_import.type.kicad_schematic' => 'kicad_schematic',
]
]);
$builder->add('clear_existing_bom', CheckboxType::class, [
diff --git a/src/Controller/ProjectController.php b/src/Controller/ProjectController.php
index 7b69ba2b..151bf18f 100644
--- a/src/Controller/ProjectController.php
+++ b/src/Controller/ProjectController.php
@@ -421,7 +421,7 @@ class ProjectController extends AbstractController
}
// Import with field mapping and priorities (validation already passed)
- $entries = $BOMImporter->stringToBOMEntries($file_content, [
+ $entries = $BOMImporter->stringToBOMEntries($project, $file_content, [
'type' => 'kicad_schematic',
'field_mapping' => $field_mapping,
'field_priorities' => $field_priorities,
diff --git a/src/DataTables/AssemblyBomEntriesDataTable.php b/src/DataTables/AssemblyBomEntriesDataTable.php
index 48d65040..2afec65a 100644
--- a/src/DataTables/AssemblyBomEntriesDataTable.php
+++ b/src/DataTables/AssemblyBomEntriesDataTable.php
@@ -34,8 +34,8 @@ use App\Entity\Attachments\Attachment;
use App\Entity\Parts\Part;
use App\Entity\AssemblySystem\AssemblyBOMEntry;
use App\Entity\ProjectSystem\Project;
-use App\Services\EntityURLGenerator;
use App\Services\Formatters\AmountFormatter;
+use App\Settings\BehaviorSettings\TableSettings;
use Doctrine\ORM\QueryBuilder;
use Omines\DataTablesBundle\Adapter\Doctrine\ORM\SearchCriteriaProvider;
use Omines\DataTablesBundle\Adapter\Doctrine\ORMAdapter;
@@ -47,15 +47,14 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class AssemblyBomEntriesDataTable implements DataTableTypeInterface
{
public function __construct(
- protected TranslatorInterface $translator,
- protected PartDataTableHelper $partDataTableHelper,
- protected ProjectDataTableHelper $projectDataTableHelper,
- protected AssemblyDataTableHelper $assemblyDataTableHelper,
- protected EntityURLGenerator $entityURLGenerator,
- protected AmountFormatter $amountFormatter,
- private string $visible_columns,
- private ColumnSortHelper $csh
- ){
+ private readonly TranslatorInterface $translator,
+ private readonly PartDataTableHelper $partDataTableHelper,
+ private readonly ProjectDataTableHelper $projectDataTableHelper,
+ private readonly AssemblyDataTableHelper $assemblyDataTableHelper,
+ private readonly AmountFormatter $amountFormatter,
+ private readonly ColumnSortHelper $csh,
+ private readonly TableSettings $tableSettings,
+ ) {
}
public function configure(DataTable $dataTable, array $options): void
@@ -200,11 +199,11 @@ class AssemblyBomEntriesDataTable implements DataTableTypeInterface
])
->add('lastModified', LocaleDateTimeColumn::class, [
'label' => $this->translator->trans('part.table.lastModified'),
- ])
- ;
+ ]);
//Apply the user configured order and visibility and add the columns to the table
- $this->csh->applyVisibilityAndConfigureColumns($dataTable, $this->visible_columns,"TABLE_ASSEMBLIES_BOM_DEFAULT_COLUMNS");
+ $this->csh->applyVisibilityAndConfigureColumns($dataTable, $this->tableSettings->assembliesBomDefaultColumns,
+ "TABLE_ASSEMBLIES_BOM_DEFAULT_COLUMNS");
$dataTable->addOrderBy('name', DataTable::SORT_ASCENDING);
diff --git a/src/DataTables/AssemblyDataTable.php b/src/DataTables/AssemblyDataTable.php
index 745a62b6..aaad2e45 100644
--- a/src/DataTables/AssemblyDataTable.php
+++ b/src/DataTables/AssemblyDataTable.php
@@ -34,6 +34,7 @@ use App\DataTables\Helpers\ColumnSortHelper;
use App\Doctrine\Helpers\FieldHelper;
use App\Entity\AssemblySystem\Assembly;
use App\Services\EntityURLGenerator;
+use App\Settings\BehaviorSettings\TableSettings;
use Doctrine\ORM\AbstractQuery;
use Doctrine\ORM\QueryBuilder;
use Omines\DataTablesBundle\Adapter\Doctrine\ORM\SearchCriteriaProvider;
@@ -53,8 +54,8 @@ final class AssemblyDataTable implements DataTableTypeInterface
private readonly TranslatorInterface $translator,
private readonly AssemblyDataTableHelper $assemblyDataTableHelper,
private readonly Security $security,
- private readonly string $visible_columns,
private readonly ColumnSortHelper $csh,
+ private readonly TableSettings $tableSettings,
) {
}
@@ -139,7 +140,8 @@ final class AssemblyDataTable implements DataTableTypeInterface
]);
//Apply the user configured order and visibility and add the columns to the table
- $this->csh->applyVisibilityAndConfigureColumns($dataTable, $this->visible_columns, "TABLE_ASSEMBLIES_DEFAULT_COLUMNS");
+ $this->csh->applyVisibilityAndConfigureColumns($dataTable, $this->tableSettings->assembliesDefaultColumns,
+ "TABLE_ASSEMBLIES_DEFAULT_COLUMNS");
$dataTable->addOrderBy('name')
->createAdapter(TwoStepORMAdapter::class, [
diff --git a/src/Entity/AssemblySystem/AssemblyBOMEntry.php b/src/Entity/AssemblySystem/AssemblyBOMEntry.php
index eb24fd3e..ebadd2b9 100644
--- a/src/Entity/AssemblySystem/AssemblyBOMEntry.php
+++ b/src/Entity/AssemblySystem/AssemblyBOMEntry.php
@@ -150,18 +150,6 @@ class AssemblyBOMEntry extends AbstractDBElement implements UniqueValidatableInt
#[Groups(['bom_entry:read', 'bom_entry:write'])]
protected ?Assembly $referencedAssembly = null;
- /**
- * @var Project|null The associated project
- */
- #[Assert\Expression(
- '(this.getPart() === null or this.getProject() === null) and (this.getName() === null or (this.getName() != null and this.getName() != ""))',
- message: 'validator.project.bom_entry.only_part_or_assembly_allowed'
- )]
- #[ORM\ManyToOne(targetEntity: Project::class)]
- #[ORM\JoinColumn(name: 'id_project', nullable: true)]
- #[Groups(['bom_entry:read', 'bom_entry:write'])]
- protected ?Project $project = null;
-
/**
* @var BigDecimal|null The price of this non-part BOM entry
*/
diff --git a/src/Form/AdminPages/AssemblyAdminForm.php b/src/Form/AdminPages/AssemblyAdminForm.php
index 0512f64a..2c2f3cc4 100644
--- a/src/Form/AdminPages/AssemblyAdminForm.php
+++ b/src/Form/AdminPages/AssemblyAdminForm.php
@@ -26,6 +26,7 @@ use App\Entity\Base\AbstractNamedDBElement;
use App\Form\AssemblySystem\AssemblyBOMEntryCollectionType;
use App\Form\Type\RichTextEditorType;
use App\Services\LogSystem\EventCommentNeededHelper;
+use App\Settings\MiscSettings\AssemblySettings;
use Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
@@ -36,9 +37,9 @@ class AssemblyAdminForm extends BaseEntityAdminForm
public function __construct(
protected Security $security,
protected EventCommentNeededHelper $eventCommentNeededHelper,
- protected bool $useAssemblyIpnPlaceholder = false
+ protected AssemblySettings $assemblySettings,
) {
- parent::__construct($security, $eventCommentNeededHelper, $useAssemblyIpnPlaceholder);
+ parent::__construct($security, $eventCommentNeededHelper, $assemblySettings);
}
protected function additionalFormElements(FormBuilderInterface $builder, array $options, AbstractNamedDBElement $entity): void
diff --git a/src/Form/AdminPages/BaseEntityAdminForm.php b/src/Form/AdminPages/BaseEntityAdminForm.php
index bbc437e3..5ffd7f4d 100644
--- a/src/Form/AdminPages/BaseEntityAdminForm.php
+++ b/src/Form/AdminPages/BaseEntityAdminForm.php
@@ -27,6 +27,7 @@ use App\Entity\PriceInformations\Currency;
use App\Entity\ProjectSystem\Project;
use App\Entity\UserSystem\Group;
use App\Services\LogSystem\EventCommentType;
+use App\Settings\MiscSettings\AssemblySettings;
use Symfony\Bundle\SecurityBundle\Security;
use App\Entity\Base\AbstractNamedDBElement;
use App\Entity\Base\AbstractStructuralDBElement;
@@ -51,7 +52,7 @@ class BaseEntityAdminForm extends AbstractType
public function __construct(
protected Security $security,
protected EventCommentNeededHelper $eventCommentNeededHelper,
- protected bool $useAssemblyIpnPlaceholder = false
+ protected AssemblySettings $assemblySettings,
) {
}
@@ -73,7 +74,7 @@ class BaseEntityAdminForm extends AbstractType
->add('name', TextType::class, [
'empty_data' => '',
'label' => 'name.label',
- 'data' => $is_new && $entity instanceof Assembly && $this->useAssemblyIpnPlaceholder ? '%%ipn%%' : $entity->getName(),
+ 'data' => $is_new && $entity instanceof Assembly && $this->assemblySettings->useIpnPlaceholderInName ? '%%ipn%%' : $entity->getName(),
'attr' => [
'placeholder' => 'part.name.placeholder',
],
diff --git a/src/Services/ImportExportSystem/BOMImporter.php b/src/Services/ImportExportSystem/BOMImporter.php
index f36462fb..7facb56a 100644
--- a/src/Services/ImportExportSystem/BOMImporter.php
+++ b/src/Services/ImportExportSystem/BOMImporter.php
@@ -72,9 +72,9 @@ class BOMImporter
private CategoryRepository $categoryRepository;
- private DBElementRepository $projectBOMEntryRepository;
+ private DBElementRepository $projectBomEntryRepository;
- private DBElementRepository $assemblyBOMEntryRepository;
+ private DBElementRepository $assemblyBomEntryRepository;
public function __construct(
private readonly EntityManagerInterface $entityManager,
@@ -85,8 +85,8 @@ class BOMImporter
$this->partRepository = $entityManager->getRepository(Part::class);
$this->manufacturerRepository = $entityManager->getRepository(Manufacturer::class);
$this->categoryRepository = $entityManager->getRepository(Category::class);
- $this->projectBOMEntryRepository = $entityManager->getRepository(ProjectBOMEntry::class);
- $this->assemblyBOMEntryRepository = $entityManager->getRepository(AssemblyBOMEntry::class);
+ $this->projectBomEntryRepository = $entityManager->getRepository(ProjectBOMEntry::class);
+ $this->assemblyBomEntryRepository = $entityManager->getRepository(AssemblyBOMEntry::class);
}
protected function configureOptions(OptionsResolver $resolver): OptionsResolver
@@ -828,11 +828,11 @@ class BOMImporter
}
if ($importObject instanceof Assembly) {
- $bomEntry = $this->assemblyBOMEntryRepository->findOneBy(['assembly' => $importObject, 'part' => $part]);
+ $bomEntry = $this->assemblyBomEntryRepository->findOneBy(['assembly' => $importObject, 'part' => $part]);
if ($bomEntry === null) {
if (isset($entry['name']) && $entry['name'] !== '') {
- $bomEntry = $this->assemblyBOMEntryRepository->findOneBy(['assembly' => $importObject, 'name' => $entry['name']]);
+ $bomEntry = $this->assemblyBomEntryRepository->findOneBy(['assembly' => $importObject, 'name' => $entry['name']]);
}
if ($bomEntry === null) {
@@ -840,11 +840,11 @@ class BOMImporter
}
}
} else {
- $bomEntry = $this->projectBOMEntryRepository->findOneBy(['project' => $importObject, 'part' => $part]);
+ $bomEntry = $this->projectBomEntryRepository->findOneBy(['project' => $importObject, 'part' => $part]);
if ($bomEntry === null) {
if (isset($entry['name']) && $entry['name'] !== '') {
- $bomEntry = $this->projectBOMEntryRepository->findOneBy(['project' => $importObject, 'name' => $entry['name']]);
+ $bomEntry = $this->projectBomEntryRepository->findOneBy(['project' => $importObject, 'name' => $entry['name']]);
}
if ($bomEntry === null) {
@@ -914,9 +914,9 @@ class BOMImporter
//Check whether there is a name
if (!empty($name)) {
if ($importObject instanceof Project) {
- $bomEntry = $this->projectBOMEntryRepository->findOneBy(['name' => $name]);
+ $bomEntry = $this->projectBomEntryRepository->findOneBy(['name' => $name]);
} else {
- $bomEntry = $this->assemblyBOMEntryRepository->findOneBy(['name' => $name]);
+ $bomEntry = $this->assemblyBomEntryRepository->findOneBy(['name' => $name]);
}
}
diff --git a/src/Settings/BehaviorSettings/AssemblyBomTableColumns.php b/src/Settings/BehaviorSettings/AssemblyBomTableColumns.php
new file mode 100644
index 00000000..da8557c2
--- /dev/null
+++ b/src/Settings/BehaviorSettings/AssemblyBomTableColumns.php
@@ -0,0 +1,46 @@
+.
+ */
+
+declare(strict_types=1);
+
+
+namespace App\Settings\BehaviorSettings;
+
+use Symfony\Contracts\Translation\TranslatableInterface;
+use Symfony\Contracts\Translation\TranslatorInterface;
+
+enum AssemblyBomTableColumns : string implements TranslatableInterface
+{
+
+ case NAME = "name";
+ case ID = "id";
+ case QUANTITY = "quantity";
+ case IPN = "ipn";
+ case DESCRIPTION = "description";
+
+ public function trans(TranslatorInterface $translator, ?string $locale = null): string
+ {
+ $key = match($this) {
+ default => 'assembly.bom.table.' . $this->value,
+ };
+
+ return $translator->trans($key, locale: $locale);
+ }
+}
diff --git a/src/Settings/BehaviorSettings/AssemblyTableColumns.php b/src/Settings/BehaviorSettings/AssemblyTableColumns.php
new file mode 100644
index 00000000..02c315b4
--- /dev/null
+++ b/src/Settings/BehaviorSettings/AssemblyTableColumns.php
@@ -0,0 +1,49 @@
+.
+ */
+
+declare(strict_types=1);
+
+
+namespace App\Settings\BehaviorSettings;
+
+use Symfony\Contracts\Translation\TranslatableInterface;
+use Symfony\Contracts\Translation\TranslatorInterface;
+
+enum AssemblyTableColumns : string implements TranslatableInterface
+{
+
+ case NAME = "name";
+ case ID = "id";
+ case IPN = "ipn";
+ case DESCRIPTION = "description";
+ case REFERENCED_ASSEMBLIES = "referencedAssemblies";
+ case ADDED_DATE = "addedDate";
+ case LAST_MODIFIED = "lastModified";
+ case EDIT = "edit";
+
+ public function trans(TranslatorInterface $translator, ?string $locale = null): string
+ {
+ $key = match($this) {
+ default => 'assembly.table.' . $this->value,
+ };
+
+ return $translator->trans($key, locale: $locale);
+ }
+}
diff --git a/src/Settings/BehaviorSettings/TableSettings.php b/src/Settings/BehaviorSettings/TableSettings.php
index b6964876..5c7455e2 100644
--- a/src/Settings/BehaviorSettings/TableSettings.php
+++ b/src/Settings/BehaviorSettings/TableSettings.php
@@ -53,7 +53,6 @@ class TableSettings
)]
public int $fullDefaultPageSize = 50;
-
/** @var PartTableColumns[] */
#[SettingsParameter(ArrayType::class,
label: new TM("settings.behavior.table.parts_default_columns"),
@@ -70,6 +69,37 @@ class TableSettings
PartTableColumns::CATEGORY, PartTableColumns::FOOTPRINT, PartTableColumns::MANUFACTURER,
PartTableColumns::LOCATION, PartTableColumns::AMOUNT];
+ /** @var AssemblyTableColumns[] */
+ #[SettingsParameter(ArrayType::class,
+ label: new TM("settings.behavior.table.assemblies_default_columns"),
+ description: new TM("settings.behavior.table.assemblies_default_columns.help"),
+ options: ['type' => EnumType::class, 'options' => ['class' => AssemblyTableColumns::class]],
+ formType: \Symfony\Component\Form\Extension\Core\Type\EnumType::class,
+ formOptions: ['class' => AssemblyTableColumns::class, 'multiple' => true, 'ordered' => true],
+ envVar: "TABLE_ASSEMBLIES_DEFAULT_COLUMNS", envVarMode: EnvVarMode::OVERWRITE, envVarMapper: [self::class, 'mapAssembliesDefaultColumnsEnv']
+ )]
+ #[Assert\NotBlank()]
+ #[Assert\Unique()]
+ #[Assert\All([new Assert\Type(AssemblyTableColumns::class)])]
+ public array $assembliesDefaultColumns = [AssemblyTableColumns::ID, AssemblyTableColumns::IPN, AssemblyTableColumns::NAME,
+ AssemblyTableColumns::DESCRIPTION, AssemblyTableColumns::REFERENCED_ASSEMBLIES, AssemblyTableColumns::EDIT];
+
+ /** @var AssemblyBomTableColumns[] */
+ #[SettingsParameter(ArrayType::class,
+ label: new TM("settings.behavior.table.assemblies_bom_default_columns"),
+ description: new TM("settings.behavior.table.assemblies_bom_default_columns.help"),
+ options: ['type' => EnumType::class, 'options' => ['class' => AssemblyBomTableColumns::class]],
+ formType: \Symfony\Component\Form\Extension\Core\Type\EnumType::class,
+ formOptions: ['class' => AssemblyBomTableColumns::class, 'multiple' => true, 'ordered' => true],
+ envVar: "TABLE_ASSEMBLIES_BOM_DEFAULT_COLUMNS", envVarMode: EnvVarMode::OVERWRITE, envVarMapper: [self::class, 'mapAssemblyBomsDefaultColumnsEnv']
+ )]
+ #[Assert\NotBlank()]
+ #[Assert\Unique()]
+ #[Assert\All([new Assert\Type(AssemblyBomTableColumns::class)])]
+
+ public array $assembliesBomDefaultColumns = [AssemblyBomTableColumns::QUANTITY, AssemblyTableColumns::ID, AssemblyTableColumns::IPN,
+ AssemblyTableColumns::NAME, AssemblyTableColumns::DESCRIPTION];
+
#[SettingsParameter(label: new TM("settings.behavior.table.preview_image_min_width"),
formOptions: ['attr' => ['min' => 1, 'max' => 100]],
envVar: "int:TABLE_IMAGE_PREVIEW_MIN_SIZE", envVarMode: EnvVarMode::OVERWRITE
@@ -101,4 +131,36 @@ class TableSettings
return $ret;
}
+ public static function mapAssembliesDefaultColumnsEnv(string $columns): array
+ {
+ $exploded = explode(',', $columns);
+ $ret = [];
+ foreach ($exploded as $column) {
+ $enum = AssemblyTableColumns::tryFrom($column);
+ if (!$enum) {
+ throw new \InvalidArgumentException("Invalid column '$column' in TABLE_ASSEMBLIES_DEFAULT_COLUMNS");
+ }
+
+ $ret[] = $enum;
+ }
+
+ return $ret;
+ }
+
+ public static function mapAssemblyBomsDefaultColumnsEnv(string $columns): array
+ {
+ $exploded = explode(',', $columns);
+ $ret = [];
+ foreach ($exploded as $column) {
+ $enum = AssemblyBomTableColumns::tryFrom($column);
+ if (!$enum) {
+ throw new \InvalidArgumentException("Invalid column '$column' in TABLE_ASSEMBLIES_BOM_DEFAULT_COLUMNS");
+ }
+
+ $ret[] = $enum;
+ }
+
+ return $ret;
+ }
+
}
diff --git a/src/Settings/MiscSettings/AssemblySettings.php b/src/Settings/MiscSettings/AssemblySettings.php
new file mode 100644
index 00000000..82fb26b6
--- /dev/null
+++ b/src/Settings/MiscSettings/AssemblySettings.php
@@ -0,0 +1,45 @@
+.
+ */
+
+declare(strict_types=1);
+
+
+namespace App\Settings\MiscSettings;
+
+use App\Settings\SettingsIcon;
+use Jbtronics\SettingsBundle\Metadata\EnvVarMode;
+use Jbtronics\SettingsBundle\Settings\Settings;
+use Jbtronics\SettingsBundle\Settings\SettingsParameter;
+use Jbtronics\SettingsBundle\Settings\SettingsTrait;
+use Symfony\Component\Translation\TranslatableMessage as TM;
+
+#[Settings(label: new TM("settings.misc.assembly"))]
+#[SettingsIcon("fa-list")]
+class AssemblySettings
+{
+ use SettingsTrait;
+
+ #[SettingsParameter(
+ label: new TM("settings.misc.assembly.useIpnPlaceholderInName"),
+ envVar: "bool:CREATE_ASSEMBLY_USE_IPN_PLACEHOLDER_IN_NAME", envVarMode: EnvVarMode::OVERWRITE,
+ )]
+ public bool $useIpnPlaceholderInName = true;
+}
diff --git a/src/Settings/MiscSettings/MiscSettings.php b/src/Settings/MiscSettings/MiscSettings.php
index b8a3a73f..68d0cf6d 100644
--- a/src/Settings/MiscSettings/MiscSettings.php
+++ b/src/Settings/MiscSettings/MiscSettings.php
@@ -34,4 +34,7 @@ class MiscSettings
#[EmbeddedSettings]
public ?ExchangeRateSettings $exchangeRate = null;
-}
\ No newline at end of file
+
+ #[EmbeddedSettings]
+ public ?AssemblySettings $assembly = null;
+}
diff --git a/translations/messages.cs.xlf b/translations/messages.cs.xlf
index c437de98..27cc76fb 100644
--- a/translations/messages.cs.xlf
+++ b/translations/messages.cs.xlf
@@ -13294,6 +13294,30 @@ Vezměte prosím na vědomí, že se nemůžete vydávat za uživatele se zakáz
Sloupce, které se mají ve výchozím nastavení zobrazovat v částečných tabulkách. Pořadí položek lze změnit pomocí funkce drag & drop.
+
+
+ settings.behavior.table.assemblies_default_columns
+ Výchozí sloupce pro tabulky sestav
+
+
+
+
+ settings.behavior.table.assemblies_default_columns.help
+ Sloupce, které by měly být zobrazeny ve výchozím nastavení v tabulkách sestav. Pořadí prvků lze změnit přetažením.
+
+
+
+
+ settings.behavior.table.assemblies_bom_default_columns
+ Výchozí sloupce pro kusovníky sestav
+
+
+
+
+ settings.behavior.table.assemblies_bom_default_columns.help
+ Sloupce, které by měly být zobrazeny ve výchozím nastavení v kusovnících sestav. Pořadí prvků lze změnit přetažením.
+
+
settings.ips.oemsecrets
@@ -13504,6 +13528,18 @@ Vezměte prosím na vědomí, že se nemůžete vydávat za uživatele se zakáz
Pokud potřebujete směnné kurzy mezi měnami mimo eurozónu, můžete zde zadat API klíč z fixer.io.
+
+
+ settings.misc.assembly
+ Sestavy
+
+
+
+
+ settings.misc.assembly.useIpnPlaceholderInName
+ Použít zástupný symbol %%ipn%% v názvu sestavy. Zástupný symbol bude při ukládání nahrazen vstupem IPN.
+
+
settings.behavior.part_info
@@ -13918,6 +13954,12 @@ Vezměte prosím na vědomí, že se nemůžete vydávat za uživatele se zakáz
CSV (KiCAD Pcbnew BOM)
+
+
+ assembly.bom_import.type.kicad_schematic
+ KiCAD Schématický editor BOM (CSV soubor)
+
+
assembly.bom_import.clear_existing_bom
@@ -15656,6 +15698,12 @@ Vezměte prosím na vědomí, že se nemůžete vydávat za uživatele se zakáz
Popis
+
+
+ assembly.table.referencedAssemblies
+ Referenceované sestavy
+
+
assembly.table.addedDate
@@ -15686,6 +15734,36 @@ Vezměte prosím na vědomí, že se nemůžete vydávat za uživatele se zakáz
Neplatný regulární výraz (regex)
+
+
+ assembly.bom.table.id
+ ID
+
+
+
+
+ assembly.bom.table.name
+ Název
+
+
+
+
+ assembly.bom.table.quantity
+ Množství
+
+
+
+
+ assembly.bom.table.ipn
+ IPN
+
+
+
+
+ assembly.bom.table.description
+ Popis
+
+
datasource.synonym
diff --git a/translations/messages.da.xlf b/translations/messages.da.xlf
index cee4f08c..f9ff7d19 100644
--- a/translations/messages.da.xlf
+++ b/translations/messages.da.xlf
@@ -13091,6 +13091,12 @@ Bemærk venligst, at du ikke kan kopiere fra deaktiveret bruger. Hvis du prøver
CSV (KiCAD Pcbnew BOM)
+
+
+ assembly.bom_import.type.kicad_schematic
+ KiCAD Skematisk editor BOM (CSV-fil)
+
+
assembly.bom_import.clear_existing_bom
@@ -13576,6 +13582,12 @@ Bemærk venligst, at du ikke kan kopiere fra deaktiveret bruger. Hvis du prøver
Beskrivelse
+
+
+ assembly.table.referencedAssemblies
+ Referencerede forsamlinger
+
+
assembly.table.addedDate
@@ -13606,6 +13618,36 @@ Bemærk venligst, at du ikke kan kopiere fra deaktiveret bruger. Hvis du prøver
Ugyldigt regulært udtryk (regex)
+
+
+ assembly.bom.table.id
+ ID
+
+
+
+
+ assembly.bom.table.name
+ Navn
+
+
+
+
+ assembly.bom.table.quantity
+ Mængde
+
+
+
+
+ assembly.bom.table.ipn
+ IPN
+
+
+
+
+ assembly.bom.table.description
+ Beskrivelse
+
+
datasource.synonym
diff --git a/translations/messages.de.xlf b/translations/messages.de.xlf
index 2a5c010b..78d92b4a 100644
--- a/translations/messages.de.xlf
+++ b/translations/messages.de.xlf
@@ -13410,6 +13410,30 @@ Bitte beachten Sie, dass Sie sich nicht als deaktivierter Benutzer ausgeben kön
Die Spalten, die standardmäßig in Bauteiltabellen angezeigt werden sollen. Die Reihenfolge der Elemente kann per Drag & Drop geändert werden.
+
+
+ settings.behavior.table.assemblies_default_columns
+ Standardmäßige Spalten für Baugruppentabellen
+
+
+
+
+ settings.behavior.table.assemblies_default_columns.help
+ Die Spalten, die standardmäßig in Baugruppentabellen angezeigt werden sollen. Die Reihenfolge der Elemente kann per Drag & Drop geändert werden.
+
+
+
+
+ settings.behavior.table.assemblies_bom_default_columns
+ Standardmäßige Spalten für Baugruppen-Stücklisten
+
+
+
+
+ settings.behavior.table.assemblies_bom_default_columns.help
+ Die Spalten, die standardmäßig in Baugruppen-Stücklisten angezeigt werden sollen. Die Reihenfolge der Elemente kann per Drag & Drop geändert werden.
+
+
settings.ips.oemsecrets
@@ -14482,6 +14506,12 @@ Bitte beachten Sie, dass Sie sich nicht als deaktivierter Benutzer ausgeben kön
CSV (KiCAD Pcbnew BOM)
+
+
+ assembly.bom_import.type.kicad_schematic
+ KiCAD Schaltplaneditor BOM (CSV Datei)
+
+
assembly.bom_import.clear_existing_bom
@@ -14997,6 +15027,18 @@ Bitte beachten Sie, dass Sie sich nicht als deaktivierter Benutzer ausgeben kön
Wenn Sie Wechselkurse zwischen Nicht-Euro-Währungen benötigen, können Sie hier einen API-Schlüssel von fixer.io eingeben.
+
+
+ settings.misc.assembly
+ Baugruppen
+
+
+
+
+ settings.misc.assembly.useIpnPlaceholderInName
+ Verwenden Sie einen %%ipn%%-Platzhalter im Namen einer Baugruppe. Der Platzhalter wird beim Speichern durch die eingegebene IPN ersetzt.
+
+
settings.behavior.part_info
@@ -16359,6 +16401,12 @@ Bitte beachten Sie, dass Sie sich nicht als deaktivierter Benutzer ausgeben kön
Beschreibung
+
+
+ assembly.table.referencedAssemblies
+ Referenzierte Baugruppen
+
+
assembly.table.addedDate
@@ -16389,6 +16437,36 @@ Bitte beachten Sie, dass Sie sich nicht als deaktivierter Benutzer ausgeben kön
Ungültiger regulärer Ausdruck (regex)
+
+
+ assembly.bom.table.id
+ ID
+
+
+
+
+ assembly.bom.table.name
+ Name
+
+
+
+
+ assembly.bom.table.quantity
+ Stückzahl
+
+
+
+
+ assembly.bom.table.ipn
+ IPN
+
+
+
+
+ assembly.bom.table.description
+ Beschreibung
+
+
datasource.synonym
diff --git a/translations/messages.el.xlf b/translations/messages.el.xlf
index f1e2237a..8290c602 100644
--- a/translations/messages.el.xlf
+++ b/translations/messages.el.xlf
@@ -3034,6 +3034,12 @@
CSV (KiCAD Pcbnew BOM)
+
+
+ assembly.bom_import.type.kicad_schematic
+ KiCAD Σχηματικό BOM (CSV αρχείο)
+
+
assembly.bom_import.clear_existing_bom
@@ -3519,6 +3525,12 @@
Περιγραφή
+
+
+ assembly.table.referencedAssemblies
+ Αναφερόμενες συναρμολογήσεις
+
+
assembly.table.addedDate
@@ -3549,6 +3561,36 @@
Μη έγκυρη κανονική έκφραση (regex)
+
+
+ assembly.bom.table.id
+ ID
+
+
+
+
+ assembly.bom.table.name
+ Όνομα
+
+
+
+
+ assembly.bom.table.quantity
+ Ποσότητα
+
+
+
+
+ assembly.bom.table.ipn
+ IPN
+
+
+
+
+ assembly.bom.table.description
+ Περιγραφή
+
+
datasource.synonym
diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf
index e541313b..843168e2 100644
--- a/translations/messages.en.xlf
+++ b/translations/messages.en.xlf
@@ -13381,6 +13381,30 @@ Please note, that you can not impersonate a disabled user. If you try you will g
The columns to show by default in part tables. Order of items can be changed via drag & drop.
+
+
+ settings.behavior.table.assemblies_default_columns
+ Default columns for assembly tables
+
+
+
+
+ settings.behavior.table.assemblies_default_columns.help
+ The columns to show by default in assembly tables. Order of items can be changed via drag & drop.
+
+
+
+
+ settings.behavior.table.assemblies_bom_default_columns
+ Default columns for assembly BOM tables
+
+
+
+
+ settings.behavior.table.assemblies_bom_default_columns.help
+ The columns to show by default in assembly BOM tables. Order of items can be changed via drag & drop.
+
+
settings.ips.oemsecrets
@@ -13831,6 +13855,12 @@ Please note, that you can not impersonate a disabled user. If you try you will g
CSV (KiCAD Pcbnew BOM)
+
+
+ assembly.bom_import.type.kicad_schematic
+ KiCAD Schematic BOM (CSV file)
+
+
assembly.bom_import.clear_existing_bom
@@ -14346,6 +14376,18 @@ Please note, that you can not impersonate a disabled user. If you try you will g
If you need exchange rates between non-euro currencies, you can input an API key from fixer.io here.
+
+
+ settings.misc.assembly
+ Assemblies
+
+
+
+
+ settings.misc.assembly.useIpnPlaceholderInName
+ Use an %%ipn%% placeholder in the name of an assembly. Placeholder is replaced with the ipn input while saving.
+
+
settings.behavior.part_info
@@ -15576,6 +15618,12 @@ Please note, that you can not impersonate a disabled user. If you try you will g
Description
+
+
+ assembly.table.referencedAssemblies
+ Referenced assemblies
+
+
assembly.table.addedDate
@@ -15606,6 +15654,36 @@ Please note, that you can not impersonate a disabled user. If you try you will g
Invalid regular expression (regex)
+
+
+ assembly.bom.table.id
+ ID
+
+
+
+
+ assembly.bom.table.name
+ Name
+
+
+
+
+ assembly.bom.table.quantity
+ Quantity
+
+
+
+
+ assembly.bom.table.ipn
+ IPN
+
+
+
+
+ assembly.bom.table.description
+ Description
+
+
datasource.synonym
diff --git a/translations/messages.es.xlf b/translations/messages.es.xlf
index 49766ed9..6fbd7db8 100644
--- a/translations/messages.es.xlf
+++ b/translations/messages.es.xlf
@@ -13257,6 +13257,12 @@ Por favor ten en cuenta que no puedes personificar a un usuario deshabilitado. S
CSV (KiCAD Pcbnew BOM)
+
+
+ assembly.bom_import.type.kicad_schematic
+ KiCAD Editor Esquemático BOM (archivo CSV)
+
+
assembly.bom_import.clear_existing_bom
@@ -13874,6 +13880,12 @@ Por favor ten en cuenta que no puedes personificar a un usuario deshabilitado. S
Descripción
+
+
+ assembly.table.referencedAssemblies
+ Ensambles referenciados
+
+
assembly.table.addedDate
@@ -13904,6 +13916,36 @@ Por favor ten en cuenta que no puedes personificar a un usuario deshabilitado. S
Expresión regular no válida (regex)
+
+
+ assembly.bom.table.id
+ ID
+
+
+
+
+ assembly.bom.table.name
+ Nombre
+
+
+
+
+ assembly.bom.table.quantity
+ Cantidad
+
+
+
+
+ assembly.bom.table.ipn
+ IPN
+
+
+
+
+ assembly.bom.table.description
+ Descripción
+
+
datasource.synonym
diff --git a/translations/messages.fr.xlf b/translations/messages.fr.xlf
index b5ed6a27..dea344c0 100644
--- a/translations/messages.fr.xlf
+++ b/translations/messages.fr.xlf
@@ -9637,6 +9637,12 @@ exemple de ville
CSV (KiCAD Pcbnew BOM)
+
+
+ assembly.bom_import.type.kicad_schematic
+ KiCAD Éditeur Schématique BOM (fichier CSV)
+
+
assembly.bom_import.clear_existing_bom
@@ -10122,6 +10128,12 @@ exemple de ville
Description
+
+
+ assembly.table.referencedAssemblies
+ Ensembles référencés
+
+
assembly.table.addedDate
@@ -10152,6 +10164,36 @@ exemple de ville
Expression régulière invalide (regex)
+
+
+ assembly.bom.table.id
+ ID
+
+
+
+
+ assembly.bom.table.name
+ Nom
+
+
+
+
+ assembly.bom.table.quantity
+ Quantité
+
+
+
+
+ assembly.bom.table.ipn
+ IPN
+
+
+
+
+ assembly.bom.table.description
+ Description
+
+
datasource.synonym
diff --git a/translations/messages.it.xlf b/translations/messages.it.xlf
index 951a1bd3..66d3a63e 100644
--- a/translations/messages.it.xlf
+++ b/translations/messages.it.xlf
@@ -13235,6 +13235,12 @@ Notare che non è possibile impersonare un utente disattivato. Quando si prova a
CSV (KiCAD Pcbnew)
+
+
+ assembly.bom_import.type.kicad_schematic
+ KiCAD Editor Schematico BOM (file CSV)
+
+
assembly.bom_import.clear_existing_bom
@@ -13744,6 +13750,12 @@ Notare che non è possibile impersonare un utente disattivato. Quando si prova a
Descrizione
+
+
+ assembly.table.referencedAssemblies
+ Assiemi referenziati
+
+
assembly.table.addedDate
@@ -13774,6 +13786,36 @@ Notare che non è possibile impersonare un utente disattivato. Quando si prova a
Espressione regolare non valida (regex)
+
+
+ assembly.bom.table.id
+ ID
+
+
+
+
+ assembly.bom.table.name
+ Nome
+
+
+
+
+ assembly.bom.table.quantity
+ Quantità
+
+
+
+
+ assembly.bom.table.ipn
+ IPN
+
+
+
+
+ assembly.bom.table.description
+ Descrizione
+
+
datasource.synonym
diff --git a/translations/messages.ja.xlf b/translations/messages.ja.xlf
index 101afd62..f909cfd3 100644
--- a/translations/messages.ja.xlf
+++ b/translations/messages.ja.xlf
@@ -9350,6 +9350,12 @@ Exampletown
CSV (KiCAD Pcbnew)
+
+
+ assembly.bom_import.type.kicad_schematic
+ KiCAD 回路図エディタ BOM (CSV ファイル)
+
+
assembly.bom_import.clear_existing_bom
@@ -9835,6 +9841,12 @@ Exampletown
説明
+
+
+ assembly.table.referencedAssemblies
+ 参照されているアセンブリ
+
+
assembly.table.addedDate
@@ -9865,6 +9877,36 @@ Exampletown
無効な正規表現(regex)
+
+
+ assembly.bom.table.id
+ ID
+
+
+
+
+ assembly.bom.table.name
+ 名前
+
+
+
+
+ assembly.bom.table.quantity
+ 数量
+
+
+
+
+ assembly.bom.table.ipn
+ IPN
+
+
+
+
+ assembly.bom.table.description
+ 説明
+
+
datasource.synonym
diff --git a/translations/messages.nl.xlf b/translations/messages.nl.xlf
index ebf67d39..6b965ef3 100644
--- a/translations/messages.nl.xlf
+++ b/translations/messages.nl.xlf
@@ -1240,6 +1240,12 @@
CSV (KiCAD Pcbnew)
+
+
+ assembly.bom_import.type.kicad_schematic
+ KiCAD Schematische editor BOM (CSV-bestand)
+
+
assembly.bom_import.clear_existing_bom
@@ -1725,6 +1731,12 @@
Beschrijving
+
+
+ assembly.table.referencedAssemblies
+ Gerefereerde assemblages
+
+
assembly.table.addedDate
@@ -1755,6 +1767,36 @@
Ongeldige reguliere expressie (regex)
+
+
+ assembly.bom.table.id
+ ID
+
+
+
+
+ assembly.bom.table.name
+ Naam
+
+
+
+
+ assembly.bom.table.quantity
+ Hoeveelheid
+
+
+
+
+ assembly.bom.table.ipn
+ IPN
+
+
+
+
+ assembly.bom.table.description
+ Beschrijving
+
+
datasource.synonym
diff --git a/translations/messages.pl.xlf b/translations/messages.pl.xlf
index d9d4eac2..9efe857c 100644
--- a/translations/messages.pl.xlf
+++ b/translations/messages.pl.xlf
@@ -13112,6 +13112,12 @@ Należy pamiętać, że nie możesz udawać nieaktywnych użytkowników. Jeśli
CSV (KiCAD Pcbnew)
+
+
+ assembly.bom_import.type.kicad_schematic
+ KiCAD Schematyczny edytor BOM (plik CSV)
+
+
assembly.bom_import.clear_existing_bom
@@ -13597,6 +13603,12 @@ Należy pamiętać, że nie możesz udawać nieaktywnych użytkowników. Jeśli
Opis
+
+
+ assembly.table.referencedAssemblies
+ Zestawy referencyjne
+
+
assembly.table.addedDate
@@ -13627,6 +13639,36 @@ Należy pamiętać, że nie możesz udawać nieaktywnych użytkowników. Jeśli
Nieprawidłowe wyrażenie regularne (regex)
+
+
+ assembly.bom.table.id
+ ID
+
+
+
+
+ assembly.bom.table.name
+ Nazwa
+
+
+
+
+ assembly.bom.table.quantity
+ Ilość
+
+
+
+
+ assembly.bom.table.ipn
+ IPN
+
+
+
+
+ assembly.bom.table.description
+ Opis
+
+
datasource.synonym
diff --git a/translations/messages.ru.xlf b/translations/messages.ru.xlf
index 991230b2..9f3d9c8e 100644
--- a/translations/messages.ru.xlf
+++ b/translations/messages.ru.xlf
@@ -13212,6 +13212,12 @@
CSV (KiCAD Pcbnew)
+
+
+ assembly.bom_import.type.kicad_schematic
+ KiCAD Схематический редактор BOM (CSV файл)
+
+
assembly.bom_import.clear_existing_bom
@@ -13697,6 +13703,12 @@
Описание
+
+
+ assembly.table.referencedAssemblies
+ Ссылочные сборки
+
+
assembly.table.addedDate
@@ -13727,6 +13739,36 @@
Неверное регулярное выражение (regex)
+
+
+ assembly.bom.table.id
+ ID
+
+
+
+
+ assembly.bom.table.name
+ Название
+
+
+
+
+ assembly.bom.table.quantity
+ Количество
+
+
+
+
+ assembly.bom.table.ipn
+ IPN
+
+
+
+
+ assembly.bom.table.description
+ Описание
+
+
datasource.synonym
diff --git a/translations/messages.zh.xlf b/translations/messages.zh.xlf
index a3e44de6..c28d53d6 100644
--- a/translations/messages.zh.xlf
+++ b/translations/messages.zh.xlf
@@ -13097,6 +13097,12 @@ Element 3
CSV 文件(KiCAD Pcbnew)
+
+
+ assembly.bom_import.type.kicad_schematic
+ KiCAD 原理图编辑器 BOM(CSV 文件)
+
+
assembly.bom_import.clear_existing_bom
@@ -13582,6 +13588,12 @@ Element 3
描述
+
+
+ assembly.table.referencedAssemblies
+ 引用的组件
+
+
assembly.table.addedDate
@@ -13612,6 +13624,36 @@ Element 3
无效的正则表达式(regex)
+
+
+ assembly.bom.table.id
+ ID
+
+
+
+
+ assembly.bom.table.name
+ 名称
+
+
+
+
+ assembly.bom.table.quantity
+ 数量
+
+
+
+
+ assembly.bom.table.ipn
+ IPN
+
+
+
+
+ assembly.bom.table.description
+ 描述
+
+
datasource.synonym