Skip to content

Commit

Permalink
Fix display of fields in ticket tab container
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne committed Apr 19, 2022
1 parent 56bd908 commit ea7bb88
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 5 additions & 4 deletions inc/field.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -751,10 +751,11 @@ static function prepareHtmlFields($fields, $items_id, $itemtype, $canedit = true
$item = new $itemtype;
$item->getFromDB($items_id);
$html = TemplateRenderer::getInstance()->render('@fields/fields.html.twig', [
'item' => $item,
'fields' => $fields,
'canedit' => $canedit,
'massiveaction' => $massiveaction,
'item' => $item,
'fields' => $fields,
'canedit' => $canedit,
'massiveaction' => $massiveaction,
'container' => $container_obj,
]);

unset($_SESSION['plugin']['fields']['values_sent']);
Expand Down
8 changes: 5 additions & 3 deletions templates/fields.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@

{% import 'components/form/fields_macros.html.twig' as macros %}

{% if item is not instanceof('CommonITILObject') %}
{% set already_wrapped = item is instanceof('CommonITILObject') and container.fields['type'] == 'dom' %}

{% if not already_wrapped %}
<div class="card-body d-flex flex-wrap">
<div class="col-12 col-xxl-12 flex-column">
<div class="d-flex flex-row flex-wrap flex-xl-nowrap">
Expand All @@ -47,7 +49,7 @@
{% set field_options = {
'readonly': readonly or not canedit,
'required': field['mandatory'],
'full_width': item is instanceof('CommonITILObject')
'full_width': already_wrapped
} %}

{% if type == 'header' %}
Expand Down Expand Up @@ -116,7 +118,7 @@
{% endif %}
{% endfor %}

{% if item is not instanceof('CommonITILObject') %}
{% if not already_wrapped %}
</div>
</div>
</div>
Expand Down

0 comments on commit ea7bb88

Please sign in to comment.