From ca82aec88d37fea9662d009ebaef81e8916e5016 Mon Sep 17 00:00:00 2001 From: David Pareja Rodriguez Date: Thu, 23 Feb 2023 15:14:12 +0100 Subject: [PATCH 1/4] Make it possible to select hours and minutes in form_confirm --- htdocs/core/class/html.form.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 418f798dc34..c5fe199aa34 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4843,7 +4843,9 @@ class Form $more .= '
'.$input['label'].'
'; $more .= '
'; $addnowlink = (empty($input['datenow']) ? 0 : 1); - $more .= $this->selectDate($input['value'], $input['name'], 0, 0, 0, '', 1, $addnowlink); + $h = $input['hours'] ?: 0; + $m = $input['minutes'] ?: 0; + $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'); From 5b47abbe38e8408317a3626048546d86e7bbf862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 31 Mar 2023 09:24:28 +0200 Subject: [PATCH 2/4] Doc --- htdocs/core/class/commonobject.class.php | 5 +++++ 1 file changed, 5 insertions(+) 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. From c2f5db9d9c9b8da7df76616bc7a8bc9a785203ba Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Mar 2023 11:40:34 +0200 Subject: [PATCH 3/4] Better compatibility --- htdocs/core/class/html.form.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index fb4aa830ea0..0ef7115ba21 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5198,8 +5198,11 @@ class Form $more .= '
' . $input['label'] . '
'; $more .= '
'; $addnowlink = (empty($input['datenow']) ? 0 : 1); - $h = $input['hours'] ?: 0; - $m = $input['minutes'] ?: 0; + $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'); From 0bdb6bae64d9245c7b5614ed952899a0d57367e9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 Mar 2023 11:44:58 +0200 Subject: [PATCH 4/4] Update html.form.class.php --- htdocs/core/class/html.form.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0ef7115ba21..99c0305d2cb 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -5199,7 +5199,7 @@ class Form $more .= '
'; $addnowlink = (empty($input['datenow']) ? 0 : 1); $h = $m = 0; - if ($input['type'] == 'datetime) { + if ($input['type'] == 'datetime') { $h = isset($input['hours']) ? $input['hours'] : 1; $m = isset($input['minutes']) ? $input['minutes'] : 1; }