diff --git a/src/Controller/PartController.php b/src/Controller/PartController.php
index b11a5c90..6708ed4c 100644
--- a/src/Controller/PartController.php
+++ b/src/Controller/PartController.php
@@ -46,6 +46,7 @@ use App\Services\Parameters\ParameterExtractor;
use App\Services\Parts\PartLotWithdrawAddHelper;
use App\Services\Parts\PricedetailHelper;
use App\Services\ProjectSystem\ProjectBuildPartHelper;
+use App\Settings\BehaviorSettings\PartInfoSettings;
use DateTime;
use Doctrine\ORM\EntityManagerInterface;
use Exception;
@@ -69,7 +70,7 @@ class PartController extends AbstractController
protected PartPreviewGenerator $partPreviewGenerator,
private readonly TranslatorInterface $translator,
private readonly AttachmentSubmitHandler $attachmentSubmitHandler, private readonly EntityManagerInterface $em,
- protected EventCommentHelper $commentHelper)
+ protected EventCommentHelper $commentHelper, private readonly PartInfoSettings $partInfoSettings)
{
}
@@ -119,8 +120,8 @@ class PartController extends AbstractController
'pricedetail_helper' => $this->pricedetailHelper,
'pictures' => $this->partPreviewGenerator->getPreviewAttachments($part),
'timeTravel' => $timeTravel_timestamp,
- 'description_params' => $parameterExtractor->extractParameters($part->getDescription()),
- 'comment_params' => $parameterExtractor->extractParameters($part->getComment()),
+ 'description_params' => $this->partInfoSettings->extractParamsFromDescription ? $parameterExtractor->extractParameters($part->getDescription()) : [],
+ 'comment_params' => $this->partInfoSettings->extractParamsFromNotes ? $parameterExtractor->extractParameters($part->getComment()) : [],
'withdraw_add_helper' => $withdrawAddHelper,
]
);
diff --git a/src/Settings/BehaviorSettings/PartInfoSettings.php b/src/Settings/BehaviorSettings/PartInfoSettings.php
index 4c44b9bb..f017c846 100644
--- a/src/Settings/BehaviorSettings/PartInfoSettings.php
+++ b/src/Settings/BehaviorSettings/PartInfoSettings.php
@@ -40,4 +40,10 @@ class PartInfoSettings
#[SettingsParameter(label: new TM("settings.behavior.part_info.show_part_image_overlay"), description: new TM("settings.behavior.part_info.show_part_image_overlay.help"),
envVar: "bool:SHOW_PART_IMAGE_OVERLAY", envVarMode: EnvVarMode::OVERWRITE)]
public bool $showPartImageOverlay = true;
-}
\ No newline at end of file
+
+ #[SettingsParameter(label: new TM("settings.behavior.part_info.extract_params_from_description"))]
+ public bool $extractParamsFromDescription = true;
+
+ #[SettingsParameter(label: new TM("settings.behavior.part_info.extract_params_from_notes"))]
+ public bool $extractParamsFromNotes = true;
+}
diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf
index b7710f0c..6680521b 100644
--- a/translations/messages.en.xlf
+++ b/translations/messages.en.xlf
@@ -13459,5 +13459,17 @@ Please note, that you can not impersonate a disabled user. If you try you will g
Show Part-DB version on homepage
+
+
+ settings.behavior.part_info.extract_params_from_description
+ Extract parameters from part description
+
+
+
+
+ settings.behavior.part_info.extract_params_from_notes
+ Extract parameters from part notes
+
+