Skip to content
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

Merged
merged 5 commits into from
Feb 2, 2024
Merged

Add timezone when sending date #8

merged 5 commits into from
Feb 2, 2024

Conversation

Mary-Clb
Copy link
Collaborator

@Mary-Clb Mary-Clb commented Dec 19, 2023

Maybe need to get the server timezone to be sure to set the POST requests dates to the same format.

@cedric-anne cedric-anne requested a review from orthagh December 19, 2023 11:45
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';
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

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"

Copy link
Contributor

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)

Copy link
Collaborator Author

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

$('.toggle').toggleClass('d-none');
$.post(CFG_GLPI['root_doc'] + "/" + GLPI_PLUGINS_PATH.centreon + "/ajax/sendCheck.php?hostid=" + {{ hostid }}, function(response){
console.log(response);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
console.log(response);

Copy link
Contributor

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 Show resolved Hide resolved
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';
Copy link
Contributor

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

src/ApiClient.php Outdated Show resolved Hide resolved
$('.toggle').toggleClass('d-none');
$.post(CFG_GLPI['root_doc'] + "/" + GLPI_PLUGINS_PATH.centreon + "/ajax/sendCheck.php?hostid=" + {{ hostid }}, function(response){
console.log(response);
Copy link
Contributor

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 Show resolved Hide resolved
src/Host.php Outdated Show resolved Hide resolved
Mary-Clb and others added 2 commits December 22, 2023 09:55
Co-authored-by: Alexandre Delaunay <[email protected]>
Co-authored-by: Alexandre Delaunay <[email protected]>
src/Host.php Outdated Show resolved Hide resolved
@cedric-anne cedric-anne requested a review from orthagh February 1, 2024 16:03
@Mary-Clb Mary-Clb merged this pull request into main Feb 2, 2024
10 checks passed
@cedric-anne cedric-anne deleted the bugfix/downtime branch February 5, 2024 07:30
cedric-anne pushed a commit that referenced this pull request Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants