diff options
author | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-08-11 18:39:01 +0300 |
---|---|---|
committer | Matthieu Napoli <matthieu@mnapoli.fr> | 2015-08-11 18:39:01 +0300 |
commit | 29ef7c2c163cc549506a95d663236df50af1a1bc (patch) | |
tree | e9c08e99cdf4be62275f93057db294e9569e67f1 | |
parent | 85e2e5320d1f180c97f45171ab9727ac3bf5e01d (diff) |
#8288 Display total number of actions across all websites
-rw-r--r-- | lang/en.json | 2 | ||||
-rw-r--r-- | plugins/MultiSites/Dashboard.php | 3 | ||||
-rw-r--r-- | plugins/MultiSites/MultiSites.php | 3 | ||||
-rw-r--r-- | plugins/MultiSites/angularjs/dashboard/dashboard-model.service.js | 4 | ||||
-rw-r--r-- | plugins/MultiSites/angularjs/dashboard/dashboard.directive.html | 6 | ||||
-rw-r--r-- | plugins/MultiSites/angularjs/site/site.directive.html | 5 |
6 files changed, 17 insertions, 6 deletions
diff --git a/lang/en.json b/lang/en.json index 9b442efc23..46bc9744ca 100644 --- a/lang/en.json +++ b/lang/en.json @@ -353,7 +353,7 @@ "Total": "Total", "TotalRatioTooltip": "This is %1$s of all %2$s %3$s.", "TotalRevenue": "Total Revenue", - "TotalVisitsPageviewsRevenue": "(Total: %s visits, %s pageviews, %s revenue)", + "TotalVisitsPageviewsActionsRevenue": "(Total: %s visits, %s pageviews, %s actions, %s revenue)", "TransitionsRowActionTooltip": "See what visitors did before and after viewing this page", "TransitionsRowActionTooltipTitle": "Open Transitions", "TranslatorEmail": "hello@piwik.org", diff --git a/plugins/MultiSites/Dashboard.php b/plugins/MultiSites/Dashboard.php index c757858504..b364482d90 100644 --- a/plugins/MultiSites/Dashboard.php +++ b/plugins/MultiSites/Dashboard.php @@ -44,7 +44,7 @@ class Dashboard { $sites = API::getInstance()->getAll($period, $date, $segment, $_restrictSitesToLogin = false, $enhanced = true, $searchTerm = false, - $showColumns = array('nb_visits', 'nb_pageviews', 'revenue')); + $showColumns = array('nb_visits', 'nb_pageviews', 'nb_actions', 'revenue')); $sites->deleteRow(DataTable::ID_SUMMARY_ROW); /** @var DataTable $pastData */ @@ -101,6 +101,7 @@ class Dashboard return array( 'nb_pageviews' => $this->sitesByGroup->getMetadata('total_nb_pageviews'), 'nb_visits' => $this->sitesByGroup->getMetadata('total_nb_visits'), + 'nb_actions' => $this->sitesByGroup->getMetadata('total_nb_actions'), 'revenue' => $this->sitesByGroup->getMetadata('total_revenue'), 'nb_visits_lastdate' => $this->sitesByGroup->getMetadata('total_nb_visits_lastdate') ? : 0, ); diff --git a/plugins/MultiSites/MultiSites.php b/plugins/MultiSites/MultiSites.php index a030fc02b0..4e0218b726 100644 --- a/plugins/MultiSites/MultiSites.php +++ b/plugins/MultiSites/MultiSites.php @@ -46,8 +46,9 @@ class MultiSites extends \Piwik\Plugin $translations[] = 'General_Website'; $translations[] = 'General_ColumnNbVisits'; $translations[] = 'General_ColumnPageviews'; + $translations[] = 'General_Actions'; $translations[] = 'General_ColumnRevenue'; - $translations[] = 'General_TotalVisitsPageviewsRevenue'; + $translations[] = 'General_TotalVisitsPageviewsActionsRevenue'; $translations[] = 'General_EvolutionSummaryGeneric'; $translations[] = 'General_AllWebsitesDashboard'; $translations[] = 'General_NVisits'; diff --git a/plugins/MultiSites/angularjs/dashboard/dashboard-model.service.js b/plugins/MultiSites/angularjs/dashboard/dashboard-model.service.js index ee0848ef2e..105ac32304 100644 --- a/plugins/MultiSites/angularjs/dashboard/dashboard-model.service.js +++ b/plugins/MultiSites/angularjs/dashboard/dashboard-model.service.js @@ -17,6 +17,7 @@ pageSize : 25, currentPage : 0, totalVisits : '?', + totalPageviews : '?', totalActions : '?', totalRevenue : '?', searchTerm : '', @@ -66,8 +67,9 @@ site.revenue_evolution = parseInt(site.revenue_evolution, 10); }); - model.totalActions = report.totals.nb_pageviews; model.totalVisits = report.totals.nb_visits; + model.totalPageviews = report.totals.nb_pageviews; + model.totalActions = report.totals.nb_actions; model.totalRevenue = report.totals.revenue; model.lastVisits = report.totals.nb_visits_lastdate; model.sites = allSites; diff --git a/plugins/MultiSites/angularjs/dashboard/dashboard.directive.html b/plugins/MultiSites/angularjs/dashboard/dashboard.directive.html index dccbbb913c..c8d8f810d7 100644 --- a/plugins/MultiSites/angularjs/dashboard/dashboard.directive.html +++ b/plugins/MultiSites/angularjs/dashboard/dashboard.directive.html @@ -5,7 +5,7 @@ {{ 'General_AllWebsitesDashboard'|translate }} <span class='smallTitle' title="{{ 'General_EvolutionSummaryGeneric'|translate:('General_NVisits'|translate:model.totalVisits):date:model.lastVisits:model.lastVisitsDate:(model.totalVisits|evolution:model.lastVisits)}}" - ng-bind-html="'General_TotalVisitsPageviewsRevenue' | translate:('<strong>'+model.totalVisits+'</strong>'):('<strong>'+model.totalActions+'</strong>'):('<strong>' + model.totalRevenue + '</strong>')"> + ng-bind-html="'General_TotalVisitsPageviewsActionsRevenue' | translate:('<strong>'+model.totalVisits+'</strong>'):('<strong>'+model.totalPageviews+'</strong>'):('<strong>'+model.totalActions+'</strong>'):('<strong>' + model.totalRevenue + '</strong>')"> </span> </h2> @@ -24,6 +24,10 @@ <span ng-class="{multisites_asc: !model.reverse && 'nb_pageviews' == model.sortColumn, multisites_desc: model.reverse && 'nb_pageviews' == model.sortColumn}" class="arrow"></span> <span class="heading">{{ 'General_ColumnPageviews'|translate }}</span> </th> + <th id="actions" class="multisites-column" ng-click="model.sortBy('nb_actions')" ng-class="{columnSorted: 'nb_actions' == model.sortColumn}"> + <span ng-class="{multisites_asc: !model.reverse && 'nb_actions' == model.sortColumn, multisites_desc: model.reverse && 'nb_actions' == model.sortColumn}" class="arrow"></span> + <span class="heading">{{ 'General_Actions'|translate }}</span> + </th> <th ng-if="displayRevenueColumn" id="revenue" class="multisites-column" ng-click="model.sortBy('revenue')" ng-class="{columnSorted: 'revenue' == model.sortColumn}"> <span ng-class="{multisites_asc: !model.reverse && 'revenue' == model.sortColumn, multisites_desc: model.reverse && 'revenue' == model.sortColumn}" class="arrow"></span> diff --git a/plugins/MultiSites/angularjs/site/site.directive.html b/plugins/MultiSites/angularjs/site/site.directive.html index b415df3d3c..57aafd6869 100644 --- a/plugins/MultiSites/angularjs/site/site.directive.html +++ b/plugins/MultiSites/angularjs/site/site.directive.html @@ -16,6 +16,9 @@ <td class="multisites-column"> {{ website.nb_pageviews }} </td> + <td class="multisites-column"> + {{ website.nb_actions }} + </td> <td ng-if="displayRevenueColumn" class="multisites-column"> {{ website.revenue }} </td> @@ -36,4 +39,4 @@ </a> </div> </td> -</tr>
\ No newline at end of file +</tr> |