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:
authorThomas Steur <thomas.steur@gmail.com>2015-11-19 07:12:24 +0300
committerThomas Steur <thomas.steur@gmail.com>2015-11-19 07:14:32 +0300
commitada836d750a74ddfda03b48baf2fa1c1173e39ff (patch)
treec479878e9b79d8883e03d8c302463e4a9a791297 /plugins/SegmentEditor
parent0bbf8eb60be3e205d7c230e430ebd7765ef38526 (diff)
make new operators available in the UI, moved check to segment data class
Diffstat (limited to 'plugins/SegmentEditor')
-rw-r--r--plugins/SegmentEditor/SegmentSelectorControl.php2
-rw-r--r--plugins/SegmentEditor/javascripts/Segmentation.js4
-rw-r--r--plugins/SegmentEditor/templates/_segmentSelector.twig2
3 files changed, 7 insertions, 1 deletions
diff --git a/plugins/SegmentEditor/SegmentSelectorControl.php b/plugins/SegmentEditor/SegmentSelectorControl.php
index e37354e1cd..9dc2659660 100644
--- a/plugins/SegmentEditor/SegmentSelectorControl.php
+++ b/plugins/SegmentEditor/SegmentSelectorControl.php
@@ -115,6 +115,8 @@ class SegmentSelectorControl extends UIControl
'General_OperationGreaterThan',
'General_OperationContains',
'General_OperationDoesNotContain',
+ 'General_OperationStartsWith',
+ 'General_OperationEndsWith',
'General_OperationIs',
'General_OperationIsNot',
'General_OperationContains',
diff --git a/plugins/SegmentEditor/javascripts/Segmentation.js b/plugins/SegmentEditor/javascripts/Segmentation.js
index 0e47bd7d19..ec1e8f23b8 100644
--- a/plugins/SegmentEditor/javascripts/Segmentation.js
+++ b/plugins/SegmentEditor/javascripts/Segmentation.js
@@ -49,6 +49,8 @@ Segmentation = (function($) {
self.availableMatches["dimension"]["!="] = self.translations['General_OperationIsNot'];
self.availableMatches["dimension"]["=@"] = self.translations['General_OperationContains'];
self.availableMatches["dimension"]["!@"] = self.translations['General_OperationDoesNotContain'];
+ self.availableMatches["dimension"]["=^"] = self.translations['General_OperationStartsWith'];
+ self.availableMatches["dimension"]["=$"] = self.translations['General_OperationEndsWith'];
segmentation.prototype.setAvailableSegments = function (segments) {
this.availableSegments = segments;
@@ -264,7 +266,7 @@ Segmentation = (function($) {
};
var findAndExplodeByMatch = function(metric){
- var matches = ["==" , "!=" , "<=", ">=", "=@" , "!@","<",">"];
+ var matches = ["==" , "!=" , "<=", ">=", "=@" , "!@","<",">", "=^", "=$"];
var newMetric = {};
var minPos = metric.length;
var match, index;
diff --git a/plugins/SegmentEditor/templates/_segmentSelector.twig b/plugins/SegmentEditor/templates/_segmentSelector.twig
index 1ffb4b3d47..f2d53b60c7 100644
--- a/plugins/SegmentEditor/templates/_segmentSelector.twig
+++ b/plugins/SegmentEditor/templates/_segmentSelector.twig
@@ -61,6 +61,8 @@
<option value=">">{{ 'General_OperationGreaterThan'|translate }}</option>
<option value="=@">{{ 'General_OperationContains'|translate }}</option>
<option value="!@">{{ 'General_OperationDoesNotContain'|translate }}</option>
+ <option value="=^">{{ 'General_OperationStartsWith'|translate }}</option>
+ <option value="=$">{{ 'General_OperationEndsWith'|translate }}</option>
</select>
</div>
<div class="segment-input metricValueBlock">