mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-28 02:23:51 +00:00
improve filter form
- hide form in some places ; - i18n - hide status filtering with a parameter (redundant)
This commit is contained in:
@@ -315,15 +315,27 @@ class SingleTaskController extends Controller
|
||||
public function myTasksAction()
|
||||
{
|
||||
return $this->redirectToRoute('chill_task_singletask_list', [
|
||||
'user_id' => $this->getUser()->getId()
|
||||
'user_id' => $this->getUser()->getId(),
|
||||
'hide_form' => true
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Arguments:
|
||||
* - user_id
|
||||
* - scope_id
|
||||
* - person_id
|
||||
* - hide_form (hide the form to filter the tasks)
|
||||
* - status: date state, amongst SingleTaskRepository::DATE_STATUSES, or 'closed'
|
||||
*
|
||||
* @Route(
|
||||
* "/{_locale}/task/singletask/list",
|
||||
* name="chill_task_singletask_list",
|
||||
* options={ "menus": { "person" : { "order": 400, "label": "Associated tasks" } } }
|
||||
* options={ "menus": {
|
||||
* "person" : { "order": 400, "label": "Associated tasks" } ,
|
||||
* "section": { "order": 400, "label": "Tasks", "icons": "tasks" }
|
||||
* }}
|
||||
* )
|
||||
*/
|
||||
public function listAction(
|
||||
@@ -359,18 +371,21 @@ class SingleTaskController extends Controller
|
||||
}
|
||||
|
||||
if (!empty($request->query->get('user_id', null))) {
|
||||
if ($request->query->get('user_id') === '_unassigned') {
|
||||
$params['unassigned'] = true;
|
||||
} else {
|
||||
$userId = $request->query->getInt('user_id', null);
|
||||
$user = $this->getDoctrine()->getManager()
|
||||
->getRepository('ChillMainBundle:User')
|
||||
->find($userId);
|
||||
|
||||
$userId = $request->query->getInt('user_id', null);
|
||||
$user = $this->getDoctrine()->getManager()
|
||||
->getRepository('ChillMainBundle:User')
|
||||
->find($userId);
|
||||
if ($user === null) {
|
||||
throw $this->createNotFoundException("This user ' $userId ' does not exist.");
|
||||
}
|
||||
|
||||
if ($user === null) {
|
||||
throw $this->createNotFoundException("This user ' $userId ' does not exist.");
|
||||
$viewParams['user'] = $user;
|
||||
$params['user'] = $user;
|
||||
}
|
||||
|
||||
$viewParams['user'] = $user;
|
||||
$params['user'] = $user;
|
||||
}
|
||||
|
||||
if (!empty($request->query->get('scope_id'))) {
|
||||
|
Reference in New Issue
Block a user