-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add timezone when sending date #8
Conversation
src/Host.php
Outdated
@@ -216,7 +216,7 @@ public function sendCheck(int $id) | |||
try { | |||
$res = $api->sendCheckToAnHost($id); | |||
$sentcheckok = __('Check sent', 'centreon'); | |||
return $sentcheckok; | |||
return '$sentcheckok'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will return '$sentcheckok'
verbatim
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about your comment @trasher
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any string between single quotes will be used as is; you will never have $sentcheck
variable value, but verabtim $sentcheck
string:
% php -r "var_dump('$sentcheckok');"
string(12) "$sentcheckok"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I was not awake sufficiently, You're completely right (I read this as you was the one to suggest to add single quotes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, I didn't see I added quotes !
I will correct it on next commit
templates/host.html.twig
Outdated
$('.toggle').toggleClass('d-none'); | ||
$.post(CFG_GLPI['root_doc'] + "/" + GLPI_PLUGINS_PATH.centreon + "/ajax/sendCheck.php?hostid=" + {{ hostid }}, function(response){ | ||
console.log(response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more globally, if you want to keep your js log, make them appears only when on debug mode
src/Host.php
Outdated
@@ -216,7 +216,7 @@ public function sendCheck(int $id) | |||
try { | |||
$res = $api->sendCheckToAnHost($id); | |||
$sentcheckok = __('Check sent', 'centreon'); | |||
return $sentcheckok; | |||
return '$sentcheckok'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about your comment @trasher
templates/host.html.twig
Outdated
$('.toggle').toggleClass('d-none'); | ||
$.post(CFG_GLPI['root_doc'] + "/" + GLPI_PLUGINS_PATH.centreon + "/ajax/sendCheck.php?hostid=" + {{ hostid }}, function(response){ | ||
console.log(response); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more globally, if you want to keep your js log, make them appears only when on debug mode
Co-authored-by: Alexandre Delaunay <[email protected]>
Co-authored-by: Alexandre Delaunay <[email protected]>
Add timezone when sending date
Maybe need to get the server timezone to be sure to set the POST requests dates to the same format.