From 89d9fe39198b711dbea42ab5719a09f4cb885d5e Mon Sep 17 00:00:00 2001 From: bgenere Date: Wed, 30 May 2018 17:08:01 +0200 Subject: [PATCH 1/3] FIX Issue for extra fields date display in template. Template is now consistent with the extrafiels_view template --- htdocs/core/tpl/extrafields_list_print_fields.tpl.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php index 2576873a2c5..e59f50501ab 100644 --- a/htdocs/core/tpl/extrafields_list_print_fields.tpl.php +++ b/htdocs/core/tpl/extrafields_list_print_fields.tpl.php @@ -25,7 +25,12 @@ if (! empty($extrafieldsobjectkey)) // $extrafieldsobject is the $object->table_ $tmpkey='options_'.$key; if (in_array($extrafields->attributes[$extrafieldsobjectkey]['type'][$key], array('date', 'datetime', 'timestamp'))) { - $value = $db->jdate($obj->$tmpkey); + $datenotinstring = $obj->$tmpkey; + if (! is_numeric($obj->$tmpkey)) // For backward compatibility + { + $datenotinstring = $db->jdate($datenotinstring); + } + $value = $datenotinstring; } else { From 67830a7d04011287c6d3939dffabf57fcb969a5c Mon Sep 17 00:00:00 2001 From: bgenere Date: Wed, 30 May 2018 17:09:24 +0200 Subject: [PATCH 2/3] FIX extrafields display properly in list for Resource module --- htdocs/resource/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index 947479e62b3..e6263a0233e 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -265,6 +265,7 @@ if ($ret) if (! $i) $totalarray['nbfield']++; } // Extra fields + $obj = (object) $resource->array_options; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; print ''; From 54023d1029b8387cbbbcef46051ac44fc78ec834 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 4 Jun 2018 13:42:30 +0200 Subject: [PATCH 3/3] Update list.php --- htdocs/resource/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/resource/list.php b/htdocs/resource/list.php index e6263a0233e..6d3abfd84a7 100644 --- a/htdocs/resource/list.php +++ b/htdocs/resource/list.php @@ -265,7 +265,7 @@ if ($ret) if (! $i) $totalarray['nbfield']++; } // Extra fields - $obj = (object) $resource->array_options; + $obj = (Object) $resource->array_options; include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php'; print '';