mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 19:58:53 +02:00
Renamed Storelocation entity to StorageLocation
This commit is contained in:
parent
09acca950d
commit
0af5a58dbe
59 changed files with 218 additions and 176 deletions
|
@ -44,7 +44,7 @@ namespace App\Services\LabelSystem\Barcodes;
|
|||
use App\Entity\Base\AbstractDBElement;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Entity\Parts\StorageLocation;
|
||||
use InvalidArgumentException;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
|
||||
|
@ -56,13 +56,13 @@ final class BarcodeContentGenerator
|
|||
public const PREFIX_MAP = [
|
||||
Part::class => 'P',
|
||||
PartLot::class => 'L',
|
||||
Storelocation::class => 'S',
|
||||
StorageLocation::class => 'S',
|
||||
];
|
||||
|
||||
private const URL_MAP = [
|
||||
Part::class => 'part',
|
||||
PartLot::class => 'lot',
|
||||
Storelocation::class => 'location',
|
||||
StorageLocation::class => 'location',
|
||||
];
|
||||
|
||||
public function __construct(private readonly UrlGeneratorInterface $urlGenerator)
|
||||
|
|
|
@ -49,7 +49,7 @@ use App\Entity\Parts\Manufacturer;
|
|||
use App\Entity\Parts\ManufacturingStatus;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Entity\Parts\StorageLocation;
|
||||
use App\Entity\UserSystem\User;
|
||||
use DateTime;
|
||||
use InvalidArgumentException;
|
||||
|
@ -98,23 +98,23 @@ final class LabelExampleElementsGenerator
|
|||
$lot->setDescription('Example Lot');
|
||||
$lot->setComment('Lot comment');
|
||||
$lot->setExpirationDate(new DateTime('+1 days'));
|
||||
$lot->setStorageLocation($this->getStructuralData(Storelocation::class));
|
||||
$lot->setStorageLocation($this->getStructuralData(StorageLocation::class));
|
||||
$lot->setAmount(123);
|
||||
$lot->setOwner($this->getUser());
|
||||
|
||||
return $lot;
|
||||
}
|
||||
|
||||
private function getStorelocation(): Storelocation
|
||||
private function getStorelocation(): StorageLocation
|
||||
{
|
||||
$storelocation = new Storelocation();
|
||||
$storelocation = new StorageLocation();
|
||||
$storelocation->setName('Location 1');
|
||||
$storelocation->setComment('Example comment');
|
||||
$storelocation->updateTimestamps();
|
||||
$storelocation->setOwner($this->getUser());
|
||||
|
||||
|
||||
$parent = new Storelocation();
|
||||
$parent = new StorageLocation();
|
||||
$parent->setName('Parent');
|
||||
|
||||
$storelocation->setParent($parent);
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace App\Services\LabelSystem;
|
|||
use App\Entity\LabelSystem\LabelOptions;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Entity\Parts\StorageLocation;
|
||||
use Dompdf\Dompdf;
|
||||
use InvalidArgumentException;
|
||||
use Jbtronics\DompdfFontLoaderBundle\Services\DompdfFactoryInterface;
|
||||
|
|
|
@ -41,7 +41,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Services\LabelSystem\PlaceholderProviders;
|
||||
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Entity\Parts\StorageLocation;
|
||||
use App\Entity\UserSystem\User;
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Services\Formatters\AmountFormatter;
|
||||
|
@ -95,11 +95,11 @@ final class PartLotProvider implements PlaceholderProviderInterface
|
|||
}
|
||||
|
||||
if ('[[LOCATION]]' === $placeholder) {
|
||||
return $label_target->getStorageLocation() instanceof Storelocation ? $label_target->getStorageLocation()->getName() : '';
|
||||
return $label_target->getStorageLocation() instanceof StorageLocation ? $label_target->getStorageLocation()->getName() : '';
|
||||
}
|
||||
|
||||
if ('[[LOCATION_FULL]]' === $placeholder) {
|
||||
return $label_target->getStorageLocation() instanceof Storelocation ? $label_target->getStorageLocation()->getFullPath() : '';
|
||||
return $label_target->getStorageLocation() instanceof StorageLocation ? $label_target->getStorageLocation()->getFullPath() : '';
|
||||
}
|
||||
|
||||
if ('[[OWNER]]' === $placeholder) {
|
||||
|
|
|
@ -23,13 +23,13 @@ declare(strict_types=1);
|
|||
namespace App\Services\LabelSystem\PlaceholderProviders;
|
||||
|
||||
use App\Entity\UserSystem\User;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Entity\Parts\StorageLocation;
|
||||
|
||||
class StorelocationProvider implements PlaceholderProviderInterface
|
||||
{
|
||||
public function replace(string $placeholder, object $label_target, array $options = []): ?string
|
||||
{
|
||||
if ($label_target instanceof Storelocation) {
|
||||
if ($label_target instanceof StorageLocation) {
|
||||
if ('[[OWNER]]' === $placeholder) {
|
||||
return $label_target->getOwner() instanceof User ? $label_target->getOwner()->getFullName() : '';
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ use App\Entity\Parameters\AbstractParameter;
|
|||
use App\Entity\Parts\MeasurementUnit;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Entity\Parts\StorageLocation;
|
||||
use App\Entity\Parts\Supplier;
|
||||
use App\Entity\PriceInformations\Currency;
|
||||
use App\Entity\PriceInformations\Orderdetail;
|
||||
|
@ -101,7 +101,7 @@ final class SandboxedTwigProvider
|
|||
MeasurementUnit::class => ['getUnit', 'isInteger', 'useSIPrefix'],
|
||||
PartLot::class => ['isExpired', 'getDescription', 'getComment', 'getExpirationDate', 'getStorageLocation',
|
||||
'getPart', 'isInstockUnknown', 'getAmount', 'getNeedsRefill', ],
|
||||
Storelocation::class => ['isFull', 'isOnlySinglePart', 'isLimitToExistingParts', 'getStorageType'],
|
||||
StorageLocation::class => ['isFull', 'isOnlySinglePart', 'isLimitToExistingParts', 'getStorageType'],
|
||||
Supplier::class => ['getShippingCosts', 'getDefaultCurrency'],
|
||||
Part::class => ['isNeedsReview', 'getTags', 'getMass', 'getDescription', 'isFavorite', 'getCategory',
|
||||
'getFootprint', 'getPartLots', 'getPartUnit', 'useFloatAmount', 'getMinAmount', 'getAmountSum',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue