summaryrefslogtreecommitdiff
path: root/app/ServiceProvider
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-04-10 15:18:20 -0400
committerFrederic Guillot <fred@kanboard.net>2016-04-10 15:18:20 -0400
commit9f0166502b8b8886156bcb4ad0497cd9ee5a60b2 (patch)
tree425f829d3ace03eec5cbcaddf667d752046d75c6 /app/ServiceProvider
parent2eadfb22912d94e76a479b694070735fbb0298f1 (diff)
Added search in activity stream
Diffstat (limited to 'app/ServiceProvider')
-rw-r--r--app/ServiceProvider/FilterProvider.php30
-rw-r--r--app/ServiceProvider/RouteProvider.php3
2 files changed, 27 insertions, 6 deletions
diff --git a/app/ServiceProvider/FilterProvider.php b/app/ServiceProvider/FilterProvider.php
index 4b4dbd2d..f3918d77 100644
--- a/app/ServiceProvider/FilterProvider.php
+++ b/app/ServiceProvider/FilterProvider.php
@@ -4,6 +4,10 @@ namespace Kanboard\ServiceProvider;
use Kanboard\Core\Filter\LexerBuilder;
use Kanboard\Core\Filter\QueryBuilder;
+use Kanboard\Filter\ProjectActivityCreationDateFilter;
+use Kanboard\Filter\ProjectActivityCreatorFilter;
+use Kanboard\Filter\ProjectActivityProjectNameFilter;
+use Kanboard\Filter\ProjectActivityTaskStatusFilter;
use Kanboard\Filter\ProjectActivityTaskTitleFilter;
use Kanboard\Filter\TaskAssigneeFilter;
use Kanboard\Filter\TaskCategoryFilter;
@@ -86,8 +90,18 @@ class FilterProvider implements ServiceProviderInterface
$container['projectActivityLexer'] = $container->factory(function ($c) {
$builder = new LexerBuilder();
- $builder->withQuery($c['projectActivity']->getQuery());
- $builder->withFilter(new ProjectActivityTaskTitleFilter());
+ $builder
+ ->withQuery($c['projectActivity']->getQuery())
+ ->withFilter(new ProjectActivityTaskTitleFilter(), true)
+ ->withFilter(new ProjectActivityTaskStatusFilter())
+ ->withFilter(new ProjectActivityProjectNameFilter())
+ ->withFilter(ProjectActivityCreationDateFilter::getInstance()
+ ->setDateParser($c['dateParser'])
+ )
+ ->withFilter(ProjectActivityCreatorFilter::getInstance()
+ ->setCurrentUserId($c['userSession']->getId())
+ )
+ ;
return $builder;
});
@@ -124,17 +138,23 @@ class FilterProvider implements ServiceProviderInterface
)
->withFilter(new TaskColumnFilter())
->withFilter(new TaskCommentFilter())
- ->withFilter(new TaskCreationDateFilter())
+ ->withFilter(TaskCreationDateFilter::getInstance()
+ ->setDateParser($c['dateParser'])
+ )
->withFilter(TaskCreatorFilter::getInstance()
->setCurrentUserId($c['userSession']->getId())
)
->withFilter(new TaskDescriptionFilter())
- ->withFilter(new TaskDueDateFilter())
+ ->withFilter(TaskDueDateFilter::getInstance()
+ ->setDateParser($c['dateParser'])
+ )
->withFilter(new TaskIdFilter())
->withFilter(TaskLinkFilter::getInstance()
->setDatabase($c['db'])
)
- ->withFilter(new TaskModificationDateFilter())
+ ->withFilter(TaskModificationDateFilter::getInstance()
+ ->setDateParser($c['dateParser'])
+ )
->withFilter(new TaskProjectFilter())
->withFilter(new TaskReferenceFilter())
->withFilter(new TaskStatusFilter())
diff --git a/app/ServiceProvider/RouteProvider.php b/app/ServiceProvider/RouteProvider.php
index 0e7548d4..30d23a51 100644
--- a/app/ServiceProvider/RouteProvider.php
+++ b/app/ServiceProvider/RouteProvider.php
@@ -42,7 +42,7 @@ class RouteProvider implements ServiceProviderInterface
// Search routes
$container['route']->addRoute('search', 'search', 'index');
- $container['route']->addRoute('search/:search', 'search', 'index');
+ $container['route']->addRoute('search/activity', 'search', 'activity');
// ProjectCreation routes
$container['route']->addRoute('project/create', 'ProjectCreation', 'create');
@@ -62,6 +62,7 @@ class RouteProvider implements ServiceProviderInterface
$container['route']->addRoute('project/:project_id/enable', 'project', 'enable');
$container['route']->addRoute('project/:project_id/permissions', 'ProjectPermission', 'index');
$container['route']->addRoute('project/:project_id/import', 'taskImport', 'step1');
+ $container['route']->addRoute('project/:project_id/activity', 'activity', 'project');
// Project Overview
$container['route']->addRoute('project/:project_id/overview', 'ProjectOverview', 'show');