diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-03-25 11:35:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-25 11:35:55 +0300 |
commit | c199cced6d1dff81a3012b754e7470fbf1a9e6ae (patch) | |
tree | 517570cb7f8c4b1c282acd0a407616ca8f903c6b /plugins/PrivacyManager | |
parent | dc45e00e44ba2ef1dcb9628ee706b871fc242d0f (diff) |
Show accurately the configured retention length (#15712)
* fix #15709 show accurately the configured retention length
* updates expected UIfiles
Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'plugins/PrivacyManager')
-rw-r--r-- | plugins/PrivacyManager/Controller.php | 16 | ||||
-rw-r--r-- | plugins/PrivacyManager/tests/UI/expected-screenshots/PrivacyManager_gdpr_overview.png | 4 |
2 files changed, 13 insertions, 7 deletions
diff --git a/plugins/PrivacyManager/Controller.php b/plugins/PrivacyManager/Controller.php index ec0af38070..4c5fa81047 100644 --- a/plugins/PrivacyManager/Controller.php +++ b/plugins/PrivacyManager/Controller.php @@ -91,12 +91,18 @@ class Controller extends \Piwik\Plugin\ControllerAdmin $rawDataRetention = ''; - if ($purgeDataSettings['delete_logs_older_than'] > 30) { - $months = floor($purgeDataSettings['delete_logs_older_than']/30); + if ($purgeDataSettings['delete_logs_older_than'] > 90) { + // only show months when it is more than 90 days... + $months = floor($purgeDataSettings['delete_logs_older_than']/30.4); + $daysLeft = round($purgeDataSettings['delete_logs_older_than'] - ($months * 30.4)); $rawDataRetention .= $months . ' ' . Piwik::translate($months > 1 ? 'Intl_PeriodMonths' : 'Intl_PeriodMonth') . ' '; - } - if ($purgeDataSettings['delete_logs_older_than'] % 30 > 0) { - $days = floor($purgeDataSettings['delete_logs_older_than']%30); + + if ($daysLeft > 0) { + $rawDataRetention .= $daysLeft . ' ' . Piwik::translate($daysLeft > 1 ? 'Intl_PeriodDays' : 'Intl_PeriodDay'); + } + + } elseif ($purgeDataSettings['delete_logs_older_than'] > 0) { + $days = $purgeDataSettings['delete_logs_older_than']; $rawDataRetention .= $days . ' ' . Piwik::translate($days > 1 ? 'Intl_PeriodDays' : 'Intl_PeriodDay'); } diff --git a/plugins/PrivacyManager/tests/UI/expected-screenshots/PrivacyManager_gdpr_overview.png b/plugins/PrivacyManager/tests/UI/expected-screenshots/PrivacyManager_gdpr_overview.png index e7ca8b21f1..665f9a2a30 100644 --- a/plugins/PrivacyManager/tests/UI/expected-screenshots/PrivacyManager_gdpr_overview.png +++ b/plugins/PrivacyManager/tests/UI/expected-screenshots/PrivacyManager_gdpr_overview.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:418badecf2d2dae40299140d7ffdda25695e752f5480247fca2fa3c6dbab932b -size 245277 +oid sha256:558ad6509110cfb86785a2daef871cd22693a9cd722ed116bf74b48b8eaf2d88 +size 245204 |