diff --git a/core/ScheduledTime.php b/core/ScheduledTime.php index 0edcd839fd0..0328a3cbe7d 100644 --- a/core/ScheduledTime.php +++ b/core/ScheduledTime.php @@ -23,6 +23,7 @@ abstract class Piwik_ScheduledTime const PERIOD_DAY = 'day'; const PERIOD_WEEK = 'week'; const PERIOD_MONTH = 'month'; + const PERIOD_YEAR = 'year'; /** * @link http://php.net/manual/en/function.date.php, format string : 'G' diff --git a/lang/en.php b/lang/en.php index 79ef8aa44a6..eeb4290cfcc 100644 --- a/lang/en.php +++ b/lang/en.php @@ -268,6 +268,10 @@ 'General_Daily' => 'Daily', 'General_Weekly' => 'Weekly', 'General_Monthly' => 'Monthly', + 'General_DailyReport' => 'daily', + 'General_WeeklyReport' => 'weekly', + 'General_MonthlyReport' => 'monthly', + 'General_YearlyReport' => 'yearly', 'General_DailyReports' => 'Daily reports', 'General_WeeklyReports' => 'Weekly reports', 'General_MonthlyReports' => 'Monthly reports', diff --git a/plugins/PDFReports/PDFReports.php b/plugins/PDFReports/PDFReports.php index 1533a70192d..a6f0b1d572d 100644 --- a/plugins/PDFReports/PDFReports.php +++ b/plugins/PDFReports/PDFReports.php @@ -310,7 +310,7 @@ function sendReport($notification) $filename = $notificationInfo[Piwik_PDFReports_API::FILENAME_KEY]; $additionalFiles = $notificationInfo[Piwik_PDFReports_API::ADDITIONAL_FILES_KEY]; - $periods = self::getPeriodToFrequency(); + $periods = self::getPeriodToFrequencyAsAdjective(); $message = Piwik_Translate('PDFReports_EmailHello'); $subject = Piwik_Translate('General_Report') . ' ' . $reportTitle . " - " . $prettyDate; @@ -606,6 +606,7 @@ private static function getDisplayFormats() } /** + * Used in the Report Listing * @ignore */ static public function getPeriodToFrequency() @@ -617,4 +618,18 @@ static public function getPeriodToFrequency() Piwik_ScheduledTime::PERIOD_MONTH => Piwik_Translate('General_Monthly'), ); } + + /** + * Used in the Report's email content, ie "monthly report" + * @ignore + */ + static public function getPeriodToFrequencyAsAdjective() + { + return array( + Piwik_ScheduledTime::PERIOD_DAY => Piwik_Translate('General_DailyReport'), + Piwik_ScheduledTime::PERIOD_WEEK => Piwik_Translate('General_WeeklyReport'), + Piwik_ScheduledTime::PERIOD_MONTH => Piwik_Translate('General_MonthlyReport'), + Piwik_ScheduledTime::PERIOD_YEAR => Piwik_Translate('General_YearlyReport'), + ); + } } diff --git a/tests/PHPUnit/Integration/expected/test_OneVisitor_SeveralDays_ImportedInRandomOrderTest_shouldShowOneVisit_InEachOfThreeDays__Live.getLastVisitsDetails_month.xml b/tests/PHPUnit/Integration/expected/test_OneVisitor_SeveralDays_ImportedInRandomOrderTest_shouldShowOneVisit_InEachOfThreeDays__Live.getLastVisitsDetails_month.xml new file mode 100644 index 00000000000..939668cdcc2 --- /dev/null +++ b/tests/PHPUnit/Integration/expected/test_OneVisitor_SeveralDays_ImportedInRandomOrderTest_shouldShowOneVisit_InEachOfThreeDays__Live.getLastVisitsDetails_month.xml @@ -0,0 +1,252 @@ + + + + 1 + 1 + 74.125.31.147 + new + + 0 + + none + + 0 + 1 + + + action + http://piwik.net/ + + 1 + 1 + Sun 7 Apr 10:00:00 + + + + + + 0 + USD + $ + 2013-04-07 + 10:00:00 + 10 + 10 + 1365328800 + 1365328800 + 2013-04-07 10:00:00 + 0 + 0s + 1 + 0 + 0 + 0 + Unknown + unk + Unknown + xx + plugins/UserCountry/flags/xx.png + + + + Unknown + + + Unknown + http://piwik.org/faq/general/#faq_52 + direct + Direct Entry + + + + + + + Windows Vista + WVI + Win Vista + plugins/UserSettings/images/os/WVI.gif + ie + Trident (IE) + Internet Explorer 7.0 + plugins/UserSettings/images/browsers/IE.gif + IE + 7.0 + unknown + unknown + plugins/UserSettings/images/screens/unknown.gif + + + 1365328800 + 10:00:00 + Sun 7 Apr + Sun 7 Apr + 10:00:00 + + + 1 + 2 + 74.125.31.147 + new + + 0 + + none + + 0 + 1 + + + action + http://piwik.net/ + + 1 + 2 + Sat 6 Apr 11:00:00 + + + + + + 0 + USD + $ + 2013-04-06 + 11:00:00 + 11 + 11 + 1365246000 + 1365246000 + 2013-04-06 11:00:00 + 0 + 0s + 1 + 0 + 0 + 0 + Unknown + unk + Unknown + xx + plugins/UserCountry/flags/xx.png + + + + Unknown + + + Unknown + http://piwik.org/faq/general/#faq_52 + direct + Direct Entry + + + + + + + Windows Vista + WVI + Win Vista + plugins/UserSettings/images/os/WVI.gif + ie + Trident (IE) + Internet Explorer 7.0 + plugins/UserSettings/images/browsers/IE.gif + IE + 7.0 + unknown + unknown + plugins/UserSettings/images/screens/unknown.gif + + + 1365246000 + 11:00:00 + Sat 6 Apr + Sat 6 Apr + 11:00:00 + + + 1 + 3 + 74.125.31.147 + new + + 0 + + none + + 0 + 1 + + + action + http://piwik.net/ + + 1 + 3 + Fri 5 Apr 12:00:00 + + + + + + 0 + USD + $ + 2013-04-05 + 12:00:00 + 12 + 12 + 1365163200 + 1365163200 + 2013-04-05 12:00:00 + 0 + 0s + 1 + 0 + 0 + 0 + Unknown + unk + Unknown + xx + plugins/UserCountry/flags/xx.png + + + + Unknown + + + Unknown + http://piwik.org/faq/general/#faq_52 + direct + Direct Entry + + + + + + + Windows Vista + WVI + Win Vista + plugins/UserSettings/images/os/WVI.gif + ie + Trident (IE) + Internet Explorer 7.0 + plugins/UserSettings/images/browsers/IE.gif + IE + 7.0 + unknown + unknown + plugins/UserSettings/images/screens/unknown.gif + + + 1365163200 + 12:00:00 + Fri 5 Apr + Fri 5 Apr + 12:00:00 + + \ No newline at end of file diff --git a/themes/default/common.css b/themes/default/common.css index c32f4d8a567..6b9a99dd12f 100644 --- a/themes/default/common.css +++ b/themes/default/common.css @@ -105,7 +105,7 @@ a { } #periodString { - display:block; + display:block; color:#444; font-size:14px; border: 1px solid #e4e5e4; @@ -117,7 +117,7 @@ a { margin-right:12px; z-index:999; position:absolute; - background: url("images/icon-calendar.gif") no-repeat scroll right 9px center #F7F7F7; + background: url("images/icon-calendar.gif") no-repeat scroll right 9px top 7px #F7F7F7; } #periodString:hover { background-color:#f1f0eb;