- opções do projeto Redmine montadas no PHP (Twig merge renumera chaves inteiras) - aba mostra o NOME do projeto vinculado (não só o ID) - botão Desvincular (projeto e entidade) + dropdown só com projetos ativos Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
50 lines
2.3 KiB
Twig
50 lines
2.3 KiB
Twig
{% import 'components/form/fields_macros.html.twig' as fields %}
|
|
|
|
<div class="alert alert-success mt-3 d-flex justify-content-between align-items-center">
|
|
<span>
|
|
<i class="ti ti-link me-2"></i>
|
|
{{ __('Vinculado ao projeto Redmine', 'redmine') }}
|
|
<strong class="ms-1">{{ redmine_project_name|default('') }} (#{{ redmine_project_id }})</strong>
|
|
</span>
|
|
<form method="post" action="{{ action_url }}" class="m-0"
|
|
onsubmit="return confirm('{{ __('Desvincular este projeto do Redmine?', 'redmine') }}');">
|
|
<input type="hidden" name="_glpi_csrf_token" value="{{ csrf_token_value }}">
|
|
<input type="hidden" name="{{ owner_field }}" value="{{ owner_id }}">
|
|
<input type="hidden" name="action" value="unlink">
|
|
<button type="submit" class="btn btn-sm btn-outline-danger">
|
|
<i class="ti ti-unlink me-1"></i>{{ __('Desvincular', 'redmine') }}
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
<form method="post" action="{{ action_url }}" class="mt-2">
|
|
<input type="hidden" name="_glpi_csrf_token" value="{{ csrf_token_value }}">
|
|
<input type="hidden" name="{{ owner_field }}" value="{{ owner_id }}">
|
|
<input type="hidden" name="action" value="set_category">
|
|
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h5 class="mb-0"><i class="ti ti-category me-1"></i>{{ __('Categoria padrão das tarefas deste projeto', 'redmine') }}</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
{% if cat_options is empty %}
|
|
<div class="alert alert-secondary mb-0">
|
|
{{ __('Este projeto Redmine não possui categorias cadastradas.', 'redmine') }}
|
|
</div>
|
|
{% else %}
|
|
<div class="row">
|
|
{{ fields.dropdownArrayField('default_category_id', default_category_id, cat_options, __('Categoria padrão', 'redmine'), {
|
|
'display_emptychoice': true
|
|
}) }}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% if cat_options is not empty %}
|
|
<div class="card-footer text-end">
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="ti ti-device-floppy me-1"></i>{{ _x('button', 'Save') }}
|
|
</button>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</form>
|