Skip to content

Commit

Permalink
[jan] Don't return future tasks from cost objects API.
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Nov 28, 2013
1 parent e5a0412 commit 5501c97
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions nag/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v4.1.4-git
----------

[jan] Don't return future tasks from cost objects API.


------
Expand Down
6 changes: 4 additions & 2 deletions nag/lib/Api.php
Expand Up @@ -1258,9 +1258,11 @@ public function listCostObjects($criteria)
);
$result = array();
$tasks->reset();
$last_week = time() - 7 * 86400;
$now = time();
$last_week = $now - 7 * 86400;
while ($task = $tasks->each()) {
if ($task->completed && $task->completed_date < $last_week) {
if (($task->completed && $task->completed_date < $last_week) ||
($task->start && $task->start > $now)) {
continue;
}
$result[$task->id] = array(
Expand Down
4 changes: 2 additions & 2 deletions nag/package.xml
Expand Up @@ -33,7 +33,7 @@
</stability>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
*
* [jan] Don&apos;t return future tasks from cost objects API.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -1441,7 +1441,7 @@
<date>2013-10-29</date>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
*
* [jan] Don&apos;t return future tasks from cost objects API.
</notes>
</release>
</changelog>
Expand Down

0 comments on commit 5501c97

Please sign in to comment.