mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-09 18:04:33 +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
|
@ -35,7 +35,7 @@ use App\Entity\Attachments\GroupAttachment;
|
|||
use App\Entity\Attachments\ManufacturerAttachment;
|
||||
use App\Entity\Attachments\MeasurementUnitAttachment;
|
||||
use App\Entity\Attachments\PartAttachment;
|
||||
use App\Entity\Attachments\StorelocationAttachment;
|
||||
use App\Entity\Attachments\StorageLocationAttachment;
|
||||
use App\Entity\Attachments\SupplierAttachment;
|
||||
use App\Entity\Attachments\UserAttachment;
|
||||
use App\Exceptions\AttachmentDownloadException;
|
||||
|
@ -81,7 +81,7 @@ class AttachmentSubmitHandler
|
|||
GroupAttachment::class => 'group',
|
||||
ManufacturerAttachment::class => 'manufacturer',
|
||||
MeasurementUnitAttachment::class => 'measurement_unit',
|
||||
StorelocationAttachment::class => 'storelocation',
|
||||
StorageLocationAttachment::class => 'storelocation',
|
||||
SupplierAttachment::class => 'supplier',
|
||||
UserAttachment::class => 'user',
|
||||
LabelAttachment::class => 'label_profile',
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace App\Services\Attachments;
|
|||
use App\Entity\Parts\Footprint;
|
||||
use App\Entity\ProjectSystem\Project;
|
||||
use App\Entity\Parts\Category;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Entity\Parts\StorageLocation;
|
||||
use App\Entity\Parts\MeasurementUnit;
|
||||
use App\Entity\Parts\Manufacturer;
|
||||
use App\Entity\Attachments\Attachment;
|
||||
|
@ -88,7 +88,7 @@ class PartPreviewGenerator
|
|||
}
|
||||
|
||||
foreach ($part->getPartLots() as $lot) {
|
||||
if ($lot->getStorageLocation() instanceof Storelocation) {
|
||||
if ($lot->getStorageLocation() instanceof StorageLocation) {
|
||||
$attachment = $lot->getStorageLocation()->getMasterPictureAttachment();
|
||||
if ($this->isAttachmentValidPicture($attachment)) {
|
||||
$list[] = $attachment;
|
||||
|
|
|
@ -37,7 +37,7 @@ use App\Entity\Parts\Manufacturer;
|
|||
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;
|
||||
|
@ -71,7 +71,7 @@ class ElementTypeNameGenerator
|
|||
MeasurementUnit::class => $this->translator->trans('measurement_unit.label'),
|
||||
Part::class => $this->translator->trans('part.label'),
|
||||
PartLot::class => $this->translator->trans('part_lot.label'),
|
||||
Storelocation::class => $this->translator->trans('storelocation.label'),
|
||||
StorageLocation::class => $this->translator->trans('storelocation.label'),
|
||||
Supplier::class => $this->translator->trans('supplier.label'),
|
||||
Currency::class => $this->translator->trans('currency.label'),
|
||||
Orderdetail::class => $this->translator->trans('orderdetail.label'),
|
||||
|
|
|
@ -35,7 +35,7 @@ use App\Entity\Parts\Manufacturer;
|
|||
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;
|
||||
|
@ -102,7 +102,7 @@ class EntityURLGenerator
|
|||
Project::class => 'project_edit',
|
||||
Supplier::class => 'supplier_edit',
|
||||
Manufacturer::class => 'manufacturer_edit',
|
||||
Storelocation::class => 'store_location_edit',
|
||||
StorageLocation::class => 'store_location_edit',
|
||||
Footprint::class => 'footprint_edit',
|
||||
User::class => 'user_edit',
|
||||
Currency::class => 'currency_edit',
|
||||
|
@ -199,7 +199,7 @@ class EntityURLGenerator
|
|||
Project::class => 'project_info',
|
||||
Supplier::class => 'supplier_edit',
|
||||
Manufacturer::class => 'manufacturer_edit',
|
||||
Storelocation::class => 'store_location_edit',
|
||||
StorageLocation::class => 'store_location_edit',
|
||||
Footprint::class => 'footprint_edit',
|
||||
User::class => 'user_edit',
|
||||
Currency::class => 'currency_edit',
|
||||
|
@ -229,7 +229,7 @@ class EntityURLGenerator
|
|||
Project::class => 'project_edit',
|
||||
Supplier::class => 'supplier_edit',
|
||||
Manufacturer::class => 'manufacturer_edit',
|
||||
Storelocation::class => 'store_location_edit',
|
||||
StorageLocation::class => 'store_location_edit',
|
||||
Footprint::class => 'footprint_edit',
|
||||
User::class => 'user_edit',
|
||||
Currency::class => 'currency_edit',
|
||||
|
@ -260,7 +260,7 @@ class EntityURLGenerator
|
|||
Project::class => 'project_new',
|
||||
Supplier::class => 'supplier_new',
|
||||
Manufacturer::class => 'manufacturer_new',
|
||||
Storelocation::class => 'store_location_new',
|
||||
StorageLocation::class => 'store_location_new',
|
||||
Footprint::class => 'footprint_new',
|
||||
User::class => 'user_new',
|
||||
Currency::class => 'currency_new',
|
||||
|
@ -291,7 +291,7 @@ class EntityURLGenerator
|
|||
Project::class => 'device_clone',
|
||||
Supplier::class => 'supplier_clone',
|
||||
Manufacturer::class => 'manufacturer_clone',
|
||||
Storelocation::class => 'store_location_clone',
|
||||
StorageLocation::class => 'store_location_clone',
|
||||
Footprint::class => 'footprint_clone',
|
||||
User::class => 'user_clone',
|
||||
Currency::class => 'currency_clone',
|
||||
|
@ -321,7 +321,7 @@ class EntityURLGenerator
|
|||
Footprint::class => 'part_list_footprint',
|
||||
Manufacturer::class => 'part_list_manufacturer',
|
||||
Supplier::class => 'part_list_supplier',
|
||||
Storelocation::class => 'part_list_store_location',
|
||||
StorageLocation::class => 'part_list_store_location',
|
||||
];
|
||||
|
||||
return $this->urlGenerator->generate($this->mapToController($map, $entity), ['id' => $entity->getID()]);
|
||||
|
@ -336,7 +336,7 @@ class EntityURLGenerator
|
|||
Project::class => 'project_delete',
|
||||
Supplier::class => 'supplier_delete',
|
||||
Manufacturer::class => 'manufacturer_delete',
|
||||
Storelocation::class => 'store_location_delete',
|
||||
StorageLocation::class => 'store_location_delete',
|
||||
Footprint::class => 'footprint_delete',
|
||||
User::class => 'user_delete',
|
||||
Currency::class => 'currency_delete',
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace App\Services\ImportExportSystem\PartKeeprImporter;
|
|||
use App\Doctrine\Purger\ResetAutoIncrementORMPurger;
|
||||
use App\Entity\Attachments\FootprintAttachment;
|
||||
use App\Entity\Attachments\ManufacturerAttachment;
|
||||
use App\Entity\Attachments\StorelocationAttachment;
|
||||
use App\Entity\Attachments\StorageLocationAttachment;
|
||||
use App\Entity\Base\AbstractDBElement;
|
||||
use App\Entity\Base\AbstractStructuralDBElement;
|
||||
use App\Entity\Contracts\TimeStampableInterface;
|
||||
|
@ -36,7 +36,7 @@ use App\Entity\Parts\Manufacturer;
|
|||
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 Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\Mapping\ClassMetadataInfo;
|
||||
|
@ -263,9 +263,9 @@ class PKDatastructureImporter
|
|||
|
||||
public function importStorelocations(array $data): int
|
||||
{
|
||||
$count = $this->importElementsWithCategory($data, Storelocation::class, 'storagelocation');
|
||||
$count = $this->importElementsWithCategory($data, StorageLocation::class, 'storagelocation');
|
||||
|
||||
$this->importAttachments($data, 'storagelocationimage', Storelocation::class, 'storageLocation_id', StorelocationAttachment::class);
|
||||
$this->importAttachments($data, 'storagelocationimage', StorageLocation::class, 'storageLocation_id', StorageLocationAttachment::class);
|
||||
|
||||
return $count;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ use App\Entity\Parts\Manufacturer;
|
|||
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;
|
||||
|
@ -93,7 +93,7 @@ class PKPartImporter
|
|||
//Create a part lot to store the stock level and location
|
||||
$lot = new PartLot();
|
||||
$lot->setAmount((float) ($part['stockLevel'] ?? 0));
|
||||
$this->setAssociationField($lot, 'storage_location', Storelocation::class, $part['storageLocation_id']);
|
||||
$this->setAssociationField($lot, 'storage_location', StorageLocation::class, $part['storageLocation_id']);
|
||||
$entity->addPartLot($lot);
|
||||
|
||||
//For partCondition, productionsRemarks and Status, create a custom parameter
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -4,7 +4,7 @@ declare(strict_types=1);
|
|||
|
||||
namespace App\Services\Parts;
|
||||
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Entity\Parts\StorageLocation;
|
||||
use App\Entity\LogSystem\PartStockChangedLogEntry;
|
||||
use App\Entity\Parts\PartLot;
|
||||
use App\Services\LogSystem\EventCommentHelper;
|
||||
|
@ -30,7 +30,7 @@ final class PartLotWithdrawAddHelper
|
|||
}
|
||||
|
||||
//So far all other restrictions are defined at the storelocation level
|
||||
if(!$partLot->getStorageLocation() instanceof Storelocation) {
|
||||
if(!$partLot->getStorageLocation() instanceof StorageLocation) {
|
||||
return true;
|
||||
}
|
||||
//We can not add parts if the storage location of the lot is marked as full
|
||||
|
|
|
@ -49,7 +49,7 @@ use App\Entity\Parts\Footprint;
|
|||
use App\Entity\Parts\Manufacturer;
|
||||
use App\Entity\Parts\MeasurementUnit;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Entity\Parts\StorageLocation;
|
||||
use App\Entity\Parts\Supplier;
|
||||
use App\Entity\PriceInformations\Currency;
|
||||
use App\Repository\AttachmentRepository;
|
||||
|
@ -113,7 +113,7 @@ class StatisticsHelper
|
|||
'footprint' => Footprint::class,
|
||||
'manufacturer' => Manufacturer::class,
|
||||
'measurement_unit' => MeasurementUnit::class,
|
||||
'storelocation' => Storelocation::class,
|
||||
'storelocation' => StorageLocation::class,
|
||||
'supplier' => Supplier::class,
|
||||
'currency' => Currency::class,
|
||||
];
|
||||
|
|
|
@ -31,7 +31,7 @@ use App\Entity\Parts\Footprint;
|
|||
use App\Entity\Parts\Manufacturer;
|
||||
use App\Entity\Parts\MeasurementUnit;
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Entity\Parts\StorageLocation;
|
||||
use App\Entity\Parts\Supplier;
|
||||
use App\Entity\PriceInformations\Currency;
|
||||
use App\Entity\UserSystem\Group;
|
||||
|
@ -182,7 +182,7 @@ class ToolsTreeBuilder
|
|||
$this->urlGenerator->generate('manufacturer_new')
|
||||
))->setIcon('fa-fw fa-treeview fa-solid fa-industry');
|
||||
}
|
||||
if ($this->security->isGranted('read', new Storelocation())) {
|
||||
if ($this->security->isGranted('read', new StorageLocation())) {
|
||||
$nodes[] = (new TreeViewNode(
|
||||
$this->translator->trans('tree.tools.edit.storelocation'),
|
||||
$this->urlGenerator->generate('store_location_new')
|
||||
|
|
|
@ -29,7 +29,7 @@ use App\Entity\ProjectSystem\Project;
|
|||
use App\Entity\Parts\Category;
|
||||
use App\Entity\Parts\Footprint;
|
||||
use App\Entity\Parts\Manufacturer;
|
||||
use App\Entity\Parts\Storelocation;
|
||||
use App\Entity\Parts\StorageLocation;
|
||||
use App\Entity\Parts\Supplier;
|
||||
use App\Helpers\Trees\TreeViewNode;
|
||||
use App\Helpers\Trees\TreeViewNodeIterator;
|
||||
|
@ -142,7 +142,7 @@ class TreeViewGenerator
|
|||
{
|
||||
return match ($class) {
|
||||
Category::class => $this->translator->trans('category.labelp'),
|
||||
Storelocation::class => $this->translator->trans('storelocation.labelp'),
|
||||
StorageLocation::class => $this->translator->trans('storelocation.labelp'),
|
||||
Footprint::class => $this->translator->trans('footprint.labelp'),
|
||||
Manufacturer::class => $this->translator->trans('manufacturer.labelp'),
|
||||
Supplier::class => $this->translator->trans('supplier.labelp'),
|
||||
|
@ -156,7 +156,7 @@ class TreeViewGenerator
|
|||
$icon = "fa-fw fa-treeview fa-solid ";
|
||||
return match ($class) {
|
||||
Category::class => $icon . 'fa-tags',
|
||||
Storelocation::class => $icon . 'fa-cube',
|
||||
StorageLocation::class => $icon . 'fa-cube',
|
||||
Footprint::class => $icon . 'fa-microchip',
|
||||
Manufacturer::class => $icon . 'fa-industry',
|
||||
Supplier::class => $icon . 'fa-truck',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue