Added track filters

* voting_visible
* chair_visible

Change-Id: I94d79e3486f4ff4db769196d68b9ed9af35567fe
Signed-off-by: smarcet <smarcet@gmail.com>
This commit is contained in:
smarcet 2021-02-23 10:04:46 -03:00
parent a86a6c576f
commit a12665736a
2 changed files with 19 additions and 2 deletions

View File

@ -111,6 +111,8 @@ final class OAuth2SummitTracksApiController extends OAuth2ProtectedController
'description' => ['=@', '=='],
'code' => ['=@', '=='],
'group_name' => ['=@', '=='],
'voting_visible' => ['=='],
'chair_visible' => ['=='],
]);
}
@ -122,6 +124,8 @@ final class OAuth2SummitTracksApiController extends OAuth2ProtectedController
'description' => 'sometimes|string',
'code' => 'sometimes|string',
'group_name' => 'sometimes|string',
'voting_visible' => 'sometimes|boolean',
'chair_visible' => 'sometimes|boolean',
]);
$order = null;
@ -207,9 +211,22 @@ final class OAuth2SummitTracksApiController extends OAuth2ProtectedController
'description' => ['=@', '=='],
'code' => ['=@', '=='],
'group_name' => ['=@', '=='],
'voting_visible' => ['=='],
'chair_visible' => ['=='],
]);
}
if(is_null($filter)) $filter = new Filter();
$filter->validate([
'name' => 'sometimes|string',
'description' => 'sometimes|string',
'code' => 'sometimes|string',
'group_name' => 'sometimes|string',
'voting_visible' => 'sometimes|boolean',
'chair_visible' => 'sometimes|boolean',
]);
$order = null;
if (Input::has('order'))
@ -222,8 +239,6 @@ final class OAuth2SummitTracksApiController extends OAuth2ProtectedController
]);
}
if(is_null($filter)) $filter = new Filter();
$data = $this->repository->getBySummit($summit, new PagingInfo($page, $per_page), $filter, $order);
$filename = "tracks-" . date('Ymd');

View File

@ -48,6 +48,8 @@ final class DoctrineSummitTrackRepository
(
"(g.name :operator :value)"
),
'voting_visible' => 't.voting_visible',
'chair_visible' => 't.chair_visible',
];
}