- nova aba Redmine em Administração > Entidades (PluginRedmineEntity) - tabela glpi_plugin_redmine_entities (1:1 entidade -> projeto Redmine, + categoria) - hook resolve o projeto Redmine por: projeto vinculado OU, na ausência, a entidade do chamado (match exato, sem herança de árvore) - twigs do tab generalizados (owner_field/owner_id) p/ reuso projeto+entidade Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
73 lines
3.2 KiB
Twig
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="{{ 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">
|
|
|
|
{# 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>
|