From 703d120f4dfb42da4949cbff90a0e4ffd44c09c2 Mon Sep 17 00:00:00 2001 From: mattpiwik <matthieu.aubry@gmail.com> Date: Tue, 29 May 2012 03:24:52 +0000 Subject: [PATCH] Forward segment + Fix notice + Widgets don't store segment in layout git-svn-id: http://dev.piwik.org/svn/trunk@6360 59fd770c-687e-43c8-a1e3-f5a4ff64c105 --- plugins/CoreHome/DataTableRowAction/RowEvolution.php | 2 +- plugins/CoreHome/templates/datatable.tpl | 2 +- plugins/CoreHome/templates/datatable_rowactions.js | 3 ++- plugins/CoreHome/templates/popover_rowevolution.tpl | 4 ++-- plugins/Dashboard/templates/dashboardObject.js | 8 ++++++-- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/plugins/CoreHome/DataTableRowAction/RowEvolution.php b/plugins/CoreHome/DataTableRowAction/RowEvolution.php index 05a8e9f04f..0a2605acf1 100644 --- a/plugins/CoreHome/DataTableRowAction/RowEvolution.php +++ b/plugins/CoreHome/DataTableRowAction/RowEvolution.php @@ -167,7 +167,7 @@ class Piwik_CoreHome_DataTableRowAction_RowEvolution protected function extractEvolutionReport($report) { $this->dataTable = $report['reportData']; - $this->rowLabel = $report['label']; + $this->rowLabel = Piwik_Common::sanitizeInputValue($report['label']); $this->rowIcon = $report['logo']; $this->availableMetrics = $report['metadata']['metrics']; $this->dimension = $report['metadata']['dimension']; diff --git a/plugins/CoreHome/templates/datatable.tpl b/plugins/CoreHome/templates/datatable.tpl index b8c8711bfd..b067446216 100644 --- a/plugins/CoreHome/templates/datatable.tpl +++ b/plugins/CoreHome/templates/datatable.tpl @@ -8,7 +8,7 @@ {$arrayDataTable.message} {else} {if count($arrayDataTable) == 0} - {if $showReportDataWasPurgedMessage} + {if isset($showReportDataWasPurgedMessage) && $showReportDataWasPurgedMessage} <div class="pk-emptyDataTable">{'CoreHome_DataForThisReportHasBeenPurged'|translate:$deleteReportsOlderThan}</div> {else} <div class="pk-emptyDataTable">{'CoreHome_ThereIsNoDataForThisReport'|translate}</div> diff --git a/plugins/CoreHome/templates/datatable_rowactions.js b/plugins/CoreHome/templates/datatable_rowactions.js index 4929838659..240c88f5e2 100644 --- a/plugins/CoreHome/templates/datatable_rowactions.js +++ b/plugins/CoreHome/templates/datatable_rowactions.js @@ -230,7 +230,8 @@ DataTable_RowActions_RowEvolution.prototype.showRowEvolution = function(tr, labe date: request.data.date, idSite: request.data.idSite, period: request.data.period, - label: requestLabel + label: requestLabel, + segment: request.data.segment }; if (metric) { diff --git a/plugins/CoreHome/templates/popover_rowevolution.tpl b/plugins/CoreHome/templates/popover_rowevolution.tpl index 9182e855a9..c3f6599ca4 100644 --- a/plugins/CoreHome/templates/popover_rowevolution.tpl +++ b/plugins/CoreHome/templates/popover_rowevolution.tpl @@ -1,10 +1,10 @@ <div class="rowevolution"> - <div class="popover-title">{$popoverTitle|escape}</div> + <div class="popover-title">{$popoverTitle}</div> <div class="graph"> {$graph} </div> <div class="metrics-container"> - <h2>{$availableMetricsText|escape}</h2> + <h2>{$availableMetricsText}</h2> <div class="rowevolution-documentation"> {'RowEvolution_Documentation'|translate} </div> diff --git a/plugins/Dashboard/templates/dashboardObject.js b/plugins/Dashboard/templates/dashboardObject.js index d890885a17..370cbc531b 100644 --- a/plugins/Dashboard/templates/dashboardObject.js +++ b/plugins/Dashboard/templates/dashboardObject.js @@ -86,12 +86,12 @@ */ loadDashboard: function(dashboardIdToLoad) { + fetchLayout(generateLayout); $(dashboardElement).empty(); dashboardName = ''; dashboardLayout = null; dashboardId = dashboardIdToLoad; piwikHelper.showAjaxLoading(); - fetchLayout(generateLayout); buildMenu(); return this; }, @@ -444,7 +444,7 @@ }, error: piwikHelper.ajaxHandleError }; - $.ajax(ajaxRequest); + piwikHelper.queueAjaxRequest( $.ajax(ajaxRequest) ); } /** @@ -461,6 +461,10 @@ var items = $('[widgetId]', this); for (var j=0; j<items.size(); j++) { columns[columnNumber][j] = $(items[j]).dashboardWidget('getWidgetObject'); + + // Do not store segment in the dashboard layout + delete columns[columnNumber][j].parameters.segment; + } columnNumber++; }); -- GitLab