From fe68b976e84598eff1f712d562f3cf01624d3978 Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Fri, 25 Nov 2011 17:06:30 +0000 Subject: [PATCH] - bugfix {html_select_date} and {html_slecet_time} did not default to current time if "time" was not specified since r4432 (issue 60) --- change_log.txt | 4 ++++ libs/plugins/function.html_select_date.php | 7 +++++-- libs/plugins/function.html_select_time.php | 7 +++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/change_log.txt b/change_log.txt index 90e5e38f..0714689e 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,8 @@ ===== trunk ===== +25.11.2011 +- bugfix {html_select_date} and {html_slecet_time} did not default to current time if "time" was not specified + since r4432 (issue 60) + 24.11.2011 - bugfix a subtemplate later used as main template did use old variable values diff --git a/libs/plugins/function.html_select_date.php b/libs/plugins/function.html_select_date.php index 18e98047..13c50035 100644 --- a/libs/plugins/function.html_select_date.php +++ b/libs/plugins/function.html_select_date.php @@ -202,8 +202,11 @@ function smarty_function_html_select_date($params, $template) list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d')); } } elseif ($time === null) { - //list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d')); - $_year = $_month = $_day = $time = null; + if (array_key_exists('time', $params)) { + $_year = $_month = $_day = $time = null; + } else { + list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d')); + } } else { list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d', $time)); } diff --git a/libs/plugins/function.html_select_time.php b/libs/plugins/function.html_select_time.php index 65dffc36..9fb8038e 100644 --- a/libs/plugins/function.html_select_time.php +++ b/libs/plugins/function.html_select_time.php @@ -180,8 +180,11 @@ function smarty_function_html_select_time($params, $template) list($_year, $_month, $_day) = $time = explode('-', date('Y-m-d')); } } elseif ($time === null) { - //list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s')); - $_hour = $_minute = $_second = $time = null; + if (array_key_exists('time', $params)) { + $_hour = $_minute = $_second = $time = null; + } else { + list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s')); + } } else { list($_hour, $_minute, $_second) = $time = explode('-', date('H-i-s', $time)); }