diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index f6e1c94396e..def9c195c36 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -320,9 +320,12 @@ if ($nolinesbefore) { echo ''; } if (is_object($objectline)) { - print '
'; - print $objectline->showOptionals($extrafields, 'edit', array(), '', '', 1, 'line'); - print '
'; + $temps = $objectline->showOptionals($extrafields, 'create', array(), '', '', 1, 'line');; + if (!empty($temps)) { + print '
'; + print $temps; + print '
'; + } } echo ''; if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index d96398cfd8b..153d4b2b309 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -128,9 +128,12 @@ $coldisplay++; //Line extrafield if (!empty($extrafields)) { - print '
'; - print $line->showOptionals($extrafields, 'edit', array('class'=>'tredited'), '', '', 1, 'line'); - print '
'; + $temps = $line->showOptionals($extrafields, 'edit', array('class'=>'tredited'), '', '', 1, 'line'); + if (!empty($temps)) { + print '
'; + print $temps + print '
'; + } } // Show autofill date for recuring invoices diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 54c2f7f50fe..8b7bfb5d288 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -160,9 +160,12 @@ if (($line->info_bits & 2) == 2) { //Line extrafield if (!empty($extrafields)) { - print '
'; - print $line->showOptionals($extrafields, 'view', array(), '', '', 1, 'line'); - print '
'; + $temps = $line->showOptionals($extrafields, 'view', array(), '', '', 1, 'line'); + if (!empty($temps)) { + print '
'; + print $temps; + print '
'; + } } }