diff --git a/inc/field.class.php b/inc/field.class.php index 651df854..815816f1 100644 --- a/inc/field.class.php +++ b/inc/field.class.php @@ -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']); diff --git a/templates/fields.html.twig b/templates/fields.html.twig index 9dc471d5..e65496c4 100644 --- a/templates/fields.html.twig +++ b/templates/fields.html.twig @@ -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 %}
@@ -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' %} @@ -116,7 +118,7 @@ {% endif %} {% endfor %} -{% if item is not instanceof('CommonITILObject') %} +{% if not already_wrapped %}