Show and link which log entry was undone/reverted on log detail page

This commit is contained in:
Jan Böhmer 2023-05-15 22:42:08 +02:00
parent 47ef8e9568
commit 5a3fc0fb43
2 changed files with 6 additions and 2 deletions

View file

@ -131,9 +131,9 @@ class LogEntryExtraFormatter
if (($context instanceof LogWithEventUndoInterface) && $context->isUndoEvent()) {
if ('undo' === $context->getUndoMode()) {
$array['log.undo_mode.undo'] = (string) $context->getUndoEventID();
$array['log.undo_mode.undo'] = '#' . $context->getUndoEventID();
} elseif ('revert' === $context->getUndoMode()) {
$array['log.undo_mode.revert'] = (string) $context->getUndoEventID();
$array['log.undo_mode.revert'] = '#' . $context->getUndoEventID();
}
}

View file

@ -28,6 +28,10 @@
{% if log_entry.type == 'part_stock_changed' %}
({{ ('log.part_stock_changed.' ~ log_entry.instockChangeType)|trans }})
{% endif %}
{% if log_entry is instanceof('App\\Entity\\Contracts\\LogWithEventUndoInterface') and log_entry.undoEvent %}
<b>({{ ('log.undo_mode.' ~ log_entry.undoMode)|trans }}: <a href="{{ path('log_details', {"id": log_entry.UndoEventID}) }}">#{{ log_entry.UndoEventID }}</a>)</b>
{% endif %}
</td>
</tr>
<tr>