mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-24 10:49:00 +02:00
Improved the rendering of a part instock change log entry
This commit is contained in:
parent
4c94d9c150
commit
5d6b7a9470
3 changed files with 72 additions and 1 deletions
|
@ -37,6 +37,7 @@ use App\Entity\LogSystem\CollectionElementDeleted;
|
|||
use App\Entity\LogSystem\ElementCreatedLogEntry;
|
||||
use App\Entity\LogSystem\ElementDeletedLogEntry;
|
||||
use App\Entity\LogSystem\ElementEditedLogEntry;
|
||||
use App\Entity\LogSystem\PartStockChangedLogEntry;
|
||||
use App\Entity\UserSystem\Group;
|
||||
use App\Entity\UserSystem\User;
|
||||
use App\Exceptions\EntityNotSupportedException;
|
||||
|
@ -190,7 +191,16 @@ class LogDataTable implements DataTableTypeInterface
|
|||
'label' => $this->translator->trans('log.type'),
|
||||
'propertyPath' => 'type',
|
||||
'render' => function (string $value, AbstractLogEntry $context) {
|
||||
return $this->translator->trans('log.type.'.$value);
|
||||
$text = $this->translator->trans('log.type.'.$value);
|
||||
|
||||
if ($context instanceof PartStockChangedLogEntry) {
|
||||
$text .= sprintf(
|
||||
' (%s)',
|
||||
$this->translator->trans('log.part_stock_changed.' . $context->getInstockChangeType())
|
||||
);
|
||||
}
|
||||
|
||||
return $text;
|
||||
},
|
||||
]);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue