Commit 57f6a85d authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Fix : Recherche pour une personne (le filtrage fonctionne à nouveau)

parent 1e0a6967
Loading
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -2775,20 +2775,14 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                    case 'ap' :
                    case 'sp' :
                        try {
//                            var_dump($value2); die();
                            $personsId[] = $value1;
                            $person = $this->getPersonService()->getPerson($value1);
                            $persons[$person->getId()] = $person;
                            $crit['val1Label'] = $person->getDisplayName();
                            $crit['val2Label'] = $value2 >= 0 ? $this->getOscarUserContextService()->getAllRoleIdPerson(
                            $crit['val2Label'] = $value2 > 0 ? $this->getOscarUserContextService()->getAllRoleIdPerson(
                            )[$value2] : '';
                            $query = $queryPersonNoRole;
                            if ($value2 >= 0) {
                                $queryParam['roleObj'] = $this->getEntityManager()->getRepository(Role::class)->find(
                                    $value2
                                );
                                $query = $queryPersonRole;
                            }
                            $ids = array_keys($query->setParameters($queryParam)->getQuery()->getArrayResult());
                            $ids = $this->getActivityService()->getActivityRepository()->getIdsForPersonWithRole($person->getId(), $value2 ? $value2 : 0);
                        } catch (\Exception $e) {
                            $crit['error'] = "Impossible de filtrer sur la personne";
                        }
+12 −1
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@
            {{#if error}}<strong class="text-danger"><i class="icon-attention-1"></i> {{error}}</strong>{{/if}}
            <div class="icon-building-filled"></div>

            <input type="hidden" name="criteria[]" class="criteria"
            <input type="text" name="criteria[]" class="criteria"
                   value="{{criteria}}"/>
            <small>{{typeLabel}}</small>
            <select class="select2 changer val1">
@@ -917,6 +917,17 @@

                        }

                        // Select
                        var select = filter.find('select.val2');

                        if( select.length > 0 ){
                            var val2Elem = filter.find('.val2');
                            if( val2Elem ){
                                val2 = val2Elem[0].value ? val2Elem[0].value : "0";
                            }

                        }

                        filter.find('.criteria').val(datas.type
                            + ';' + filter.find('.val1').val()
                            + ';' + val2);