Compare commits

..

No commits in common. "3f6a6cc7675603f51acd2d54c13739e05bff885a" and "1cd0b459be8b3502ab06da5bb6990dcad92583ca" have entirely different histories.

5 changed files with 54 additions and 84 deletions

52
composer.lock generated
View file

@ -8485,16 +8485,16 @@
}, },
{ {
"name": "phpoffice/phpspreadsheet", "name": "phpoffice/phpspreadsheet",
"version": "5.4.0", "version": "5.3.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/PHPOffice/PhpSpreadsheet.git", "url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
"reference": "48f2fe37d64c2dece0ef71fb2ac55497566782af" "reference": "4d597c1aacdde1805a33c525b9758113ea0d90df"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/48f2fe37d64c2dece0ef71fb2ac55497566782af", "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/4d597c1aacdde1805a33c525b9758113ea0d90df",
"reference": "48f2fe37d64c2dece0ef71fb2ac55497566782af", "reference": "4d597c1aacdde1805a33c525b9758113ea0d90df",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -8502,7 +8502,6 @@
"ext-ctype": "*", "ext-ctype": "*",
"ext-dom": "*", "ext-dom": "*",
"ext-fileinfo": "*", "ext-fileinfo": "*",
"ext-filter": "*",
"ext-gd": "*", "ext-gd": "*",
"ext-iconv": "*", "ext-iconv": "*",
"ext-libxml": "*", "ext-libxml": "*",
@ -8517,12 +8516,13 @@
"markbaker/complex": "^3.0", "markbaker/complex": "^3.0",
"markbaker/matrix": "^3.0", "markbaker/matrix": "^3.0",
"php": "^8.1", "php": "^8.1",
"psr/http-client": "^1.0",
"psr/http-factory": "^1.0",
"psr/simple-cache": "^1.0 || ^2.0 || ^3.0" "psr/simple-cache": "^1.0 || ^2.0 || ^3.0"
}, },
"require-dev": { "require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "dev-main", "dealerdirect/phpcodesniffer-composer-installer": "dev-main",
"dompdf/dompdf": "^2.0 || ^3.0", "dompdf/dompdf": "^2.0 || ^3.0",
"ext-intl": "*",
"friendsofphp/php-cs-fixer": "^3.2", "friendsofphp/php-cs-fixer": "^3.2",
"mitoteam/jpgraph": "^10.5", "mitoteam/jpgraph": "^10.5",
"mpdf/mpdf": "^8.1.1", "mpdf/mpdf": "^8.1.1",
@ -8536,7 +8536,7 @@
}, },
"suggest": { "suggest": {
"dompdf/dompdf": "Option for rendering PDF with PDF Writer", "dompdf/dompdf": "Option for rendering PDF with PDF Writer",
"ext-intl": "PHP Internationalization Functions, required for NumberFormat Wizard and StringHelper::setLocale()", "ext-intl": "PHP Internationalization Functions, required for NumberFormat Wizard",
"mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers", "mitoteam/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
"mpdf/mpdf": "Option for rendering PDF with PDF Writer", "mpdf/mpdf": "Option for rendering PDF with PDF Writer",
"tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer" "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
@ -8569,9 +8569,6 @@
}, },
{ {
"name": "Adrien Crivelli" "name": "Adrien Crivelli"
},
{
"name": "Owen Leibman"
} }
], ],
"description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine", "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
@ -8588,9 +8585,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues", "issues": "https://github.com/PHPOffice/PhpSpreadsheet/issues",
"source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/5.4.0" "source": "https://github.com/PHPOffice/PhpSpreadsheet/tree/5.3.0"
}, },
"time": "2026-01-11T04:52:00+00:00" "time": "2025-11-24T15:47:10+00:00"
}, },
{ {
"name": "phpstan/phpdoc-parser", "name": "phpstan/phpdoc-parser",
@ -17343,32 +17340,43 @@
}, },
{ {
"name": "web-auth/cose-lib", "name": "web-auth/cose-lib",
"version": "4.5.0", "version": "4.4.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/web-auth/cose-lib.git", "url": "https://github.com/web-auth/cose-lib.git",
"reference": "5adac6fe126994a3ee17ed9950efb4947ab132a9" "reference": "a93b61c48fb587855f64a9ec11ad7b60e867cb15"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/web-auth/cose-lib/zipball/5adac6fe126994a3ee17ed9950efb4947ab132a9", "url": "https://api.github.com/repos/web-auth/cose-lib/zipball/a93b61c48fb587855f64a9ec11ad7b60e867cb15",
"reference": "5adac6fe126994a3ee17ed9950efb4947ab132a9", "reference": "a93b61c48fb587855f64a9ec11ad7b60e867cb15",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"brick/math": "^0.9|^0.10|^0.11|^0.12|^0.13|^0.14", "brick/math": "^0.9|^0.10|^0.11|^0.12|^0.13",
"ext-json": "*", "ext-json": "*",
"ext-openssl": "*", "ext-openssl": "*",
"php": ">=8.1", "php": ">=8.1",
"spomky-labs/pki-framework": "^1.0" "spomky-labs/pki-framework": "^1.0"
}, },
"require-dev": { "require-dev": {
"spomky-labs/cbor-php": "^3.2.2" "deptrac/deptrac": "^3.0",
"ekino/phpstan-banned-code": "^1.0|^2.0|^3.0",
"infection/infection": "^0.29",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.7|^2.0",
"phpstan/phpstan-deprecation-rules": "^1.0|^2.0",
"phpstan/phpstan-phpunit": "^1.1|^2.0",
"phpstan/phpstan-strict-rules": "^1.0|^2.0",
"phpunit/phpunit": "^10.1|^11.0|^12.0",
"rector/rector": "^2.0",
"symfony/phpunit-bridge": "^6.4|^7.0",
"symplify/easy-coding-standard": "^12.0"
}, },
"suggest": { "suggest": {
"ext-bcmath": "For better performance, please install either GMP (recommended) or BCMath extension", "ext-bcmath": "For better performance, please install either GMP (recommended) or BCMath extension",
"ext-gmp": "For better performance, please install either GMP (recommended) or BCMath extension", "ext-gmp": "For better performance, please install either GMP (recommended) or BCMath extension"
"spomky-labs/cbor-php": "For COSE Signature support"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@ -17398,7 +17406,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/web-auth/cose-lib/issues", "issues": "https://github.com/web-auth/cose-lib/issues",
"source": "https://github.com/web-auth/cose-lib/tree/4.5.0" "source": "https://github.com/web-auth/cose-lib/tree/4.4.2"
}, },
"funding": [ "funding": [
{ {
@ -17410,7 +17418,7 @@
"type": "patreon" "type": "patreon"
} }
], ],
"time": "2026-01-03T14:43:18+00:00" "time": "2025-08-14T20:33:29+00:00"
}, },
{ {
"name": "web-auth/webauthn-lib", "name": "web-auth/webauthn-lib",

View file

@ -319,7 +319,6 @@ class PartListsController extends AbstractController
//As an unchecked checkbox is not set in the query, the default value for all bools have to be false (which is the default argument value)! //As an unchecked checkbox is not set in the query, the default value for all bools have to be false (which is the default argument value)!
$filter->setName($request->query->getBoolean('name')); $filter->setName($request->query->getBoolean('name'));
$filter->setDbId($request->query->getBoolean('dbid'));
$filter->setCategory($request->query->getBoolean('category')); $filter->setCategory($request->query->getBoolean('category'));
$filter->setDescription($request->query->getBoolean('description')); $filter->setDescription($request->query->getBoolean('description'));
$filter->setMpn($request->query->getBoolean('mpn')); $filter->setMpn($request->query->getBoolean('mpn'));

View file

@ -23,7 +23,6 @@ declare(strict_types=1);
namespace App\DataTables\Filters; namespace App\DataTables\Filters;
use App\DataTables\Filters\Constraints\AbstractConstraint; use App\DataTables\Filters\Constraints\AbstractConstraint;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Doctrine\DBAL\ParameterType;
class PartSearchFilter implements FilterInterface class PartSearchFilter implements FilterInterface
{ {
@ -34,9 +33,6 @@ class PartSearchFilter implements FilterInterface
/** @var bool Use name field for searching */ /** @var bool Use name field for searching */
protected bool $name = true; protected bool $name = true;
/** @var bool Use id field for searching */
protected bool $dbId = false;
/** @var bool Use category name for searching */ /** @var bool Use category name for searching */
protected bool $category = true; protected bool $category = true;
@ -124,51 +120,33 @@ class PartSearchFilter implements FilterInterface
public function apply(QueryBuilder $queryBuilder): void public function apply(QueryBuilder $queryBuilder): void
{ {
$fields_to_search = $this->getFieldsToSearch(); $fields_to_search = $this->getFieldsToSearch();
$is_numeric = preg_match('/^\d+$/', $this->keyword) === 1;
// Add exact ID match only when the keyword is numeric
$search_dbId = $is_numeric && (bool)$this->dbId;
//If we have nothing to search for, do nothing //If we have nothing to search for, do nothing
if (($fields_to_search === [] && !$search_dbId) || $this->keyword === '') { if ($fields_to_search === [] || $this->keyword === '') {
return; return;
} }
$expressions = []; //Convert the fields to search to a list of expressions
$expressions = array_map(function (string $field): string {
if($fields_to_search !== []) {
//Convert the fields to search to a list of expressions
$expressions = array_map(function (string $field): string {
if ($this->regex) {
return sprintf("REGEXP(%s, :search_query) = TRUE", $field);
}
return sprintf("ILIKE(%s, :search_query) = TRUE", $field);
}, $fields_to_search);
//For regex, we pass the query as is, for like we add % to the start and end as wildcards
if ($this->regex) { if ($this->regex) {
$queryBuilder->setParameter('search_query', $this->keyword); return sprintf("REGEXP(%s, :search_query) = TRUE", $field);
} else {
//Escape % and _ characters in the keyword
$this->keyword = str_replace(['%', '_'], ['\%', '\_'], $this->keyword);
$queryBuilder->setParameter('search_query', '%' . $this->keyword . '%');
} }
}
//Use equal expression to just search for exact numeric matches return sprintf("ILIKE(%s, :search_query) = TRUE", $field);
if ($search_dbId) { }, $fields_to_search);
$expressions[] = $queryBuilder->expr()->eq('part.id', ':id_exact');
$queryBuilder->setParameter('id_exact', (int) $this->keyword,
\Doctrine\DBAL\ParameterType::INTEGER);
}
//Guard condition //Add Or concatenation of the expressions to our query
if (!empty($expressions)) { $queryBuilder->andWhere(
//Add Or concatenation of the expressions to our query $queryBuilder->expr()->orX(...$expressions)
$queryBuilder->andWhere( );
$queryBuilder->expr()->orX(...$expressions)
); //For regex, we pass the query as is, for like we add % to the start and end as wildcards
if ($this->regex) {
$queryBuilder->setParameter('search_query', $this->keyword);
} else {
//Escape % and _ characters in the keyword
$this->keyword = str_replace(['%', '_'], ['\%', '\_'], $this->keyword);
$queryBuilder->setParameter('search_query', '%' . $this->keyword . '%');
} }
} }
@ -205,17 +183,6 @@ class PartSearchFilter implements FilterInterface
return $this; return $this;
} }
public function isDbId(): bool
{
return $this->dbId;
}
public function setDbId(bool $dbId): PartSearchFilter
{
$this->dbId = $dbId;
return $this;
}
public function isCategory(): bool public function isCategory(): bool
{ {
return $this->category; return $this->category;

View file

@ -11,10 +11,6 @@
<input type="checkbox" class="form-check-input" id="search_name" name="name" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}> <input type="checkbox" class="form-check-input" id="search_name" name="name" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}>
<label for="search_name" class="form-check-label justify-content-start">{% trans %}name.label{% endtrans %}</label> <label for="search_name" class="form-check-label justify-content-start">{% trans %}name.label{% endtrans %}</label>
</div> </div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="search_dbid" name="dbid" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}>
<label for="search_dbid" class="form-check-label justify-content-start">{% trans %}id.label{% endtrans %}</label>
</div>
<div class="form-check"> <div class="form-check">
<input type="checkbox" class="form-check-input" id="search_category" name="category" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}> <input type="checkbox" class="form-check-input" id="search_category" name="category" value="1" checked {{ stimulus_controller('elements/localStorage_checkbox') }}>
<label for="search_category" class="form-check-label justify-content-start">{% trans %}category.label{% endtrans %}</label> <label for="search_category" class="form-check-label justify-content-start">{% trans %}category.label{% endtrans %}</label>

View file

@ -2785,9 +2785,9 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0" lodash.uniq "^4.5.0"
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001759: caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001759:
version "1.0.30001764" version "1.0.30001763"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001764.tgz#03206c56469f236103b90f9ae10bcb8b9e1f6005" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001763.tgz#9397446dd110b1aeadb0df249c41b2ece7f90f09"
integrity sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g== integrity sha512-mh/dGtq56uN98LlNX9qdbKnzINhX0QzhiWBFEkFfsFO4QyCvL8YegrJAazCwXIeqkIob8BlZPGM3xdnY+sgmvQ==
ccount@^2.0.0: ccount@^2.0.0:
version "2.0.1" version "2.0.1"
@ -5959,9 +5959,9 @@ path-type@^4.0.0:
integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==
pdfmake@^0.2.2: pdfmake@^0.2.2:
version "0.2.23" version "0.2.22"
resolved "https://registry.yarnpkg.com/pdfmake/-/pdfmake-0.2.23.tgz#249ce735fbc58e212ea3343d60f388408b8f2f02" resolved "https://registry.yarnpkg.com/pdfmake/-/pdfmake-0.2.22.tgz#f0b3d4986476f121d97ce68d80da7b09c76cffe8"
integrity sha512-A/IksoKb/ikOZH1edSDJ/2zBbqJKDghD4+fXn3rT7quvCJDlsZMs3NmIB3eajLMMFU9Bd3bZPVvlUMXhvFI+bQ== integrity sha512-nY0tvBlBCAfefFzXkWGHzW7OQeWKsGKL8M1I8o+fFhLBDtYesSA2G/KxfOF8jn+l53kzCLSTAdmTyPV2EM/v9g==
dependencies: dependencies:
"@foliojs-fork/linebreak" "^1.1.2" "@foliojs-fork/linebreak" "^1.1.2"
"@foliojs-fork/pdfkit" "^0.15.3" "@foliojs-fork/pdfkit" "^0.15.3"