update Piwik to version 2.16 (fixes #91)
This commit is contained in:
parent
9abe039dc8
commit
47263617c5
58 changed files with 418860 additions and 226988 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -9,19 +9,25 @@
|
|||
namespace Piwik\Plugins\ScheduledReports;
|
||||
|
||||
use Exception;
|
||||
use Piwik\API\Request;
|
||||
use Piwik\Common;
|
||||
use Piwik\Config;
|
||||
use Piwik\Container\StaticContainer;
|
||||
use Piwik\Date;
|
||||
use Piwik\Db;
|
||||
use Piwik\Log;
|
||||
use Piwik\NoAccessException;
|
||||
use Piwik\Piwik;
|
||||
use Piwik\Plugins\LanguagesManager\LanguagesManager;
|
||||
use Piwik\Plugins\SegmentEditor\API as APISegmentEditor;
|
||||
use Piwik\Plugins\SitesManager\API as SitesManagerApi;
|
||||
use Piwik\ReportRenderer;
|
||||
use Piwik\ReportRenderer\Html;
|
||||
use Piwik\Site;
|
||||
use Piwik\Tracker;
|
||||
use Piwik\Translate;
|
||||
use Zend_Mime;
|
||||
use Piwik\Translation\Translator;
|
||||
use Piwik\Url;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
/**
|
||||
* The ScheduledReports API lets you manage Scheduled Email reports, as well as generate, download or email any existing report.
|
||||
|
|
@ -31,7 +37,7 @@ use Zend_Mime;
|
|||
*
|
||||
* You can also get the list of all existing reports via "getReports", create new reports via "addReport",
|
||||
* or manage existing reports with "updateReport" and "deleteReport".
|
||||
* See also the documentation about <a href='http://piwik.org/docs/email-reports/' target='_blank'>Scheduled Email reports</a> in Piwik.
|
||||
* See also the documentation about <a href='http://piwik.org/docs/email-reports/' rel='noreferrer' target='_blank'>Scheduled Email reports</a> in Piwik.
|
||||
*
|
||||
* @method static \Piwik\Plugins\ScheduledReports\API getInstance()
|
||||
*/
|
||||
|
|
@ -53,7 +59,18 @@ class API extends \Piwik\Plugin\API
|
|||
const OUTPUT_INLINE = 3;
|
||||
const OUTPUT_RETURN = 4;
|
||||
|
||||
const REPORT_TRUNCATE = 23;
|
||||
// static cache storing reports
|
||||
public static $cache = array();
|
||||
|
||||
/**
|
||||
* @var LoggerInterface
|
||||
*/
|
||||
private $logger;
|
||||
|
||||
public function __construct(LoggerInterface $logger)
|
||||
{
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new report and schedules it.
|
||||
|
|
@ -86,29 +103,20 @@ class API extends \Piwik\Plugin\API
|
|||
// validation of requested reports
|
||||
$reports = self::validateRequestedReports($idSite, $reportType, $reports);
|
||||
|
||||
$db = Db::get();
|
||||
$idReport = $db->fetchOne("SELECT max(idreport) + 1 FROM " . Common::prefixTable('report'));
|
||||
|
||||
if ($idReport == false) {
|
||||
$idReport = 1;
|
||||
}
|
||||
|
||||
$db->insert(Common::prefixTable('report'),
|
||||
array(
|
||||
'idreport' => $idReport,
|
||||
'idsite' => $idSite,
|
||||
'login' => $currentUser,
|
||||
'description' => $description,
|
||||
'idsegment' => $idSegment,
|
||||
'period' => $period,
|
||||
'hour' => $hour,
|
||||
'type' => $reportType,
|
||||
'format' => $reportFormat,
|
||||
'parameters' => $parameters,
|
||||
'reports' => $reports,
|
||||
'ts_created' => Date::now()->getDatetime(),
|
||||
'deleted' => 0,
|
||||
));
|
||||
$idReport = $this->getModel()->createReport(array(
|
||||
'idsite' => $idSite,
|
||||
'login' => $currentUser,
|
||||
'description' => $description,
|
||||
'idsegment' => $idSegment,
|
||||
'period' => $period,
|
||||
'hour' => $hour,
|
||||
'type' => $reportType,
|
||||
'format' => $reportFormat,
|
||||
'parameters' => $parameters,
|
||||
'reports' => $reports,
|
||||
'ts_created' => Date::now()->getDatetime(),
|
||||
'deleted' => 0,
|
||||
));
|
||||
|
||||
return $idReport;
|
||||
}
|
||||
|
|
@ -132,7 +140,7 @@ class API extends \Piwik\Plugin\API
|
|||
Piwik::checkUserHasViewAccess($idSite);
|
||||
|
||||
$scheduledReports = $this->getReports($idSite, $periodSearch = false, $idReport);
|
||||
$report = reset($scheduledReports);
|
||||
$report = reset($scheduledReports);
|
||||
$idReport = $report['idreport'];
|
||||
|
||||
$currentUser = Piwik::getCurrentUserLogin();
|
||||
|
|
@ -146,19 +154,16 @@ class API extends \Piwik\Plugin\API
|
|||
// validation of requested reports
|
||||
$reports = self::validateRequestedReports($idSite, $reportType, $reports);
|
||||
|
||||
Db::get()->update(Common::prefixTable('report'),
|
||||
array(
|
||||
'description' => $description,
|
||||
'idsegment' => $idSegment,
|
||||
'period' => $period,
|
||||
'hour' => $hour,
|
||||
'type' => $reportType,
|
||||
'format' => $reportFormat,
|
||||
'parameters' => $parameters,
|
||||
'reports' => $reports,
|
||||
),
|
||||
"idreport = '$idReport'"
|
||||
);
|
||||
$this->getModel()->updateReport($idReport, array(
|
||||
'description' => $description,
|
||||
'idsegment' => $idSegment,
|
||||
'period' => $period,
|
||||
'hour' => $hour,
|
||||
'type' => $reportType,
|
||||
'format' => $reportFormat,
|
||||
'parameters' => $parameters,
|
||||
'reports' => $reports,
|
||||
));
|
||||
|
||||
self::$cache = array();
|
||||
}
|
||||
|
|
@ -174,18 +179,13 @@ class API extends \Piwik\Plugin\API
|
|||
$report = reset($APIScheduledReports);
|
||||
Piwik::checkUserHasSuperUserAccessOrIsTheUser($report['login']);
|
||||
|
||||
Db::get()->update(Common::prefixTable('report'),
|
||||
array(
|
||||
'deleted' => 1,
|
||||
),
|
||||
"idreport = '$idReport'"
|
||||
);
|
||||
$this->getModel()->updateReport($idReport, array(
|
||||
'deleted' => 1,
|
||||
));
|
||||
|
||||
self::$cache = array();
|
||||
}
|
||||
|
||||
// static cache storing reports
|
||||
public static $cache = array();
|
||||
|
||||
/**
|
||||
* Returns the list of reports matching the passed parameters
|
||||
*
|
||||
|
|
@ -200,6 +200,7 @@ class API extends \Piwik\Plugin\API
|
|||
public function getReports($idSite = false, $period = false, $idReport = false, $ifSuperUserReturnOnlySuperUserReports = false, $idSegment = false)
|
||||
{
|
||||
Piwik::checkUserHasSomeViewAccess();
|
||||
|
||||
$cacheKey = (int)$idSite . '.' . (string)$period . '.' . (int)$idReport . '.' . (int)$ifSuperUserReturnOnlySuperUserReports;
|
||||
if (isset(self::$cache[$cacheKey])) {
|
||||
return self::$cache[$cacheKey];
|
||||
|
|
@ -251,10 +252,14 @@ class API extends \Piwik\Plugin\API
|
|||
|
||||
foreach ($reports as &$report) {
|
||||
// decode report parameters
|
||||
$report['parameters'] = Common::json_decode($report['parameters'], true);
|
||||
$report['parameters'] = json_decode($report['parameters'], true);
|
||||
|
||||
// decode report list
|
||||
$report['reports'] = Common::json_decode($report['reports'], true);
|
||||
$report['reports'] = json_decode($report['reports'], true);
|
||||
|
||||
if (!empty($report['parameters']['additionalEmails']) && is_array($report['parameters']['additionalEmails'])) {
|
||||
$report['parameters']['additionalEmails'] = array_values($report['parameters']['additionalEmails']);
|
||||
}
|
||||
}
|
||||
|
||||
// static cache
|
||||
|
|
@ -284,7 +289,9 @@ class API extends \Piwik\Plugin\API
|
|||
$language = Translate::getLanguageDefault();
|
||||
}
|
||||
|
||||
Translate::reloadLanguage($language);
|
||||
/** @var Translator $translator */
|
||||
$translator = StaticContainer::get('Piwik\Translation\Translator');
|
||||
$translator->setCurrentLanguage($language);
|
||||
|
||||
$reports = $this->getReports($idSite = false, $_period = false, $idReport);
|
||||
$report = reset($reports);
|
||||
|
|
@ -309,7 +316,7 @@ class API extends \Piwik\Plugin\API
|
|||
}
|
||||
|
||||
// override and/or validate report parameters
|
||||
$report['parameters'] = Common::json_decode(
|
||||
$report['parameters'] = json_decode(
|
||||
self::validateReportParameters($reportType, empty($parameters) ? $report['parameters'] : $parameters),
|
||||
true
|
||||
);
|
||||
|
|
@ -328,7 +335,7 @@ class API extends \Piwik\Plugin\API
|
|||
// the report will be rendered with the first 23 rows and will aggregate other rows in a summary row
|
||||
// 23 rows table fits in one portrait page
|
||||
$initialFilterTruncate = Common::getRequestVar('filter_truncate', false);
|
||||
$_GET['filter_truncate'] = self::REPORT_TRUNCATE;
|
||||
$_GET['filter_truncate'] = Config::getInstance()->General['scheduled_reports_truncate'];
|
||||
|
||||
$prettyDate = null;
|
||||
$processedReports = array();
|
||||
|
|
@ -350,6 +357,7 @@ class API extends \Piwik\Plugin\API
|
|||
|
||||
if ($apiAction == 'getAll') {
|
||||
$_GET['filter_truncate'] = false;
|
||||
$_GET['filter_limit'] = -1; // show all websites in all websites report
|
||||
|
||||
// when a view/admin user created a report, workaround the fact that "Super User"
|
||||
// is enforced in Scheduled tasks, and ensure Multisites.getAll only return the websites that this user can access
|
||||
|
|
@ -362,12 +370,39 @@ class API extends \Piwik\Plugin\API
|
|||
}
|
||||
}
|
||||
|
||||
$processedReport = \Piwik\Plugins\API\API::getInstance()->getProcessedReport(
|
||||
$idSite, $period, $date, $apiModule, $apiAction,
|
||||
$segment != null ? urlencode($segment['definition']) : false,
|
||||
$apiParameters, $idGoal = false, $language
|
||||
$params = array(
|
||||
'idSite' => $idSite,
|
||||
'period' => $period,
|
||||
'date' => $date,
|
||||
'apiModule' => $apiModule,
|
||||
'apiAction' => $apiAction,
|
||||
'apiParameters' => $apiParameters,
|
||||
'idGoal' => false,
|
||||
'language' => $language,
|
||||
'serialize' => 0,
|
||||
'format' => 'original'
|
||||
);
|
||||
|
||||
if ($segment != null) {
|
||||
$params['segment'] = urlencode($segment['definition']);
|
||||
} else {
|
||||
$params['segment'] = false;
|
||||
}
|
||||
|
||||
try {
|
||||
$processedReport = Request::processRequest('API.getProcessedReport', $params);
|
||||
} catch (\Exception $ex) {
|
||||
// NOTE: can't use warning or error because the log message will appear in the UI as a notification
|
||||
$this->logger->info("Error getting '?{report}' when generating scheduled report: {exception}", array(
|
||||
'report' => http_build_query($params),
|
||||
'exception' => $ex->getMessage(),
|
||||
));
|
||||
|
||||
$this->logger->debug($ex);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
$processedReport['segment'] = $segment;
|
||||
|
||||
// TODO add static method getPrettyDate($period, $date) in Period
|
||||
|
|
@ -390,10 +425,10 @@ class API extends \Piwik\Plugin\API
|
|||
*
|
||||
* This event can be used to modify the report data or report metadata of one or more reports
|
||||
* in a scheduled report, before the scheduled report is rendered and delivered.
|
||||
*
|
||||
*
|
||||
* TODO: list data available in $report or make it a new class that can be documented (same for
|
||||
* all other events that use a $report)
|
||||
*
|
||||
*
|
||||
* @param array &$processedReports The list of processed reports in the scheduled
|
||||
* report. Entries includes report data and metadata for each report.
|
||||
* @param string $reportType A string ID describing how the scheduled report will be sent, eg,
|
||||
|
|
@ -411,10 +446,10 @@ class API extends \Piwik\Plugin\API
|
|||
|
||||
/**
|
||||
* Triggered when obtaining a renderer instance based on the scheduled report output format.
|
||||
*
|
||||
*
|
||||
* Plugins that provide new scheduled report output formats should use this event to
|
||||
* handle their new report formats.
|
||||
*
|
||||
*
|
||||
* @param ReportRenderer &$reportRenderer This variable should be set to an instance that
|
||||
* extends {@link Piwik\ReportRenderer} by one of the event
|
||||
* subscribers.
|
||||
|
|
@ -429,7 +464,7 @@ class API extends \Piwik\Plugin\API
|
|||
array(&$reportRenderer, $reportType, $outputType, $report)
|
||||
);
|
||||
|
||||
if(is_null($reportRenderer)) {
|
||||
if (is_null($reportRenderer)) {
|
||||
throw new Exception("A report renderer was not supplied in the event " . self::GET_RENDERER_INSTANCE_EVENT);
|
||||
}
|
||||
|
||||
|
|
@ -439,7 +474,12 @@ class API extends \Piwik\Plugin\API
|
|||
// render report
|
||||
$description = str_replace(array("\r", "\n"), ' ', $report['description']);
|
||||
|
||||
list($reportSubject, $reportTitle) = self::getReportSubjectAndReportTitle(Site::getNameFor($idSite), $report['reports']);
|
||||
list($reportSubject, $reportTitle) = self::getReportSubjectAndReportTitle(Common::unsanitizeInputValue(Site::getNameFor($idSite)), $report['reports']);
|
||||
|
||||
// if reporting for a segment, use the segment's name in the title
|
||||
if(is_array($segment) && strlen($segment['name'])) {
|
||||
$reportTitle .= " - ".$segment['name'];
|
||||
}
|
||||
$filename = "$reportTitle - $prettyDate - $description";
|
||||
|
||||
$reportRenderer->renderFrontPage($reportTitle, $prettyDate, $description, $reportMetadata, $segment);
|
||||
|
|
@ -481,7 +521,7 @@ class API extends \Piwik\Plugin\API
|
|||
}
|
||||
}
|
||||
|
||||
public function sendReport($idReport, $period = false, $date = false)
|
||||
public function sendReport($idReport, $period = false, $date = false, $force = false)
|
||||
{
|
||||
Piwik::checkUserIsNotAnonymous();
|
||||
|
||||
|
|
@ -516,17 +556,18 @@ class API extends \Piwik\Plugin\API
|
|||
throw new Exception("The report file wasn't found in $outputFilename");
|
||||
}
|
||||
|
||||
$filename = basename($outputFilename);
|
||||
$handle = fopen($outputFilename, "r");
|
||||
$contents = fread($handle, filesize($outputFilename));
|
||||
fclose($handle);
|
||||
$contents = file_get_contents($outputFilename);
|
||||
|
||||
if (empty($contents)) {
|
||||
Log::warning("Scheduled report file '%s' exists but is empty!", $outputFilename);
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered when sending scheduled reports.
|
||||
*
|
||||
* Plugins that provide new scheduled report transport mediums should use this event to
|
||||
* send the scheduled report.
|
||||
*
|
||||
*
|
||||
* @param string $reportType A string ID describing how the report is sent, eg,
|
||||
* `'sms'` or `'email'`.
|
||||
* @param array $report An array describing the scheduled report that is being
|
||||
|
|
@ -542,6 +583,9 @@ class API extends \Piwik\Plugin\API
|
|||
* @param string $reportTitle The scheduled report's given title (given by a Piwik user).
|
||||
* @param array $additionalFiles The list of additional files that should be
|
||||
* sent with this report.
|
||||
* @param \Piwik\Period $period The period for which the report has been generated.
|
||||
* @param boolean $force A report can only be sent once per period. Setting this to true
|
||||
* will force to send the report even if it has already been sent.
|
||||
*/
|
||||
Piwik::postEvent(
|
||||
self::SEND_REPORT_EVENT,
|
||||
|
|
@ -549,30 +593,36 @@ class API extends \Piwik\Plugin\API
|
|||
$report['type'],
|
||||
$report,
|
||||
$contents,
|
||||
$filename,
|
||||
$filename = basename($outputFilename),
|
||||
$prettyDate,
|
||||
$reportSubject,
|
||||
$reportTitle,
|
||||
$additionalFiles
|
||||
$additionalFiles,
|
||||
\Piwik\Period\Factory::build($report['period'], $date),
|
||||
$force
|
||||
)
|
||||
);
|
||||
|
||||
// Update flag in DB
|
||||
Db::get()->update(Common::prefixTable('report'),
|
||||
array('ts_last_sent' => Date::now()->getDatetime()),
|
||||
"idreport = " . $report['idreport']
|
||||
);
|
||||
$now = Date::now()->getDatetime();
|
||||
$this->getModel()->updateReport($report['idreport'], array('ts_last_sent' => $now));
|
||||
|
||||
// If running from piwik.php with debug, do not delete the PDF after sending the email
|
||||
if (!isset($GLOBALS['PIWIK_TRACKER_DEBUG']) || !$GLOBALS['PIWIK_TRACKER_DEBUG']) {
|
||||
$tracker = new Tracker();
|
||||
if (!$tracker->isDebugModeEnabled()) {
|
||||
@chmod($outputFilename, 0600);
|
||||
}
|
||||
}
|
||||
|
||||
private function getModel()
|
||||
{
|
||||
return new Model();
|
||||
}
|
||||
|
||||
private static function getReportSubjectAndReportTitle($websiteName, $reports)
|
||||
{
|
||||
// if the only report is "All websites", we don't display the site name
|
||||
$reportTitle = Piwik::translate('General_Website') . " " . $websiteName;
|
||||
$reportTitle = $websiteName;
|
||||
$reportSubject = $websiteName;
|
||||
if (count($reports) == 1
|
||||
&& $reports[0] == 'MultiSites_getAll'
|
||||
|
|
@ -591,10 +641,10 @@ class API extends \Piwik\Plugin\API
|
|||
|
||||
/**
|
||||
* Triggered when gathering the available parameters for a scheduled report type.
|
||||
*
|
||||
*
|
||||
* Plugins that provide their own scheduled report transport mediums should use this
|
||||
* event to list the available report parameters for their transport medium.
|
||||
*
|
||||
*
|
||||
* @param array $availableParameters The list of available parameters for this report type.
|
||||
* This is an array that maps paramater IDs with a boolean
|
||||
* that indicates whether the parameter is mandatory or not.
|
||||
|
|
@ -620,17 +670,17 @@ class API extends \Piwik\Plugin\API
|
|||
|
||||
/**
|
||||
* Triggered when validating the parameters for a scheduled report.
|
||||
*
|
||||
*
|
||||
* Plugins that provide their own scheduled reports backend should use this
|
||||
* event to validate the custom parameters defined with {@link ScheduledReports::getReportParameters()}.
|
||||
*
|
||||
*
|
||||
* @param array $parameters The list of parameters for the scheduled report.
|
||||
* @param string $reportType A string ID describing how the report is sent, eg,
|
||||
* `'sms'` or `'email'`.
|
||||
*/
|
||||
Piwik::postEvent(self::VALIDATE_PARAMETERS_EVENT, array(&$parameters, $reportType));
|
||||
|
||||
return Common::json_encode($parameters);
|
||||
return json_encode($parameters);
|
||||
}
|
||||
|
||||
private static function validateAndTruncateDescription(&$description)
|
||||
|
|
@ -659,7 +709,7 @@ class API extends \Piwik\Plugin\API
|
|||
}
|
||||
}
|
||||
|
||||
return Common::json_encode($requestedReports);
|
||||
return json_encode($requestedReports);
|
||||
}
|
||||
|
||||
private static function validateCommonReportAttributes($period, $hour, &$description, &$idSegment, $reportType, $reportFormat)
|
||||
|
|
@ -729,7 +779,7 @@ class API extends \Piwik\Plugin\API
|
|||
/**
|
||||
* @ignore
|
||||
*/
|
||||
static public function getReportMetadata($idSite, $reportType)
|
||||
public static function getReportMetadata($idSite, $reportType)
|
||||
{
|
||||
$availableReportMetadata = array();
|
||||
|
||||
|
|
@ -737,10 +787,10 @@ class API extends \Piwik\Plugin\API
|
|||
* TODO: change this event so it returns a list of API methods instead of report metadata arrays.
|
||||
* Triggered when gathering the list of Piwik reports that can be used with a certain
|
||||
* transport medium.
|
||||
*
|
||||
*
|
||||
* Plugins that provide their own transport mediums should use this
|
||||
* event to list the Piwik reports that their backend supports.
|
||||
*
|
||||
*
|
||||
* @param array &$availableReportMetadata An array containg report metadata for each supported
|
||||
* report.
|
||||
* @param string $reportType A string ID describing how the report is sent, eg,
|
||||
|
|
@ -758,18 +808,18 @@ class API extends \Piwik\Plugin\API
|
|||
/**
|
||||
* @ignore
|
||||
*/
|
||||
static public function allowMultipleReports($reportType)
|
||||
public static function allowMultipleReports($reportType)
|
||||
{
|
||||
$allowMultipleReports = null;
|
||||
|
||||
/**
|
||||
* Triggered when we're determining if a scheduled report transport medium can
|
||||
* handle sending multiple Piwik reports in one scheduled report or not.
|
||||
*
|
||||
*
|
||||
* Plugins that provide their own transport mediums should use this
|
||||
* event to specify whether their backend can send more than one Piwik report
|
||||
* at a time.
|
||||
*
|
||||
*
|
||||
* @param bool &$allowMultipleReports Whether the backend type can handle multiple
|
||||
* Piwik reports or not.
|
||||
* @param string $reportType A string ID describing how the report is sent, eg,
|
||||
|
|
@ -785,16 +835,16 @@ class API extends \Piwik\Plugin\API
|
|||
/**
|
||||
* @ignore
|
||||
*/
|
||||
static public function getReportTypes()
|
||||
public static function getReportTypes()
|
||||
{
|
||||
$reportTypes = array();
|
||||
|
||||
/**
|
||||
* Triggered when gathering all available transport mediums.
|
||||
*
|
||||
*
|
||||
* Plugins that provide their own transport mediums should use this
|
||||
* event to make their medium available.
|
||||
*
|
||||
*
|
||||
* @param array &$reportTypes An array mapping transport medium IDs with the paths to those
|
||||
* mediums' icons. Add your new backend's ID to this array.
|
||||
*/
|
||||
|
|
@ -806,16 +856,16 @@ class API extends \Piwik\Plugin\API
|
|||
/**
|
||||
* @ignore
|
||||
*/
|
||||
static public function getReportFormats($reportType)
|
||||
public static function getReportFormats($reportType)
|
||||
{
|
||||
$reportFormats = array();
|
||||
|
||||
/**
|
||||
* Triggered when gathering all available scheduled report formats.
|
||||
*
|
||||
*
|
||||
* Plugins that provide their own scheduled report format should use
|
||||
* this event to make their format available.
|
||||
*
|
||||
*
|
||||
* @param array &$reportFormats An array mapping string IDs for each available
|
||||
* scheduled report format with icon paths for those
|
||||
* formats. Add your new format's ID to this array.
|
||||
|
|
@ -833,17 +883,17 @@ class API extends \Piwik\Plugin\API
|
|||
/**
|
||||
* @ignore
|
||||
*/
|
||||
static public function getReportRecipients($report)
|
||||
public static function getReportRecipients($report)
|
||||
{
|
||||
$recipients = array();
|
||||
|
||||
/**
|
||||
* Triggered when getting the list of recipients of a scheduled report.
|
||||
*
|
||||
*
|
||||
* Plugins that provide their own scheduled report transport medium should use this event
|
||||
* to extract the list of recipients their backend's specific scheduled report
|
||||
* format.
|
||||
*
|
||||
*
|
||||
* @param array &$recipients An array of strings describing each of the scheduled
|
||||
* reports recipients. Can be, for example, a list of email
|
||||
* addresses or phone numbers or whatever else your plugin
|
||||
|
|
@ -861,7 +911,7 @@ class API extends \Piwik\Plugin\API
|
|||
/**
|
||||
* @ignore
|
||||
*/
|
||||
static public function getSegment($idSegment)
|
||||
public static function getSegment($idSegment)
|
||||
{
|
||||
if (self::isSegmentEditorActivated() && !empty($idSegment)) {
|
||||
|
||||
|
|
@ -885,60 +935,7 @@ class API extends \Piwik\Plugin\API
|
|||
|
||||
private function getAttachments($reportRenderer, $report, $processedReports, $prettyDate)
|
||||
{
|
||||
$additionalFiles = array();
|
||||
|
||||
if ($reportRenderer instanceof Html) {
|
||||
|
||||
foreach ($processedReports as $processedReport) {
|
||||
|
||||
if ($processedReport['displayGraph']) {
|
||||
|
||||
$additionalFiles[] = $this->createAttachment($report, $processedReport, $prettyDate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $additionalFiles;
|
||||
}
|
||||
|
||||
private function createAttachment($report, $processedReport, $prettyDate)
|
||||
{
|
||||
$additionalFile = array();
|
||||
|
||||
$segment = self::getSegment($report['idsegment']);
|
||||
|
||||
$segmentName = $segment != null ? sprintf(' (%s)', $segment['name']) : '';
|
||||
|
||||
$processedReportMetadata = $processedReport['metadata'];
|
||||
|
||||
$additionalFile['filename'] =
|
||||
sprintf(
|
||||
'%s - %s - %s %d - %s %d%s.png',
|
||||
$processedReportMetadata['name'],
|
||||
$prettyDate,
|
||||
Piwik::translate('General_Website'),
|
||||
$report['idsite'],
|
||||
Piwik::translate('General_Report'),
|
||||
$report['idreport'],
|
||||
$segmentName
|
||||
);
|
||||
|
||||
$additionalFile['cid'] = $processedReportMetadata['uniqueId'];
|
||||
|
||||
$additionalFile['content'] =
|
||||
ReportRenderer::getStaticGraph(
|
||||
$processedReportMetadata,
|
||||
Html::IMAGE_GRAPH_WIDTH,
|
||||
Html::IMAGE_GRAPH_HEIGHT,
|
||||
$processedReport['evolutionGraph'],
|
||||
$segment
|
||||
);
|
||||
|
||||
$additionalFile['mimeType'] = 'image/png';
|
||||
|
||||
$additionalFile['encoding'] = Zend_Mime::ENCODING_BASE64;
|
||||
|
||||
return $additionalFile;
|
||||
return $reportRenderer->getAttachments($report, $processedReports, $prettyDate);
|
||||
}
|
||||
|
||||
private function checkUserHasViewPermission($login, $idSite)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -8,7 +8,6 @@
|
|||
*/
|
||||
namespace Piwik\Plugins\ScheduledReports;
|
||||
|
||||
use Piwik\Common;
|
||||
use Piwik\Piwik;
|
||||
use Piwik\Plugins\LanguagesManager\LanguagesManager;
|
||||
use Piwik\Plugins\SegmentEditor\API as APISegmentEditor;
|
||||
|
|
@ -66,7 +65,7 @@ class Controller extends \Piwik\Plugin\Controller
|
|||
}
|
||||
}
|
||||
$view->reports = $reports;
|
||||
$view->reportsJSON = Common::json_encode($reportsById);
|
||||
$view->reportsJSON = json_encode($reportsById);
|
||||
|
||||
$view->downloadOutputType = API::OUTPUT_INLINE;
|
||||
|
||||
|
|
|
|||
76
www/analytics/plugins/ScheduledReports/Menu.php
Normal file
76
www/analytics/plugins/ScheduledReports/Menu.php
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*
|
||||
*/
|
||||
namespace Piwik\Plugins\ScheduledReports;
|
||||
|
||||
use Piwik\Menu\MenuUser;
|
||||
use Piwik\Piwik;
|
||||
use Piwik\Plugins\MobileMessaging\MobileMessaging;
|
||||
use Piwik\Plugins\MobileMessaging\API as APIMobileMessaging;
|
||||
|
||||
class Menu extends \Piwik\Plugin\Menu
|
||||
{
|
||||
const MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY = 'MobileMessaging_TopMenu';
|
||||
const PDF_REPORTS_TOP_MENU_TRANSLATION_KEY = 'ScheduledReports_EmailReports';
|
||||
|
||||
public function configureUserMenu(MenuUser $menu)
|
||||
{
|
||||
$tooltip = Piwik::translate(
|
||||
\Piwik\Plugin\Manager::getInstance()->isPluginActivated('MobileMessaging')
|
||||
? 'MobileMessaging_TopLinkTooltip' : 'ScheduledReports_TopLinkTooltip');
|
||||
|
||||
$menu->addPersonalItem(
|
||||
$this->getTopMenuTranslationKey(),
|
||||
$this->urlForAction('index', array('segment' => false)),
|
||||
7,
|
||||
$tooltip
|
||||
);
|
||||
}
|
||||
|
||||
function getTopMenuTranslationKey()
|
||||
{
|
||||
// if MobileMessaging is not activated, display 'Email reports'
|
||||
if (!\Piwik\Plugin\Manager::getInstance()->isPluginActivated('MobileMessaging'))
|
||||
return self::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY;
|
||||
|
||||
if (Piwik::isUserIsAnonymous()) {
|
||||
return self::MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY;
|
||||
}
|
||||
|
||||
try {
|
||||
$reports = API::getInstance()->getReports();
|
||||
$reportCount = count($reports);
|
||||
|
||||
// if there are no reports and the mobile account is
|
||||
// - not configured: display 'Email reports'
|
||||
// - configured: display 'Email & SMS reports'
|
||||
if ($reportCount == 0) {
|
||||
return APIMobileMessaging::getInstance()->areSMSAPICredentialProvided() ?
|
||||
self::MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY : self::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY;
|
||||
}
|
||||
} catch(\Exception $e) {
|
||||
return self::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY;
|
||||
}
|
||||
|
||||
$anyMobileReport = false;
|
||||
foreach ($reports as $report) {
|
||||
if ($report['type'] == MobileMessaging::MOBILE_TYPE) {
|
||||
$anyMobileReport = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// if there is at least one sms report, display 'Email & SMS reports'
|
||||
if ($anyMobileReport) {
|
||||
return self::MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY;
|
||||
}
|
||||
|
||||
return self::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY;
|
||||
}
|
||||
|
||||
}
|
||||
92
www/analytics/plugins/ScheduledReports/Model.php
Normal file
92
www/analytics/plugins/ScheduledReports/Model.php
Normal file
|
|
@ -0,0 +1,92 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*
|
||||
*/
|
||||
namespace Piwik\Plugins\ScheduledReports;
|
||||
|
||||
use Piwik\Common;
|
||||
use Piwik\Db;
|
||||
use Piwik\DbHelper;
|
||||
use Piwik\ReportRenderer;
|
||||
|
||||
class Model
|
||||
{
|
||||
private static $rawPrefix = 'report';
|
||||
private $table;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->table = Common::prefixTable(self::$rawPrefix);
|
||||
}
|
||||
|
||||
public function deleteUserReportForSite($userLogin, $idSite)
|
||||
{
|
||||
$query = 'DELETE FROM ' . $this->table . ' WHERE login = ? and idsite = ?';
|
||||
$bind = array($userLogin, $idSite);
|
||||
Db::query($query, $bind);
|
||||
}
|
||||
|
||||
public function deleteAllReportForUser($userLogin)
|
||||
{
|
||||
Db::query('DELETE FROM ' . $this->table . ' WHERE login = ?', $userLogin);
|
||||
}
|
||||
|
||||
public function updateReport($idReport, $report)
|
||||
{
|
||||
$idReport = (int) $idReport;
|
||||
|
||||
$this->getDb()->update($this->table, $report, "idreport = " . $idReport);
|
||||
}
|
||||
|
||||
public function createReport($report)
|
||||
{
|
||||
$nextId = $this->getNextReportId();
|
||||
$report['idreport'] = $nextId;
|
||||
|
||||
$this->getDb()->insert($this->table, $report);
|
||||
|
||||
return $nextId;
|
||||
}
|
||||
|
||||
private function getNextReportId()
|
||||
{
|
||||
$db = $this->getDb();
|
||||
$idReport = $db->fetchOne("SELECT max(idreport) + 1 FROM " . $this->table);
|
||||
|
||||
if ($idReport == false) {
|
||||
$idReport = 1;
|
||||
}
|
||||
|
||||
return $idReport;
|
||||
}
|
||||
|
||||
private function getDb()
|
||||
{
|
||||
return Db::get();
|
||||
}
|
||||
|
||||
public static function install()
|
||||
{
|
||||
$reportTable = "`idreport` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`idsite` INTEGER(11) NOT NULL,
|
||||
`login` VARCHAR(100) NOT NULL,
|
||||
`description` VARCHAR(255) NOT NULL,
|
||||
`idsegment` INT(11),
|
||||
`period` VARCHAR(10) NOT NULL,
|
||||
`hour` tinyint NOT NULL default 0,
|
||||
`type` VARCHAR(10) NOT NULL,
|
||||
`format` VARCHAR(10) NOT NULL,
|
||||
`reports` TEXT NOT NULL,
|
||||
`parameters` TEXT NULL,
|
||||
`ts_created` TIMESTAMP NULL,
|
||||
`ts_last_sent` TIMESTAMP NULL,
|
||||
`deleted` tinyint(4) NOT NULL default 0,
|
||||
PRIMARY KEY (`idreport`)";
|
||||
|
||||
DbHelper::createTable(self::$rawPrefix, $reportTable);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -9,32 +9,28 @@
|
|||
namespace Piwik\Plugins\ScheduledReports;
|
||||
|
||||
use Exception;
|
||||
use Piwik\Common;
|
||||
use Piwik\Config;
|
||||
use Piwik\Db;
|
||||
use Piwik\DbHelper;
|
||||
use Piwik\Log;
|
||||
use Piwik\Mail;
|
||||
use Piwik\Menu\MenuTop;
|
||||
use Piwik\Option;
|
||||
use Piwik\Period;
|
||||
use Piwik\Piwik;
|
||||
use Piwik\Plugins\CoreAdminHome\CustomLogo;
|
||||
use Piwik\Plugins\MobileMessaging\API as APIMobileMessaging;
|
||||
use Piwik\Plugins\MobileMessaging\MobileMessaging;
|
||||
use Piwik\Plugins\SegmentEditor\API as APISegmentEditor;
|
||||
use Piwik\Plugins\UsersManager\API as APIUsersManager;
|
||||
use Piwik\Plugins\UsersManager\Model as UserModel;
|
||||
use Piwik\ReportRenderer;
|
||||
use Piwik\ScheduledTask;
|
||||
use Piwik\ScheduledTime;
|
||||
use Piwik\Site;
|
||||
use Piwik\Scheduler\Schedule\Schedule;
|
||||
use Piwik\SettingsPiwik;
|
||||
use Piwik\Tracker;
|
||||
use Piwik\View;
|
||||
use Zend_Mime;
|
||||
use Piwik\Config;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ScheduledReports extends \Piwik\Plugin
|
||||
{
|
||||
const MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY = 'MobileMessaging_TopMenu';
|
||||
const PDF_REPORTS_TOP_MENU_TRANSLATION_KEY = 'ScheduledReports_EmailReports';
|
||||
|
||||
const DISPLAY_FORMAT_GRAPHS_ONLY_FOR_KEY_METRICS = 1; // Display Tables Only (Graphs only for key metrics)
|
||||
const DISPLAY_FORMAT_GRAPHS_ONLY = 2; // Display Graphs Only for all reports
|
||||
|
|
@ -55,32 +51,33 @@ class ScheduledReports extends \Piwik\Plugin
|
|||
|
||||
const EMAIL_TYPE = 'email';
|
||||
|
||||
static private $availableParameters = array(
|
||||
private static $availableParameters = array(
|
||||
self::EMAIL_ME_PARAMETER => false,
|
||||
self::EVOLUTION_GRAPH_PARAMETER => false,
|
||||
self::ADDITIONAL_EMAILS_PARAMETER => false,
|
||||
self::DISPLAY_FORMAT_PARAMETER => true,
|
||||
);
|
||||
|
||||
static private $managedReportTypes = array(
|
||||
self::EMAIL_TYPE => 'plugins/Zeitgeist/images/email.png'
|
||||
private static $managedReportTypes = array(
|
||||
self::EMAIL_TYPE => 'plugins/Morpheus/images/email.png'
|
||||
);
|
||||
|
||||
static private $managedReportFormats = array(
|
||||
ReportRenderer::HTML_FORMAT => 'plugins/Zeitgeist/images/html_icon.png',
|
||||
ReportRenderer::PDF_FORMAT => 'plugins/UserSettings/images/plugins/pdf.gif',
|
||||
private static $managedReportFormats = array(
|
||||
ReportRenderer::HTML_FORMAT => 'plugins/Morpheus/images/html_icon.png',
|
||||
ReportRenderer::PDF_FORMAT => 'plugins/DevicePlugins/images/plugins/pdf.gif',
|
||||
ReportRenderer::CSV_FORMAT => 'plugins/Morpheus/images/export.png',
|
||||
);
|
||||
|
||||
const OPTION_KEY_LAST_SENT_DATERANGE = 'report_last_sent_daterange_';
|
||||
|
||||
/**
|
||||
* @see Piwik\Plugin::getListHooksRegistered
|
||||
* @see Piwik\Plugin::registerEvents
|
||||
*/
|
||||
public function getListHooksRegistered()
|
||||
public function registerEvents()
|
||||
{
|
||||
return array(
|
||||
'Menu.Top.addItems' => 'addTopMenu',
|
||||
'TaskScheduler.getScheduledTasks' => 'getScheduledTasks',
|
||||
'AssetManager.getJavaScriptFiles' => 'getJsFiles',
|
||||
'AssetManager.getStylesheetFiles' => 'getStylesheetFiles',
|
||||
'MobileMessaging.deletePhoneNumber' => 'deletePhoneNumber',
|
||||
'ScheduledReports.getReportParameters' => 'getReportParameters',
|
||||
'ScheduledReports.validateReportParameters' => 'validateReportParameters',
|
||||
|
|
@ -94,12 +91,22 @@ class ScheduledReports extends \Piwik\Plugin
|
|||
'ScheduledReports.sendReport' => 'sendReport',
|
||||
'Template.reportParametersScheduledReports' => 'template_reportParametersScheduledReports',
|
||||
'UsersManager.deleteUser' => 'deleteUserReport',
|
||||
'UsersManager.removeSiteAccess' => 'deleteUserReportForSites',
|
||||
'SitesManager.deleteSite.end' => 'deleteSiteReport',
|
||||
APISegmentEditor::DEACTIVATE_SEGMENT_EVENT => 'segmentDeactivation',
|
||||
'SegmentEditor.deactivate' => 'segmentDeactivation',
|
||||
'SegmentEditor.update' => 'segmentUpdated',
|
||||
'Translate.getClientSideTranslationKeys' => 'getClientSideTranslationKeys',
|
||||
'Request.getRenamedModuleAndAction' => 'renameDeprecatedModuleAndAction',
|
||||
);
|
||||
}
|
||||
|
||||
public function renameDeprecatedModuleAndAction(&$module, &$action)
|
||||
{
|
||||
if($module == 'PDFReports') {
|
||||
$module = 'ScheduledReports';
|
||||
}
|
||||
}
|
||||
|
||||
public function getClientSideTranslationKeys(&$translationKeys)
|
||||
{
|
||||
$translationKeys[] = "ScheduledReports_ReportSent";
|
||||
|
|
@ -124,66 +131,77 @@ class ScheduledReports extends \Piwik\Plugin
|
|||
$jsFiles[] = "plugins/ScheduledReports/javascripts/pdf.js";
|
||||
}
|
||||
|
||||
public function getStylesheetFiles(&$stylesheets)
|
||||
{
|
||||
$stylesheets[] = 'plugins/ScheduledReports/stylesheets/scheduledreports.less';
|
||||
}
|
||||
|
||||
public function validateReportParameters(&$parameters, $reportType)
|
||||
{
|
||||
if (self::manageEvent($reportType)) {
|
||||
$reportFormat = $parameters[self::DISPLAY_FORMAT_PARAMETER];
|
||||
$availableDisplayFormats = array_keys(self::getDisplayFormats());
|
||||
if (!in_array($reportFormat, $availableDisplayFormats)) {
|
||||
throw new Exception(
|
||||
Piwik::translate(
|
||||
// General_ExceptionInvalidAggregateReportsFormat should be named General_ExceptionInvalidDisplayFormat
|
||||
'General_ExceptionInvalidAggregateReportsFormat',
|
||||
array($reportFormat, implode(', ', $availableDisplayFormats))
|
||||
)
|
||||
);
|
||||
}
|
||||
if (! self::manageEvent($reportType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// emailMe is an optional parameter
|
||||
if (!isset($parameters[self::EMAIL_ME_PARAMETER])) {
|
||||
$parameters[self::EMAIL_ME_PARAMETER] = self::EMAIL_ME_PARAMETER_DEFAULT_VALUE;
|
||||
} else {
|
||||
$parameters[self::EMAIL_ME_PARAMETER] = self::valueIsTrue($parameters[self::EMAIL_ME_PARAMETER]);
|
||||
}
|
||||
$reportFormat = $parameters[self::DISPLAY_FORMAT_PARAMETER];
|
||||
$availableDisplayFormats = array_keys(self::getDisplayFormats());
|
||||
if (!in_array($reportFormat, $availableDisplayFormats)) {
|
||||
throw new Exception(
|
||||
Piwik::translate(
|
||||
// General_ExceptionInvalidAggregateReportsFormat should be named General_ExceptionInvalidDisplayFormat
|
||||
'General_ExceptionInvalidAggregateReportsFormat',
|
||||
array($reportFormat, implode(', ', $availableDisplayFormats))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// evolutionGraph is an optional parameter
|
||||
if (!isset($parameters[self::EVOLUTION_GRAPH_PARAMETER])) {
|
||||
$parameters[self::EVOLUTION_GRAPH_PARAMETER] = self::EVOLUTION_GRAPH_PARAMETER_DEFAULT_VALUE;
|
||||
} else {
|
||||
$parameters[self::EVOLUTION_GRAPH_PARAMETER] = self::valueIsTrue($parameters[self::EVOLUTION_GRAPH_PARAMETER]);
|
||||
}
|
||||
// emailMe is an optional parameter
|
||||
if (!isset($parameters[self::EMAIL_ME_PARAMETER])) {
|
||||
$parameters[self::EMAIL_ME_PARAMETER] = self::EMAIL_ME_PARAMETER_DEFAULT_VALUE;
|
||||
} else {
|
||||
$parameters[self::EMAIL_ME_PARAMETER] = self::valueIsTrue($parameters[self::EMAIL_ME_PARAMETER]);
|
||||
}
|
||||
|
||||
// additionalEmails is an optional parameter
|
||||
if (isset($parameters[self::ADDITIONAL_EMAILS_PARAMETER])) {
|
||||
$parameters[self::ADDITIONAL_EMAILS_PARAMETER] = self::checkAdditionalEmails($parameters[self::ADDITIONAL_EMAILS_PARAMETER]);
|
||||
}
|
||||
// evolutionGraph is an optional parameter
|
||||
if (!isset($parameters[self::EVOLUTION_GRAPH_PARAMETER])) {
|
||||
$parameters[self::EVOLUTION_GRAPH_PARAMETER] = self::EVOLUTION_GRAPH_PARAMETER_DEFAULT_VALUE;
|
||||
} else {
|
||||
$parameters[self::EVOLUTION_GRAPH_PARAMETER] = self::valueIsTrue($parameters[self::EVOLUTION_GRAPH_PARAMETER]);
|
||||
}
|
||||
|
||||
// additionalEmails is an optional parameter
|
||||
if (isset($parameters[self::ADDITIONAL_EMAILS_PARAMETER])) {
|
||||
$parameters[self::ADDITIONAL_EMAILS_PARAMETER] = self::checkAdditionalEmails($parameters[self::ADDITIONAL_EMAILS_PARAMETER]);
|
||||
}
|
||||
}
|
||||
|
||||
// based on http://www.php.net/manual/en/filter.filters.validate.php -> FILTER_VALIDATE_BOOLEAN
|
||||
static private function valueIsTrue($value)
|
||||
private static function valueIsTrue($value)
|
||||
{
|
||||
return $value == 'true' || $value == 1 || $value == '1' || $value === true;
|
||||
}
|
||||
|
||||
public function getReportMetadata(&$reportMetadata, $reportType, $idSite)
|
||||
{
|
||||
if (self::manageEvent($reportType)) {
|
||||
$availableReportMetadata = \Piwik\Plugins\API\API::getInstance()->getReportMetadata($idSite);
|
||||
if (! self::manageEvent($reportType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$filteredReportMetadata = array();
|
||||
foreach ($availableReportMetadata as $reportMetadata) {
|
||||
// removing reports from the API category and MultiSites.getOne
|
||||
if (
|
||||
$reportMetadata['category'] == 'API' ||
|
||||
$reportMetadata['category'] == Piwik::translate('General_MultiSitesSummary') && $reportMetadata['name'] == Piwik::translate('General_SingleWebsitesDashboard')
|
||||
) continue;
|
||||
$availableReportMetadata = \Piwik\Plugins\API\API::getInstance()->getReportMetadata($idSite);
|
||||
|
||||
$filteredReportMetadata[] = $reportMetadata;
|
||||
$filteredReportMetadata = array();
|
||||
foreach ($availableReportMetadata as $reportMetadata) {
|
||||
// removing reports from the API category and MultiSites.getOne
|
||||
if (
|
||||
$reportMetadata['category'] == 'API' ||
|
||||
$reportMetadata['category'] == Piwik::translate('General_MultiSitesSummary') && $reportMetadata['name'] == Piwik::translate('General_SingleWebsitesDashboard')
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$reportMetadata = $filteredReportMetadata;
|
||||
$filteredReportMetadata[] = $reportMetadata;
|
||||
}
|
||||
|
||||
$reportMetadata = $filteredReportMetadata;
|
||||
}
|
||||
|
||||
public function getReportTypes(&$reportTypes)
|
||||
|
|
@ -207,53 +225,57 @@ class ScheduledReports extends \Piwik\Plugin
|
|||
|
||||
public function processReports(&$processedReports, $reportType, $outputType, $report)
|
||||
{
|
||||
if (self::manageEvent($reportType)) {
|
||||
$displayFormat = $report['parameters'][self::DISPLAY_FORMAT_PARAMETER];
|
||||
$evolutionGraph = $report['parameters'][self::EVOLUTION_GRAPH_PARAMETER];
|
||||
if (! self::manageEvent($reportType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($processedReports as &$processedReport) {
|
||||
$metadata = $processedReport['metadata'];
|
||||
$displayFormat = $report['parameters'][self::DISPLAY_FORMAT_PARAMETER];
|
||||
$evolutionGraph = $report['parameters'][self::EVOLUTION_GRAPH_PARAMETER];
|
||||
|
||||
$isAggregateReport = !empty($metadata['dimension']);
|
||||
foreach ($processedReports as &$processedReport) {
|
||||
$metadata = $processedReport['metadata'];
|
||||
|
||||
$processedReport['displayTable'] = $displayFormat != self::DISPLAY_FORMAT_GRAPHS_ONLY;
|
||||
$isAggregateReport = !empty($metadata['dimension']);
|
||||
|
||||
$processedReport['displayGraph'] =
|
||||
($isAggregateReport ?
|
||||
$displayFormat == self::DISPLAY_FORMAT_GRAPHS_ONLY || $displayFormat == self::DISPLAY_FORMAT_TABLES_AND_GRAPHS
|
||||
:
|
||||
$displayFormat != self::DISPLAY_FORMAT_TABLES_ONLY)
|
||||
&& \Piwik\SettingsServer::isGdExtensionEnabled()
|
||||
&& \Piwik\Plugin\Manager::getInstance()->isPluginActivated('ImageGraph')
|
||||
&& !empty($metadata['imageGraphUrl']);
|
||||
$processedReport['displayTable'] = $displayFormat != self::DISPLAY_FORMAT_GRAPHS_ONLY;
|
||||
|
||||
$processedReport['evolutionGraph'] = $evolutionGraph;
|
||||
$processedReport['displayGraph'] =
|
||||
($isAggregateReport ?
|
||||
$displayFormat == self::DISPLAY_FORMAT_GRAPHS_ONLY || $displayFormat == self::DISPLAY_FORMAT_TABLES_AND_GRAPHS
|
||||
:
|
||||
$displayFormat != self::DISPLAY_FORMAT_TABLES_ONLY)
|
||||
&& \Piwik\SettingsServer::isGdExtensionEnabled()
|
||||
&& \Piwik\Plugin\Manager::getInstance()->isPluginActivated('ImageGraph')
|
||||
&& !empty($metadata['imageGraphUrl']);
|
||||
|
||||
// remove evolution metrics from MultiSites.getAll
|
||||
if ($metadata['module'] == 'MultiSites') {
|
||||
$columns = $processedReport['columns'];
|
||||
$processedReport['evolutionGraph'] = $evolutionGraph;
|
||||
|
||||
foreach (\Piwik\Plugins\MultiSites\API::getApiMetrics($enhanced = true) as $metricSettings) {
|
||||
unset($columns[$metricSettings[\Piwik\Plugins\MultiSites\API::METRIC_EVOLUTION_COL_NAME_KEY]]);
|
||||
}
|
||||
// remove evolution metrics from MultiSites.getAll
|
||||
if ($metadata['module'] == 'MultiSites') {
|
||||
$columns = $processedReport['columns'];
|
||||
|
||||
$processedReport['metadata'] = $metadata;
|
||||
$processedReport['columns'] = $columns;
|
||||
foreach (\Piwik\Plugins\MultiSites\API::getApiMetrics($enhanced = true) as $metricSettings) {
|
||||
unset($columns[$metricSettings[\Piwik\Plugins\MultiSites\API::METRIC_EVOLUTION_COL_NAME_KEY]]);
|
||||
}
|
||||
|
||||
$processedReport['metadata'] = $metadata;
|
||||
$processedReport['columns'] = $columns;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getRendererInstance(&$reportRenderer, $reportType, $outputType, $report)
|
||||
{
|
||||
if (self::manageEvent($reportType)) {
|
||||
$reportFormat = $report['format'];
|
||||
if (! self::manageEvent($reportType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$reportRenderer = ReportRenderer::factory($reportFormat);
|
||||
$reportFormat = $report['format'];
|
||||
|
||||
if ($reportFormat == ReportRenderer::HTML_FORMAT) {
|
||||
$reportRenderer->setRenderImageInline($outputType != API::OUTPUT_SAVE_ON_DISK);
|
||||
}
|
||||
$reportRenderer = ReportRenderer::factory($reportFormat);
|
||||
|
||||
if ($reportFormat == ReportRenderer::HTML_FORMAT) {
|
||||
$reportRenderer->setRenderImageInline($outputType != API::OUTPUT_SAVE_ON_DISK);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -265,132 +287,159 @@ class ScheduledReports extends \Piwik\Plugin
|
|||
}
|
||||
|
||||
public function sendReport($reportType, $report, $contents, $filename, $prettyDate, $reportSubject, $reportTitle,
|
||||
$additionalFiles)
|
||||
$additionalFiles, Period $period = null, $force)
|
||||
{
|
||||
if (self::manageEvent($reportType)) {
|
||||
$periods = self::getPeriodToFrequencyAsAdjective();
|
||||
$message = Piwik::translate('ScheduledReports_EmailHello');
|
||||
$subject = Piwik::translate('General_Report') . ' ' . $reportTitle . " - " . $prettyDate;
|
||||
if (! self::manageEvent($reportType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$mail = new Mail();
|
||||
$mail->setDefaultFromPiwik();
|
||||
$mail->setSubject($subject);
|
||||
$attachmentName = $subject;
|
||||
// Safeguard against sending the same report twice to the same email (unless $force is true)
|
||||
if (!$force && $this->reportAlreadySent($report, $period)) {
|
||||
Log::warning(
|
||||
'Preventing the same scheduled report from being sent again (report #%s for period "%s")',
|
||||
$report['idreport'],
|
||||
$prettyDate
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$displaySegmentInfo = false;
|
||||
$segmentInfo = null;
|
||||
$segment = API::getSegment($report['idsegment']);
|
||||
if ($segment != null) {
|
||||
$displaySegmentInfo = true;
|
||||
$segmentInfo = Piwik::translate('ScheduledReports_SegmentAppliedToReports', $segment['name']);
|
||||
}
|
||||
$periods = self::getPeriodToFrequencyAsAdjective();
|
||||
$message = Piwik::translate('ScheduledReports_EmailHello');
|
||||
$subject = Piwik::translate('General_Report') . ' ' . $reportTitle . " - " . $prettyDate;
|
||||
|
||||
switch ($report['format']) {
|
||||
case 'html':
|
||||
$mail = new Mail();
|
||||
$mail->setDefaultFromPiwik();
|
||||
$mail->setSubject($subject);
|
||||
$attachmentName = $subject;
|
||||
|
||||
// Needed when using images as attachment with cid
|
||||
$mail->setType(Zend_Mime::MULTIPART_RELATED);
|
||||
$message .= "<br/>" . Piwik::translate('ScheduledReports_PleaseFindBelow', array($periods[$report['period']], $reportTitle));
|
||||
$this->setReplyToAsSender($mail, $report);
|
||||
|
||||
if ($displaySegmentInfo) {
|
||||
$message .= " " . $segmentInfo;
|
||||
}
|
||||
$displaySegmentInfo = false;
|
||||
$segmentInfo = null;
|
||||
$segment = API::getSegment($report['idsegment']);
|
||||
if ($segment != null) {
|
||||
$displaySegmentInfo = true;
|
||||
$segmentInfo = Piwik::translate('ScheduledReports_SegmentAppliedToReports', $segment['name']);
|
||||
}
|
||||
|
||||
$mail->setBodyHtml($message . "<br/><br/>" . $contents);
|
||||
break;
|
||||
$messageFindAttached = Piwik::translate('ScheduledReports_PleaseFindAttachedFile', array($periods[$report['period']], $reportTitle));
|
||||
$messageFindBelow = Piwik::translate('ScheduledReports_PleaseFindBelow', array($periods[$report['period']], $reportTitle));
|
||||
$messageSentFrom = '';
|
||||
|
||||
$piwikUrl = SettingsPiwik::getPiwikUrl();
|
||||
if (!empty($piwikUrl)) {
|
||||
$messageSentFrom = Piwik::translate('ScheduledReports_SentFromX', $piwikUrl);
|
||||
}
|
||||
|
||||
case 'csv':
|
||||
$message .= "\n" . Piwik::translate('ScheduledReports_PleaseFindAttachedFile', array($periods[$report['period']], $reportTitle));
|
||||
switch ($report['format']) {
|
||||
case 'html':
|
||||
|
||||
if ($displaySegmentInfo) {
|
||||
$message .= " " . $segmentInfo;
|
||||
}
|
||||
// Needed when using images as attachment with cid
|
||||
$mail->setType(Zend_Mime::MULTIPART_RELATED);
|
||||
$message .= "<br/>$messageFindBelow<br/>$messageSentFrom";
|
||||
|
||||
$mail->setBodyText($message);
|
||||
$mail->createAttachment(
|
||||
$contents,
|
||||
'application/csv',
|
||||
Zend_Mime::DISPOSITION_INLINE,
|
||||
Zend_Mime::ENCODING_BASE64,
|
||||
$attachmentName . '.csv'
|
||||
);
|
||||
break;
|
||||
if ($displaySegmentInfo) {
|
||||
$message .= " " . $segmentInfo;
|
||||
}
|
||||
|
||||
default:
|
||||
case 'pdf':
|
||||
$message .= "\n" . Piwik::translate('ScheduledReports_PleaseFindAttachedFile', array($periods[$report['period']], $reportTitle));
|
||||
$mail->setBodyHtml($message . "<br/><br/>" . $contents);
|
||||
break;
|
||||
|
||||
if ($displaySegmentInfo) {
|
||||
$message .= " " . $segmentInfo;
|
||||
}
|
||||
case 'csv':
|
||||
$message .= "\n$messageFindAttached\n$messageSentFrom";
|
||||
|
||||
$mail->setBodyText($message);
|
||||
$mail->createAttachment(
|
||||
$contents,
|
||||
'application/pdf',
|
||||
Zend_Mime::DISPOSITION_INLINE,
|
||||
Zend_Mime::ENCODING_BASE64,
|
||||
$attachmentName . '.pdf'
|
||||
);
|
||||
break;
|
||||
}
|
||||
if ($displaySegmentInfo) {
|
||||
$message .= " " . $segmentInfo;
|
||||
}
|
||||
|
||||
foreach ($additionalFiles as $additionalFile) {
|
||||
$fileContent = $additionalFile['content'];
|
||||
$at = $mail->createAttachment(
|
||||
$fileContent,
|
||||
$additionalFile['mimeType'],
|
||||
$mail->setBodyText($message);
|
||||
$mail->createAttachment(
|
||||
$contents,
|
||||
'application/csv',
|
||||
Zend_Mime::DISPOSITION_INLINE,
|
||||
$additionalFile['encoding'],
|
||||
$additionalFile['filename']
|
||||
Zend_Mime::ENCODING_BASE64,
|
||||
$attachmentName . '.csv'
|
||||
);
|
||||
$at->id = $additionalFile['cid'];
|
||||
break;
|
||||
|
||||
unset($fileContent);
|
||||
}
|
||||
default:
|
||||
case 'pdf':
|
||||
$message .= "\n$messageFindAttached\n$messageSentFrom";
|
||||
|
||||
// Get user emails and languages
|
||||
$reportParameters = $report['parameters'];
|
||||
$emails = array();
|
||||
|
||||
if (isset($reportParameters[self::ADDITIONAL_EMAILS_PARAMETER])) {
|
||||
$emails = $reportParameters[self::ADDITIONAL_EMAILS_PARAMETER];
|
||||
}
|
||||
|
||||
if ($reportParameters[self::EMAIL_ME_PARAMETER] == 1) {
|
||||
if (Piwik::getCurrentUserLogin() == $report['login']) {
|
||||
$emails[] = Piwik::getCurrentUserEmail();
|
||||
} else {
|
||||
try {
|
||||
$user = APIUsersManager::getInstance()->getUser($report['login']);
|
||||
} catch (Exception $e) {
|
||||
return;
|
||||
}
|
||||
$emails[] = $user['email'];
|
||||
if ($displaySegmentInfo) {
|
||||
$message .= " " . $segmentInfo;
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($emails as $email) {
|
||||
if (empty($email)) {
|
||||
continue;
|
||||
}
|
||||
$mail->addTo($email);
|
||||
$mail->setBodyText($message);
|
||||
$mail->createAttachment(
|
||||
$contents,
|
||||
'application/pdf',
|
||||
Zend_Mime::DISPOSITION_INLINE,
|
||||
Zend_Mime::ENCODING_BASE64,
|
||||
$attachmentName . '.pdf'
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
foreach ($additionalFiles as $additionalFile) {
|
||||
$fileContent = $additionalFile['content'];
|
||||
$at = $mail->createAttachment(
|
||||
$fileContent,
|
||||
$additionalFile['mimeType'],
|
||||
Zend_Mime::DISPOSITION_INLINE,
|
||||
$additionalFile['encoding'],
|
||||
$additionalFile['filename']
|
||||
);
|
||||
$at->id = $additionalFile['cid'];
|
||||
|
||||
unset($fileContent);
|
||||
}
|
||||
|
||||
// Get user emails and languages
|
||||
$reportParameters = $report['parameters'];
|
||||
$emails = array();
|
||||
|
||||
if (isset($reportParameters[self::ADDITIONAL_EMAILS_PARAMETER])) {
|
||||
$emails = $reportParameters[self::ADDITIONAL_EMAILS_PARAMETER];
|
||||
}
|
||||
|
||||
if ($reportParameters[self::EMAIL_ME_PARAMETER] == 1) {
|
||||
if (Piwik::getCurrentUserLogin() == $report['login']) {
|
||||
$emails[] = Piwik::getCurrentUserEmail();
|
||||
} else {
|
||||
try {
|
||||
$mail->send();
|
||||
$user = APIUsersManager::getInstance()->getUser($report['login']);
|
||||
} catch (Exception $e) {
|
||||
|
||||
// If running from piwik.php with debug, we ignore the 'email not sent' error
|
||||
if (!isset($GLOBALS['PIWIK_TRACKER_DEBUG']) || !$GLOBALS['PIWIK_TRACKER_DEBUG']) {
|
||||
throw new Exception("An error occured while sending '$filename' " .
|
||||
" to " . implode(', ', $mail->getRecipients()) .
|
||||
". Error was '" . $e->getMessage() . "'");
|
||||
}
|
||||
return;
|
||||
}
|
||||
$mail->clearRecipients();
|
||||
$emails[] = $user['email'];
|
||||
}
|
||||
}
|
||||
|
||||
if (! $force) {
|
||||
$this->markReportAsSent($report, $period);
|
||||
}
|
||||
|
||||
foreach ($emails as $email) {
|
||||
if (empty($email)) {
|
||||
continue;
|
||||
}
|
||||
$mail->addTo($email);
|
||||
|
||||
try {
|
||||
$mail->send();
|
||||
} catch (Exception $e) {
|
||||
|
||||
// If running from piwik.php with debug, we ignore the 'email not sent' error
|
||||
$tracker = new Tracker();
|
||||
if (!$tracker->isDebugModeEnabled()) {
|
||||
throw new Exception("An error occured while sending '$filename' " .
|
||||
" to " . implode(', ', $mail->getRecipients()) .
|
||||
". Error was '" . $e->getMessage() . "'");
|
||||
}
|
||||
}
|
||||
$mail->clearRecipients();
|
||||
}
|
||||
}
|
||||
|
||||
public function deletePhoneNumber($phoneNumber)
|
||||
|
|
@ -437,23 +486,25 @@ class ScheduledReports extends \Piwik\Plugin
|
|||
|
||||
public function getReportRecipients(&$recipients, $reportType, $report)
|
||||
{
|
||||
if (self::manageEvent($reportType)) {
|
||||
$parameters = $report['parameters'];
|
||||
$eMailMe = $parameters[self::EMAIL_ME_PARAMETER];
|
||||
|
||||
if ($eMailMe) {
|
||||
$recipients[] = Piwik::getCurrentUserEmail();
|
||||
}
|
||||
|
||||
if (isset($parameters[self::ADDITIONAL_EMAILS_PARAMETER])) {
|
||||
$additionalEMails = $parameters[self::ADDITIONAL_EMAILS_PARAMETER];
|
||||
$recipients = array_merge($recipients, $additionalEMails);
|
||||
}
|
||||
$recipients = array_filter($recipients);
|
||||
if (! self::manageEvent($reportType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$parameters = $report['parameters'];
|
||||
$eMailMe = $parameters[self::EMAIL_ME_PARAMETER];
|
||||
|
||||
if ($eMailMe) {
|
||||
$recipients[] = Piwik::getCurrentUserEmail();
|
||||
}
|
||||
|
||||
if (isset($parameters[self::ADDITIONAL_EMAILS_PARAMETER])) {
|
||||
$additionalEMails = $parameters[self::ADDITIONAL_EMAILS_PARAMETER];
|
||||
$recipients = array_merge($recipients, $additionalEMails);
|
||||
}
|
||||
$recipients = array_values(array_filter($recipients));
|
||||
}
|
||||
|
||||
static public function template_reportParametersScheduledReports(&$out)
|
||||
public static function template_reportParametersScheduledReports(&$out)
|
||||
{
|
||||
$view = new View('@ScheduledReports/reportParametersScheduledReports');
|
||||
$view->currentUserEmail = Piwik::getCurrentUserEmail();
|
||||
|
|
@ -469,118 +520,92 @@ class ScheduledReports extends \Piwik\Plugin
|
|||
return in_array($reportType, array_keys(self::$managedReportTypes));
|
||||
}
|
||||
|
||||
public function getScheduledTasks(&$tasks)
|
||||
public function segmentUpdated($idSegment, $updatedSegment)
|
||||
{
|
||||
foreach (API::getInstance()->getReports() as $report) {
|
||||
if (!$report['deleted'] && $report['period'] != ScheduledTime::PERIOD_NEVER) {
|
||||
$reportsUsingSegment = API::getInstance()->getReports(false, false, false, false, $idSegment);
|
||||
|
||||
$timezone = Site::getTimezoneFor($report['idsite']);
|
||||
$reportsNeedSegment = array();
|
||||
|
||||
$schedule = ScheduledTime::getScheduledTimeForPeriod($report['period']);
|
||||
$schedule->setHour($report['hour']);
|
||||
$schedule->setTimezone($timezone);
|
||||
$tasks[] = new ScheduledTask (
|
||||
API::getInstance(),
|
||||
'sendReport',
|
||||
$report['idreport'], $schedule
|
||||
);
|
||||
if (!$updatedSegment['enable_all_users']) {
|
||||
// which reports would become invisible to other users?
|
||||
foreach($reportsUsingSegment as $report) {
|
||||
if ($report['login'] == Piwik::getCurrentUserLogin()) {
|
||||
continue;
|
||||
}
|
||||
$reportsNeedSegment[] = $report;
|
||||
}
|
||||
}
|
||||
|
||||
if ($updatedSegment['enable_only_idsite']) {
|
||||
// which reports from other websites are set to use this segment restricted to one website?
|
||||
foreach($reportsUsingSegment as $report) {
|
||||
if ($report['idsite'] == $updatedSegment['enable_only_idsite']) {
|
||||
continue;
|
||||
}
|
||||
$reportsNeedSegment[] = $report;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($reportsNeedSegment)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->throwExceptionReportsAreUsingSegment($reportsNeedSegment);
|
||||
}
|
||||
|
||||
public function segmentDeactivation($idSegment)
|
||||
{
|
||||
$reportsUsingSegment = API::getInstance()->getReports(false, false, false, false, $idSegment);
|
||||
|
||||
if (count($reportsUsingSegment) > 0) {
|
||||
|
||||
$reportList = '';
|
||||
$reportNameJoinText = ' ' . Piwik::translate('General_And') . ' ';
|
||||
foreach ($reportsUsingSegment as $report) {
|
||||
$reportList .= '\'' . $report['description'] . '\'' . $reportNameJoinText;
|
||||
}
|
||||
$reportList = rtrim($reportList, $reportNameJoinText);
|
||||
|
||||
$errorMessage = Piwik::translate('ScheduledReports_Segment_Deletion_Error', $reportList);
|
||||
throw new Exception($errorMessage);
|
||||
if (empty($reportsUsingSegment)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->throwExceptionReportsAreUsingSegment($reportsUsingSegment);
|
||||
}
|
||||
|
||||
function addTopMenu()
|
||||
/**
|
||||
* @param $reportsUsingSegment
|
||||
* @throws \Exception
|
||||
*/
|
||||
protected function throwExceptionReportsAreUsingSegment($reportsUsingSegment)
|
||||
{
|
||||
MenuTop::addEntry(
|
||||
$this->getTopMenuTranslationKey(),
|
||||
array('module' => 'ScheduledReports', 'action' => 'index', 'segment' => false),
|
||||
true,
|
||||
13,
|
||||
$isHTML = false,
|
||||
$tooltip = Piwik::translate(
|
||||
\Piwik\Plugin\Manager::getInstance()->isPluginActivated('MobileMessaging')
|
||||
? 'MobileMessaging_TopLinkTooltip' : 'ScheduledReports_TopLinkTooltip'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function getTopMenuTranslationKey()
|
||||
{
|
||||
// if MobileMessaging is not activated, display 'Email reports'
|
||||
if (!\Piwik\Plugin\Manager::getInstance()->isPluginActivated('MobileMessaging'))
|
||||
return self::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY;
|
||||
|
||||
if (Piwik::isUserIsAnonymous()) {
|
||||
return self::MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY;
|
||||
$reportList = '';
|
||||
$reportNameJoinText = ' ' . Piwik::translate('General_And') . ' ';
|
||||
foreach ($reportsUsingSegment as $report) {
|
||||
$reportList .= '\'' . $report['description'] . '\'' . $reportNameJoinText;
|
||||
}
|
||||
$reportList = rtrim($reportList, $reportNameJoinText);
|
||||
|
||||
$reports = API::getInstance()->getReports();
|
||||
$reportCount = count($reports);
|
||||
|
||||
// if there are no reports and the mobile account is
|
||||
// not configured, display 'Email reports'
|
||||
// configured, display 'Email & SMS reports'
|
||||
if ($reportCount == 0)
|
||||
return APIMobileMessaging::getInstance()->areSMSAPICredentialProvided() ?
|
||||
self::MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY : self::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY;
|
||||
|
||||
$anyMobileReport = false;
|
||||
foreach ($reports as $report) {
|
||||
if ($report['type'] == MobileMessaging::MOBILE_TYPE) {
|
||||
$anyMobileReport = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// if there is at least one sms report, display 'Email & SMS reports'
|
||||
if ($anyMobileReport) {
|
||||
return self::MOBILE_MESSAGING_TOP_MENU_TRANSLATION_KEY;
|
||||
}
|
||||
|
||||
return self::PDF_REPORTS_TOP_MENU_TRANSLATION_KEY;
|
||||
$errorMessage = Piwik::translate('ScheduledReports_Segment_Deletion_Error', $reportList);
|
||||
throw new Exception($errorMessage);
|
||||
}
|
||||
|
||||
public function deleteUserReport($userLogin)
|
||||
{
|
||||
Db::query('DELETE FROM ' . Common::prefixTable('report') . ' WHERE login = ?', $userLogin);
|
||||
$this->getModel()->deleteAllReportForUser($userLogin);
|
||||
}
|
||||
|
||||
public function deleteUserReportForSites($userLogin, $idSites)
|
||||
{
|
||||
if (empty($idSites) || empty($userLogin)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$model = $this->getModel();
|
||||
|
||||
foreach ($idSites as $idSite) {
|
||||
$model->deleteUserReportForSite($userLogin, $idSite);
|
||||
}
|
||||
}
|
||||
|
||||
private function getModel()
|
||||
{
|
||||
return new Model();
|
||||
}
|
||||
|
||||
public function install()
|
||||
{
|
||||
$reportTable = "`idreport` INT(11) NOT NULL AUTO_INCREMENT,
|
||||
`idsite` INTEGER(11) NOT NULL,
|
||||
`login` VARCHAR(100) NOT NULL,
|
||||
`description` VARCHAR(255) NOT NULL,
|
||||
`idsegment` INT(11),
|
||||
`period` VARCHAR(10) NOT NULL,
|
||||
`hour` tinyint NOT NULL default 0,
|
||||
`type` VARCHAR(10) NOT NULL,
|
||||
`format` VARCHAR(10) NOT NULL,
|
||||
`reports` TEXT NOT NULL,
|
||||
`parameters` TEXT NULL,
|
||||
`ts_created` TIMESTAMP NULL,
|
||||
`ts_last_sent` TIMESTAMP NULL,
|
||||
`deleted` tinyint(4) NOT NULL default 0,
|
||||
PRIMARY KEY (`idreport`)";
|
||||
|
||||
DbHelper::createTable('report', $reportTable);
|
||||
Model::install();
|
||||
}
|
||||
|
||||
private static function checkAdditionalEmails($additionalEmails)
|
||||
|
|
@ -593,7 +618,7 @@ class ScheduledReports extends \Piwik\Plugin
|
|||
throw new Exception(Piwik::translate('UsersManager_ExceptionInvalidEmail') . ' (' . $email . ')');
|
||||
}
|
||||
}
|
||||
$additionalEmails = array_filter($additionalEmails);
|
||||
$additionalEmails = array_values(array_filter($additionalEmails));
|
||||
return $additionalEmails;
|
||||
}
|
||||
|
||||
|
|
@ -615,13 +640,13 @@ class ScheduledReports extends \Piwik\Plugin
|
|||
* Used in the Report Listing
|
||||
* @ignore
|
||||
*/
|
||||
static public function getPeriodToFrequency()
|
||||
public static function getPeriodToFrequency()
|
||||
{
|
||||
return array(
|
||||
ScheduledTime::PERIOD_NEVER => Piwik::translate('General_Never'),
|
||||
ScheduledTime::PERIOD_DAY => Piwik::translate('General_Daily'),
|
||||
ScheduledTime::PERIOD_WEEK => Piwik::translate('General_Weekly'),
|
||||
ScheduledTime::PERIOD_MONTH => Piwik::translate('General_Monthly'),
|
||||
Schedule::PERIOD_NEVER => Piwik::translate('General_Never'),
|
||||
Schedule::PERIOD_DAY => Piwik::translate('General_Daily'),
|
||||
Schedule::PERIOD_WEEK => Piwik::translate('General_Weekly'),
|
||||
Schedule::PERIOD_MONTH => Piwik::translate('General_Monthly'),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -629,14 +654,42 @@ class ScheduledReports extends \Piwik\Plugin
|
|||
* Used in the Report's email content, ie "monthly report"
|
||||
* @ignore
|
||||
*/
|
||||
static public function getPeriodToFrequencyAsAdjective()
|
||||
public static function getPeriodToFrequencyAsAdjective()
|
||||
{
|
||||
return array(
|
||||
ScheduledTime::PERIOD_DAY => Piwik::translate('General_DailyReport'),
|
||||
ScheduledTime::PERIOD_WEEK => Piwik::translate('General_WeeklyReport'),
|
||||
ScheduledTime::PERIOD_MONTH => Piwik::translate('General_MonthlyReport'),
|
||||
ScheduledTime::PERIOD_YEAR => Piwik::translate('General_YearlyReport'),
|
||||
ScheduledTime::PERIOD_RANGE => Piwik::translate('General_RangeReports'),
|
||||
Schedule::PERIOD_DAY => Piwik::translate('General_DailyReport'),
|
||||
Schedule::PERIOD_WEEK => Piwik::translate('General_WeeklyReport'),
|
||||
Schedule::PERIOD_MONTH => Piwik::translate('General_MonthlyReport'),
|
||||
Schedule::PERIOD_YEAR => Piwik::translate('General_YearlyReport'),
|
||||
Schedule::PERIOD_RANGE => Piwik::translate('General_RangeReports'),
|
||||
);
|
||||
}
|
||||
|
||||
protected function setReplyToAsSender(Mail $mail, array $report)
|
||||
{
|
||||
if (Config::getInstance()->General['scheduled_reports_replyto_is_user_email_and_alias']) {
|
||||
if (isset($report['login'])) {
|
||||
$userModel = new UserModel();
|
||||
$user = $userModel->getUser($report['login']);
|
||||
|
||||
$mail->setReplyTo($user['email'], $user['alias']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function reportAlreadySent($report, Period $period)
|
||||
{
|
||||
$key = self::OPTION_KEY_LAST_SENT_DATERANGE . $report['idreport'];
|
||||
|
||||
$previousDate = Option::get($key);
|
||||
|
||||
return $previousDate === $period->getRangeString();
|
||||
}
|
||||
|
||||
private function markReportAsSent($report, Period $period)
|
||||
{
|
||||
$key = self::OPTION_KEY_LAST_SENT_DATERANGE . $report['idreport'];
|
||||
|
||||
Option::set($key, $period->getRangeString());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
31
www/analytics/plugins/ScheduledReports/Tasks.php
Normal file
31
www/analytics/plugins/ScheduledReports/Tasks.php
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*
|
||||
*/
|
||||
namespace Piwik\Plugins\ScheduledReports;
|
||||
|
||||
use Piwik\Scheduler\Schedule\Schedule;
|
||||
use Piwik\Site;
|
||||
|
||||
class Tasks extends \Piwik\Plugin\Tasks
|
||||
{
|
||||
public function schedule()
|
||||
{
|
||||
foreach (API::getInstance()->getReports() as $report) {
|
||||
if (!$report['deleted'] && $report['period'] != Schedule::PERIOD_NEVER) {
|
||||
|
||||
$timezone = Site::getTimezoneFor($report['idsite']);
|
||||
|
||||
$schedule = Schedule::getScheduledTimeForPeriod($report['period']);
|
||||
$schedule->setHour($report['hour']);
|
||||
$schedule->setTimezone($timezone);
|
||||
|
||||
$this->custom(API::getInstance(), 'sendReport', $report['idreport'], $schedule);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,21 +1,21 @@
|
|||
<?php
|
||||
/**
|
||||
* Piwik - Open source web analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
*
|
||||
*/
|
||||
use Piwik\Container\StaticContainer;
|
||||
|
||||
/**
|
||||
* Override settings in libs/tcpdf_config.php
|
||||
*
|
||||
*/
|
||||
|
||||
define('K_PATH_MAIN', PIWIK_INCLUDE_PATH . '/libs/tcpdf/');
|
||||
define('K_PATH_MAIN', PIWIK_VENDOR_PATH . '/tecnickcom/tcpdf/');
|
||||
|
||||
$pathTmpTCPDF = PIWIK_USER_PATH . '/tmp/tcpdf/';
|
||||
$pathTmpTCPDF = \Piwik\SettingsPiwik::rewriteTmpPathWithHostname($pathTmpTCPDF);
|
||||
$pathTmpTCPDF = StaticContainer::get('path.tmp') . '/tcpdf/';
|
||||
|
||||
define('K_PATH_CACHE', $pathTmpTCPDF);
|
||||
define('K_PATH_IMAGES', $pathTmpTCPDF);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*!
|
||||
* Piwik - Web Analytics
|
||||
* Piwik - free/libre analytics platform
|
||||
*
|
||||
* @link http://piwik.org
|
||||
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
|
||||
|
|
@ -36,23 +36,23 @@ function formSetEditReport(idReport) {
|
|||
$('#report_hour').val(report.hour);
|
||||
$('[name=report_format].' + report.type + ' option[value=' + report.format + ']').prop('selected', 'selected');
|
||||
|
||||
var selectorReportFormat = 'select[name=report_format].' + $('#report_type').val();
|
||||
$(selectorReportFormat).change( toggleDisplayOptionsByFormat );
|
||||
$('select[name=report_type]').change( toggleDisplayOptionsByFormat );
|
||||
$('select[name=report_format]').change( toggleDisplayOptionsByFormat );
|
||||
|
||||
// When CSV is selected, hide "Display options"
|
||||
toggleDisplayOptionsByFormat();
|
||||
|
||||
function toggleDisplayOptionsByFormat() {
|
||||
var selectorReportFormat = 'select[name=report_format].' + $('#report_type').val();
|
||||
var format = $(selectorReportFormat).val();
|
||||
var displayOptionsSelector = $('#row_report_display_options');
|
||||
if (format == 'csv') {
|
||||
if (format == 'csv' || format == 'sms') {
|
||||
displayOptionsSelector.hide();
|
||||
} else {
|
||||
displayOptionsSelector.show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$('[name=reportsList] input').prop('checked', false);
|
||||
|
||||
var key;
|
||||
|
|
@ -67,7 +67,7 @@ function formSetEditReport(idReport) {
|
|||
|
||||
function getReportAjaxRequest(idReport, defaultApiMethod) {
|
||||
var parameters = {};
|
||||
piwikHelper.lazyScrollTo(".centerLargeDiv>h2", 400);
|
||||
piwikHelper.lazyScrollTo(".emailReports>h2", 400);
|
||||
parameters.module = 'API';
|
||||
parameters.method = defaultApiMethod;
|
||||
if (idReport == 0) {
|
||||
|
|
@ -143,6 +143,7 @@ function initManagePdf() {
|
|||
var idReport = $(this).attr('idreport');
|
||||
var parameters = getReportAjaxRequest(idReport, 'ScheduledReports.sendReport');
|
||||
parameters.idReport = idReport;
|
||||
parameters.force = true;
|
||||
|
||||
var ajaxHandler = new ajaxHelper();
|
||||
ajaxHandler.addParams(parameters, 'POST');
|
||||
|
|
@ -154,7 +155,7 @@ function initManagePdf() {
|
|||
});
|
||||
|
||||
// Delete Report
|
||||
$('a[name=linkDeleteReport]').click(function () {
|
||||
$('.delete-report').click(function () {
|
||||
var idReport = $(this).attr('id');
|
||||
|
||||
function onDelete() {
|
||||
|
|
@ -172,7 +173,7 @@ function initManagePdf() {
|
|||
});
|
||||
|
||||
// Edit Report click
|
||||
$('a[name=linkEditReport]').click(function () {
|
||||
$('.edit-report').click(function () {
|
||||
var idReport = $(this).attr('id');
|
||||
formSetEditReport(idReport);
|
||||
$('.entityAddContainer').show();
|
||||
|
|
@ -187,7 +188,7 @@ function initManagePdf() {
|
|||
});
|
||||
|
||||
// Add a Report click
|
||||
$('#linkAddReport').click(function () {
|
||||
$('#add-report').click(function () {
|
||||
$('.entityAddContainer').show();
|
||||
$('#entityEditContainer').hide();
|
||||
formSetEditReport(/*idReport = */0);
|
||||
|
|
|
|||
29
www/analytics/plugins/ScheduledReports/lang/ar.json
Normal file
29
www/analytics/plugins/ScheduledReports/lang/ar.json
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
"ScheduledReports": {
|
||||
"AlsoSendReportToTheseEmails": "أرسل التقرير إلى هذه العناوين أيضاً (عنوان لكل سطر):",
|
||||
"AreYouSureDeleteReport": "هل ترغب حقاً في حذف هذا التقرير وجدولته الزمنية؟",
|
||||
"CancelAndReturnToReports": "إلغاء و%1$s رجوع إلى قائمة التقارير%2$s",
|
||||
"CreateAndScheduleReport": "أنشئ وأعد جدولاً لتقرير",
|
||||
"CreateReport": "إنشاء تقرير",
|
||||
"DescriptionOnFirstPage": "وصف التقرير سيتم عرضه في الصفحة الأولى من التقرير.",
|
||||
"EmailHello": "مرحباً",
|
||||
"EmailReports": "التقارير البريدية",
|
||||
"EmailSchedule": "جدولة البريد",
|
||||
"FrontPage": "صفحة المقدمة",
|
||||
"MonthlyScheduleHelp": "الجدولة الشهرية: سيتم إرسال التقرير في الأول من كل شهر.",
|
||||
"MustBeLoggedIn": "يجب أن تسجل الدخول لإنشاء وجدولة التقارير.",
|
||||
"PiwikReports": "تقارير Piwik",
|
||||
"PleaseFindAttachedFile": "انظر المرفقات رجاء لتحميل %1$s التقارير حول %2$s.",
|
||||
"PleaseFindBelow": "ستجد %1$s تقريرك حول %2$s أدناه.",
|
||||
"ReportFormat": "تهيئة التقرير",
|
||||
"ReportsIncluded": "الإحصائيات المُضمنة",
|
||||
"SendReportNow": "أرسل التقرير الآن",
|
||||
"SendReportTo": "أرسل التقرير إلى",
|
||||
"SentToMe": "أرسلها لي",
|
||||
"TableOfContent": "قائمة التقارير",
|
||||
"ThereIsNoReportToManage": "لا يوجد تقرير لإدارته للموقع %s.",
|
||||
"TopOfReport": "إلى أعلى",
|
||||
"UpdateReport": "تحديث تقرير",
|
||||
"WeeklyScheduleHelp": "جدولة أسبوعية: سيتم إرسال التقرير يوم الاثنين من كل أسبوع."
|
||||
}
|
||||
}
|
||||
30
www/analytics/plugins/ScheduledReports/lang/be.json
Normal file
30
www/analytics/plugins/ScheduledReports/lang/be.json
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"ScheduledReports": {
|
||||
"AlsoSendReportToTheseEmails": "Акрамя таго, адправіць справаздачу на гэтыя электронныя адрасы (па аднаму ў радку):",
|
||||
"AreYouSureDeleteReport": "Вы сапраўды жадаеце выдаліць гэты даклад і яго расклад?",
|
||||
"CancelAndReturnToReports": "Адмяніць і %1$sвярнуцца да спісу справаздач %2$s",
|
||||
"CreateAndScheduleReport": "Стварыць справаздачу і зрабіць расклад",
|
||||
"CreateReport": "Стварыць справаздачу",
|
||||
"DescriptionOnFirstPage": "Апісанне справаздачы будзе адлюстроўвацца на першай старонцы справаздачы.",
|
||||
"EmailHello": "Прывітанне,",
|
||||
"EmailReports": "Справаздачы па Email",
|
||||
"EmailSchedule": "Расклад электроннай пошты",
|
||||
"FrontPage": "Галоўная старонка",
|
||||
"MonthlyScheduleHelp": "Штомесячны расклад: справаздача будзе адпраўлена першым днём кожнага месяца.",
|
||||
"MustBeLoggedIn": "Вы павінны ўвайсці ў сістэму для стварэння і планавання карыстацкіх справаздач.",
|
||||
"Pagination": "Старонка %1$s з %2$s",
|
||||
"PiwikReports": "Piwik справаздачы",
|
||||
"PleaseFindAttachedFile": "Вы можаце знайсці ў прыкладаемым файле вашу %1$s справаздачу для %2$s.",
|
||||
"PleaseFindBelow": "Ніжэй вы знойдзеце вашу %1$s справаздачу для %2$s.",
|
||||
"ReportFormat": "Фармат справаздачы",
|
||||
"ReportsIncluded": "Уключаная статыстыка",
|
||||
"SendReportNow": "Адправіць справаздачу зараз",
|
||||
"SendReportTo": "Адправіць справаздачу да",
|
||||
"SentToMe": "Адправіць да мяне",
|
||||
"TableOfContent": "Спіс справаздач",
|
||||
"ThereIsNoReportToManage": "Не існуе ніякіх справаздач для гэтага вэб-сайта %s",
|
||||
"TopOfReport": "Вярнуцца наверх",
|
||||
"UpdateReport": "Абнавіць справаздачу",
|
||||
"WeeklyScheduleHelp": "Штотыднёвы расклад: справаздача будзе адпраўлена першым панядзелакам кожнага тыдня."
|
||||
}
|
||||
}
|
||||
43
www/analytics/plugins/ScheduledReports/lang/bg.json
Normal file
43
www/analytics/plugins/ScheduledReports/lang/bg.json
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"ScheduledReports": {
|
||||
"AggregateReportsFormat": "(по избор) Покажете опции",
|
||||
"AggregateReportsFormat_GraphsOnly": "Покажете само графики (без докладни таблици)",
|
||||
"AggregateReportsFormat_TablesAndGraphs": "Покажете докладни таблици и графики за всички доклади.",
|
||||
"AggregateReportsFormat_TablesOnly": "(по подразбиране) Покажи таблицата с отчетите (Графики само за ключови метрични данни)",
|
||||
"AlsoSendReportToTheseEmails": "Също така изпраща доклада до тези имейли (по един на ред):",
|
||||
"AreYouSureDeleteReport": "Сигурни ли сте че искате да изтриете този доклад и разписание?",
|
||||
"CancelAndReturnToReports": "Откажи и се %1$s върни в списъка с отчети %2$s",
|
||||
"CreateAndScheduleReport": "Създайте доклад и разписание",
|
||||
"CreateReport": "Създайте доклад",
|
||||
"CustomVisitorSegment": "Персонализиран посетителски сегмент:",
|
||||
"DescriptionOnFirstPage": "Описанието на този отчет ще бъде показано на първата страница на отчета.",
|
||||
"DisplayFormat_TablesOnly": "Покажете само таблици (без графики)",
|
||||
"EmailHello": "Здравей,",
|
||||
"EmailReports": "Email доклади",
|
||||
"EmailSchedule": "Списък с е-пощи",
|
||||
"EvolutionGraph": "Показване на графиките с история за най-високите %s стойности",
|
||||
"FrontPage": "Заглавна страница",
|
||||
"MonthlyScheduleHelp": "Месечен график: докладът ще бъде изпратен на първия ден от всеки месец.",
|
||||
"MustBeLoggedIn": "Трябва да сте влязъл, за да създавате и планирате персонализирани отчети.",
|
||||
"NoRecipients": "Този доклад все още няма получатели",
|
||||
"Pagination": "Страница %1$s от %2$s",
|
||||
"PiwikReports": "Piwik доклади",
|
||||
"PleaseFindAttachedFile": "Моля, вижте в прикачения си файл %1$s доклад за %2$s.",
|
||||
"PleaseFindBelow": "Моля намерете по-долу вашият %1$s отчет за %2$s.",
|
||||
"ReportFormat": "Формат на доклад",
|
||||
"ReportIncludeNWebsites": "Този отчет ще включва главните метрични данни за всички уеб сайтове, които са били посещавани поне веднъж (от %s сайта, които са налични).",
|
||||
"ReportSent": "Отчетът е изпратен",
|
||||
"ReportsIncluded": "Включена статистика",
|
||||
"ReportType": "Изпрати доклад чрез",
|
||||
"ReportUpdated": "Отчетът е обновен",
|
||||
"SegmentAppliedToReports": "Сегментът '%s' се прилага към отчетите.",
|
||||
"SendReportNow": "Изпрати доклад сега",
|
||||
"SendReportTo": "Изпрати доклад до",
|
||||
"SentToMe": "Изпрати до мен",
|
||||
"TableOfContent": "Лист с отчети",
|
||||
"ThereIsNoReportToManage": "Няма отчет за сайт %s",
|
||||
"TopOfReport": "Върнете се в началото",
|
||||
"UpdateReport": "Обновете доклад",
|
||||
"WeeklyScheduleHelp": "Седмичен график: докладът ще бъде изпратен на първия понеделник на всяка седмица."
|
||||
}
|
||||
}
|
||||
40
www/analytics/plugins/ScheduledReports/lang/ca.json
Normal file
40
www/analytics/plugins/ScheduledReports/lang/ca.json
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
"ScheduledReports": {
|
||||
"AggregateReportsFormat": "(opcional) mostrar les opcions",
|
||||
"AggregateReportsFormat_GraphsOnly": "Mostra només els gràfics (sense taules)",
|
||||
"AggregateReportsFormat_TablesAndGraphs": "Mostrar les taules i els gràfics per a tots els informes.",
|
||||
"AggregateReportsFormat_TablesOnly": "(per defecte) Mostra les taules d'informe (Gràfiques només per les mètriques clau)",
|
||||
"AlsoSendReportToTheseEmails": "Envía també l'informe als seguents correus electrònics (un per línia):",
|
||||
"AreYouSureDeleteReport": "Esteu segurs que voleu eliminar aquest informe i la seva programació?",
|
||||
"CancelAndReturnToReports": "Cancela i %1$storna a la llista d'informes%2$s",
|
||||
"CreateAndScheduleReport": "Crear i programar un informe",
|
||||
"CreateReport": "Crear un informe",
|
||||
"DescriptionOnFirstPage": "La descripció del informes es mostrarà a la primera pàgina del informe.",
|
||||
"DisplayFormat_TablesOnly": "Mostra només taules (sense gràfics)",
|
||||
"EmailHello": "Hola,",
|
||||
"EmailReports": "Informes per correu electrònic",
|
||||
"EmailSchedule": "Programació per correu electrònic",
|
||||
"EvolutionGraph": "Mostrar els valors històrics pels %s valors més representatius.",
|
||||
"FrontPage": "Portada",
|
||||
"MonthlyScheduleHelp": "Programació mensual: L'informe s'enviarà el primer día de cada més.",
|
||||
"MustBeLoggedIn": "Heu d'estar identificat per crear i programar informes personalitzats",
|
||||
"NoRecipients": "Aquest informe no té destinataris",
|
||||
"Pagination": "Pàgina %1$s de %2$s",
|
||||
"PiwikReports": "Informes Piwik",
|
||||
"PleaseFindAttachedFile": "Podeu trobar al fitxer adjunt el vostre informe %1$s per a %2$s.",
|
||||
"PleaseFindBelow": "A continuació podeu trobar el vostre informe %1$s per a %2$s.",
|
||||
"ReportFormat": "Format de l'informe",
|
||||
"ReportIncludeNWebsites": "L'informe incloura les mètriques més importants de tots els llocs webs que tinguin almenys una visita (dels %s llocs web actualment disponibles)",
|
||||
"ReportsIncluded": "Estadístiques incloses",
|
||||
"ReportType": "Envia l'informe a través de",
|
||||
"SendReportNow": "Envia l'informe ara",
|
||||
"SendReportTo": "Envia l'informe a",
|
||||
"SentToMe": "Enviam l'informe a mi",
|
||||
"TableOfContent": "Llista d'informes",
|
||||
"ThereIsNoReportToManage": "No hi ha cap informe per administrar el lloc web %s",
|
||||
"TopLinkTooltip": "Creeu informes per correu electrònic per a que les estadístiques del Piwik es dipositin al vostre correu electrònic (o als dels vostres clients) automàticament",
|
||||
"TopOfReport": "Torna a dalt",
|
||||
"UpdateReport": "Actualitza l'informe",
|
||||
"WeeklyScheduleHelp": "Programació semanal: L'informe s'enviara el Dilluns de cada setmana."
|
||||
}
|
||||
}
|
||||
50
www/analytics/plugins/ScheduledReports/lang/cs.json
Normal file
50
www/analytics/plugins/ScheduledReports/lang/cs.json
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"ScheduledReports": {
|
||||
"AggregateReportsFormat": "Možnosti zobrazení",
|
||||
"AggregateReportsFormat_GraphsOnly": "Pouze zobrazit grafy (ne tabulky hlášení)",
|
||||
"AggregateReportsFormat_TablesAndGraphs": "Zobrazit tabulky hlášení a grafy pro všechna hlášení",
|
||||
"AggregateReportsFormat_TablesOnly": "(Výchozí) zobrazit tabulky hlášení (grafy pouze pro klíčová měření)",
|
||||
"AlsoSendReportToTheseEmails": "Odesílat hlášení také na tyto emaily (jeden email na řádek):",
|
||||
"AreYouSureDeleteReport": "Opravdu chcete odstranit toto hlášení a jeho plán?",
|
||||
"CancelAndReturnToReports": "Zrušit a %1$svrátit se k seznamu hlášení%2$s",
|
||||
"CreateAndScheduleReport": "Vytvořit a naplánovat hlášení",
|
||||
"CreateReport": "Vytvořit hlášení",
|
||||
"CustomVisitorSegment": "Vlastní segment návštěvníka",
|
||||
"DescriptionOnFirstPage": "Popis hlášení bude zobrazen na první jeho straně.",
|
||||
"DisplayFormat_TablesOnly": "Pouze zobrazit tabulky (žádné grafy)",
|
||||
"EmailHello": "Ahoj,",
|
||||
"EmailReports": "Poslat hlášení na email",
|
||||
"EmailSchedule": "Plánování zasílání hlášení",
|
||||
"EvolutionGraph": "Zobrazit historické grafy pro %s nejvyšších hodnot",
|
||||
"FrontPage": "Hlavní strana",
|
||||
"PersonalEmailReports": "Osobní emailová hlášení",
|
||||
"MonthlyScheduleHelp": "Měsíční plán: hlášení bude odesláno první den měsíce",
|
||||
"MustBeLoggedIn": "Musíte být přihlášen, abyste mohl vytvářet vlastní hlášení.",
|
||||
"NoRecipients": "Toto hlášení nemá příjemce",
|
||||
"Pagination": "Stránka %1$s z %2$s",
|
||||
"PiwikReports": "Hlášení Piwiku",
|
||||
"PleaseFindAttachedFile": "Prosím najděte v přiloženém souboru %1$s hlášení pro %2$s",
|
||||
"SentFromX": "Odesláno z %s.",
|
||||
"PleaseFindBelow": "Najděte níže vaše %1$s hlášení pro %2$s.",
|
||||
"PluginDescription": "Vytvořte vlastní emailová hlášení a naplánujte jejich zaslání denně, týdně nebo měsíčně jednomu nebo více lidem. Je podporováno mnoho formátů (HTML, PDF, CSV, obrázky).",
|
||||
"ReportFormat": "Formát hlášení",
|
||||
"ReportHour": "Odeslat hlášení v %s hodin",
|
||||
"ReportIncludeNWebsites": "Hlášení bude obsahovat hlavní měření pro webové stránky, které mají aspoň jednnu návštěvu z %s aktuálně dostupných stránek.",
|
||||
"ReportSent": "Hlášení posláno",
|
||||
"ReportsIncluded": "Zahrnuté statistiky",
|
||||
"ReportType": "Odeslat hlášení pomocí",
|
||||
"ReportUpdated": "Hlášení aktualizováno",
|
||||
"Segment_Deletion_Error": "Tento segment nemůže být smazán nebo zneviditelněn, protože se používá k vytváření emailových hlášení %s. Zkuste to znovu poté, co ho z těchto hlášení odstraníte.",
|
||||
"Segment_Help": "Můžete zvolit existující segment, který bude aplikován na data v tomto e-mailovém hlášení. Segmenty můžete vytvářet a upravovat vlastní segmenty na vaší nástěnce %1$s(klikněte zde pro otevření)%2$s, pak klikněte na box \"%3$s\", pak \"%4$s\".",
|
||||
"SegmentAppliedToReports": "Segment %s je aplikován na hlášení.",
|
||||
"SendReportNow": "Odeslat hlášení ihned",
|
||||
"SendReportTo": "Odeslat hlášení",
|
||||
"SentToMe": "Odeslat hlášení mně",
|
||||
"TableOfContent": "Seznam hlášení",
|
||||
"ThereIsNoReportToManage": "Pro stránky %s neexistuje žádné hlášení, které lze spravovat",
|
||||
"TopLinkTooltip": "Vytvářejte vlastní hlášení, která budou automaticky doručena na vaši nebo zákazníkovu emailovou adresu.",
|
||||
"TopOfReport": "Zpět nahoru",
|
||||
"UpdateReport": "Aktualizovat hlášení",
|
||||
"WeeklyScheduleHelp": "Týdenní plán: hlášení bude odesláno každé pondělí"
|
||||
}
|
||||
}
|
||||
47
www/analytics/plugins/ScheduledReports/lang/da.json
Normal file
47
www/analytics/plugins/ScheduledReports/lang/da.json
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
"ScheduledReports": {
|
||||
"AggregateReportsFormat": "(valgfrit) Visningsindstillinger",
|
||||
"AggregateReportsFormat_GraphsOnly": "Vis kun diagrammer (ingen tabeller)",
|
||||
"AggregateReportsFormat_TablesAndGraphs": "Vis tabeller og diagrammer for alle rapporter",
|
||||
"AggregateReportsFormat_TablesOnly": "(standard) Vis tabeller (diagrammer kun for nøglemålinger)",
|
||||
"AlsoSendReportToTheseEmails": "Send også rapporten til disse e-mails (en e-mail pr linje):",
|
||||
"AreYouSureDeleteReport": "Er du sikker på du vil slette rapporten og tidsplanen?",
|
||||
"CancelAndReturnToReports": "Annuller og %1$sretur til listen over rapporter%2$s",
|
||||
"CreateAndScheduleReport": "Opret og planlæg rapport",
|
||||
"CreateReport": "Opret rapport",
|
||||
"CustomVisitorSegment": "Brugerdefineret besøgssegment:",
|
||||
"DescriptionOnFirstPage": "Rapportbeskrivelsen bliver vist på den første side i rapporten.",
|
||||
"DisplayFormat_TablesOnly": "Vis kun tabeller (ingen grafer)",
|
||||
"EmailHello": "Hej,",
|
||||
"EmailReports": "E-mail rapporter",
|
||||
"EmailSchedule": "E-mail tidsplan",
|
||||
"EvolutionGraph": "Vis historiske grafer for top %s værdier",
|
||||
"FrontPage": "Forside",
|
||||
"PersonalEmailReports": "Personlige E-mail rapporter",
|
||||
"MonthlyScheduleHelp": "Månedlig tidsplan: Rapporten vil blive sendt den første dag i hver måned.",
|
||||
"MustBeLoggedIn": "Du skal være logget på for at oprette og planlægge brugerdefinerede rapporter.",
|
||||
"NoRecipients": "Denne rapport har ingen modtagere",
|
||||
"Pagination": "Side %1$s af %2$s",
|
||||
"PiwikReports": "Piwik rapporter",
|
||||
"PleaseFindAttachedFile": "Vedlagt i vedhæftede fil din %1$s rapport for %2$s.",
|
||||
"PleaseFindBelow": "Find rapporten nedenfor %1$s for %2$s.",
|
||||
"ReportFormat": "Rapport format",
|
||||
"ReportIncludeNWebsites": "Rapporten indeholder de vigtigste nøgletal for alle hjemmesider, der har mindst ét besøg (fra %s hjemmesider der pt er tilgængelige).",
|
||||
"ReportSent": "Rapport afsent",
|
||||
"ReportsIncluded": "Statikker inkluderet",
|
||||
"ReportType": "Send rapport via",
|
||||
"ReportUpdated": "Rapport opdateret",
|
||||
"Segment_Deletion_Error": "Dette segment kan ikke slettes eller gøres usynligt for andre, da det bruges til at generere e-mailrapporter %s. Fjern evt. dette segment fra disse rapporter og prøv igen.",
|
||||
"Segment_Help": "Du kan vælge et eksisterende brugerdefineret segment til anvendelse på oplysninger i e-mail rapporten. Du kan oprette og redigere brugerdefinerede segmenter i kontrolpanelet %1$s (klik her for at åbne) %2$s, og klik derefter på \"%3$s\" feltet, \"%4$s\".",
|
||||
"SegmentAppliedToReports": "Segmentet '%s' anvendes til rapporterne.",
|
||||
"SendReportNow": "Send rapport nu",
|
||||
"SendReportTo": "Send rapport til",
|
||||
"SentToMe": "Send til mig",
|
||||
"TableOfContent": "Rapport liste",
|
||||
"ThereIsNoReportToManage": "Ingen rapporter at administrere for hjemmesiden %s",
|
||||
"TopLinkTooltip": "Opret e-mail-rapporter for at få Piwik statistik leveret til din e-mail eller dine kunders adresse automatisk!",
|
||||
"TopOfReport": "Tilbage til toppen",
|
||||
"UpdateReport": "Opdater rapport",
|
||||
"WeeklyScheduleHelp": "Ugentlig tidsplan: Rapporten vil blive sendt hver uge om mandagen."
|
||||
}
|
||||
}
|
||||
50
www/analytics/plugins/ScheduledReports/lang/de.json
Normal file
50
www/analytics/plugins/ScheduledReports/lang/de.json
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"ScheduledReports": {
|
||||
"AggregateReportsFormat": "(optional) Anzeigeoptionen",
|
||||
"AggregateReportsFormat_GraphsOnly": "Nur Graphen anzeigen (keine Tabellenberichte)",
|
||||
"AggregateReportsFormat_TablesAndGraphs": "Tabellen und Graphen für alle Berichte anzeigen",
|
||||
"AggregateReportsFormat_TablesOnly": "(Standard) Tabellenberichte anzeigen (Graphen nur für die wichtigsten Metriken)",
|
||||
"AlsoSendReportToTheseEmails": "Bericht zusätzlich an folgende E-Mail-Adressen senden (eine Adresse pro Zeile):",
|
||||
"AreYouSureDeleteReport": "Sind Sie sicher, dass Sie diesen Bericht und dessen Zeitplan löschen möchten?",
|
||||
"CancelAndReturnToReports": "Abbrechen und %1$szur Liste der Berichte zurückkehren%2$s",
|
||||
"CreateAndScheduleReport": "Einen Bericht erstellen und planen",
|
||||
"CreateReport": "Bericht erstellen",
|
||||
"CustomVisitorSegment": "Benutzerdefiniertes Besuchersegment:",
|
||||
"DescriptionOnFirstPage": "Die Beschreibung wird auf der ersten Seite des Berichts angezeigt.",
|
||||
"DisplayFormat_TablesOnly": "Nur Tabellen anzeigen (keine Grafiken)",
|
||||
"EmailHello": "Hallo,",
|
||||
"EmailReports": "E-Mail-Berichte",
|
||||
"EmailSchedule": "E-Mail-Zeitplan",
|
||||
"EvolutionGraph": "Zeige historischen Graph für die Top %s Werte",
|
||||
"FrontPage": "Titelseite",
|
||||
"PersonalEmailReports": "Persönliche Email-Berichte",
|
||||
"MonthlyScheduleHelp": "Monatlich: Bericht wird immer am ersten Tag des Monats verschickt.",
|
||||
"MustBeLoggedIn": "Sie müssen angemeldet sein, um Berichte anlegen und versenden zu können.",
|
||||
"NoRecipients": "Dieser Bericht hat keine Empfänger",
|
||||
"Pagination": "Seite %1$s von %2$s",
|
||||
"PiwikReports": "Piwik-Berichte",
|
||||
"PleaseFindAttachedFile": "Sie finden in der angehängten Datei Ihren Bericht (Intervall: %1$s) für %2$s.",
|
||||
"SentFromX": "Gesendet von %s",
|
||||
"PleaseFindBelow": "Unterhalb befindet sich der Bericht (Intervall: %1$s) für %2$s.",
|
||||
"PluginDescription": "Erstellen Sie eigene Berichte und planen Sie deren täglichen, wöchentlichen oder monatlichen Versand an einen oder mehrere Empfänger. Diverse Berichtsformate werden unterstützt (HTML, PDF, CSV, Bilder).",
|
||||
"ReportFormat": "Berichtsformat",
|
||||
"ReportHour": "Bericht senden um %s Uhr",
|
||||
"ReportIncludeNWebsites": "Dieser Bericht wird die Hauptmetriken für alle Websites enthalten, die mindestens einen Besuch haben (von den %s derzeit verfügbaren Websites).",
|
||||
"ReportSent": "Bericht wurde versendet",
|
||||
"ReportsIncluded": "Beinhaltete Statistiken",
|
||||
"ReportType": "Bericht versenden via",
|
||||
"ReportUpdated": "Bericht aktualisiert",
|
||||
"Segment_Deletion_Error": "Dieses Segment kann nicht gelöscht oder für andere Benutzer unsichtbar gemacht werden, da es zur Generierung der E-Mail-Berichte %s verwendet wird. Bitte versuchen Sie es erneut, nachdem Sie dieses Segment aus den Berichten entfernt haben.",
|
||||
"Segment_Help": "Sie können ein Segment wählen das auf die Daten des E-Mail-Berichts angewendet werden soll. Sie können Segmente auf dem Dashboard anlegen oder bearbeiten %1$s(hier klicken zum öffnen)%2$s, klicken Sie dann auf die \"%3$s\" Box und dann auf \"%4$s\".",
|
||||
"SegmentAppliedToReports": "Das Segment '%s' wird auf die Berichte angewendet.",
|
||||
"SendReportNow": "Bericht jetzt senden",
|
||||
"SendReportTo": "Bericht senden an",
|
||||
"SentToMe": "An mich senden",
|
||||
"TableOfContent": "Liste der Berichte",
|
||||
"ThereIsNoReportToManage": "Es gibt keine Berichte für die Website %s",
|
||||
"TopLinkTooltip": "Erstellen Sie E-Mailberichte, um Piwik Statistiken automatisch an Ihre E-Mailadresse oder die eines Kunden zu senden!",
|
||||
"TopOfReport": "Zurück zum Anfang",
|
||||
"UpdateReport": "Bericht ändern",
|
||||
"WeeklyScheduleHelp": "Wöchentlich: Bericht wird jede Woche montags verschickt."
|
||||
}
|
||||
}
|
||||
50
www/analytics/plugins/ScheduledReports/lang/el.json
Normal file
50
www/analytics/plugins/ScheduledReports/lang/el.json
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"ScheduledReports": {
|
||||
"AggregateReportsFormat": "(προαιρετικό) Προβολή επιλογών",
|
||||
"AggregateReportsFormat_GraphsOnly": "Προβολή μόνο Διαγραμμάτων (κανένας πίνακας αναφοράς)",
|
||||
"AggregateReportsFormat_TablesAndGraphs": "Προβολή πινάκων Αναφοράς και Διαγραμμάτων για όλες τις αναφορές",
|
||||
"AggregateReportsFormat_TablesOnly": "(προεπιλογή) Προβολή Πινάκων Αναφορών (Διαγράμματα μόνο για μετρήσεις κλειδιού)",
|
||||
"AlsoSendReportToTheseEmails": "Να αποσταλεί η αναφορά και σε αυτές τις ηλεκτρονικές διευθύνσεις (μία σε κάθε γραμμή):",
|
||||
"AreYouSureDeleteReport": "Θέλετε σίγουρα να διαγράψετε αυτή την αναφορά και τον προγραμματισμό της;",
|
||||
"CancelAndReturnToReports": "Άκυρο και %1$sεπιστροφή στη λίστα αναφορών%2$s",
|
||||
"CreateAndScheduleReport": "Δημιουργήστε και Προγραμματίστε μια αναφορά",
|
||||
"CreateReport": "Δημιουργία Αναφοράς",
|
||||
"CustomVisitorSegment": "Προσαρμοσμένο Τμήμα Επισκεπτών:",
|
||||
"DescriptionOnFirstPage": "Η περιγραφή της αναφοράς θα εμφανίζεται στην πρώτη σελίδα της αναφοράς.",
|
||||
"DisplayFormat_TablesOnly": "Προβολή πινάκων μόνο (χωρίς γραφικά)",
|
||||
"EmailHello": "Γεια σας,",
|
||||
"EmailReports": "Αναφορές Αλληλογραφίας",
|
||||
"EmailSchedule": "Προγραμματισμός Ηλεκτρονικής Αλληλογραφίας",
|
||||
"EvolutionGraph": "Προβολή Ιστορικών Διαγραμμάτων για τις κορυφαίες %s τιμές",
|
||||
"FrontPage": "Εξώφυλλο",
|
||||
"PersonalEmailReports": "Προσωπικές Αναφορές με E-mail",
|
||||
"MonthlyScheduleHelp": "Μηνιαίος προγραμματισμός: η αναφορά θα αποσταλεί την πρώτη μέρα κάθε μήνα.",
|
||||
"MustBeLoggedIn": "Πρέπει να έχετε συνδεθεί για να δημιουργήσετε και να προγραμματίσετε προσαρμοσμένες αναφορές.",
|
||||
"NoRecipients": "Αυτή η αναφορά δεν έχει παραλήπτες",
|
||||
"Pagination": "Σελίδα %1$s από %2$s",
|
||||
"PiwikReports": "Αναφορές Piwik",
|
||||
"PleaseFindAttachedFile": "Βρείτε στο συνημμένο αρχείο την αναφορά %1$s για %2$s.",
|
||||
"SentFromX": "Στάλθηκε από %s.",
|
||||
"PleaseFindBelow": "Βρείτε παρακάτω την αναφορά %1$s για τη %2$s.",
|
||||
"PluginDescription": "Δημιουργεί προσαρμοσμένες αναφορές και τις προγραμματίζει για καθημερινή, εβδομαδιαία ή μηνιαία αναφορά σε ένα ή περισσότερα άτομα. Υποστηρίζονται αρκετοί τύποι αναφορών (html, pdf, csv, εικόνες).",
|
||||
"ReportFormat": "Μορφή Αναφοράς",
|
||||
"ReportHour": "Αποστολή αναφοράς στις %s",
|
||||
"ReportIncludeNWebsites": "Η αναφορά θα περιλαμβάνει βασικές μετρήσεις για όλες τις ιστοσελίδες που έχουν τουλάχιστον μια επισκεψη (από τις συνολικά %s διαθέσιμες ιστοσελίδες).",
|
||||
"ReportSent": "Η αναφορά στάλθηκε.",
|
||||
"ReportsIncluded": "Συμπερίληψη στατιστικών",
|
||||
"ReportType": "Αποστολή αναφοράς μέσω",
|
||||
"ReportUpdated": "Η αναφορά ενημερώθηκε",
|
||||
"Segment_Deletion_Error": "Δεν είναι δυνατό να διαγραφεί το τμήμα ή να γίνει αόρατο σε άλλους χρήστες επειδή χρησιμοποιείται για τη δημιουργία των αναφορών ηλ. ταχυδρομείου %s. Παρακαλούμε δοκιμάστε πάλι αφού αφαιρέσετε το τμήμα αυτό από την αναφορά.",
|
||||
"Segment_Help": "Μπορείτε να επιλέξετε κάποιο υπάρχον προσαρμοσμένο τμήμα που θα εφαρμοστεί στα δεδομένα σε αυτή την αναφορά e-mail. Μπορείτε να δημιουργήσετε ή τροποποιήσετε προσαρμοσμένα τμήματα στον πίνακα ελέγχου σας %1$s(κάντε κλικ για άνοιγμα)%2$s, μετά κλικ στο πλήκτρο \"%3$s\" και μετά \"%4$s\".",
|
||||
"SegmentAppliedToReports": "Το τμήμα '%s' εφαρμόζεται στις αναφορές.",
|
||||
"SendReportNow": "Αποστολή Αναφοράς τώρα",
|
||||
"SendReportTo": "Αποστολή αναφοράς σε",
|
||||
"SentToMe": "Αποστολή σε μένα",
|
||||
"TableOfContent": "Λίστα αναφορών",
|
||||
"ThereIsNoReportToManage": "Δεν υπάρχει αναφορά για τη διαχείριση της ιστοσελίδας %s",
|
||||
"TopLinkTooltip": "Δημιουργία Αναφορών Ηλεκτρονικής Αλληλογραφίας για να λάβετε στατιστικά Piwik που θα παραδίδονται στο ηλεκτρονικό σας ταχυδρομείο ή στη διεύθυνση των πελατών σας αυτόματα!",
|
||||
"TopOfReport": "Επιστροφή στην κορυφή",
|
||||
"UpdateReport": "Ενημέρωση Αναφοράς",
|
||||
"WeeklyScheduleHelp": "Εβδομαδιαίος προγραμματισμός: η αναφορά θα αποσταλεί την Δευτέρα κάθε εβδομάδας."
|
||||
}
|
||||
}
|
||||
50
www/analytics/plugins/ScheduledReports/lang/en.json
Normal file
50
www/analytics/plugins/ScheduledReports/lang/en.json
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"ScheduledReports": {
|
||||
"AggregateReportsFormat": "(optional) Display options",
|
||||
"AggregateReportsFormat_GraphsOnly": "Display Graphs only (no report tables)",
|
||||
"AggregateReportsFormat_TablesAndGraphs": "Display Report tables and Graphs for all reports",
|
||||
"AggregateReportsFormat_TablesOnly": "(default) Display Report tables (Graphs only for key metrics)",
|
||||
"AlsoSendReportToTheseEmails": "Also send the report to these emails (one email per line):",
|
||||
"AreYouSureDeleteReport": "Are you sure you want to delete this report and its schedule?",
|
||||
"CancelAndReturnToReports": "Cancel and %1$sreturn to the list of reports%2$s",
|
||||
"CreateAndScheduleReport": "Create and Schedule a report",
|
||||
"CreateReport": "Create Report",
|
||||
"CustomVisitorSegment": "Custom Visitor Segment:",
|
||||
"DescriptionOnFirstPage": "The report description will be displayed on the first page of the report.",
|
||||
"DisplayFormat_TablesOnly": "Display Tables only (no graphs)",
|
||||
"EmailHello": "Hello,",
|
||||
"EmailReports": "Email Reports",
|
||||
"EmailSchedule": "Email Schedule",
|
||||
"EvolutionGraph": "Show Historical Graphs for the top %s values",
|
||||
"FrontPage": "Front Page",
|
||||
"PersonalEmailReports": "Personal Email Reports",
|
||||
"MonthlyScheduleHelp": "Monthly schedule: report will be sent the first day of each month.",
|
||||
"MustBeLoggedIn": "You must be logged in to create and schedule custom reports.",
|
||||
"NoRecipients": "This report has no recipients",
|
||||
"Pagination": "Page %1$s of %2$s",
|
||||
"PiwikReports": "Piwik Reports",
|
||||
"PleaseFindAttachedFile": "Please find in attached file your %1$s report for %2$s.",
|
||||
"SentFromX": "Sent from %s.",
|
||||
"PleaseFindBelow": "Please find below your %1$s report for %2$s.",
|
||||
"PluginDescription": "Create custom reports and schedule them to be emailed daily, weekly or monthly to one or several people. Several report formats are supported (html, pdf, csv, images).",
|
||||
"ReportFormat": "Report Format",
|
||||
"ReportHour": "Send report at %s o'clock",
|
||||
"ReportIncludeNWebsites": "The report will include main metrics for all websites that have at least one visit (from the %s websites currently available).",
|
||||
"ReportSent": "Report sent",
|
||||
"ReportsIncluded": "Statistics included",
|
||||
"ReportType": "Send report via",
|
||||
"ReportUpdated": "Report updated",
|
||||
"Segment_Deletion_Error": "This segment cannot be deleted or made invisible to other users because it is used to generate email report(s) %s. Please retry after removing this segment from this report(s).",
|
||||
"Segment_Help": "You can select an existing custom segment to apply to data in this email report. You may create and edit custom segments in your dashboard %1$s(click here to open)%2$s, then click on the \"%3$s\" box, then \"%4$s\".",
|
||||
"SegmentAppliedToReports": "The segment '%s' is applied to the reports.",
|
||||
"SendReportNow": "Send Report now",
|
||||
"SendReportTo": "Send report to",
|
||||
"SentToMe": "Send to me",
|
||||
"TableOfContent": "Report list",
|
||||
"ThereIsNoReportToManage": "There is no report to manage for website %s",
|
||||
"TopLinkTooltip": "Create Email Reports to get Piwik stats delivered to your email or your customers' address automatically!",
|
||||
"TopOfReport": "Back to top",
|
||||
"UpdateReport": "Update Report",
|
||||
"WeeklyScheduleHelp": "Weekly schedule: report will be sent on Monday of each week."
|
||||
}
|
||||
}
|
||||
48
www/analytics/plugins/ScheduledReports/lang/es.json
Normal file
48
www/analytics/plugins/ScheduledReports/lang/es.json
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"ScheduledReports": {
|
||||
"AggregateReportsFormat": "(opcional) Mostrar opciones",
|
||||
"AggregateReportsFormat_GraphsOnly": "Mostrar sólo gráficas (sin informe de tablas)",
|
||||
"AggregateReportsFormat_TablesAndGraphs": "Mostrar Informe de tablas y gráficas para todos los informes",
|
||||
"AggregateReportsFormat_TablesOnly": "(por defecto) Mostrar Reporte de tablas (gráficas sólo para mediciones clave)",
|
||||
"AlsoSendReportToTheseEmails": "También enviar el informe a estos correos electrónicos (uno por línea):",
|
||||
"AreYouSureDeleteReport": "¿Está seguro que desea eliminar este informe y su envío programado?",
|
||||
"CancelAndReturnToReports": "Cancelar y %1$svolver a la lista de informes%2$s",
|
||||
"CreateAndScheduleReport": "Crear y programar un informe",
|
||||
"CreateReport": "Crear informe",
|
||||
"CustomVisitorSegment": "Segmento de visitante personalizado:",
|
||||
"DescriptionOnFirstPage": "La descripción del informe será mostrada en la primera página del mismo.",
|
||||
"DisplayFormat_TablesOnly": "Mostrar sólo tablas (sin gráficas)",
|
||||
"EmailHello": "Hola,",
|
||||
"EmailReports": "Informes por correo electrónico",
|
||||
"EmailSchedule": "Programar el envío del correo electrónico",
|
||||
"EvolutionGraph": "Mostrar gráficas históricas de los valores %s más altos",
|
||||
"FrontPage": "Página principal",
|
||||
"PersonalEmailReports": "Informes personales por correo electrónico",
|
||||
"MonthlyScheduleHelp": "Envío mensual: los informes serán enviados el primer día de cada mes.",
|
||||
"MustBeLoggedIn": "Debe haber iniciado sesión para crear y programar informes personalizados.",
|
||||
"NoRecipients": "Este informe no tiene destinatarios",
|
||||
"Pagination": "Página %1$s de %2$s",
|
||||
"PiwikReports": "Informes Piwik",
|
||||
"PleaseFindAttachedFile": "Encuentre el informe en el archivo adjunto su %1$s informe por %2$s.",
|
||||
"PleaseFindBelow": "Por favor encuentre debajo su %1$s informe para %2$s.",
|
||||
"PluginDescription": "Cree informes personalizados y prográmelos para ser enviados por correo electrónico diaria, semanal o mensualmente a uno o varias personas. Algunos formatos de informe están soportados (html, pdf, csv, imágenes).",
|
||||
"ReportFormat": "Formato del informe",
|
||||
"ReportIncludeNWebsites": "El informe incluirá las principales métricas para todos los sitios de internet con al menos una visita (de todo %s los sitios de internet disponibles).",
|
||||
"ReportSent": "Informe enviado",
|
||||
"ReportsIncluded": "Estadísticas incluidas",
|
||||
"ReportType": "Enviar informe vía",
|
||||
"ReportUpdated": "Informe actualizado",
|
||||
"Segment_Deletion_Error": "Este segmento no puede ser eliminado o hacerse invisible para otros usuarios porque es utilizado para crear informe(s) por correo electrónico %s. Por favor elimine este segmento del informe(s) y vuelva a intentar.",
|
||||
"Segment_Help": "Puede elegir un segmento personalizado existente para aplicar a los datos de este informe por correo electrónico. Puede crear y modificar segmentos personalizados en su tablero %1$s (haga clic aquí para abrir)%2$s, haciendo clic en la casilla \"%3$s\" y luego en \"%4$s\".",
|
||||
"SegmentAppliedToReports": "El segmento '%s' está siendo aplicado a los informes.",
|
||||
"SendReportNow": "Enviar informe ahora",
|
||||
"SendReportTo": "Enviar informe a",
|
||||
"SentToMe": "Enviarme una copia",
|
||||
"TableOfContent": "Lista de informes",
|
||||
"ThereIsNoReportToManage": "No hay informes que administrar para el sitio de internet %s",
|
||||
"TopLinkTooltip": "Cree informes por medio del correo electrónico para obtener las estadísticas de Piwik enviadas a su correo electrónico o las de sus clientes automáticamente!",
|
||||
"TopOfReport": "Volver arriba",
|
||||
"UpdateReport": "Actualizar Informe",
|
||||
"WeeklyScheduleHelp": "Envío semanal: los informes serán enviados el primer lunes de cada semana."
|
||||
}
|
||||
}
|
||||
32
www/analytics/plugins/ScheduledReports/lang/et.json
Normal file
32
www/analytics/plugins/ScheduledReports/lang/et.json
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"ScheduledReports": {
|
||||
"AggregateReportsFormat": "(valikuline) Kuvamise seaded",
|
||||
"AggregateReportsFormat_GraphsOnly": "Kuva ainult graafikud (tabelid puuduvad)",
|
||||
"AggregateReportsFormat_TablesAndGraphs": "Kuva tabelid ja graafikud kõikidele raportitele",
|
||||
"AggregateReportsFormat_TablesOnly": "(vaikimisi) Kuva raportite tabelid (ja olulistele mõõdikutele ka graafikud)",
|
||||
"AlsoSendReportToTheseEmails": "Saada raport ka järgnevatele e-posti aadressitele (iga aadress eraldi real):",
|
||||
"CancelAndReturnToReports": "Katkesta ja %1$snaase raportite nimekirja%2$s",
|
||||
"CreateAndScheduleReport": "Loo ja ajasta raporti käivitumine",
|
||||
"CreateReport": "Loo raport",
|
||||
"CustomVisitorSegment": "Kohandatud külastaja segment:",
|
||||
"EmailHello": "Tere,",
|
||||
"EmailReports": "E-posti raportid",
|
||||
"EmailSchedule": "E-posti ajastamine",
|
||||
"FrontPage": "Esileht",
|
||||
"Pagination": "Lehekülg %1$s \/ %2$s",
|
||||
"PiwikReports": "Piwiku raportid",
|
||||
"PleaseFindAttachedFile": "Manusest leiad oma %1$s raporti %2$s jaoks.",
|
||||
"ReportFormat": "Raporti formaat",
|
||||
"ReportIncludeNWebsites": "Antud raport sisaldab põhimõõdikuid kõikide veebilehtede kohta, millel on vähemalt üks külastus (%s veebilehest, mis on kokku saadaval).",
|
||||
"ReportSent": "Raport saadetud",
|
||||
"ReportsIncluded": "Statistika osade kaasamine",
|
||||
"ReportType": "Raporti saatmise kanal",
|
||||
"ReportUpdated": "Raport uuendatud",
|
||||
"SendReportNow": "Saada raport kohe",
|
||||
"SendReportTo": "Raporti saaja",
|
||||
"SentToMe": "Saada mulle",
|
||||
"ThereIsNoReportToManage": "Puuduvad olemasolevad raportid veebilehe %s kohta",
|
||||
"TopOfReport": "Tagasi üles",
|
||||
"UpdateReport": "Uuenda raportit"
|
||||
}
|
||||
}
|
||||
43
www/analytics/plugins/ScheduledReports/lang/fa.json
Normal file
43
www/analytics/plugins/ScheduledReports/lang/fa.json
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"ScheduledReports": {
|
||||
"AggregateReportsFormat": "(اختیاری) گزینه های نمایش)",
|
||||
"AggregateReportsFormat_GraphsOnly": "نمایش ها نمودار ها تنها (بدون جداول گزارش)",
|
||||
"AggregateReportsFormat_TablesAndGraphs": "نمایش جداول گزارش و نمودار برای همه گزارش ها",
|
||||
"AggregateReportsFormat_TablesOnly": "(پیش فرض) نمایش جدول گزارش (نمودار فقط برای معیارهای کلیدی)",
|
||||
"AlsoSendReportToTheseEmails": "همچنین گزارش به این ایمیل ها فرستاده می شود (هر ایمیل در یک خط):",
|
||||
"AreYouSureDeleteReport": "آیا شما مطمئن هستید که میخواهید این گزارش و زمانبندی را حذف کنید؟",
|
||||
"CancelAndReturnToReports": "لغو و بازگشت%1$s به لیست گزارشات%2$s",
|
||||
"CreateAndScheduleReport": "ایجاد و زمانبندی یک گزارش",
|
||||
"CreateReport": "ایجاد گزارش",
|
||||
"CustomVisitorSegment": "بخش سفارشی بازدید کنندگان:",
|
||||
"DescriptionOnFirstPage": "توضیحات گزارش در اولین صفحه گزارش نمایش داده خواهد شد.",
|
||||
"DisplayFormat_TablesOnly": "نمایش جداول تنها (بدون نمودار)",
|
||||
"EmailHello": "درود,",
|
||||
"EmailReports": "گزارش ها را ایمیل کن",
|
||||
"EmailSchedule": "زمانبندی ایمیل",
|
||||
"EvolutionGraph": "نمایش نمودارهای گرافیکی برای مقدار %s بالا",
|
||||
"FrontPage": "صفحه اول",
|
||||
"MonthlyScheduleHelp": "زمانبندی ماهانه: گزارش در اولین روز هر ماه فرستاده خواهد شد.",
|
||||
"MustBeLoggedIn": "برای ساخت و زمانبندی گزارشات دلخواه باید ابتدا وارد شوید",
|
||||
"NoRecipients": "این گزارش هیچ دریافت کننده ای ندارد.",
|
||||
"Pagination": "صفحه %1$s از %2$s",
|
||||
"PiwikReports": "گزارش های Piwik",
|
||||
"PleaseFindBelow": "لطفا در زیر پیدا نمایید %1$s گزارش برای %2$s.",
|
||||
"ReportFormat": "فرمت گزارش",
|
||||
"ReportIncludeNWebsites": "گزارش شامل معیار های اصلی برای تمام وبسایت هایی که حداقل یک بازدید دارند می شود (از میان %s وبسایتی که در دسترس هستند).",
|
||||
"ReportSent": "گزارش ارسال شد",
|
||||
"ReportsIncluded": "شامل گزارشات می باشد",
|
||||
"ReportType": "گزارش را ارسال کن با",
|
||||
"ReportUpdated": "گزارش به روز شده",
|
||||
"SegmentAppliedToReports": "بخش '%s' در گزارش استفاده شود.",
|
||||
"SendReportNow": "ارسال گزارش هم اکنون",
|
||||
"SendReportTo": "ارسال گزارش به",
|
||||
"SentToMe": "ارسال به من",
|
||||
"TableOfContent": "لیست گزارشات",
|
||||
"ThereIsNoReportToManage": "هیچ گزارشی برای مدیریت وب سایت وجود ندارد %s",
|
||||
"TopLinkTooltip": "گزارش های ایمیلی بسازید تا آمارهای پیویکی به طور خودکار به ایمیل شما یا مشتریانتان تحویل داده شود!",
|
||||
"TopOfReport": "بازگشت به بالا",
|
||||
"UpdateReport": "ویرایش گزارش",
|
||||
"WeeklyScheduleHelp": "زمانبندی هفتگی: گزارش در روز دوشنبه هر هفته فرستاده خواهد شد."
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue