Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

Commit

Permalink
Bugfix activities per month
Browse files Browse the repository at this point in the history
  • Loading branch information
arnovr committed Oct 6, 2014
1 parent 6577524 commit 189ab85
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 3 additions & 5 deletions lib/adapters/c3js/activity/activityusagepermonthadapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function formatData($data)
{
$x[] = $date;
}
$result = $this->parseUsernamesToRow($usernames);
$this->parseUsernamesToRow($result, $usernames);
}

$result["x"] = $x;
Expand All @@ -57,13 +57,12 @@ public function formatData($data)
}

/**
* @TODO Check if this isn't obsolete, what goes in and what goes out
* @param array $result
* @param array $usernames
* @return array
*/
private function parseUsernamesToRow(array $usernames)
private function parseUsernamesToRow(&$result, array $usernames)
{
$result = array();
foreach($usernames as $username => $count)
{
if ( !in_array($username, array_keys($result)) )
Expand All @@ -73,7 +72,6 @@ private function parseUsernamesToRow(array $usernames)

$result[$username][] = $count;
}
return $result;
}

}
2 changes: 0 additions & 2 deletions lib/entity/activity/activityusagerepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public function findAllPerMonth($username = '')
for($i = 1; $i <= $runs; $i++)
{
list($startTimestamp, $endTimestamp) = $this->calculateStartAndEndTimestamp($i, $created);

if ( $username !== '' )
{
$return[$created->format('Y-m-d')] = $this->findActivitiesBetweenTimestampAndUser($startTimestamp, $endTimestamp, $username);
Expand All @@ -103,7 +102,6 @@ public function findAllPerMonth($username = '')
$return[$created->format('Y-m-d')] = $this->findActivitiesBetweenTimestamp($startTimestamp, $endTimestamp);
}
}

return $return;
}

Expand Down

0 comments on commit 189ab85

Please sign in to comment.