Redmine/templates/project_form.html.twig
Gemini 80d1576a80 Redmine Integration 1.3.0
Plugin de integração GLPI <-> Redmine:
- Config nativa (Twig) com API key cifrada (GLPIKey)
- Vínculo projeto GLPI <-> projeto Redmine (aba do projeto) + categoria por vínculo
- 1 issue Redmine por chamado; defaults (tracker/priority/activity) e mapa de status
- Tempo das TicketTasks -> time entries (gate em "Feito"), idempotente
- Autores via impersonation (X-Redmine-Switch-User) + auto-membership por role
- Mapeamento de usuários GLPI->Redmine (auto-match por e-mail + overrides)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 18:32:19 -03:00

73 lines
3.2 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="projects_id" value="{{ projects_id }}">
<input type="hidden" name="_glpi_csrf_token" value="{{ csrf_token_value }}">
<input type="hidden" name="_glpi_simple_form" value="1">
{# Build a {id: name} options map from the cached Redmine projects #}
{% set rp_options = {} %}
{% for rp in redmine_projects %}
{% set rp_options = rp_options|merge({(rp.id): rp.name}) %}
{% endfor %}
<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', '', rp_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', '', rp_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>