Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2010-06-23 07:45:36 +0400
committermatt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2010-06-23 07:45:36 +0400
commit7e1b5d6b762340cbff1bb928d15815980c7649a7 (patch)
treee07da179b9e1372866d2349777bd1cc6b4c9e8cf /plugins/Actions
parent999f46479294713104c962bfe7469e9b6e7a4bbf (diff)
parentc98ea06f2cccec81c6ccce49162a583494e44d91 (diff)
Diffstat (limited to 'plugins/Actions')
-rw-r--r--plugins/Actions/API.php13
-rw-r--r--plugins/Actions/Actions.php86
-rw-r--r--plugins/Actions/Controller.php168
-rw-r--r--plugins/Actions/tests/Actions.test.php6
4 files changed, 205 insertions, 68 deletions
diff --git a/plugins/Actions/API.php b/plugins/Actions/API.php
index 658d5da13f..8b45cc989f 100644
--- a/plugins/Actions/API.php
+++ b/plugins/Actions/API.php
@@ -62,7 +62,18 @@ class Piwik_Actions_API
public function getPageUrls( $idSite, $period, $date, $expanded = false, $idSubtable = false )
{
- return $this->getDataTable('Actions_actions_url', $idSite, $period, $date, $expanded, $idSubtable );
+ $dataTable = $this->getDataTable('Actions_actions_url', $idSite, $period, $date, $expanded, $idSubtable );
+
+ // Average time on page = total time on page / number visits on that page
+ $dataTable->filter('ColumnCallbackAddColumnQuotient', array('avg_time_on_page', 'sum_time_spent', 'nb_visits', 0));
+
+ // Bounce rate = single page visits on this page / visits started on this page
+ $dataTable->filter('ColumnCallbackAddColumnPercentage', array('bounce_rate', 'entry_bounce_count', 'entry_nb_visits', 0));
+
+ // % Exit = Number of visits that finished on this page / visits on this page
+ $dataTable->filter('ColumnCallbackAddColumnPercentage', array('exit_rate', 'exit_nb_visits', 'nb_visits', 0));
+
+ return $dataTable;
}
public function getPageTitles( $idSite, $period, $date, $expanded = false, $idSubtable = false)
diff --git a/plugins/Actions/Actions.php b/plugins/Actions/Actions.php
index 199726675a..9919c02019 100644
--- a/plugins/Actions/Actions.php
+++ b/plugins/Actions/Actions.php
@@ -19,7 +19,8 @@
*/
class Piwik_Actions extends Piwik_Plugin
{
- static protected $actionCategoryDelimiter = null;
+ static protected $actionUrlCategoryDelimiter = null;
+ static protected $actionTitleCategoryDelimiter = null;
static protected $defaultActionName = null;
static protected $defaultActionNameWhenNotDefined = null;
static protected $defaultActionUrlWhenNotDefined = null;
@@ -31,11 +32,10 @@ class Piwik_Actions extends Piwik_Plugin
public function getInformation()
{
$info = array(
- 'name' => 'Actions',
- 'description' => 'Reports about the page views, the outlinks and downloads. Outlinks and Downloads tracking is automatic!',
+ 'description' => Piwik_Translate('Actions_PluginDescription'),
'author' => 'Piwik',
- 'homepage' => 'http://piwik.org/',
- 'version' => '0.1',
+ 'author_homepage' => 'http://piwik.org/',
+ 'version' => Piwik_Version::VERSION,
);
return $info;
}
@@ -53,7 +53,18 @@ class Piwik_Actions extends Piwik_Plugin
public function __construct()
{
- self::$actionCategoryDelimiter = Zend_Registry::get('config')->General->action_category_delimiter;
+ // for BC, we read the old style delimiter first (see #1067)
+ $actionDelimiter = Zend_Registry::get('config')->General->action_category_delimiter;
+ if(empty($actionDelimiter))
+ {
+ self::$actionUrlCategoryDelimiter = Zend_Registry::get('config')->General->action_url_category_delimiter;
+ self::$actionTitleCategoryDelimiter = Zend_Registry::get('config')->General->action_title_category_delimiter;
+ }
+ else
+ {
+ self::$actionUrlCategoryDelimiter = self::$actionTitleCategoryDelimiter = $actionDelimiter;
+ }
+
self::$defaultActionName = Zend_Registry::get('config')->General->action_default_name;
self::$defaultActionNameWhenNotDefined = Zend_Registry::get('config')->General->action_default_name_when_not_defined;
self::$defaultActionUrlWhenNotDefined = Zend_Registry::get('config')->General->action_default_url_when_not_defined;
@@ -64,6 +75,8 @@ class Piwik_Actions extends Piwik_Plugin
function addWidgets()
{
+ Piwik_AddWidget( 'Actions_Actions', 'Actions_SubmenuPagesEntry', 'Actions', 'getEntryPageUrls');
+ Piwik_AddWidget( 'Actions_Actions', 'Actions_SubmenuPagesExit', 'Actions', 'getExitPageUrls');
Piwik_AddWidget( 'Actions_Actions', 'Actions_SubmenuPages', 'Actions', 'getPageUrls');
Piwik_AddWidget( 'Actions_Actions', 'Actions_SubmenuPageTitles', 'Actions', 'getPageTitles');
Piwik_AddWidget( 'Actions_Actions', 'Actions_SubmenuOutlinks', 'Actions', 'getOutlinks');
@@ -73,6 +86,8 @@ class Piwik_Actions extends Piwik_Plugin
function addMenus()
{
Piwik_AddMenu('Actions_Actions', 'Actions_SubmenuPages', array('module' => 'Actions', 'action' => 'getPageUrls'));
+ Piwik_AddMenu('Actions_Actions', 'Actions_SubmenuPagesEntry', array('module' => 'Actions', 'action' => 'getEntryPageUrls'));
+ Piwik_AddMenu('Actions_Actions', 'Actions_SubmenuPagesExit', array('module' => 'Actions', 'action' => 'getExitPageUrls'));
Piwik_AddMenu('Actions_Actions', 'Actions_SubmenuPageTitles', array('module' => 'Actions', 'action' => 'getPageTitles'));
Piwik_AddMenu('Actions_Actions', 'Actions_SubmenuOutlinks', array('module' => 'Actions', 'action' => 'getOutlinks'));
Piwik_AddMenu('Actions_Actions', 'Actions_SubmenuDownloads', array('module' => 'Actions', 'action' => 'getDownloads'));
@@ -113,6 +128,7 @@ class Piwik_Actions extends Piwik_Plugin
public function archiveDay( $notification )
{
//TODO Actions should use integer based keys like other archive in piwik
+ /* @var $archiveProcessing Piwik_ArchiveProcessing */
$archiveProcessing = $notification->getNotificationObject();
$this->actionsTablesByType = array(
@@ -143,11 +159,12 @@ class Piwik_Actions extends Piwik_Plugin
FROM (".$archiveProcessing->logTable." as t1
LEFT JOIN ".$archiveProcessing->logVisitActionTable." as t2 USING (idvisit))
LEFT JOIN ".$archiveProcessing->logActionTable." as t3 ON (t2.idaction_url = t3.idaction)
- WHERE visit_server_date = ?
+ WHERE visit_last_action_time >= ?
+ AND visit_last_action_time <= ?
AND idsite = ?
GROUP BY t3.idaction
ORDER BY nb_hits DESC";
- $query = $archiveProcessing->db->query($query, array( $archiveProcessing->strDateStart, $archiveProcessing->idsite ));
+ $query = $archiveProcessing->db->query($query, array( $archiveProcessing->getStartDatetimeUTC(), $archiveProcessing->getEndDatetimeUTC(), $archiveProcessing->idsite ));
$modified = $this->updateActionsTableWithRowQuery($query);
/*
@@ -161,11 +178,12 @@ class Piwik_Actions extends Piwik_Plugin
FROM (".$archiveProcessing->logTable." as t1
LEFT JOIN ".$archiveProcessing->logVisitActionTable." as t2 USING (idvisit))
LEFT JOIN ".$archiveProcessing->logActionTable." as t3 ON (t2.idaction_name = t3.idaction)
- WHERE visit_server_date = ?
+ WHERE visit_last_action_time >= ?
+ AND visit_last_action_time <= ?
AND idsite = ?
GROUP BY t3.idaction
ORDER BY nb_hits DESC";
- $query = $archiveProcessing->db->query($query, array( $archiveProcessing->strDateStart, $archiveProcessing->idsite ));
+ $query = $archiveProcessing->db->query($query, array( $archiveProcessing->getStartDatetimeUTC(), $archiveProcessing->getEndDatetimeUTC(), $archiveProcessing->idsite ));
$modified = $this->updateActionsTableWithRowQuery($query);
/*
@@ -180,11 +198,12 @@ class Piwik_Actions extends Piwik_Plugin
sum(case visit_total_actions when 1 then 1 else 0 end) as entry_bounce_count
FROM ".$archiveProcessing->logTable."
JOIN ".$archiveProcessing->logActionTable." ON (visit_entry_idaction_url = idaction)
- WHERE visit_server_date = ?
+ WHERE visit_last_action_time >= ?
+ AND visit_last_action_time <= ?
AND idsite = ?
GROUP BY visit_entry_idaction_url
";
- $query = $archiveProcessing->db->query($query, array( $archiveProcessing->strDateStart, $archiveProcessing->idsite ));
+ $query = $archiveProcessing->db->query($query, array( $archiveProcessing->getStartDatetimeUTC(), $archiveProcessing->getEndDatetimeUTC(), $archiveProcessing->idsite ));
$modified = $this->updateActionsTableWithRowQuery($query);
@@ -194,15 +213,15 @@ class Piwik_Actions extends Piwik_Plugin
$query = "SELECT name,
type,
count(distinct visitor_idcookie) as exit_nb_uniq_visitors,
- count(*) as exit_nb_visits,
- sum(case visit_total_actions when 1 then 1 else 0 end) as exit_bounce_count
+ count(*) as exit_nb_visits
FROM ".$archiveProcessing->logTable."
JOIN ".$archiveProcessing->logActionTable." ON (visit_exit_idaction_url = idaction)
- WHERE visit_server_date = ?
+ WHERE visit_last_action_time >= ?
+ AND visit_last_action_time <= ?
AND idsite = ?
GROUP BY visit_exit_idaction_url
";
- $query = $archiveProcessing->db->query($query, array( $archiveProcessing->strDateStart, $archiveProcessing->idsite ));
+ $query = $archiveProcessing->db->query($query, array( $archiveProcessing->getStartDatetimeUTC(), $archiveProcessing->getEndDatetimeUTC(), $archiveProcessing->idsite ));
$modified = $this->updateActionsTableWithRowQuery($query);
/*
@@ -214,11 +233,12 @@ class Piwik_Actions extends Piwik_Plugin
FROM (".$archiveProcessing->logTable." log_visit
JOIN ".$archiveProcessing->logVisitActionTable." log_link_visit_action USING (idvisit))
JOIN ".$archiveProcessing->logActionTable." log_action ON (log_action.idaction = log_link_visit_action.idaction_url_ref)
- WHERE visit_server_date = ?
+ WHERE visit_last_action_time >= ?
+ AND visit_last_action_time <= ?
AND idsite = ?
GROUP BY idaction_url_ref
";
- $query = $archiveProcessing->db->query($query, array( $archiveProcessing->strDateStart, $archiveProcessing->idsite ));
+ $query = $archiveProcessing->db->query($query, array( $archiveProcessing->getStartDatetimeUTC(), $archiveProcessing->getEndDatetimeUTC(), $archiveProcessing->idsite ));
$modified = $this->updateActionsTableWithRowQuery($query);
$this->archiveDayRecordInDatabase($archiveProcessing);
}
@@ -320,12 +340,21 @@ class Piwik_Actions extends Piwik_Plugin
}
}
- if(empty(self::$actionCategoryDelimiter))
+ if($type == Piwik_Tracker_Action::TYPE_ACTION_NAME)
+ {
+ $categoryDelimiter = self::$actionTitleCategoryDelimiter;
+ }
+ else
+ {
+ $categoryDelimiter = self::$actionUrlCategoryDelimiter;
+ }
+
+ if(empty($categoryDelimiter))
{
return array( trim($name) );
}
- $split = explode(self::$actionCategoryDelimiter, $name, self::$limitLevelSubCategory);
+ $split = explode($categoryDelimiter, $name, self::$limitLevelSubCategory);
// trim every category and remove empty categories
$split = array_map('trim', $split);
@@ -349,9 +378,14 @@ class Piwik_Actions extends Piwik_Plugin
$rowsProcessed = 0;
while( $row = $query->fetch() )
{
+ // in some unknown case, the type field is NULL, as reported in #1082 - we ignore this page view
+ if(empty($row['type'])) {
+ continue;
+ }
+
$actionExplodedNames = $this->getActionExplodedNames($row['name'], $row['type']);
- // we work on the root table of the given TYPE (either ACTION or DOWNLOAD or OUTLINK etc.)
+ // we work on the root table of the given TYPE (either ACTION_URL or DOWNLOAD or OUTLINK etc.)
$currentTable =& $this->actionsTablesByType[$row['type']];
// go to the level of the subcategory
@@ -370,7 +404,7 @@ class Piwik_Actions extends Piwik_Plugin
{
$actionName = '/' . $actionName;
}
- else if( $row['type'] == Piwik_Tracker_Action::TYPE_ACTION_NAME )
+ else
{
$actionName = ' ' . $actionName;
}
@@ -397,6 +431,14 @@ class Piwik_Actions extends Piwik_Plugin
}
}
+ // For pages that bounce, we don't know the time on page.
+ if($row['type'] == Piwik_Tracker_Action::TYPE_ACTION_URL
+ && isset($row['nb_visits'])
+ && !isset($row['sum_time_spent']))
+ {
+ $row['sum_time_spent'] = Zend_Registry::get('config')->Tracker->default_time_one_page_visit * $row['nb_visits'];
+ }
+
foreach($row as $name => $value)
{
// we don't add this information as itnot pertinent
diff --git a/plugins/Actions/Controller.php b/plugins/Actions/Controller.php
index 64974199b4..5e85433fbb 100644
--- a/plugins/Actions/Controller.php
+++ b/plugins/Actions/Controller.php
@@ -17,29 +17,91 @@
*/
class Piwik_Actions_Controller extends Piwik_Controller
{
- public function getPageUrls($fetch = false)
+ const ACTIONS_REPORT_ROWS_DISPLAY = 100;
+
+ protected function getPageUrlsView($currentAction, $controllerActionSubtable)
{
$view = Piwik_ViewDataTable::factory();
$view->init( $this->pluginName,
- __FUNCTION__,
+ $currentAction,
'Actions.getPageUrls',
- 'getPageUrlsSubDataTable' );
+ $controllerActionSubtable );
$view->setColumnTranslation('label', Piwik_Translate('Actions_ColumnPageURL'));
+ return $view;
+ }
+
+ public function getPageUrls($fetch = false)
+ {
+ $view = $this->getPageUrlsView(__FUNCTION__, 'getPageUrlsSubDataTable');
+ $this->configureViewPageUrls($view);
$this->configureViewActions($view);
return $this->renderView($view, $fetch);
}
public function getPageUrlsSubDataTable($fetch = false)
{
- $view = Piwik_ViewDataTable::factory();
- $view->init( $this->pluginName,
- __FUNCTION__,
- 'Actions.getPageUrls',
- 'getActionsSubDataTable' );
+ $view = $this->getPageUrlsView(__FUNCTION__, 'getPageUrlsSubDataTable');
+ $this->configureViewPageUrls($view);
+ $this->configureViewActions($view);
+ return $this->renderView($view, $fetch);
+ }
+
+ protected function configureViewPageUrls($view)
+ {
+ $view->setColumnsToDisplay( array('label','nb_hits','nb_visits', 'bounce_rate', 'avg_time_on_page', 'exit_rate') );
+ }
+
+ public function getEntryPageUrls($fetch = false)
+ {
+ $view = $this->getPageUrlsView(__FUNCTION__, 'getEntryPageUrlsSubDataTable');
+ $this->configureViewEntryPageUrls($view);
+ $this->configureViewActions($view);
+ return $this->renderView($view, $fetch);
+ }
+
+ public function getEntryPageUrlsSubDataTable($fetch = false)
+ {
+ $view = $this->getPageUrlsView(__FUNCTION__, 'getEntryPageUrlsSubDataTable');
+ $this->configureViewEntryPageUrls($view);
$this->configureViewActions($view);
return $this->renderView($view, $fetch);
}
+
+ protected function configureViewEntryPageUrls($view)
+ {
+ $view->setSortedColumn('entry_nb_visits');
+ $view->setColumnsToDisplay( array('label','entry_nb_visits', 'entry_bounce_count', 'bounce_rate') );
+ $view->setColumnTranslation('entry_bounce_count', Piwik_Translate('General_ColumnBounces'), Piwik_Translate('General_BouncesDefinition'));
+ $view->setColumnTranslation('entry_nb_visits', Piwik_Translate('General_ColumnEntrances'), Piwik_Translate('General_EntrancesDefinition'));
+ // remove pages that are not entry pages
+ $view->queueFilter('ColumnCallbackDeleteRow', array('entry_nb_visits', 'strlen'));
+ }
+ public function getExitPageUrls($fetch = false)
+ {
+ $view = $this->getPageUrlsView(__FUNCTION__, 'getExitPageUrlsSubDataTable');
+ $this->configureViewExitPageUrls($view);
+ $this->configureViewActions($view);
+ return $this->renderView($view, $fetch);
+ }
+
+ public function getExitPageUrlsSubDataTable($fetch = false)
+ {
+ $view = $this->getPageUrlsView(__FUNCTION__, 'getExitPageUrlsSubDataTable');
+ $this->configureViewExitPageUrls($view);
+ $this->configureViewActions($view);
+ return $this->renderView($view, $fetch);
+ }
+
+ protected function configureViewExitPageUrls($view)
+ {
+ $view->setSortedColumn('exit_nb_visits');
+ $view->setColumnsToDisplay( array('label', 'exit_nb_visits', 'nb_visits', 'exit_rate') );
+ $view->setColumnTranslation('exit_nb_visits', Piwik_Translate('General_ColumnExits'), Piwik_Translate('General_ExitsDefinition'));
+ // remove pages that are not exit pages
+ $view->queueFilter('ColumnCallbackDeleteRow', array('exit_nb_visits', 'strlen'));
+ }
+
public function getPageTitles($fetch = false)
{
$view = Piwik_ViewDataTable::factory();
@@ -48,6 +110,7 @@ class Piwik_Actions_Controller extends Piwik_Controller
'Actions.getPageTitles',
'getPageTitlesSubDataTable' );
$view->setColumnTranslation('label', Piwik_Translate('Actions_ColumnPageName'));
+ $this->configureViewPageTitles($view);
$this->configureViewActions($view);
return $this->renderView($view, $fetch);
}
@@ -59,10 +122,16 @@ class Piwik_Actions_Controller extends Piwik_Controller
__FUNCTION__,
'Actions.getPageTitles',
'getPageTitlesSubDataTable' );
+ $this->configureViewPageTitles($view);
$this->configureViewActions($view);
return $this->renderView($view, $fetch);
}
+ protected function configureViewPageTitles($view)
+ {
+ $view->setColumnsToDisplay( array('label','nb_hits','nb_visits') );
+ }
+
public function getDownloads($fetch = false)
{
$view = Piwik_ViewDataTable::factory();
@@ -72,7 +141,6 @@ class Piwik_Actions_Controller extends Piwik_Controller
'getDownloadsSubDataTable' );
$this->configureViewDownloads($view);
- $view->disableShowAllColumns();
return $this->renderView($view, $fetch);
}
@@ -84,7 +152,6 @@ class Piwik_Actions_Controller extends Piwik_Controller
'Actions.getDownloads',
'getDownloadsSubDataTable');
$this->configureViewDownloads($view);
- $view->disableSearchBox();
return $this->renderView($view, $fetch);
}
@@ -96,8 +163,6 @@ class Piwik_Actions_Controller extends Piwik_Controller
'Actions.getOutlinks',
'getOutlinksSubDataTable' );
$this->configureViewOutlinks($view);
- $view->disableExcludeLowPopulation();
- $view->disableShowAllColumns();
return $this->renderView($view, $fetch);
}
@@ -109,34 +174,21 @@ class Piwik_Actions_Controller extends Piwik_Controller
'Actions.getOutlinks',
'getOutlinksSubDataTable');
$this->configureViewOutlinks($view);
- $view->disableSearchBox();
return $this->renderView($view, $fetch);
}
+ /*
+ * Page titles & Page URLs reports
+ */
protected function configureViewActions($view)
{
- $view->setTemplate('CoreHome/templates/datatable_actions.tpl');
-
- if(Piwik_Common::getRequestVar('idSubtable', -1) != -1)
- {
- $view->setTemplate('CoreHome/templates/datatable_actions_subdatable.tpl');
- }
- $currentlySearching = $view->setSearchRecursive();
-
- if($currentlySearching)
- {
- $view->setTemplate('CoreHome/templates/datatable_actions_recursive.tpl');
- }
- $view->disableSort();
- $view->disableOffsetInformation();
- $view->disableShowAllViewsIcons();
- $view->disableShowAllColumns();
-
- $view->setLimit( 100 );
- $view->setColumnsToDisplay( array('label','nb_hits','nb_visits') );
$view->setColumnTranslation('nb_hits', Piwik_Translate('General_ColumnPageviews'));
$view->setColumnTranslation('nb_visits', Piwik_Translate('General_ColumnUniquePageviews'));
-
+ $view->setColumnTranslation('avg_time_on_page', Piwik_Translate('General_ColumnAverageTimeOnPage'), Piwik_Translate('General_AverageTimeOnPageDefinition'));
+ $view->setColumnTranslation('bounce_rate', Piwik_Translate('General_ColumnBounceRate'), Piwik_Translate('General_PageBounceRateDefinition'));
+ $view->setColumnTranslation('exit_rate', Piwik_Translate('General_ColumnExitRate'), Piwik_Translate('General_PageExitRateDefinition'));
+ $view->queueFilter('ColumnCallbackReplace', array('avg_time_on_page', array('Piwik', 'getPrettyTimeFromSeconds')));
+
if(Piwik_Common::getRequestVar('enable_filter_excludelowpop', '0', 'string' ) != '0')
{
// computing minimum value to exclude
@@ -150,18 +202,14 @@ class Piwik_Actions_Controller extends Piwik_Controller
$view->setExcludeLowPopulation( 'nb_hits', $nbActionsLowPopulationThreshold );
}
-
- $view->main();
-
- // we need to rewrite the phpArray so it contains all the recursive arrays
- if($currentlySearching)
- {
- $phpArrayRecursive = $this->getArrayFromRecursiveDataTable($view->getDataTable());
- $view->getView()->arrayDataTable = $phpArrayRecursive;
- }
+
+ $this->configureGenericViewActions($view);
return $view;
}
+ /*
+ * Downloads report
+ */
protected function configureViewDownloads($view)
{
$view->setColumnsToDisplay( array('label','nb_visits','nb_hits') );
@@ -169,9 +217,12 @@ class Piwik_Actions_Controller extends Piwik_Controller
$view->setColumnTranslation('nb_hits', Piwik_Translate('Actions_ColumnDownloads'));
$view->setColumnTranslation('nb_visits', Piwik_Translate('Actions_ColumnUniqueDownloads'));
$view->disableExcludeLowPopulation();
- $view->setLimit( 15 );
+ $this->configureGenericViewActions($view);
}
+ /*
+ * Outlinks report
+ */
protected function configureViewOutlinks($view)
{
$view->setColumnsToDisplay( array('label','nb_visits','nb_hits') );
@@ -179,9 +230,38 @@ class Piwik_Actions_Controller extends Piwik_Controller
$view->setColumnTranslation('nb_hits', Piwik_Translate('Actions_ColumnClicks'));
$view->setColumnTranslation('nb_visits', Piwik_Translate('Actions_ColumnUniqueClicks'));
$view->disableExcludeLowPopulation();
- $view->setLimit( 15 );
+ $this->configureGenericViewActions($view);
}
+ /*
+ * Common to all Actions reports, how to use the custom Actions Datatable html
+ */
+ protected function configureGenericViewActions($view)
+ {
+ $view->setTemplate('CoreHome/templates/datatable_actions.tpl');
+ if(Piwik_Common::getRequestVar('idSubtable', -1) != -1)
+ {
+ $view->setTemplate('CoreHome/templates/datatable_actions_subdatable.tpl');
+ }
+ $currentlySearching = $view->setSearchRecursive();
+ if($currentlySearching)
+ {
+ $view->setTemplate('CoreHome/templates/datatable_actions_recursive.tpl');
+ }
+ // disable Footer icons
+ $view->disableShowAllViewsIcons();
+ $view->disableShowAllColumns();
+
+ $view->setLimit( self::ACTIONS_REPORT_ROWS_DISPLAY );
+ $view->main();
+ // we need to rewrite the phpArray so it contains all the recursive arrays
+ if($currentlySearching)
+ {
+ $phpArrayRecursive = $this->getArrayFromRecursiveDataTable($view->getDataTable());
+ $view->getView()->arrayDataTable = $phpArrayRecursive;
+ }
+ }
+
protected function getArrayFromRecursiveDataTable( $dataTable, $depth = 0 )
{
$table = array();
diff --git a/plugins/Actions/tests/Actions.test.php b/plugins/Actions/tests/Actions.test.php
index 08f11e81ef..a7f0197334 100644
--- a/plugins/Actions/tests/Actions.test.php
+++ b/plugins/Actions/tests/Actions.test.php
@@ -56,7 +56,11 @@ class Test_Piwik_Actions extends UnitTestCase
),
array(
'params' => array( 'name' => '', 'type' => Piwik_Tracker_Action::TYPE_ACTION_NAME),
- 'expected' => array( 'index' ),
+ 'expected' => array( Zend_Registry::get('config')->General->action_default_name_when_not_defined ),
+ ),
+ array(
+ 'params' => array( 'name' => '', 'type' => Piwik_Tracker_Action::TYPE_ACTION_URL),
+ 'expected' => array( Zend_Registry::get('config')->General->action_default_url_when_not_defined ),
),
array(
'params' => array( 'name' => 'http://example.org/download.zip', 'type' => Piwik_Tracker_Action::TYPE_DOWNLOAD),