diff --git a/src/Controller/PartListsController.php b/src/Controller/PartListsController.php index 77e5bef2..ab23c0f2 100644 --- a/src/Controller/PartListsController.php +++ b/src/Controller/PartListsController.php @@ -294,6 +294,7 @@ class PartListsController extends AbstractController $filter->setTags($request->query->getBoolean('tags', true)); $filter->setStorelocation($request->query->getBoolean('storelocation', true)); $filter->setComment($request->query->getBoolean('comment', true)); + $filter->setIPN($request->query->getBoolean('ipn', true)); $filter->setOrdernr($request->query->getBoolean('ordernr', true)); $filter->setSupplier($request->query->getBoolean('supplier', false)); $filter->setManufacturer($request->query->getBoolean('manufacturer', false)); diff --git a/src/DataTables/Filters/PartSearchFilter.php b/src/DataTables/Filters/PartSearchFilter.php index 6dfe2a62..b3f1cafd 100644 --- a/src/DataTables/Filters/PartSearchFilter.php +++ b/src/DataTables/Filters/PartSearchFilter.php @@ -65,6 +65,9 @@ class PartSearchFilter implements FilterInterface /** @var bool Use footprint name for searching */ protected bool $footprint = false; + /** @var bool Use Internal Part number for searching */ + protected bool $ipn = true; + public function __construct(string $query) { $this->keyword = $query; @@ -104,6 +107,9 @@ class PartSearchFilter implements FilterInterface if($this->footprint) { $fields_to_search[] = 'footprint.name'; } + if ($this->ipn) { + $fields_to_search[] = 'part.ipn'; + } return $fields_to_search; } @@ -301,6 +307,17 @@ class PartSearchFilter implements FilterInterface return $this; } + public function isIPN(): bool + { + return $this->ipn; + } + + public function setIPN(bool $ipn): PartSearchFilter + { + $this->ipn = $ipn; + return $this; + } + /** * @return bool */ diff --git a/templates/_navbar_search.html.twig b/templates/_navbar_search.html.twig index f66fb0a4..642021da 100644 --- a/templates/_navbar_search.html.twig +++ b/templates/_navbar_search.html.twig @@ -5,7 +5,7 @@