add closed tasks

- the entity has a new column / property "closed" (boolean)
- An event listener in created during container compilation, which listen on tasks
  status changed
- The taskworkflow manager and task workflow definition indicate if the tasks is closed ;
- Add list for closed tasks in controller, and change parameter 'date_status' to 'status';
- and change query to allow to filter on closed tasks
This commit is contained in:
2018-04-26 12:11:06 +02:00
parent d251074430
commit eadaeaef35
9 changed files with 131 additions and 31 deletions

View File

@@ -0,0 +1,28 @@
<?php declare(strict_types = 1);
namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
/**
* Add a column 'closed' on tasks
*/
class Version20180426093011 extends AbstractMigration
{
public function up(Schema $schema)
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE chill_task.single_task ADD closed BOOLEAN DEFAULT \'false\' NOT NULL');
$this->addSql('ALTER TABLE chill_task.recurring_task ADD closed BOOLEAN DEFAULT \'false\' NOT NULL');
}
public function down(Schema $schema)
{
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE chill_task.recurring_task DROP closed');
$this->addSql('ALTER TABLE chill_task.single_task DROP closed');
}
}

View File

@@ -100,7 +100,7 @@
{% else %}
<ul class="record_actions">
<li>
<a href="{{ path('chill_task_task_list_by_person', {'personId': person.id, 'date_status' : [ status ] }) }}" class="sc-button bt-cancel">
<a href="{{ path('chill_task_task_list_by_person', {'personId': person.id, 'status' : [ status ] }) }}" class="sc-button bt-cancel">
{{ 'See more' | trans }}
</a>
</li>
@@ -132,6 +132,10 @@
{% if single_task_not_started_tasks is defined %}
{{ helper.date_status('Tasks not started', single_task_not_started_tasks, single_task_not_started_count, single_task_not_started_paginator, 'not_started', isSingleStatus, person) }}
{% endif %}
{% if single_task_closed_tasks is defined %}
{{ helper.date_status('Closed', single_task_closed_tasks, single_task_closed_count, single_task_closed_paginator, 'closed', isSingleStatus, person) }}
{% endif %}
{% if isSingleStatus == false %}
<ul class="record_actions">