workflows: add freeze mechanism on breadcrumbs, edit document button, and history

This commit is contained in:
2022-01-21 23:23:52 +01:00
parent ab23290599
commit 917dd49d07
4 changed files with 54 additions and 28 deletions

View File

@@ -21,24 +21,28 @@
</div>
</div>
{% set freezed = false %}
{% for step in entity_workflow.stepsChained %}
{% if loop.last %}
{% if step.previous is not null and step.previous.freezeAfter == true %}
{% set freezed = true %}
{% endif %}
{% endif %}
{% endfor %}
{% if display_action is defined and display_action == true %}
<ul class="record_actions">
<li>
{{ m.download_button(document.object, document.title) }}
</li>
<li>
{#
data-button is optional !
OPTIONS:
'changeIcon' string
{% if not freezed %}
{% set button = {
'changeIcon': 'fa-unlock',
} %}{#
'changeClass' string
'noText' boolean
#}{% set button = {
'changeIcon': 'fa-unlock',
} %}
#}
{# vue component #}
<span
data-module="wopi-link"
@@ -47,6 +51,11 @@
data-doc-type="{{ document.object.type|e('html_attr') }}"
data-button="{{ button|json_encode }}"
></span>
{% else %}
<a class="btn btn-update change-icon disabled" href="#" title="{{ 'workflow.freezed document'|trans }}">
<i class="fa fa-lock me-2"></i>{{ 'Update document'|trans }}
</a>
{% endif %}
</li>
</ul>
{% endif %}