|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace LoginCidadao\OAuthBundle\Controller; |
|
4
|
|
|
|
|
5
|
|
|
use Symfony\Component\HttpFoundation\Request; |
|
6
|
|
|
use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
|
7
|
|
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
|
8
|
|
|
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; |
|
9
|
|
|
use LoginCidadao\CoreBundle\Helper\GridHelper; |
|
10
|
|
|
|
|
11
|
|
|
class OrganizationMembersController extends Controller |
|
12
|
|
|
{ |
|
13
|
|
|
|
|
14
|
|
|
/** |
|
15
|
|
|
* @Route("/organizations/members/filter", name="lc_organizations_members_filter") |
|
16
|
|
|
* @Template() |
|
17
|
|
|
*/ |
|
18
|
|
|
public function memberSearchAction(Request $request) |
|
19
|
|
|
{ |
|
20
|
|
|
$grid = new GridHelper(); |
|
21
|
|
|
$grid->setId('developer-filter-grid') |
|
22
|
|
|
->setPerPage(5) |
|
23
|
|
|
->setMaxResult(5) |
|
24
|
|
|
->setInfiniteGrid(true) |
|
25
|
|
|
->setRouteParams(array('ac_data')) |
|
26
|
|
|
->setRoute('lc_organizations_members_filter'); |
|
27
|
|
|
|
|
28
|
|
|
$parms = $request->get('ac_data'); |
|
29
|
|
|
if (isset($parms['username'])) { |
|
30
|
|
|
$query = $this->getDoctrine() |
|
31
|
|
|
->getRepository('LoginCidadaoCoreBundle:Person') |
|
32
|
|
|
->getUserSearchQuery($parms['username']); |
|
33
|
|
|
|
|
34
|
|
|
$grid->setQueryBuilder($query); |
|
|
|
|
|
|
35
|
|
|
} |
|
36
|
|
|
|
|
37
|
|
|
return array('grid' => $grid->createView($request)); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
* @Route("/organizations/members", name="lc_organizations_members") |
|
42
|
|
|
* @Template() |
|
43
|
|
|
*/ |
|
44
|
|
|
public function listMembersAction(Request $request) |
|
45
|
|
|
{ |
|
46
|
|
|
$grid = new GridHelper(); |
|
47
|
|
|
$grid->setId('developer-grid') |
|
48
|
|
|
->setPerPage(5) |
|
49
|
|
|
->setMaxResult(5) |
|
50
|
|
|
->setInfiniteGrid(true) |
|
51
|
|
|
->setRouteParams(array('ac_data')) |
|
52
|
|
|
->setRoute('lc_organizations_members'); |
|
53
|
|
|
|
|
54
|
|
|
$parms = $request->get('ac_data'); |
|
55
|
|
|
if (isset($parms['person_id']) && !empty($parms['person_id'])) { |
|
56
|
|
|
$query = $this->getDoctrine() |
|
57
|
|
|
->getRepository('LoginCidadaoCoreBundle:Person') |
|
58
|
|
|
->getFindByIdIn($parms['person_id']); |
|
59
|
|
|
$grid->setQueryBuilder($query); |
|
|
|
|
|
|
60
|
|
|
} |
|
61
|
|
|
return array('grid' => $grid->createView($request)); |
|
62
|
|
|
} |
|
63
|
|
|
} |
|
64
|
|
|
|
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.