mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Allow to filter by the lot owner
This commit is contained in:
parent
f91b719542
commit
d32e902d17
4 changed files with 32 additions and 8 deletions
|
@ -37,6 +37,8 @@ use App\Entity\Parts\Manufacturer;
|
||||||
use App\Entity\Parts\MeasurementUnit;
|
use App\Entity\Parts\MeasurementUnit;
|
||||||
use App\Entity\Parts\Storelocation;
|
use App\Entity\Parts\Storelocation;
|
||||||
use App\Entity\Parts\Supplier;
|
use App\Entity\Parts\Supplier;
|
||||||
|
use App\Entity\UserSystem\User;
|
||||||
|
use App\Form\Filters\Constraints\UserEntityConstraintType;
|
||||||
use App\Services\Trees\NodesListBuilder;
|
use App\Services\Trees\NodesListBuilder;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Doctrine\ORM\QueryBuilder;
|
use Doctrine\ORM\QueryBuilder;
|
||||||
|
@ -71,17 +73,12 @@ class PartFilter implements FilterInterface
|
||||||
protected IntConstraint $amountSum;
|
protected IntConstraint $amountSum;
|
||||||
protected LessThanDesiredConstraint $lessThanDesired;
|
protected LessThanDesiredConstraint $lessThanDesired;
|
||||||
|
|
||||||
/**
|
|
||||||
* @return LessThanDesiredConstraint
|
|
||||||
*/
|
|
||||||
public function getLessThanDesired(): LessThanDesiredConstraint
|
|
||||||
{
|
|
||||||
return $this->lessThanDesired;
|
|
||||||
}
|
|
||||||
protected BooleanConstraint $lotNeedsRefill;
|
protected BooleanConstraint $lotNeedsRefill;
|
||||||
protected TextConstraint $lotDescription;
|
protected TextConstraint $lotDescription;
|
||||||
protected BooleanConstraint $lotUnknownAmount;
|
protected BooleanConstraint $lotUnknownAmount;
|
||||||
protected DateTimeConstraint $lotExpirationDate;
|
protected DateTimeConstraint $lotExpirationDate;
|
||||||
|
protected EntityConstraint $lotOwner;
|
||||||
|
|
||||||
protected EntityConstraint $measurementUnit;
|
protected EntityConstraint $measurementUnit;
|
||||||
protected TextConstraint $manufacturer_product_url;
|
protected TextConstraint $manufacturer_product_url;
|
||||||
protected TextConstraint $manufacturer_product_number;
|
protected TextConstraint $manufacturer_product_number;
|
||||||
|
@ -125,6 +122,7 @@ class PartFilter implements FilterInterface
|
||||||
$this->lotUnknownAmount = new BooleanConstraint('partLots.instock_unknown');
|
$this->lotUnknownAmount = new BooleanConstraint('partLots.instock_unknown');
|
||||||
$this->lotExpirationDate = new DateTimeConstraint('partLots.expiration_date');
|
$this->lotExpirationDate = new DateTimeConstraint('partLots.expiration_date');
|
||||||
$this->lotDescription = new TextConstraint('partLots.description');
|
$this->lotDescription = new TextConstraint('partLots.description');
|
||||||
|
$this->lotOwner = new EntityConstraint($nodesListBuilder, User::class, 'partLots.owner');
|
||||||
|
|
||||||
$this->manufacturer = new EntityConstraint($nodesListBuilder, Manufacturer::class, 'part.manufacturer');
|
$this->manufacturer = new EntityConstraint($nodesListBuilder, Manufacturer::class, 'part.manufacturer');
|
||||||
$this->manufacturer_product_number = new TextConstraint('part.manufacturer_product_number');
|
$this->manufacturer_product_number = new TextConstraint('part.manufacturer_product_number');
|
||||||
|
@ -291,6 +289,14 @@ class PartFilter implements FilterInterface
|
||||||
return $this->lotCount;
|
return $this->lotCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return EntityConstraint
|
||||||
|
*/
|
||||||
|
public function getLotOwner(): EntityConstraint
|
||||||
|
{
|
||||||
|
return $this->lotOwner;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return TagsConstraint
|
* @return TagsConstraint
|
||||||
*/
|
*/
|
||||||
|
@ -394,7 +400,13 @@ class PartFilter implements FilterInterface
|
||||||
return $this->obsolete;
|
return $this->obsolete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return LessThanDesiredConstraint
|
||||||
|
*/
|
||||||
|
public function getLessThanDesired(): LessThanDesiredConstraint
|
||||||
|
{
|
||||||
|
return $this->lessThanDesired;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,6 +36,7 @@ use App\Form\Filters\Constraints\ParameterConstraintType;
|
||||||
use App\Form\Filters\Constraints\StructuralEntityConstraintType;
|
use App\Form\Filters\Constraints\StructuralEntityConstraintType;
|
||||||
use App\Form\Filters\Constraints\TagsConstraintType;
|
use App\Form\Filters\Constraints\TagsConstraintType;
|
||||||
use App\Form\Filters\Constraints\TextConstraintType;
|
use App\Form\Filters\Constraints\TextConstraintType;
|
||||||
|
use App\Form\Filters\Constraints\UserEntityConstraintType;
|
||||||
use Svg\Tag\Text;
|
use Svg\Tag\Text;
|
||||||
use Symfony\Component\Form\AbstractType;
|
use Symfony\Component\Form\AbstractType;
|
||||||
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
|
||||||
|
@ -227,6 +228,10 @@ class PartFilterType extends AbstractType
|
||||||
'label' => 'part.filter.lotDescription',
|
'label' => 'part.filter.lotDescription',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$builder->add('lotOwner', UserEntityConstraintType::class, [
|
||||||
|
'label' => 'part.filter.lotOwner',
|
||||||
|
]);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attachments count
|
* Attachments count
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -66,6 +66,7 @@
|
||||||
{{ form_row(filterForm.lotCount) }}
|
{{ form_row(filterForm.lotCount) }}
|
||||||
{{ form_row(filterForm.lotExpirationDate) }}
|
{{ form_row(filterForm.lotExpirationDate) }}
|
||||||
{{ form_row(filterForm.lotDescription) }}
|
{{ form_row(filterForm.lotDescription) }}
|
||||||
|
{{ form_row(filterForm.lotOwner) }}
|
||||||
{{ form_row(filterForm.lotNeedsRefill) }}
|
{{ form_row(filterForm.lotNeedsRefill) }}
|
||||||
{{ form_row(filterForm.lotUnknownAmount) }}
|
{{ form_row(filterForm.lotUnknownAmount) }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11277,5 +11277,11 @@ Element 3</target>
|
||||||
<target><![CDATA[In stock less than desired (total amount < min. amount)]]></target>
|
<target><![CDATA[In stock less than desired (total amount < min. amount)]]></target>
|
||||||
</segment>
|
</segment>
|
||||||
</unit>
|
</unit>
|
||||||
|
<unit id="lHTN.a1" name="part.filter.lotOwner">
|
||||||
|
<segment>
|
||||||
|
<source>part.filter.lotOwner</source>
|
||||||
|
<target>Lot owner</target>
|
||||||
|
</segment>
|
||||||
|
</unit>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue