Fix bug: closing all tasks by column, also update closed tasks
This commit is contained in:
@@ -22,6 +22,7 @@ Improvements:
|
|||||||
|
|
||||||
Bug fixes:
|
Bug fixes:
|
||||||
|
|
||||||
|
* Closing all tasks by column, also update closed tasks
|
||||||
* Fixed wrong task link generation within Markdown text
|
* Fixed wrong task link generation within Markdown text
|
||||||
* Fixed wrong URL on comment toggle link for sorting
|
* Fixed wrong URL on comment toggle link for sorting
|
||||||
* Fixed form submission with Meta+Enter keyboard shortcut
|
* Fixed form submission with Meta+Enter keyboard shortcut
|
||||||
|
|||||||
@@ -83,7 +83,13 @@ class TaskStatus extends Base
|
|||||||
*/
|
*/
|
||||||
public function closeTasksBySwimlaneAndColumn($swimlane_id, $column_id)
|
public function closeTasksBySwimlaneAndColumn($swimlane_id, $column_id)
|
||||||
{
|
{
|
||||||
$task_ids = $this->db->table(Task::TABLE)->eq('swimlane_id', $swimlane_id)->eq('column_id', $column_id)->findAllByColumn('id');
|
$task_ids = $this->db
|
||||||
|
->table(Task::TABLE)
|
||||||
|
->eq('swimlane_id', $swimlane_id)
|
||||||
|
->eq('column_id', $column_id)
|
||||||
|
->eq(Task::TABLE.'.is_active', Task::STATUS_OPEN)
|
||||||
|
->findAllByColumn('id');
|
||||||
|
|
||||||
$this->closeMultipleTasks($task_ids);
|
$this->closeMultipleTasks($task_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ class TaskStatusTest extends Base
|
|||||||
$this->assertEquals(2, $tc->create(array('title' => 'test', 'project_id' => 1)));
|
$this->assertEquals(2, $tc->create(array('title' => 'test', 'project_id' => 1)));
|
||||||
$this->assertEquals(3, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2)));
|
$this->assertEquals(3, $tc->create(array('title' => 'test', 'project_id' => 1, 'column_id' => 2)));
|
||||||
$this->assertEquals(4, $tc->create(array('title' => 'test', 'project_id' => 1, 'swimlane_id' => 1)));
|
$this->assertEquals(4, $tc->create(array('title' => 'test', 'project_id' => 1, 'swimlane_id' => 1)));
|
||||||
|
$this->assertEquals(5, $tc->create(array('title' => 'test', 'project_id' => 1, 'is_active' => 0, 'date_completed' => strtotime('2015-01-01'))));
|
||||||
|
|
||||||
|
$taskBefore = $tf->getById(5);
|
||||||
|
|
||||||
$this->assertEquals(2, $tf->countByColumnAndSwimlaneId(1, 1, 0));
|
$this->assertEquals(2, $tf->countByColumnAndSwimlaneId(1, 1, 0));
|
||||||
$this->assertEquals(1, $tf->countByColumnAndSwimlaneId(1, 1, 1));
|
$this->assertEquals(1, $tf->countByColumnAndSwimlaneId(1, 1, 1));
|
||||||
@@ -45,6 +48,10 @@ class TaskStatusTest extends Base
|
|||||||
$this->assertEquals(0, $tf->countByColumnAndSwimlaneId(1, 1, 0));
|
$this->assertEquals(0, $tf->countByColumnAndSwimlaneId(1, 1, 0));
|
||||||
$this->assertEquals(0, $tf->countByColumnAndSwimlaneId(1, 1, 1));
|
$this->assertEquals(0, $tf->countByColumnAndSwimlaneId(1, 1, 1));
|
||||||
$this->assertEquals(0, $tf->countByColumnAndSwimlaneId(1, 2, 0));
|
$this->assertEquals(0, $tf->countByColumnAndSwimlaneId(1, 2, 0));
|
||||||
|
|
||||||
|
$taskAfter = $tf->getById(5);
|
||||||
|
$this->assertEquals(strtotime('2015-01-01'), $taskAfter['date_completed']);
|
||||||
|
$this->assertEquals($taskBefore['date_modification'], $taskAfter['date_modification']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testStatus()
|
public function testStatus()
|
||||||
|
|||||||
Reference in New Issue
Block a user