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:
authormattab <matthieu.aubry@gmail.com>2013-05-12 10:09:22 +0400
committermattab <matthieu.aubry@gmail.com>2013-05-12 10:09:22 +0400
commitd89a08b8b27ef9a7293e9f8cf351bedbd838e2cb (patch)
tree0aa6a2e2233d8a3b77deefe97fb3e142592003a4 /plugins
parent263892f231da5f6e998342aef02f33aa7edf8622 (diff)
Fixes #3932
* you can now write browserCode==ff;referrerKeyword!= to select all visitors using firefox and that have a keyword set * or you can write referrerKeyword==;browserCode==ff to select all visitors using firefox and that did not have any keyword set Also fixes #3933 Refs #2135 * fixing last bugs with segment selector encoding (working on chrome + FF + opera) - I 'hope' it will work on iE...
Diffstat (limited to 'plugins')
-rw-r--r--plugins/API/API.php2
-rw-r--r--plugins/CoreHome/DataTableRowAction/RowEvolution.php2
-rw-r--r--plugins/CoreHome/templates/broadcast.js5
-rw-r--r--plugins/CoreHome/templates/datatable.js2
-rw-r--r--plugins/CoreHome/templates/datatable_rowactions.js1
-rw-r--r--plugins/CoreHome/templates/menu.js4
-rw-r--r--plugins/CoreHome/templates/menu.tpl2
-rw-r--r--plugins/Live/Controller.php2
-rw-r--r--plugins/SegmentEditor/templates/Segmentation.js7
-rw-r--r--plugins/UserCountryMap/Controller.php6
-rw-r--r--plugins/VisitsSummary/Controller.php2
11 files changed, 17 insertions, 18 deletions
diff --git a/plugins/API/API.php b/plugins/API/API.php
index e9d3511f19..2402b515fd 100644
--- a/plugins/API/API.php
+++ b/plugins/API/API.php
@@ -1659,7 +1659,7 @@ class Piwik_API_API
// Select non empty fields only
// Note: this optimization has only a very minor impact
- $requestLastVisits.= "&segment=$segmentName" . Piwik_SegmentExpression::MATCH_IS_NOT_NULL . "null";
+ $requestLastVisits.= "&segment=$segmentName".urlencode('!=');
// By default Live fetches all actions for all visitors, but we'd rather do this only when required
if($this->doesSegmentNeedActionsData($segmentName)) {
diff --git a/plugins/CoreHome/DataTableRowAction/RowEvolution.php b/plugins/CoreHome/DataTableRowAction/RowEvolution.php
index 5df1ce3e16..ab42ea3452 100644
--- a/plugins/CoreHome/DataTableRowAction/RowEvolution.php
+++ b/plugins/CoreHome/DataTableRowAction/RowEvolution.php
@@ -91,7 +91,7 @@ class Piwik_CoreHome_DataTableRowAction_RowEvolution
list($this->date, $lastN) =
Piwik_ViewDataTable_GenerateGraphHTML_ChartEvolution::getDateRangeAndLastN($this->period, $end);
}
- $this->segment = Piwik_Common::getRequestVar('segment', '', 'string');
+ $this->segment = Piwik_ViewDataTable::getRawSegmentFromRequest();
$this->loadEvolutionReport();
}
diff --git a/plugins/CoreHome/templates/broadcast.js b/plugins/CoreHome/templates/broadcast.js
index 31c3fb6c29..508777c174 100644
--- a/plugins/CoreHome/templates/broadcast.js
+++ b/plugins/CoreHome/templates/broadcast.js
@@ -462,7 +462,10 @@ var broadcast = {
hashStr = url.substring(url.indexOf("#"), url.length);
}
else {
- hashStr = (location.hash);
+ locationSplit = location.href.split('#');
+ if(typeof locationSplit[1] != 'undefined') {
+ hashStr = '#' + locationSplit[1];
+ }
}
return hashStr;
diff --git a/plugins/CoreHome/templates/datatable.js b/plugins/CoreHome/templates/datatable.js
index 1369b11786..a0a9b4afd4 100644
--- a/plugins/CoreHome/templates/datatable.js
+++ b/plugins/CoreHome/templates/datatable.js
@@ -1367,7 +1367,7 @@ dataTable.prototype =
// doing AJAX request
var menuItem = null;
$("#root").find(">ul.nav a").each(function () {
- if ($(this).attr('name') == url) {
+ if ($(this).attr('href') == url) {
menuItem = this;
return false
}
diff --git a/plugins/CoreHome/templates/datatable_rowactions.js b/plugins/CoreHome/templates/datatable_rowactions.js
index afe31cc61b..238c4e7309 100644
--- a/plugins/CoreHome/templates/datatable_rowactions.js
+++ b/plugins/CoreHome/templates/datatable_rowactions.js
@@ -213,6 +213,7 @@ DataTable_RowAction.prototype.getLabelFromTr = function (tr) {
if (!value) {
value = label.text();
}
+ value = value.trim();
return encodeURIComponent(value);
};
diff --git a/plugins/CoreHome/templates/menu.js b/plugins/CoreHome/templates/menu.js
index 3be160b1ca..b2010152be 100644
--- a/plugins/CoreHome/templates/menu.js
+++ b/plugins/CoreHome/templates/menu.js
@@ -29,7 +29,7 @@ menu.prototype =
onItemClick: function (item) {
$('ul.nav').trigger('piwikSwitchPage', item);
- broadcast.propagateAjax($(item).attr('name'));
+ broadcast.propagateAjax( $(item).attr('href').substr(1) );
return false;
},
@@ -45,7 +45,7 @@ menu.prototype =
// for all sub menu we want to have a unique id based on their module and action
// for main menu we want to add just the module as its id.
this.menuNode.find('li').each(function () {
- var url = $(this).find('a').attr('name');
+ var url = $(this).find('a').attr('href').substr(1);
var module = broadcast.getValueFromUrl("module", url);
var action = broadcast.getValueFromUrl("action", url);
var moduleId = broadcast.getValueFromUrl("idGoal", url) || broadcast.getValueFromUrl("idDashboard", url);
diff --git a/plugins/CoreHome/templates/menu.tpl b/plugins/CoreHome/templates/menu.tpl
index e9e2fcd853..476483f745 100644
--- a/plugins/CoreHome/templates/menu.tpl
+++ b/plugins/CoreHome/templates/menu.tpl
@@ -6,7 +6,7 @@
<ul>
{foreach from=$level2 key=name item=urlParameters name=level2}
{if strpos($name, '_') !== 0}
- <li><a name='{$urlParameters._url|@urlRewriteWithParameters}' href='#{$urlParameters._url|@urlRewriteWithParameters|substr:1}'
+ <li><a href='#{$urlParameters._url|@urlRewriteWithParameters|substr:1}'
onclick='return piwikMenu.onItemClick(this);'>{$name|translate|escape:'html'}</a></li>
{/if}
{/foreach}
diff --git a/plugins/Live/Controller.php b/plugins/Live/Controller.php
index 40f2300678..ef703aa743 100644
--- a/plugins/Live/Controller.php
+++ b/plugins/Live/Controller.php
@@ -130,7 +130,7 @@ class Piwik_Live_Controller extends Piwik_Controller
private function setCounters($view)
{
- $segment = Piwik_Common::getRequestVar('segment', false, 'string');
+ $segment = Piwik_ViewDataTable::getRawSegmentFromRequest();
$last30min = Piwik_Live_API::getInstance()->getCounters($this->idSite, $lastMinutes = 30, $segment);
$last30min = $last30min[0];
$today = Piwik_Live_API::getInstance()->getCounters($this->idSite, $lastMinutes = 24 * 60, $segment);
diff --git a/plugins/SegmentEditor/templates/Segmentation.js b/plugins/SegmentEditor/templates/Segmentation.js
index eb8379efe9..0b5ab93147 100644
--- a/plugins/SegmentEditor/templates/Segmentation.js
+++ b/plugins/SegmentEditor/templates/Segmentation.js
@@ -948,12 +948,7 @@ $(document).ready( function(){
var changeSegment = function(segmentDefinition){
$('#segmentEditorPanel a.close').click();
segmentDefinition = cleanupSegmentDefinition(segmentDefinition);
-
-// if($.browser.mozilla ) {
- segmentDefinition = encodeURIComponent(segmentDefinition);
-// }
-// alert('new segment to reload='+segmentDefinition);
-
+ segmentDefinition = encodeURIComponent(segmentDefinition);
return broadcast.propagateNewPage('segment=' + segmentDefinition, true);
};
diff --git a/plugins/UserCountryMap/Controller.php b/plugins/UserCountryMap/Controller.php
index b0ca11de21..5195ec7421 100644
--- a/plugins/UserCountryMap/Controller.php
+++ b/plugins/UserCountryMap/Controller.php
@@ -73,7 +73,7 @@ class Piwik_UserCountryMap_Controller extends Piwik_Controller
'date' => $date,
'token_auth' => $token_auth,
'format' => 'json',
- 'segment' => Piwik_Common::unsanitizeInputValue(Piwik_Common::getRequestVar('segment', '')),
+ 'segment' => Piwik_ViewDataTable::getRawSegmentFromRequest(),
'showRawMetrics' => 1,
'enable_filter_excludelowpop' => 1,
'filter_excludelowpop_value' => -1
@@ -144,7 +144,7 @@ class Piwik_UserCountryMap_Controller extends Piwik_Controller
'date' => self::REAL_TIME_WINDOW,
'token_auth' => $token_auth,
'format' => 'json',
- 'segment' => Piwik_Common::unsanitizeInputValue(Piwik_Common::getRequestVar('segment', '')),
+ 'segment' => Piwik_ViewDataTable::getRawSegmentFromRequest(),
'showRawMetrics' => 1
));
@@ -192,7 +192,7 @@ class Piwik_UserCountryMap_Controller extends Piwik_Controller
. "&period=" . $period
. "&date=" . $date
. "&token_auth=" . $token_auth
- . "&segment=" . Piwik_Common::unsanitizeInputValue(Piwik_Common::getRequestVar('segment', ''))
+ . "&segment=" . Piwik_ViewDataTable::getRawSegmentFromRequest()
. "&enable_filter_excludelowpop=1"
. "&showRawMetrics=1";
diff --git a/plugins/VisitsSummary/Controller.php b/plugins/VisitsSummary/Controller.php
index c93cf11679..fd62d14e38 100644
--- a/plugins/VisitsSummary/Controller.php
+++ b/plugins/VisitsSummary/Controller.php
@@ -129,7 +129,7 @@ class Piwik_VisitsSummary_Controller extends Piwik_Controller
$dataTableVisit = self::getVisitsSummary();
$dataRow = $dataTableVisit->getRowsCount() == 0 ? new Piwik_DataTable_Row() : $dataTableVisit->getFirstRow();
- $dataTableActions = Piwik_Actions_API::getInstance()->get($idSite, Piwik_Common::getRequestVar('period'), Piwik_Common::getRequestVar('date'), Piwik_Common::getRequestVar('segment', false));
+ $dataTableActions = Piwik_Actions_API::getInstance()->get($idSite, Piwik_Common::getRequestVar('period'), Piwik_Common::getRequestVar('date'), Piwik_ViewDataTable::getRawSegmentFromRequest());
$dataActionsRow =
$dataTableActions->getRowsCount() == 0 ? new Piwik_DataTable_Row() : $dataTableActions->getFirstRow();