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>2016-02-02 13:02:00 +0300
committerThomas Steur <thomas.steur@gmail.com>2016-02-02 13:02:00 +0300
commitdbd1d12642f534639117eabe302790ba8576a91d (patch)
tree97bc37e3d3bf82db1f2c5c7d101be642dee0813a
parent888ade738e5e1367406cf7865c5feb5da94ab0fd (diff)
refs #9686 add help links in error message to Piwik PRO
-rw-r--r--core/Config.php3
-rwxr-xr-xcore/Twig.php11
-rw-r--r--core/Updates/2.16.0-rc2.php5
-rw-r--r--lang/en.json1
-rw-r--r--plugins/CoreHome/templates/getDefaultIndexView.twig2
-rw-r--r--plugins/Dashboard/stylesheets/dashboard.less10
-rw-r--r--plugins/ExampleRssWidget/Widgets.php1
-rw-r--r--plugins/Morpheus/stylesheets/uibase/_loading.less5
-rw-r--r--plugins/Morpheus/templates/admin.twig2
-rw-r--r--plugins/Morpheus/templates/ajaxMacros.twig28
-rw-r--r--plugins/Morpheus/templates/user.twig2
-rw-r--r--plugins/MultiSites/MultiSites.php4
-rw-r--r--plugins/MultiSites/angularjs/dashboard/dashboard.controller.js1
-rw-r--r--plugins/MultiSites/angularjs/dashboard/dashboard.directive.html9
-rw-r--r--plugins/MultiSites/angularjs/dashboard/dashboard.directive.less3
15 files changed, 76 insertions, 11 deletions
diff --git a/core/Config.php b/core/Config.php
index a1bbabc349..adc3ba948d 100644
--- a/core/Config.php
+++ b/core/Config.php
@@ -157,7 +157,8 @@ class Config
'action_url_category_delimiter' => $general['action_url_category_delimiter'],
'autocomplete_min_sites' => $general['autocomplete_min_sites'],
'datatable_export_range_as_day' => $general['datatable_export_range_as_day'],
- 'datatable_row_limits' => $this->getDatatableRowLimits()
+ 'datatable_row_limits' => $this->getDatatableRowLimits(),
+ 'are_ads_enabled' => $general['piwik_pro_ads_enabled']
);
}
diff --git a/core/Twig.php b/core/Twig.php
index 637a4f34ad..c3b6ba7414 100755
--- a/core/Twig.php
+++ b/core/Twig.php
@@ -87,6 +87,7 @@ class Twig
$this->addFilter_percentage();
$this->addFilter_percent();
$this->addFilter_percentEvolution();
+ $this->addFilter_piwikProAdLink();
$this->addFilter_piwikProOnPremisesAdLink();
$this->addFilter_piwikProCloudAdLink();
$this->addFilter_prettyDate();
@@ -324,6 +325,16 @@ class Twig
$this->twig->addFilter($percentage);
}
+ protected function addFilter_piwikProAdLink()
+ {
+ $ads = $this->getPiwikProAdvertising();
+ $piwikProAd = new Twig_SimpleFilter('piwikProCampaignParameters', function ($url, $campaignName, $campaignMedium, $campaignContent = '') use ($ads) {
+ $url = $ads->addPromoCampaignParametersToUrl($url, $campaignName, $campaignMedium, $campaignContent);
+ return $url;
+ });
+ $this->twig->addFilter($piwikProAd);
+ }
+
protected function addFilter_piwikProOnPremisesAdLink()
{
$twigEnv = $this->getTwigEnvironment();
diff --git a/core/Updates/2.16.0-rc2.php b/core/Updates/2.16.0-rc2.php
index 53265455bf..2bddb6b5cb 100644
--- a/core/Updates/2.16.0-rc2.php
+++ b/core/Updates/2.16.0-rc2.php
@@ -16,9 +16,12 @@ class Updates_2_16_0_rc2 extends Updates
public function doUpdate(Updater $updater)
{
$pluginManager = \Piwik\Plugin\Manager::getInstance();
+ $pluginName = 'PiwikPro';
try {
- $pluginManager->activatePlugin('PiwikPro');
+ if (!$pluginManager->isPluginActivated($pluginName)) {
+ $pluginManager->activatePlugin($pluginName);
+ }
} catch (\Exception $e) {
}
}
diff --git a/lang/en.json b/lang/en.json
index 131b224b40..835d2d84f0 100644
--- a/lang/en.json
+++ b/lang/en.json
@@ -231,6 +231,7 @@
"Name": "Name",
"NbActions": "Number of Actions",
"NbSearches": "Number of Internal Searches",
+ "NeedMoreHelp": "Need more help?",
"Never": "Never",
"NewReportsWillBeProcessedByCron": "When Piwik archiving is not triggered by the browser, new reports will be processed by the crontab.",
"NewUpdatePiwikX": "New Update: Piwik %s",
diff --git a/plugins/CoreHome/templates/getDefaultIndexView.twig b/plugins/CoreHome/templates/getDefaultIndexView.twig
index a09030ff3d..62e8d8ffe7 100644
--- a/plugins/CoreHome/templates/getDefaultIndexView.twig
+++ b/plugins/CoreHome/templates/getDefaultIndexView.twig
@@ -10,7 +10,7 @@
{% endblock %}
{% block content %}
- {{ ajax.requestErrorDiv(emailSuperUser|default('')) }}
+ {{ ajax.requestErrorDiv(emailSuperUser|default(''), arePiwikProAdsEnabled) }}
{{ ajax.loadingDiv() }}
<div id="content" class="home">
diff --git a/plugins/Dashboard/stylesheets/dashboard.less b/plugins/Dashboard/stylesheets/dashboard.less
index 26120e1abb..20a5fbac92 100644
--- a/plugins/Dashboard/stylesheets/dashboard.less
+++ b/plugins/Dashboard/stylesheets/dashboard.less
@@ -112,9 +112,19 @@
font-size: 10pt;
}
+.widgetLoadingError {
+ .alert.alert-danger {
+ border: 0;
+ }
+}
+
.widgetLoadingError, .dimensionLoadingError {
color: @theme-color-brand;
text-align: left;
+ a {
+ color: @theme-color-brand;
+ text-decoration: underline;
+ }
}
#closeMenuIcon {
diff --git a/plugins/ExampleRssWidget/Widgets.php b/plugins/ExampleRssWidget/Widgets.php
index e0d67cdd9f..41d316323c 100644
--- a/plugins/ExampleRssWidget/Widgets.php
+++ b/plugins/ExampleRssWidget/Widgets.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\Plugins\ExampleRssWidget;
+use Piwik\Common;
use Piwik\Piwik;
class Widgets extends \Piwik\Plugin\Widgets
diff --git a/plugins/Morpheus/stylesheets/uibase/_loading.less b/plugins/Morpheus/stylesheets/uibase/_loading.less
index e57e3d0a6d..f375f7917f 100644
--- a/plugins/Morpheus/stylesheets/uibase/_loading.less
+++ b/plugins/Morpheus/stylesheets/uibase/_loading.less
@@ -15,6 +15,11 @@
display:none;
}
+#root > #loadingError {
+ margin-left: 20px;
+ margin-right: 20px;
+}
+
#loadingError {
font-size: 15px;
padding: 8px 0;
diff --git a/plugins/Morpheus/templates/admin.twig b/plugins/Morpheus/templates/admin.twig
index 7ebadaad09..143d5a9f07 100644
--- a/plugins/Morpheus/templates/admin.twig
+++ b/plugins/Morpheus/templates/admin.twig
@@ -19,7 +19,7 @@
{% include "@CoreHome/_topScreen.twig" %}
{% import 'ajaxMacros.twig' as ajax %}
- {{ ajax.requestErrorDiv(emailSuperUser|default('')) }}
+ {{ ajax.requestErrorDiv(emailSuperUser|default(''), arePiwikProAdsEnabled) }}
{{ postEvent("Template.beforeContent", "admin", currentModule) }}
<div class="page">
diff --git a/plugins/Morpheus/templates/ajaxMacros.twig b/plugins/Morpheus/templates/ajaxMacros.twig
index 4d06fd4e30..348e73d5f0 100644
--- a/plugins/Morpheus/templates/ajaxMacros.twig
+++ b/plugins/Morpheus/templates/ajaxMacros.twig
@@ -13,10 +13,26 @@
</div>
{% endmacro %}
-{% macro requestErrorDiv(emailSuperUser) %}
- {% if emailSuperUser is defined and emailSuperUser %}
- <div id="loadingError">{{ 'General_ErrorRequest'|translate('<a href="mailto:' ~ emailSuperUser ~ '">', '</a>')|raw }}</div>
- {% else %}
- <div id="loadingError">{{ 'General_ErrorRequest'|translate('', '') }}</div>
- {% endif %}
+{% macro requestErrorDiv(emailSuperUser, arePiwikProAdsEnabled = false) %}
+ <div id="loadingError">
+ <div class="alert alert-danger">
+
+ {% if emailSuperUser is defined and emailSuperUser %}
+ {{ 'General_ErrorRequest'|translate('<a href="mailto:' ~ emailSuperUser ~ '">', '</a>')|raw }}
+ {% else %}
+ {{ 'General_ErrorRequest'|translate('', '') }}
+ {% endif %}
+
+ <br /><br />
+ {{ 'General_NeedMoreHelp'|translate }}
+
+ <a rel="noreferrer" target="_blank" href="https://piwik.org/faq/troubleshooting/faq_19489/">{{ 'General_Faq'|translate }}</a> –
+ <a rel="noreferrer" target="_blank" href="http://forum.piwik.org/">{{ 'Feedback_CommunityHelp'|translate }}</a>
+
+ {% if arePiwikProAdsEnabled %}
+ –
+ <a rel="noreferrer" target="_blank" href="{{ 'https://piwik.pro/'|piwikProCampaignParameters('Help', 'AjaxError')|e('html_attr') }}">{{ 'Feedback_ProfessionalHelp'|translate }}</a>
+ {%- endif %}.
+ </div>
+ </div>
{% endmacro %} \ No newline at end of file
diff --git a/plugins/Morpheus/templates/user.twig b/plugins/Morpheus/templates/user.twig
index d69823db39..b343961eae 100644
--- a/plugins/Morpheus/templates/user.twig
+++ b/plugins/Morpheus/templates/user.twig
@@ -21,7 +21,7 @@
{% include "@CoreHome/_topScreen.twig" %}
{% import 'ajaxMacros.twig' as ajax %}
- {{ ajax.requestErrorDiv(emailSuperUser|default('')) }}
+ {{ ajax.requestErrorDiv(emailSuperUser|default(''), arePiwikProAdsEnabled) }}
{{ postEvent("Template.beforeContent", "user", currentModule) }}
<div class="page">
diff --git a/plugins/MultiSites/MultiSites.php b/plugins/MultiSites/MultiSites.php
index 1fb90cfeae..d104db301b 100644
--- a/plugins/MultiSites/MultiSites.php
+++ b/plugins/MultiSites/MultiSites.php
@@ -62,6 +62,10 @@ class MultiSites extends \Piwik\Plugin
$translations[] = 'General_ErrorRequest';
$translations[] = 'General_Pagination';
$translations[] = 'General_ClickToSearch';
+ $translations[] = 'General_NeedMoreHelp';
+ $translations[] = 'General_Faq';
+ $translations[] = 'Feedback_CommunityHelp';
+ $translations[] = 'Feedback_ProfessionalHelp';
}
public function getJsFiles(&$jsFiles)
diff --git a/plugins/MultiSites/angularjs/dashboard/dashboard.controller.js b/plugins/MultiSites/angularjs/dashboard/dashboard.controller.js
index 3ba1b15a21..35cf26a5de 100644
--- a/plugins/MultiSites/angularjs/dashboard/dashboard.controller.js
+++ b/plugins/MultiSites/angularjs/dashboard/dashboard.controller.js
@@ -19,6 +19,7 @@
$scope.idSite = piwik.broadcast.getValueFromUrl('idSite');
$scope.url = piwik.piwik_url;
$scope.period = piwik.period;
+ $scope.arePiwikProAdsEnabled = piwik.config && piwik.config.are_ads_enabled;
this.refresh = function (interval) {
multisitesDashboardModel.refreshInterval = interval;
diff --git a/plugins/MultiSites/angularjs/dashboard/dashboard.directive.html b/plugins/MultiSites/angularjs/dashboard/dashboard.directive.html
index a0f183a7c6..06a7fb6613 100644
--- a/plugins/MultiSites/angularjs/dashboard/dashboard.directive.html
+++ b/plugins/MultiSites/angularjs/dashboard/dashboard.directive.html
@@ -59,6 +59,15 @@
<td colspan="7">
<div class="notification system notification-error">
{{ 'General_ErrorRequest'|translate:(''):('') }}
+
+ <br /><br />
+ {{ 'General_NeedMoreHelp'|translate }}
+
+ <a rel="noreferrer" target="_blank" href="https://piwik.org/faq/troubleshooting/faq_19489/">{{ 'General_Faq'|translate }}</a>
+ –
+ <a rel="noreferrer" target="_blank" href="http://forum.piwik.org/">{{ 'Feedback_CommunityHelp'|translate }}</a>
+ <span ng-show="arePiwikProAdsEnabled"> – </span>
+ <a ng-show="arePiwikProAdsEnabled" rel="noreferrer" target="_blank" href="https://piwik.pro/?pk_campaign=Help&pk_medium=AjaxError&pk_content=MultiSites&pk_source=Piwik_App">{{ 'Feedback_ProfessionalHelp'|translate }}</a>.
</div>
</td>
</tr>
diff --git a/plugins/MultiSites/angularjs/dashboard/dashboard.directive.less b/plugins/MultiSites/angularjs/dashboard/dashboard.directive.less
index a200b3d626..c83ab162aa 100644
--- a/plugins/MultiSites/angularjs/dashboard/dashboard.directive.less
+++ b/plugins/MultiSites/angularjs/dashboard/dashboard.directive.less
@@ -21,6 +21,9 @@
.notification-error {
margin-top: 15px;
+ a {
+ text-decoration: underline !important;
+ }
}
.add_new_site,