From f40ec4d0a79dba18ce4a66d17b0db06e11b8f37b Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Mon, 1 Mar 2021 14:51:51 +0100 Subject: [PATCH] fix(targetticket): date 'now' from a template Signed-off-by: Thierry Bugier --- inc/targetticket.class.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inc/targetticket.class.php b/inc/targetticket.class.php index 254f1a62c..1de0bb4d7 100644 --- a/inc/targetticket.class.php +++ b/inc/targetticket.class.php @@ -710,6 +710,11 @@ public function getDefaultData(PluginFormcreatorFormAnswer $formanswer) : array unset($predefined_fields['_groups_id_assign']); } + // Manage special values + if (isset($predefined_fields['date']) && $predefined_fields['date'] == 'NOW') { + $predefined_fields['date'] = $_SESSION['glpi_currenttime']; + } + $data = array_merge($data, $predefined_fields); return $data; }