Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Rename visibility field label to "Is Private"
- Restored group selection in mappings
- Fix special caracters malformed in translations
- Fix error when displaying the additional information form

## [2.15.3] - 2025-12-22

Expand Down
40 changes: 13 additions & 27 deletions inc/info.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,8 @@

use Glpi\Application\View\TemplateRenderer;

/**
* -------------------------------------------------------------------------
* DataInjection plugin for GLPI
* -------------------------------------------------------------------------
*
* LICENSE
*
* This file is part of DataInjection.
*
* DataInjection is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* DataInjection is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DataInjection. If not, see <http://www.gnu.org/licenses/>.
* -------------------------------------------------------------------------
* @copyright Copyright (C) 2007-2023 by DataInjection plugin team.
* @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html
* @link https://github.com/pluginsGLPI/datainjection
* -------------------------------------------------------------------------
*/
use function Safe\ob_start;
use function Safe\ob_get_clean;

class PluginDatainjectionInfo extends CommonDBTM
{
Expand Down Expand Up @@ -281,8 +256,19 @@ public static function showAdditionalInformationsForm(PluginDatainjectionModel $
$modeltype = PluginDatainjectionModel::getInstance($model->getField('filetype'));
$modeltype->getFromDBByModelID($model->getField('id'));

$rendered_infos = [];
foreach ($infos as $info_data) {
$info = new self();
$info->fields = $info_data;

ob_start();
self::displayAdditionalInformation($info, $_SESSION['datainjection']['infos'] ?? []);
$rendered_infos[] = ob_get_clean();
}

$data = [
'infos' => $infos,
'rendered_infos' => $rendered_infos,
'model' => $model,
'modeltype' => $modeltype,
'has_sample' => $modeltype->haveSample(),
Expand Down
16 changes: 12 additions & 4 deletions templates/infoadditionnalinfo.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,17 @@
</div>
{% endif %}

{% for info in infos %}
<div class="text-center mt-3">
{{ self.displayAdditionalInformation(info, session_infos)|raw }}
{% if rendered_infos|length > 0 %}
<div class="d-flex justify-content-center mt-3">
<table class="table table-borderless w-auto text-center">
<tbody>
{% for rendered_info in rendered_infos %}
<tr>
{{ rendered_info|raw }}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endfor %}
{% endif %}
{% endif %}