mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-10 10:24:31 +02:00
Show part lots and orderdetails with a name in target column if it exists.
This commit is contained in:
parent
71fa827784
commit
7cf500279e
3 changed files with 22 additions and 3 deletions
|
@ -45,6 +45,7 @@ namespace App\DataTables\Column;
|
||||||
use App\Entity\Attachments\Attachment;
|
use App\Entity\Attachments\Attachment;
|
||||||
use App\Entity\Base\AbstractDBElement;
|
use App\Entity\Base\AbstractDBElement;
|
||||||
use App\Entity\Base\AbstractNamedDBElement;
|
use App\Entity\Base\AbstractNamedDBElement;
|
||||||
|
use App\Entity\Contracts\NamedElementInterface;
|
||||||
use App\Entity\LogSystem\AbstractLogEntry;
|
use App\Entity\LogSystem\AbstractLogEntry;
|
||||||
use App\Entity\Parameters\AbstractParameter;
|
use App\Entity\Parameters\AbstractParameter;
|
||||||
use App\Entity\Parts\PartLot;
|
use App\Entity\Parts\PartLot;
|
||||||
|
@ -98,7 +99,7 @@ class LogEntryTargetColumn extends AbstractColumn
|
||||||
$tmp = '';
|
$tmp = '';
|
||||||
|
|
||||||
//The element is existing
|
//The element is existing
|
||||||
if ($target instanceof AbstractNamedDBElement) {
|
if ($target instanceof NamedElementInterface && !empty($target->getName())) {
|
||||||
try {
|
try {
|
||||||
$tmp = sprintf(
|
$tmp = sprintf(
|
||||||
'<a href="%s">%s</a>',
|
'<a href="%s">%s</a>',
|
||||||
|
|
|
@ -44,6 +44,7 @@ namespace App\Entity\Parts;
|
||||||
|
|
||||||
use App\Entity\Base\AbstractDBElement;
|
use App\Entity\Base\AbstractDBElement;
|
||||||
use App\Entity\Base\TimestampTrait;
|
use App\Entity\Base\TimestampTrait;
|
||||||
|
use App\Entity\Contracts\NamedElementInterface;
|
||||||
use App\Entity\Contracts\TimeStampableInterface;
|
use App\Entity\Contracts\TimeStampableInterface;
|
||||||
use App\Validator\Constraints\Selectable;
|
use App\Validator\Constraints\Selectable;
|
||||||
use App\Validator\Constraints\ValidPartLot;
|
use App\Validator\Constraints\ValidPartLot;
|
||||||
|
@ -61,7 +62,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||||
* @ORM\HasLifecycleCallbacks()
|
* @ORM\HasLifecycleCallbacks()
|
||||||
* @ValidPartLot()
|
* @ValidPartLot()
|
||||||
*/
|
*/
|
||||||
class PartLot extends AbstractDBElement implements TimeStampableInterface
|
class PartLot extends AbstractDBElement implements TimeStampableInterface, NamedElementInterface
|
||||||
{
|
{
|
||||||
use TimestampTrait;
|
use TimestampTrait;
|
||||||
|
|
||||||
|
@ -326,4 +327,12 @@ class PartLot extends AbstractDBElement implements TimeStampableInterface
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function getName(): string
|
||||||
|
{
|
||||||
|
return $this->description;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,7 @@ namespace App\Entity\PriceInformations;
|
||||||
|
|
||||||
use App\Entity\Base\AbstractDBElement;
|
use App\Entity\Base\AbstractDBElement;
|
||||||
use App\Entity\Base\TimestampTrait;
|
use App\Entity\Base\TimestampTrait;
|
||||||
|
use App\Entity\Contracts\NamedElementInterface;
|
||||||
use App\Entity\Contracts\TimeStampableInterface;
|
use App\Entity\Contracts\TimeStampableInterface;
|
||||||
use App\Entity\Parts\Part;
|
use App\Entity\Parts\Part;
|
||||||
use App\Entity\Parts\Supplier;
|
use App\Entity\Parts\Supplier;
|
||||||
|
@ -67,7 +68,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||||
* @ORM\Entity()
|
* @ORM\Entity()
|
||||||
* @ORM\HasLifecycleCallbacks()
|
* @ORM\HasLifecycleCallbacks()
|
||||||
*/
|
*/
|
||||||
class Orderdetail extends AbstractDBElement implements TimeStampableInterface
|
class Orderdetail extends AbstractDBElement implements TimeStampableInterface, NamedElementInterface
|
||||||
{
|
{
|
||||||
use TimestampTrait;
|
use TimestampTrait;
|
||||||
|
|
||||||
|
@ -359,4 +360,12 @@ class Orderdetail extends AbstractDBElement implements TimeStampableInterface
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @inheritDoc
|
||||||
|
*/
|
||||||
|
public function getName(): string
|
||||||
|
{
|
||||||
|
return $this->getSupplierPartNr();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue