diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8dabc902e5c..4b3d6fca2d3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7699,7 +7699,7 @@ abstract class CommonObject if (empty($reshook)) { if (key_exists('label', $extrafields->attributes[$this->table_element]) && is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) { $out .= "\n"; - $out .= ' '; + $out .= ' '; $out .= "\n"; $extrafields_collapse_num = ''; diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 8d21a789648..daef20542a5 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -354,7 +354,7 @@ if ($nolinesbefore) { } if (is_object($objectline)) { $temps = $objectline->showOptionals($extrafields, 'create', array(), '', '', 1, 'line'); - ; + if (!empty($temps)) { print '
'; print $temps; diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index a58a62b5ffd..e02a601c9cd 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1342,6 +1342,23 @@ if ($action == 'create') { print ''; // ancre pour retourner sur la ligne print dol_htmlentitiesbr($objp->description); + $objectline = new FichinterLigne($db); + $objectline->fetch($objp->rowid); + $objectline->fetch_optionals(); + + $extrafields->fetch_name_optionals_label($objectline->table_element); + + if (!empty($extrafields)) { + $temps = $objectline->showOptionals($extrafields, 'view', array(), '', '', 1, 'line'); + if (!empty($temps)) { + print '
'; + print $temps; + print '
'; + } + } + + print ''; + // Date print ''.(empty($conf->global->FICHINTER_DATE_WITHOUT_HOUR) ?dol_print_date($db->jdate($objp->date_intervention), 'dayhour') : dol_print_date($db->jdate($objp->date_intervention), 'day')).''; @@ -1378,15 +1395,6 @@ if ($action == 'create') { } print ''; - - $line = new FichinterLigne($db); - $line->fetch($objp->rowid); - - $extrafields->fetch_name_optionals_label($line->table_element); - - $line->fetch_optionals(); - - print $line->showOptionals($extrafields, 'view', array('colspan'=>5)); } // Line in update mode @@ -1405,6 +1413,22 @@ if ($action == 'create') { require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor = new DolEditor('np_desc', $objp->description, '', 164, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, ROWS_2, '90%'); $doleditor->Create(); + + $objectline = new FichinterLigne($db); + $objectline->fetch($objp->rowid); + $objectline->fetch_optionals(); + + $extrafields->fetch_name_optionals_label($objectline->table_element); + + if (!empty($extrafields)) { + $temps = $objectline->showOptionals($extrafields, 'edit', array(), '', '', 1, 'line'); + if (!empty($temps)) { + print '
'; + print $temps; + print '
'; + } + } + print ''; // Date d'intervention @@ -1431,14 +1455,6 @@ if ($action == 'create') { print ''; print ''; print ''."\n"; - - $line = new FichinterLigne($db); - $line->fetch($objp->rowid); - - $extrafields->fetch_name_optionals_label($line->table_element); - $line->fetch_optionals(); - - print $line->showOptionals($extrafields, 'edit', array('colspan'=>5)); } $i++; @@ -1481,6 +1497,20 @@ if ($action == 'create') { $doleditor = new DolEditor('np_desc', GETPOST('np_desc', 'restricthtml'), '', 100, 'dolibarr_details', '', false, true, $conf->global->FCKEDITOR_ENABLE_DETAILS, ROWS_2, '90%'); $doleditor->Create(); } + + $objectline = new FichinterLigne($db); + $extrafields->fetch_name_optionals_label($objectline->table_element); + + if (is_object($objectline)) { + $temps = $objectline->showOptionals($extrafields, 'create', array(), '', '', 1, 'line'); + + if (!empty($temps)) { + print '
'; + print $temps; + print '
'; + } + } + print ''; // Date intervention @@ -1513,14 +1543,6 @@ if ($action == 'create') { print ''; print ''; - //Line extrafield - - $lineadd = new FichinterLigne($db); - - $extrafields->fetch_name_optionals_label($lineadd->table_element); - - print $lineadd->showOptionals($extrafields, 'edit', array('colspan'=>5)); - if (!$num) { print ''; }