- 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>
70 lines
3.1 KiB
Twig
70 lines
3.1 KiB
Twig
{% import 'components/form/fields_macros.html.twig' as fields %}
|
|
|
|
<form action="{{ action_url }}" method="post" class="mt-4" data-ajax="false">
|
|
<input type="hidden" name="{{ owner_field }}" value="{{ owner_id }}">
|
|
<input type="hidden" name="_glpi_csrf_token" value="{{ csrf_token_value }}">
|
|
<input type="hidden" name="_glpi_simple_form" value="1">
|
|
|
|
{# project_options ({id: name}) é montado no PHP — não usar merge no Twig,
|
|
que renumera chaves inteiras e corrompe os valores das opções. #}
|
|
|
|
<div class="card shadow-sm">
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
<h5 class="mb-0"><i class="fas fa-sitemap"></i> Integração Redmine</h5>
|
|
<button type="submit" name="action" value="sync" class="btn btn-sm btn-outline-secondary">
|
|
<i class="fas fa-sync"></i> Sincronizar Metadados
|
|
</button>
|
|
</div>
|
|
<div class="card-body">
|
|
|
|
<div class="alert alert-info">
|
|
Selecione um projeto existente para vinculá-lo, <strong>ou</strong> deixe em <strong>-----</strong> e preencha o formulário para criar um novo projeto no Redmine.
|
|
</div>
|
|
|
|
<div class="row">
|
|
{{ fields.dropdownArrayField('redmine_project_id', '', project_options, __('Vincular a Projeto Existente', 'redmine'), {
|
|
'display_emptychoice': true,
|
|
'full_width': true
|
|
}) }}
|
|
|
|
{{ fields.textField('name', project_name, __('Nome', 'redmine'), {
|
|
'full_width': true,
|
|
'required': true
|
|
}) }}
|
|
|
|
{{ fields.textareaField('description', project_description, __('Descrição', 'redmine'), {
|
|
'full_width': true,
|
|
'rows': 5
|
|
}) }}
|
|
|
|
{{ fields.textField('identifier', project_identifier, __('Identificador', 'redmine'), {
|
|
'full_width': true,
|
|
'required': true,
|
|
'helper': __('Deve ter entre 1 e 100 caracteres minúsculos, números ou traços.', 'redmine')
|
|
}) }}
|
|
|
|
{{ fields.checkboxField('is_public', 0, __('Público', 'redmine'), {
|
|
'full_width': true,
|
|
'helper': __('Projetos públicos são visíveis para todos.', 'redmine')
|
|
}) }}
|
|
|
|
{{ fields.dropdownArrayField('parent_id', '', project_options, __('Subprojeto de', 'redmine'), {
|
|
'display_emptychoice': true,
|
|
'full_width': true
|
|
}) }}
|
|
|
|
{{ fields.dropdownArrayField('enabled_module_names', '', modules, __('Módulos', 'redmine'), {
|
|
'multiple': true,
|
|
'values': ['issue_tracking', 'time_tracking'],
|
|
'full_width': true
|
|
}) }}
|
|
</div>
|
|
|
|
</div>
|
|
<div class="card-footer text-center">
|
|
<button type="submit" name="action" value="process" class="btn btn-primary px-5">
|
|
<i class="fas fa-save"></i> Criar ou Vincular
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</form>
|