/** * Add available tables and columns to the report builder lookup * * @param ReportBuilderEvent $event * * @return void */ public function onReportBuilder(ReportBuilderEvent $event) { if ($event->checkContext(array('emails', 'email.stats'))) { $prefix = 'e.'; $variantParent = 'vp.'; $columns = array($prefix . 'subject' => array('label' => 'mautic.email.subject', 'type' => 'string'), $prefix . 'lang' => array('label' => 'mautic.core.language', 'type' => 'string'), $prefix . 'read_count' => array('label' => 'mautic.email.report.read_count', 'type' => 'int'), $prefix . 'revision' => array('label' => 'mautic.email.report.revision', 'type' => 'int'), $variantParent . 'id' => array('label' => 'mautic.email.report.variant_parent_id', 'type' => 'int'), $variantParent . 'subject' => array('label' => 'mautic.email.report.variant_parent_subject', 'type' => 'string'), $prefix . 'variant_start_date' => array('label' => 'mautic.email.report.variant_start_date', 'type' => 'datetime'), $prefix . 'variant_sent_count' => array('label' => 'mautic.email.report.variant_sent_count', 'type' => 'int'), $prefix . 'variant_read_count' => array('label' => 'mautic.email.report.variant_read_count', 'type' => 'int')); $columns = array_merge($columns, $event->getStandardColumns($prefix), $event->getCategoryColumns()); $data = array('display_name' => 'mautic.email.emails', 'columns' => $columns); $event->addTable('emails', $data); if ($event->checkContext('email.stats')) { $statPrefix = 'es.'; $statColumns = array($statPrefix . 'email_address' => array('label' => 'mautic.email.report.stat.email_address', 'type' => 'email'), $statPrefix . 'date_sent' => array('label' => 'mautic.email.report.stat.date_sent', 'type' => 'datetime'), $statPrefix . 'is_read' => array('label' => 'mautic.email.report.stat.is_read', 'type' => 'bool'), $statPrefix . 'is_failed' => array('label' => 'mautic.email.report.stat.is_failed', 'type' => 'bool'), $statPrefix . 'viewed_in_browser' => array('label' => 'mautic.email.report.stat.viewed_in_browser', 'type' => 'bool'), $statPrefix . 'date_read' => array('label' => 'mautic.email.report.stat.date_read', 'type' => 'datetime'), $statPrefix . 'retry_count' => array('label' => 'mautic.email.report.stat.retry_count', 'type' => 'int'), $statPrefix . 'source' => array('label' => 'mautic.report.field.source', 'type' => 'string'), $statPrefix . 'source_id' => array('label' => 'mautic.report.field.source_id', 'type' => 'int')); $data = array('display_name' => 'mautic.email.stats.report.table', 'columns' => array_merge($columns, $statColumns, $event->getLeadColumns(), $event->getIpColumn())); $event->addTable('email.stats', $data); // Register Graphs $context = 'email.stats'; $event->addGraph($context, 'line', 'mautic.email.graph.line.stats'); $event->addGraph($context, 'pie', 'mautic.email.graph.pie.ignored.read.failed'); $event->addGraph($context, 'table', 'mautic.email.table.most.emails.sent'); $event->addGraph($context, 'table', 'mautic.email.table.most.emails.read'); $event->addGraph($context, 'table', 'mautic.email.table.most.emails.failed'); $event->addGraph($context, 'table', 'mautic.email.table.most.emails.read.percent'); } } }
/** * Add available tables and columns to the report builder lookup * * @param ReportBuilderEvent $event * * @return void */ public function onReportBuilder(ReportBuilderEvent $event) { if ($event->checkContext(array('pages', 'page.hits'))) { $prefix = 'p.'; $translationPrefix = 'tp.'; $variantPrefix = 'vp.'; $columns = array($prefix . 'title' => array('label' => 'mautic.core.title', 'type' => 'string'), $prefix . 'alias' => array('label' => 'mautic.core.alias', 'type' => 'string'), $prefix . 'revision' => array('label' => 'mautic.page.report.revision', 'type' => 'string'), $prefix . 'hits' => array('label' => 'mautic.page.field.hits', 'type' => 'int'), $prefix . 'unique_hits' => array('label' => 'mautic.page.field.unique_hits', 'type' => 'int'), $translationPrefix . 'id' => array('label' => 'mautic.page.report.translation_parent_id', 'type' => 'int'), $translationPrefix . 'title' => array('label' => 'mautic.page.report.translation_parent_title', 'type' => 'string'), $variantPrefix . 'id' => array('label' => 'mautic.page.report.variant_parent_id', 'type' => 'string'), $variantPrefix . 'title' => array('label' => 'mautic.page.report.variant_parent_title', 'type' => 'string'), $prefix . 'lang' => array('label' => 'mautic.core.language', 'type' => 'string'), $prefix . 'variant_start_date' => array('label' => 'mautic.page.report.variant_start_date', 'type' => 'datetime'), $prefix . 'variant_hits' => array('label' => 'mautic.page.report.variant_hits', 'type' => 'int')); $columns = array_merge($columns, $event->getStandardColumns('p.', array('name', 'description')), $event->getCategoryColumns()); $data = array('display_name' => 'mautic.page.pages', 'columns' => $columns); $event->addTable('pages', $data); if ($event->checkContext('page.hits')) { $hitPrefix = 'ph.'; $redirectHit = 'r.'; $emailPrefix = 'e.'; $hitColumns = array($hitPrefix . 'date_hit' => array('label' => 'mautic.page.report.hits.date_hit', 'type' => 'datetime'), $hitPrefix . 'date_left' => array('label' => 'mautic.page.report.hits.date_left', 'type' => 'datetime'), $hitPrefix . 'country' => array('label' => 'mautic.page.report.hits.country', 'type' => 'string'), $hitPrefix . 'region' => array('label' => 'mautic.page.report.hits.region', 'type' => 'string'), $hitPrefix . 'city' => array('label' => 'mautic.page.report.hits.city', 'type' => 'string'), $hitPrefix . 'isp' => array('label' => 'mautic.page.report.hits.isp', 'type' => 'string'), $hitPrefix . 'organization' => array('label' => 'mautic.page.report.hits.organization', 'type' => 'string'), $hitPrefix . 'code' => array('label' => 'mautic.page.report.hits.code', 'type' => 'int'), $hitPrefix . 'referer' => array('label' => 'mautic.page.report.hits.referer', 'type' => 'string'), $hitPrefix . 'url' => array('label' => 'mautic.page.report.hits.url', 'type' => 'url'), $hitPrefix . 'url_title' => array('label' => 'mautic.page.report.hits.url_title', 'type' => 'string'), $hitPrefix . 'user_agent' => array('label' => 'mautic.page.report.hits.user_agent', 'type' => 'string'), $hitPrefix . 'remote_host' => array('label' => 'mautic.page.report.hits.remote_host', 'type' => 'string'), $hitPrefix . 'browser_languages' => array('label' => 'mautic.page.report.hits.browser_languages', 'type' => 'array'), $hitPrefix . 'source' => array('label' => 'mautic.report.field.source', 'type' => 'string'), $hitPrefix . 'source_id' => array('label' => 'mautic.report.field.source_id', 'type' => 'int'), $redirectHit . 'url' => array('label' => 'mautic.page.report.hits.redirect_url', 'type' => 'url'), $redirectHit . 'hits' => array('label' => 'mautic.page.report.hits.redirect_hit_count', 'type' => 'int'), $redirectHit . 'unique_hits' => array('label' => 'mautic.page.report.hits.redirect_unique_hits', 'type' => 'string'), $emailPrefix . 'id' => array('label' => 'mautic.page.report.hits.email_id', 'type' => 'int'), $emailPrefix . 'subject' => array('label' => 'mautic.page.report.hits.email_subject', 'type' => 'string')); $data = array('display_name' => 'mautic.page.hits', 'columns' => array_merge($columns, $hitColumns, $event->getLeadColumns(), $event->getIpColumn())); $event->addTable('page.hits', $data); // Register graphs $context = 'page.hits'; $event->addGraph($context, 'line', 'mautic.page.graph.line.hits'); $event->addGraph($context, 'line', 'mautic.page.graph.line.time.on.site'); $event->addGraph($context, 'pie', 'mautic.page.graph.pie.time.on.site', array('translate' => false)); $event->addGraph($context, 'pie', 'mautic.page.graph.pie.new.vs.returning'); $event->addGraph($context, 'pie', 'mautic.page.graph.pie.languages', array('translate' => false)); $event->addGraph($context, 'table', 'mautic.page.table.referrers'); $event->addGraph($context, 'table', 'mautic.page.table.most.visited'); $event->addGraph($context, 'table', 'mautic.page.table.most.visited.unique'); } } }
/** * Add available tables and columns to the report builder lookup * * @param ReportBuilderEvent $event * * @return void */ public function onReportBuilder(ReportBuilderEvent $event) { if ($event->checkContext(['assets', 'asset.downloads'])) { // Assets $prefix = 'a.'; $columns = [$prefix . 'download_count' => ['label' => 'mautic.asset.report.download_count', 'type' => 'int'], $prefix . 'unique_download_count' => ['label' => 'mautic.asset.report.unique_download_count', 'type' => 'int'], $prefix . 'alias' => ['label' => 'mautic.core.alias', 'type' => 'string'], $prefix . 'lang' => ['label' => 'mautic.core.language', 'type' => 'string'], $prefix . 'title' => ['label' => 'mautic.core.title', 'type' => 'string']]; $columns = array_merge($columns, $event->getStandardColumns($prefix, ['name'], 'mautic_asset_action'), $event->getCategoryColumns()); $event->addTable('assets', ['display_name' => 'mautic.asset.assets', 'columns' => $columns]); if ($event->checkContext(['asset.downloads'])) { // Downloads $downloadPrefix = 'ad.'; $downloadColumns = [$downloadPrefix . 'date_download' => ['label' => 'mautic.asset.report.download.date_download', 'type' => 'datetime'], $downloadPrefix . 'code' => ['label' => 'mautic.asset.report.download.code', 'type' => 'string'], $downloadPrefix . 'referer' => ['label' => 'mautic.core.referer', 'type' => 'string'], $downloadPrefix . 'source' => ['label' => 'mautic.report.field.source', 'type' => 'string'], $downloadPrefix . 'source_id' => ['label' => 'mautic.report.field.source_id', 'type' => 'int']]; $event->addTable('asset.downloads', ['display_name' => 'mautic.asset.report.downloads.table', 'columns' => array_merge($columns, $downloadColumns, $event->getLeadColumns(), $event->getIpColumn())], 'assets'); // Add Graphs $context = 'asset.downloads'; $event->addGraph($context, 'line', 'mautic.asset.graph.line.downloads'); $event->addGraph($context, 'table', 'mautic.asset.table.most.downloaded'); $event->addGraph($context, 'table', 'mautic.asset.table.top.referrers'); $event->addGraph($context, 'pie', 'mautic.asset.graph.pie.statuses', ['translate' => false]); } } }
/** * Add available tables and columns to the report builder lookup. * * @param ReportBuilderEvent $event */ public function onReportBuilder(ReportBuilderEvent $event) { if ($event->checkContext(['forms', 'form.submissions'])) { // Forms $prefix = 'f.'; $columns = [$prefix . 'alias' => ['label' => 'mautic.core.alias', 'type' => 'string']]; $columns = array_merge($columns, $event->getStandardColumns($prefix, [], 'mautic_form_action'), $event->getCategoryColumns()); $data = ['display_name' => 'mautic.form.forms', 'columns' => $columns]; $event->addTable('forms', $data); if ($event->checkContext('form.submissions')) { // Form submissions $submissionPrefix = 'fs.'; $pagePrefix = 'p.'; $submissionColumns = [$submissionPrefix . 'date_submitted' => ['label' => 'mautic.form.report.submit.date_submitted', 'type' => 'datetime'], $submissionPrefix . 'referer' => ['label' => 'mautic.core.referer', 'type' => 'string'], $pagePrefix . 'id' => ['label' => 'mautic.form.report.page_id', 'type' => 'int', 'link' => 'mautic_page_action'], $pagePrefix . 'name' => ['label' => 'mautic.form.report.page_name', 'type' => 'string']]; $data = ['display_name' => 'mautic.form.report.submission.table', 'columns' => array_merge($submissionColumns, $columns, $event->getLeadColumns(), $event->getIpColumn())]; $event->addTable('form.submissions', $data, 'forms'); // Register graphs $context = 'form.submissions'; $event->addGraph($context, 'line', 'mautic.form.graph.line.submissions'); $event->addGraph($context, 'table', 'mautic.form.table.top.referrers'); $event->addGraph($context, 'table', 'mautic.form.table.most.submitted'); } } }