diff options
-rw-r--r-- | CONTRIBUTORS.md | 1 | ||||
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | app/Model/SubtaskTimeTracking.php | 17 | ||||
-rw-r--r-- | composer.json | 4 | ||||
-rw-r--r-- | composer.lock | 26 | ||||
-rw-r--r-- | tests/units/SubtaskTimeTrackingTest.php | 16 |
7 files changed, 44 insertions, 24 deletions
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index a8e077a1..9c0c2414 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -20,6 +20,7 @@ Contributors: - [Cynthia Pereira](https://github.com/cynthiapereira) - [David-Norris](https://github.com/David-Norris) - [Draza (bdpsoft)](https://github.com/bdpsoft) +- [Eskiso](https://github.com/eSkiSo) - [Esteban Monge](https://github.com/EstebanMonge) - [Fábio Hideki](https://github.com/fabiohxcx) - [Federico Lazcano](https://github.com/lazki) @@ -8,6 +8,7 @@ New features: * Add user api access * Add config parameter to define session duration * Add config parameter to disable/enable RememberMe authentication +* Add Portuguese (European) translation Improvements: @@ -21,6 +22,7 @@ Bug fixes: * Wrong template name for subtasks tooltip due to previous refactoring * Fix broken url for closed tasks in project view * Fix permission issue when changing the url manually +* Fix bug task estimate is reseted when using subtask timer Version 1.0.17 -------------- @@ -11,7 +11,7 @@ Official website: <http://kanboard.net> - Minimalist software, focus only on essential features (Less is more) - Open source and self-hosted - Super simple installation -- Translated in 19 languages +- Translated in 20 languages - Distributed under [MIT License](LICENSE) - [List of features are available on the website](http://kanboard.net/features) - [Change Log](ChangeLog) diff --git a/app/Model/SubtaskTimeTracking.php b/app/Model/SubtaskTimeTracking.php index 9f17ee3f..997031e8 100644 --- a/app/Model/SubtaskTimeTracking.php +++ b/app/Model/SubtaskTimeTracking.php @@ -301,7 +301,6 @@ class SubtaskTimeTracking extends Base ->findOneColumn('start'); if ($start_time) { - $start = new DateTime; $start->setTimestamp($start_time); @@ -341,18 +340,24 @@ class SubtaskTimeTracking extends Base public function updateTaskTimeTracking($task_id) { $result = $this->calculateSubtaskTime($task_id); + $values = array(); + + if ($result['total_spent'] > 0) { + $values['time_spent'] = $result['total_spent']; + } - if (empty($result['total_spent']) && empty($result['total_estimated'])) { + if ($result['total_estimated'] > 0) { + $values['time_estimated'] = $result['total_estimated']; + } + + if (empty($values)) { return true; } return $this->db ->table(Task::TABLE) ->eq('id', $task_id) - ->update(array( - 'time_spent' => $result['total_spent'], - 'time_estimated' => $result['total_estimated'], - )); + ->update($values); } /** diff --git a/composer.json b/composer.json index c1f12c6f..a2b41f57 100644 --- a/composer.json +++ b/composer.json @@ -7,8 +7,8 @@ "eluceo/ical": "0.8.0", "erusev/parsedown" : "1.5.3", "fabiang/xmpp" : "0.6.1", - "fguillot/json-rpc" : "dev-master", - "fguillot/picodb" : "1.0.0", + "fguillot/json-rpc" : "1.0.1", + "fguillot/picodb" : "1.0.1", "fguillot/simpleLogger" : "0.0.2", "fguillot/simple-validator" : "0.0.3", "nickcernis/html-to-markdown" : "2.2.1", diff --git a/composer.lock b/composer.lock index 6ec8ac46..8dfc3e46 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "aa2376c6b4ac36457adf8cf46f584fd9", + "hash": "f708764553321994743c3d42c4d6e512", "packages": [ { "name": "christian-riesen/base32", @@ -260,20 +260,20 @@ }, { "name": "fguillot/json-rpc", - "version": "dev-master", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/fguillot/JsonRPC.git", - "reference": "050f046b1cae99210ae2fe64618831d3961f5bd9" + "reference": "9a117e964c4c6ad026da7ae1ca155f7686e3deaf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fguillot/JsonRPC/zipball/050f046b1cae99210ae2fe64618831d3961f5bd9", - "reference": "050f046b1cae99210ae2fe64618831d3961f5bd9", + "url": "https://api.github.com/repos/fguillot/JsonRPC/zipball/9a117e964c4c6ad026da7ae1ca155f7686e3deaf", + "reference": "9a117e964c4c6ad026da7ae1ca155f7686e3deaf", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": ">=5.3.4" }, "type": "library", "autoload": { @@ -292,20 +292,20 @@ ], "description": "Simple Json-RPC client/server library that just works", "homepage": "https://github.com/fguillot/JsonRPC", - "time": "2015-07-29 20:56:20" + "time": "2015-08-07 22:31:21" }, { "name": "fguillot/picodb", - "version": "v1.0.0", + "version": "v1.0.1", "source": { "type": "git", "url": "https://github.com/fguillot/picoDb.git", - "reference": "6d9e2314a7aa2893a49c7da7b66f7352bd6ea296" + "reference": "8a311523d114180e04a1e08ced6766f26d7ebbae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fguillot/picoDb/zipball/6d9e2314a7aa2893a49c7da7b66f7352bd6ea296", - "reference": "6d9e2314a7aa2893a49c7da7b66f7352bd6ea296", + "url": "https://api.github.com/repos/fguillot/picoDb/zipball/8a311523d114180e04a1e08ced6766f26d7ebbae", + "reference": "8a311523d114180e04a1e08ced6766f26d7ebbae", "shasum": "" }, "require": { @@ -329,7 +329,7 @@ ], "description": "Minimalist database query builder", "homepage": "https://github.com/fguillot/picoDb", - "time": "2015-06-27 16:13:40" + "time": "2015-08-13 01:44:29" }, { "name": "fguillot/simple-validator", @@ -805,11 +805,11 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "fguillot/json-rpc": 20, "swiftmailer/swiftmailer": 0, "symfony/console": 0 }, "prefer-stable": false, + "prefer-lowest": false, "platform": { "php": ">=5.3", "ext-mbstring": "*", diff --git a/tests/units/SubtaskTimeTrackingTest.php b/tests/units/SubtaskTimeTrackingTest.php index 27ba7c7d..94f2ce54 100644 --- a/tests/units/SubtaskTimeTrackingTest.php +++ b/tests/units/SubtaskTimeTrackingTest.php @@ -205,12 +205,19 @@ class SubtaskTimeTrackingTest extends Base $this->assertEquals(1, $tc->create(array('title' => 'test 1', 'project_id' => 1))); $this->assertEquals(2, $tc->create(array('title' => 'test 2', 'project_id' => 1, 'time_estimated' => 1.5, 'time_spent' => 0.5))); + $this->assertEquals(3, $tc->create(array('title' => 'test 2', 'project_id' => 1, 'time_estimated' => 4, 'time_spent' => 2))); $this->assertEquals(1, $s->create(array('title' => 'subtask #1', 'task_id' => 1, 'time_spent' => 2.2))); $this->assertEquals(2, $s->create(array('title' => 'subtask #2', 'task_id' => 1, 'time_estimated' => 1))); + $this->assertEquals(3, $s->create(array('title' => 'subtask #3', 'task_id' => 2, 'time_spent' => 3.4))); + $this->assertEquals(4, $s->create(array('title' => 'subtask #4', 'task_id' => 2, 'time_estimated' => 1.25))); + + $this->assertEquals(5, $s->create(array('title' => 'subtask #5', 'task_id' => 3, 'time_spent' => 8))); + $st->updateTaskTimeTracking(1); $st->updateTaskTimeTracking(2); + $st->updateTaskTimeTracking(3); $task = $tf->getById(1); $this->assertNotEmpty($task); @@ -219,8 +226,13 @@ class SubtaskTimeTrackingTest extends Base $task = $tf->getById(2); $this->assertNotEmpty($task); - $this->assertEquals(0.5, $task['time_spent'], 'Total spent', 0.01); - $this->assertEquals(1.5, $task['time_estimated'], 'Total estimated', 0.01); + $this->assertEquals(3.4, $task['time_spent'], 'Total spent', 0.01); + $this->assertEquals(1.25, $task['time_estimated'], 'Total estimated', 0.01); + + $task = $tf->getById(3); + $this->assertNotEmpty($task); + $this->assertEquals(4, $task['time_estimated']); + $this->assertEquals(8, $task['time_spent']); } public function testGetCalendarEvents() |