Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Mon 3834 display datetime in csv export #7533

Merged
merged 13 commits into from
May 16, 2019

Conversation

sc979
Copy link
Contributor

@sc979 sc979 commented May 13, 2019

Pull Request Template

Description

Correct the date in the exported csv files :
1 - Convert the timestamps to formatted dates/times for each occurences.
2 - Homogenize the formatted start and end date.
3 - improve string sent from request security
4 - setting a default start date if the user didn't chose a period, nor a start date (to avoid to display/export logs since 1/1/1970 -> timestamp = 0 )

Fixes # (support)

Type of change

  • Patch fixing an issue (non-breaking change)

Target serie

  • 18.10.x
  • 19.04.x (master)

How this pull request can be tested ?

Please describe the procedure to verify that the goal of the PR is matched. Provide clear instructions so that it can be correctly tested.

1 - Go to Monitoring -> event logs, choose a resource -> export the csv -> then check the csv output
2 - Go to Monitoring -> event logs, choose a resource and a start date -> export the csv -> then check the csv output
3 - Go to Monitoring -> event logs, choose a resource and a period -> export the csv -> then check the csv output

do the same for Monitoring -> system logs

Checklist

Community contributors & Centreon team
  • I followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  •   I have rebased my development branch on the base branch (master, maintenance).
  • I have made sure that acceptance tests related to the story are successful (local and CI)

Copy link
Contributor

@kduret kduret left a comment

Choose a reason for hiding this comment

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

It should be better to use ISO-8601 date format :
php function ==> date('c', $timestamp)

Copy link
Contributor

@kduret kduret left a comment

Choose a reason for hiding this comment

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

but not sure this could be apply everywhere cause sometimes date and time are in separated columns

@sc979
Copy link
Contributor Author

sc979 commented May 13, 2019

indeed, they are (in the foreach)

www/include/eventLogs/export/data.php Outdated Show resolved Hide resolved
www/include/eventLogs/export/data.php Outdated Show resolved Hide resolved
www/include/eventLogs/export/data.php Outdated Show resolved Hide resolved
www/include/eventLogs/export/data.php Outdated Show resolved Hide resolved
www/include/eventLogs/export/data.php Outdated Show resolved Hide resolved
www/include/eventLogs/export/data.php Outdated Show resolved Hide resolved
sc979 and others added 6 commits May 14, 2019 11:15
Co-Authored-By: loiclau <loic.lau@gmail.com>
Co-Authored-By: loiclau <loic.lau@gmail.com>
Co-Authored-By: loiclau <loic.lau@gmail.com>
Co-Authored-By: loiclau <loic.lau@gmail.com>
Co-Authored-By: loiclau <loic.lau@gmail.com>
Co-Authored-By: loiclau <loic.lau@gmail.com>
@sc979 sc979 merged commit 11a5c1f into master May 16, 2019
@sc979 sc979 deleted the MON-3834-display-datetime-in-csv-export branch May 16, 2019 14:54
sc979 added a commit that referenced this pull request May 16, 2019
* enh(BE): securise id from request
* style and PSR2
* enh(csv): homogenize exported date values' format
* enh(BE): filter sanitize strings from REQUEST
* fix(BE): setting a start date if the user didn't
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants