diff options
author | Peter Zhang <peter@innocraft.com> | 2021-12-19 15:39:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-19 15:39:39 +0300 |
commit | 36f83c1468d3ba7bb74a1a755c804f4df21ad78e (patch) | |
tree | 6e2c099110acadf17f34c80027eb67c1c82ec6c1 /plugins/Goals/Controller.php | |
parent | 946c3cd2e4b578485001bb3a2a049de2a2a9fe3d (diff) |
convert sparkline api to one request - fixes archive (#18493)
* update lock
update lock
* update sparkline
update sparkline
* Update getSparklines.twig
update title link
* Update Pages.php
add comments
* update loader
update loader
* update template
update template
* update to visualise
update to visualise
* Update Controller.php
update controller
* revert lock
revert lock
* update matrix
update matrix
* update config title
update config title
* Delete getSparklines.twig
remove template
* Update Pages.php
remove mutilple
* us getMetrics
us getMetrics
* update tests
update tests
* Update plugins/Goals/Controller.php
Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com>
* Update plugins/Goals/Pages.php
Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com>
* built vue files
* Update CoreHome.umd.min.js
update umd js
* update goal remove revenue sparklin
update goal remove revenue sparkline
* remove hide extra columns
remove hide extra columns
* update graphic
update graphic
* update remove goal in the settings
update remove goal in the settings
* Update GoalsPages_overview.png
update screenshot
* Update plugins/Goals/Controller.php
Co-authored-by: Stefan Giehl <stefan@matomo.org>
* Update plugins/Goals/Controller.php
Co-authored-by: Stefan Giehl <stefan@matomo.org>
* remove check actions and remove foreach loop on goals
remove check actions and remove foreach loop on goals
* Update plugins/Goals/Controller.php
Co-authored-by: Stefan Giehl <stefan@matomo.org>
Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com>
Co-authored-by: peterhashair <peterhashair@users.noreply.github.com>
Co-authored-by: sgiehl <stefan@matomo.org>
Diffstat (limited to 'plugins/Goals/Controller.php')
-rw-r--r-- | plugins/Goals/Controller.php | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/plugins/Goals/Controller.php b/plugins/Goals/Controller.php index 02f8ee5c9e..fd7ddc109a 100644 --- a/plugins/Goals/Controller.php +++ b/plugins/Goals/Controller.php @@ -8,6 +8,7 @@ */ namespace Piwik\Plugins\Goals; +use Piwik\API\Proxy; use Piwik\API\Request; use Piwik\Common; use Piwik\DataTable; @@ -16,10 +17,13 @@ use Piwik\DataTable\Filter\AddColumnsProcessedMetricsGoal; use Piwik\FrontController; use Piwik\Piwik; use Piwik\Plugin\Manager; +use Piwik\Plugin\ViewDataTable; +use Piwik\Plugins\CoreVisualizations\Visualizations\Sparklines; use Piwik\Plugins\Live\Live; use Piwik\Plugins\Referrers\API as APIReferrers; use Piwik\Translation\Translator; use Piwik\View; +use Piwik\ViewDataTable\Factory as ViewDataTableFactory; /** * @@ -219,6 +223,29 @@ class Controller extends \Piwik\Plugin\Controller return $this->renderView($view); } + public function getSparklines() + { + $content = ""; + $goals = Request::processRequest('Goals.getGoals', ['idSite' => $this->idSite, 'filter_limit' => '-1'], []); + + foreach ($goals as $goal) { + $params = [ + 'idGoal' => $goal['idgoal'], + 'allow_multiple' => (int) $goal['allow_multiple'], + 'only_summary' => 1, + ]; + + \Piwik\Context::executeWithQueryParameters($params, function() use (&$content) { + //load Visualisations Sparkline + $view = ViewDataTableFactory::build(Sparklines::ID, 'Goals.getMetrics', 'Goals.' . __METHOD__, true); + $view->config->show_title = true; + $content .= $view->render(); + }); + } + + return $content; + } + private function getColumnTranslation($nameToLabel, $columnName, $idGoal) { $columnTranslation = ''; |