diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index ad2fa068757..7f0115b83bc 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -33,13 +33,13 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) { if ($action == 'edit_extras') { - $value = (isset($_POST ["options_" . $key]) ? $_POST ["options_" . $key] : $object->array_options ["options_" . $key]); + $value = (isset($_POST["options_" . $key]) ? $_POST["options_" . $key] : $object->array_options["options_" . $key]); } else { - $value = $object->array_options ["options_" . $key]; + $value = $object->array_options["options_" . $key]; } - if ($extrafields->attribute_type [$key] == 'separate') + if ($extrafields->attribute_type[$key] == 'separate') { print $extrafields->showSeparator($key); } @@ -47,7 +47,8 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) { print '
| attribute_required [$key])) print ' class="fieldrequired"'; + //var_dump($action);exit; + if ((! empty($action) && $action != 'view') && ! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"'; print '>' . $label . ' | '; //TODO Improve element and rights detection @@ -67,8 +68,8 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) print ''; // Convert date into timestamp format - if (in_array($extrafields->attribute_type [$key], array('date','datetime'))) { - $value = isset($_POST ["options_" . $key]) ? dol_mktime($_POST ["options_" . $key . "hour"], $_POST ["options_" . $key . "min"], 0, $_POST ["options_" . $key . "month"], $_POST ["options_" . $key . "day"], $_POST ["options_" . $key . "year"]) : $db->jdate($object->array_options ['options_' . $key]); + if (in_array($extrafields->attribute_type[$key], array('date','datetime'))) { + $value = isset($_POST["options_" . $key]) ? dol_mktime($_POST["options_" . $key . "hour"], $_POST["options_" . $key . "min"], 0, $_POST["options_" . $key . "month"], $_POST["options_" . $key . "day"], $_POST["options_" . $key . "year"]) : $db->jdate($object->array_options['options_' . $key]); } //TODO Improve element and rights detection @@ -77,7 +78,7 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) print ' | ||||