diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index f11548d6a5a..c0fc7805bec 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -86,6 +86,11 @@ abstract class CommonObject
*/
public $element;
+ /**
+ * @var int The related element
+ */
+ public $fk_element;
+
/**
* @var string Name to use for 'features' parameter to check module permissions user->rights->feature with restrictedArea().
* Undefined means same value than $element. Can be use to force a check on another element for example for class of line, we mention here the parent element.
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 8a2ab3e0d42..f76d439e49f 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -5206,15 +5206,20 @@ class Form
$more .= '
' . $input['label'] . '
';
$more .= '
';
$addnowlink = (empty($input['datenow']) ? 0 : 1);
- $more .= $this->selectDate($input['value'], $input['name'], ($input['type'] == 'datetime' ? 1 : 0), ($input['type'] == 'datetime' ? 1 : 0), 0, '', 1, $addnowlink);
- $more .= '
' . "\n";
- $formquestion[] = array('name' => $input['name'] . 'day');
- $formquestion[] = array('name' => $input['name'] . 'month');
- $formquestion[] = array('name' => $input['name'] . 'year');
- $formquestion[] = array('name' => $input['name'] . 'hour');
- $formquestion[] = array('name' => $input['name'] . 'min');
- } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
- $more .= '';
+ $h = $m = 0;
+ if ($input['type'] == 'datetime') {
+ $h = isset($input['hours']) ? $input['hours'] : 1;
+ $m = isset($input['minutes']) ? $input['minutes'] : 1;
+ }
+ $more .= $this->selectDate($input['value'], $input['name'], $h, $m, 0, '', 1, $addnowlink);
+ $more .= '
'."\n";
+ $formquestion[] = array('name'=>$input['name'].'day');
+ $formquestion[] = array('name'=>$input['name'].'month');
+ $formquestion[] = array('name'=>$input['name'].'year');
+ $formquestion[] = array('name'=>$input['name'].'hour');
+ $formquestion[] = array('name'=>$input['name'].'min');
+ } elseif ($input['type'] == 'other') { // can be 1 column or 2 depending if label is set or not
+ $more .= '';
if (!empty($input['label'])) {
$more .= $input['label'] . '
';
}