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:
authorsgiehl <stefan@piwik.org>2016-07-12 23:08:14 +0300
committersgiehl <stefan@piwik.org>2016-07-15 00:10:16 +0300
commit96f289b0a679b36867e4b5a5b7fed70b8132a2a6 (patch)
treec7f37a2cabcc83bd11e6e8b1e89cea1ae4550a61
parentad9a0c3d6eb7a901f2454663de54c953a89d72d5 (diff)
use better message depending of the availability of archiving triggered by browser
-rw-r--r--core/ArchiveProcessor/Rules.php6
-rw-r--r--plugins/SegmentEditor/SegmentSelectorControl.php2
-rw-r--r--plugins/SegmentEditor/javascripts/Segmentation.js12
-rw-r--r--plugins/SegmentEditor/lang/en.json3
-rw-r--r--plugins/SegmentEditor/templates/_segmentSelector.twig11
5 files changed, 30 insertions, 4 deletions
diff --git a/core/ArchiveProcessor/Rules.php b/core/ArchiveProcessor/Rules.php
index 7f37b3250c..7538d7f7d0 100644
--- a/core/ArchiveProcessor/Rules.php
+++ b/core/ArchiveProcessor/Rules.php
@@ -163,6 +163,12 @@ class Rules
return Config::getInstance()->General['time_before_today_archive_considered_outdated'];
}
+ public static function isBrowserArchivingAvailableForSegments()
+ {
+ $generalConfig = Config::getInstance()->General;
+ return (self::isRequestAuthorizedToArchive() && !$generalConfig['browser_archiving_disabled_enforce']);
+ }
+
public static function isArchivingDisabledFor(array $idSites, Segment $segment, $periodLabel)
{
$generalConfig = Config::getInstance()->General;
diff --git a/plugins/SegmentEditor/SegmentSelectorControl.php b/plugins/SegmentEditor/SegmentSelectorControl.php
index 130b616d48..866bd2bac5 100644
--- a/plugins/SegmentEditor/SegmentSelectorControl.php
+++ b/plugins/SegmentEditor/SegmentSelectorControl.php
@@ -9,6 +9,7 @@
namespace Piwik\Plugins\SegmentEditor;
use Piwik\API\Request;
+use Piwik\ArchiveProcessor\Rules;
use Piwik\Common;
use Piwik\Config;
use Piwik\Container\StaticContainer;
@@ -78,6 +79,7 @@ class SegmentSelectorControl extends UIControl
$this->authorizedToCreateSegments = SegmentEditorAPI::getInstance()->isUserCanAddNewSegment($this->idSite);
$this->isUserAnonymous = Piwik::isUserIsAnonymous();
$this->segmentTranslations = $this->getTranslations();
+ $this->segmentProcessedOnRequest = Rules::isBrowserArchivingAvailableForSegments();
}
public function getClientSideProperties()
diff --git a/plugins/SegmentEditor/javascripts/Segmentation.js b/plugins/SegmentEditor/javascripts/Segmentation.js
index 74b44fa089..609368def7 100644
--- a/plugins/SegmentEditor/javascripts/Segmentation.js
+++ b/plugins/SegmentEditor/javascripts/Segmentation.js
@@ -1077,7 +1077,17 @@ Segmentation = (function($) {
});
if(segmentStr != getSegmentFromId(segmentId).definition) {
- piwikHelper.modalConfirm(self.target.find('.segment-definition-change-confirm'), {
+ var segmentProcessedOnRequest = $('.segment-definition-change-confirm').data('segmentProcessedOnRequest');
+
+ $('.process-on-request, .no-process-on-request').hide();
+
+ if (segmentProcessedOnRequest == 1 && autoArchive == 0) {
+ $('.process-on-request').show();
+ } else {
+ $('.no-process-on-request').show();
+ }
+
+ piwikHelper.modalConfirm('.segment-definition-change-confirm', {
yes: function () {
self.updateMethod(params);
}
diff --git a/plugins/SegmentEditor/lang/en.json b/plugins/SegmentEditor/lang/en.json
index 43331447c8..346a573b2d 100644
--- a/plugins/SegmentEditor/lang/en.json
+++ b/plugins/SegmentEditor/lang/en.json
@@ -6,7 +6,8 @@
"AreYouSureDeleteSegment": "Are you sure you want to delete this segment?",
"AutoArchivePreProcessed": "segmented reports are pre-processed (faster, requires cron)",
"AutoArchiveRealTime": "segmented reports are processed in real time",
- "ChangingSegmentDefinitionConfirmation": "You're about to change the segment definition. Your analytics reports for this new segment won't be available until the reports are re-processed. It may take a few hours to reprocess your reports. Proceed anyway?",
+ "ChangingSegmentDefinitionConfirmationNotProcessedOnRequest": "You're about to change the segment definition. Your analytics reports for this new segment won't be available until the reports are re-processed. It may take a few hours for reports data to show for this segment. Proceed anyway?",
+ "ChangingSegmentDefinitionConfirmationProcessedOnRequest": "You're about to change the segment definition. Your analytics reports for this new segment will be re-processed the next time you request them, which may take some time. Proceed anyway?",
"ChooseASegment": "Choose a segment",
"CurrentlySelectedSegment": "Currently selected segment: %s",
"DataAvailableAtLaterDate": "Your segmented analytics reports will be available later. We apologize for the inconvenience.",
diff --git a/plugins/SegmentEditor/templates/_segmentSelector.twig b/plugins/SegmentEditor/templates/_segmentSelector.twig
index 9c2aa063b2..7a9afb4e02 100644
--- a/plugins/SegmentEditor/templates/_segmentSelector.twig
+++ b/plugins/SegmentEditor/templates/_segmentSelector.twig
@@ -167,8 +167,15 @@
<input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
<input role="no" type="button" value="{{ 'General_No'|translate }}"/>
</div>
-<div class="ui-confirm segment-definition-change-confirm">
- <h2>{{ 'SegmentEditor_ChangingSegmentDefinitionConfirmation'|translate }}</h2>
+<div class="ui-confirm segment-definition-change-confirm" data-segment-processed-on-request="{{ segmentProcessedOnRequest|number_format }}">
+ <h2>
+ <span class="process-on-request">
+ {{ 'SegmentEditor_ChangingSegmentDefinitionConfirmationProcessedOnRequest'|translate }}
+ </span>
+ <span class="no-process-on-request">
+ {{ 'SegmentEditor_ChangingSegmentDefinitionConfirmationNotProcessedOnRequest'|translate }}
+ </span>
+ </h2>
<input role="yes" type="button" value="{{ 'General_Yes'|translate }}"/>
<input role="no" type="button" value="{{ 'General_No'|translate }}"/>
</div>