From d298e16afc3a34be8d9215c1d91a64c82ec42aad Mon Sep 17 00:00:00 2001 From: SinergiaCRM Date: Mon, 26 Feb 2024 08:46:31 +0000 Subject: [PATCH] # This is a combination of 9 commits. # This is the 1st commit message: Fix #10364 - Adding now option in Datetime fields # This is the commit message #2: Fix #10364 - Adding now option in Datetime fields # This is the commit message #3: Fix #10364 - Adding now option in Datetime fields # This is the commit message #4: Fix #10364 - Adding now option in Datetime fields # This is the commit message #5: Fix #10364 - Adding now option in Datetime fields # This is the commit message #6: Fix #10364 - Adding now option in Datetime fields # This is the commit message #7: Fix #10364 - Adding now option in Datetime fields # This is the commit message #8: Fix #10364 - Adding now option in Datetime fields # This is the commit message #9: Fix #10364 - Adding now option in Datetime fields --- include/MassUpdate.php | 6 +-- .../Fields/Datetimecombo/EditView.tpl | 2 +- include/utils.php | 6 ++- .../Fields/Datetimecombo/Datetimecombo.js | 48 +++++-------------- .../templates/Fields/Forms/datetimecombo.php | 2 + .../templates/Fields/Forms/datetimecombo.tpl | 24 ++++++++++ .../Fields/TemplateDatetimecombo.php | 5 +- 7 files changed, 52 insertions(+), 41 deletions(-) diff --git a/include/MassUpdate.php b/include/MassUpdate.php index b5a6bd5fac8..829d8a5d964 100755 --- a/include/MassUpdate.php +++ b/include/MassUpdate.php @@ -601,7 +601,7 @@ public function getMassUpdateForm( break; case "datetimecombo": $even = !$even; - $newhtml .= $this->addDatetime($displayname, $field["name"]); + $newhtml .= $this->addDatetime($displayname, $field["name"],$field["display_default"]); break; case "datetime": case "date": @@ -1296,7 +1296,7 @@ public function addRadioenum($displayname, $varname, $options) * @param displayname Name to display in the popup window * @param varname name of the variable */ - public function addDatetime($displayname, $varname) + public function addDatetime($displayname, $varname, $fieldtimeformat) { global $timedate, $app_strings, $app_list_strings, $theme, $current_user; $userformat = $timedate->get_user_time_format(); @@ -1318,7 +1318,7 @@ public function addDatetime($displayname, $varname) $dtscript {include file="modules/DynamicFields/templates/Fields/Forms/coreBottom.tpl"} \ No newline at end of file diff --git a/modules/DynamicFields/templates/Fields/TemplateDatetimecombo.php b/modules/DynamicFields/templates/Fields/TemplateDatetimecombo.php index ebfed23b0c5..1a73459f467 100755 --- a/modules/DynamicFields/templates/Fields/TemplateDatetimecombo.php +++ b/modules/DynamicFields/templates/Fields/TemplateDatetimecombo.php @@ -51,7 +51,8 @@ class TemplateDatetimecombo extends TemplateRange public $len = ''; public $dateStrings = array( '-none-' => '', - 'today'=>'now', + 'now' => 'now', + 'today'=> 'today', 'yesterday'=> '-1 day', 'tomorrow'=>'+1 day', 'next week'=> '+1 week', @@ -167,6 +168,8 @@ public function populateFromPost() //lets format the string to make sure the leading 0's are added back in for hours and minutes $_REQUEST['default'] = $_REQUEST['defaultDate'] . '&' . sprintf('%02d:%02d%s', $hours, $minutes, $meridiem); } + } elseif ($_REQUEST['defaultDate'] == 'now') { + $_REQUEST['default'] = 'now'; } else { $_REQUEST['default'] = ''; }