Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/CoreConsole/Commands/GenerateReport.php')
-rw-r--r--plugins/CoreConsole/Commands/GenerateReport.php24
1 files changed, 16 insertions, 8 deletions
diff --git a/plugins/CoreConsole/Commands/GenerateReport.php b/plugins/CoreConsole/Commands/GenerateReport.php
index 9eb7313400..3f9fda4939 100644
--- a/plugins/CoreConsole/Commands/GenerateReport.php
+++ b/plugins/CoreConsole/Commands/GenerateReport.php
@@ -10,8 +10,10 @@
namespace Piwik\Plugins\CoreConsole\Commands;
use Piwik\Columns\Dimension;
+use Piwik\Piwik;
use Piwik\Plugin\Manager;
use Piwik\Plugin\Report;
+use Piwik\Plugin\Reports;
use Piwik\Translate;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -67,8 +69,8 @@ class GenerateReport extends GeneratePluginBase
$this->copyTemplateToPlugin($exampleFolder, $pluginName, $replace, $whitelistFiles);
$this->writeSuccessMessage($output, array(
- sprintf('Reports/%s.php for %s generated.', ucfirst($apiName), $pluginName),
- 'You should now implement the method called "' . lcfirst($apiName) . '" in API.php',
+ sprintf('plugins/%s/Reports/%s.php for %s generated.', $pluginName, ucfirst($apiName)),
+ 'You should now implement the method called <comment>"' . lcfirst($apiName) . '()"</comment> in API.php',
// 'Read more about this here: link to developer guide',
'Enjoy!'
));
@@ -78,8 +80,10 @@ class GenerateReport extends GeneratePluginBase
{
$order = 1;
- foreach (Report::getAllReports() as $report) {
- if ($report->getCategory() === $category) {
+ $reports = new Reports();
+
+ foreach ($reports->getAllReports() as $report) {
+ if ($report->getCategoryId() === $category) {
if ($report->getOrder() > $order) {
$order = $report->getOrder() + 1;
}
@@ -189,10 +193,12 @@ class GenerateReport extends GeneratePluginBase
$category = $input->getOption('category');
+ $reports = new Reports();
+
$categories = array();
- foreach (Report::getAllReports() as $report) {
- if ($report->getCategory()) {
- $categories[] = $report->getCategory();
+ foreach ($reports->getAllReports() as $report) {
+ if ($report->getCategoryId()) {
+ $categories[] = Piwik::translate($report->getCategoryId());
}
}
$categories = array_values(array_unique($categories));
@@ -226,7 +232,9 @@ class GenerateReport extends GeneratePluginBase
$dimensions = array();
$dimensionNames = array();
- foreach (Report::getAllReports() as $report) {
+ $reports = new Reports();
+
+ foreach ($reports->getAllReports() as $report) {
$dimension = $report->getDimension();
if (is_object($dimension)) {
$name = $dimension->getName();