Skip to content

Commit

Permalink
PHRAS-4033 fix timeline history for writemetadata and subdefinition (#…
Browse files Browse the repository at this point in the history
…4491)

* fix timeline historic for writemetadata and subdefinition

* fix alter table in log_docs
  • Loading branch information
aynsix authored Mar 25, 2024
1 parent d8d8c71 commit 28bb363
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
3 changes: 2 additions & 1 deletion lib/classes/Session/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ public function initOrUpdateLogDocsFromWorker(\record_adapter $record, \databox
$comment = json_encode([
'finished' => empty($finished) ? '' : $finished->format('Y-m-d H:i:s'),
'duration' => empty($finished) ? '' : $finished->getTimestamp() - $workerRunningJob->getCreated()->getTimestamp() ,
'status' => $status
'status' => $status,
'subdefName' => $subdefName
]);

if ($count > 0) {
Expand Down
2 changes: 1 addition & 1 deletion lib/conf.d/bases_structure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2580,7 +2580,7 @@
</field>
<field>
<name>action</name>
<type>enum('push','add','validate','edit','collection','status','print','substit','publish','download','mail','ftp','delete', 'subdefCreation', 'writeMetadatas', '')</type>
<type>enum('push','add','validate','edit','collection','status','print','substit','publish','download','mail','ftp','delete','subdefCreation','writeMetadatas','')</type>
<null></null>
<extra></extra>
<default></default>
Expand Down
24 changes: 20 additions & 4 deletions templates/web/prod/preview/short_history.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,27 @@
{% set content = done['final']|join(', ') %}
{% trans with {'%dest%' : dest, '%content%' : content} %}Envoi par ftp a %dest% de %content%{% endtrans %}
{% elseif action == 'subdefCreation' %}
{% set comment = done['comment'] | join(', ') | json_to_array %}
{% trans with {'%subdefName%' : done['final'] | join(', '), '%started%' : hour, '%duration%' : (comment.duration == '') ? '-' : comment.duration | date_duration , '%status%' : comment.status} %}create subdefinition: %subdefName% start at %started% during %duration% -- status %status%{% endtrans %}
{% for k, comment in done['comment'] %}
{% set comment = comment | json_to_array %}
{% set subdefName = comment.subdefName is defined ? comment.subdefName : done['final'][k] %}

{% trans with {'%subdefName%' : subdefName, '%started%' : hour, '%duration%' : (comment.duration == '') ? '-' : comment.duration | date_duration , '%status%' : comment.status} %}create subdefinition: %subdefName% start at %started% during %duration% -- status %status%{% endtrans %}
{% if done['final']|length > 1 %}
{# separate with line break #}
<br><br>
{% endif %}
{% endfor %}
{% elseif action == 'writeMetadatas' %}
{% set comment = done['comment'] | join(', ') | json_to_array %}
{% trans with {'%subdefName%' : done['final'] | join(', '), '%started%' : hour, '%duration%' : (comment.duration == '') ? '-' : comment.duration | date_duration , '%status%' : comment.status} %}write metadatas: %subdefName% start at %started% during %duration% -- status %status%{% endtrans %}
{% for k, comment in done['comment'] %}
{% set comment = comment | json_to_array %}
{% set subdefName = comment.subdefName is defined ? comment.subdefName : done['final'][k] %}

{% trans with {'%subdefName%' : subdefName, '%started%' : hour, '%duration%' : (comment.duration == '') ? '-' : comment.duration | date_duration , '%status%' : comment.status} %}write metadatas: %subdefName% start at %started% during %duration% -- status %status%{% endtrans %}
{% endfor %}
{% if done['final']|length > 1 %}
{# separate with line break #}
<br><br>
{% endif %}
{% elseif action == 'delete' %}
{{ 'report::supression du document' | trans }}
{% elseif action == 'add' %}
Expand Down

0 comments on commit 28bb363

Please sign in to comment.