diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-03-29 10:32:46 +0400 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-03-29 10:32:46 +0400 |
commit | f8932466b8151fb11b51193f5e6ad75eeceef2ad (patch) | |
tree | d7aa9e2bfadc19b0bcdc1b16a9ec6908ac1f93df /plugins/Actions | |
parent | f0e9fee730b4b8c330430d2177fe6f7516fd3299 (diff) |
Refs #56
- Added timezone setting per website. Added API to fetch the list of supported timezones. UTC Manual offsets are supported even if the PHP doesn't have timezone support built in.
- Added default timezone setting that the Super user can set. It will be used to pre-select timezones when creating new websites, or setting the default timezone when adding websites via the API without specifying the timezone.
- Default timezone set to UTC to all existing websites on update. PHP Default timezone set to UTC in index.php and piwik.php.
- Removed all usage of mysql date/time functions (which are internally doing timezone conversions based on mysql timezone), now using php generated timestamps (in UTC), or dates manually converted to the website timezone.
- Altered the few Mysql fields that were defaulting to "Current timestamp", they now default to NULL.
- Deprecated the field log_visit.server_date and log_conversion.server_date as they are now not used. Must use DATE(visit_last_action_time) instead. Note that the new INDEX on (idsite, visit_last_action_time, config_md5config) will greatly benefit the Live! plugin.
- Deprecated Piwik_Date->get, must now use Piwik_Date->toString
- Deprecated the DB adapters getCurrentTimezone() feature, as we now don't rely on the DB timezone. Also removed the warning from the install screen.
Diffstat (limited to 'plugins/Actions')
-rw-r--r-- | plugins/Actions/Actions.php | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/plugins/Actions/Actions.php b/plugins/Actions/Actions.php index 371c0ce215..930e869b55 100644 --- a/plugins/Actions/Actions.php +++ b/plugins/Actions/Actions.php @@ -125,6 +125,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( @@ -155,11 +156,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); /* @@ -173,11 +175,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); /* @@ -192,11 +195,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); @@ -210,11 +214,12 @@ class Piwik_Actions extends Piwik_Plugin sum(case visit_total_actions when 1 then 1 else 0 end) as exit_bounce_count 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); /* @@ -226,11 +231,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); } |