Commit c434be34 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

Fix : Le filtre sur les types des documents ne fonctionne pas (Mauvais...

Fix : Le filtre sur les types des documents ne fonctionne pas (Mauvais réaffichage de l'option "n'a pas" et résultats incohérent liè à une erreur d'identifiant du type de document)
parent 4518772b
Loading
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -986,13 +986,11 @@ class ProjectGrantSearchService implements UseEntityManager, UsePersonService, U
            }
        }


        $idsRef = $activitiesIds;

        // Vue projet
        if ($projectView) {
            if ($search) {

                $idsProject = $this->getProjectGrantService()->getActivityRepository()
                    ->getIdsProjectsForActivityAndEmpty(
                        $search,
@@ -1001,8 +999,8 @@ class ProjectGrantSearchService implements UseEntityManager, UsePersonService, U
                        $params['sortDirection'],
                        $params['sortIgnoreNull'] == 'on'
                    );

            } else {
            }
            else {
                $idsProject = $this->getProjectGrantService()->getActivityRepository()
                    ->getIdsProjectsForActivity(
                        $activitiesIds,
@@ -1156,7 +1154,11 @@ class ProjectGrantSearchService implements UseEntityManager, UsePersonService, U
     */
    private function getFilterOptionsDocumentTypes(): array
    {
        return $this->getProjectGrantService()->getDocumentTypes();
        $types = [];
        foreach ($this->getProjectGrantService()->getDocumentTypes() as $type) {
            $types[$type->getId()] = $type->getLabel();
        };
        return $types;
    }

    /**
+10 −12
Original line number Diff line number Diff line
@@ -926,6 +926,16 @@
                            }
                        }

                        // Select
                        var input = filter.find('input.val2');
                        if( input.length > 0 ){
                            console.log("VAL2 INPUT");
                            var val2Elem = filter.find('.val2');
                            if( val2Elem ){
                                val2 = val2Elem[0].value ? val2Elem[0].value : "";
                            }
                        }

                        // Checkbox ?
                        var checkboxs = filter.find('.val2[type="checkbox"]');

@@ -960,18 +970,6 @@

                        }

                        // Select
                        var input = filter.find('input.val2');
                        console.log(input);

                        if( input.length > 0 ){
                            console.log("VAL2 INPUT");
                            var val2Elem = filter.find('.val2');
                            if( val2Elem ){
                                val2 = val2Elem[0].value ? val2Elem[0].value : "";
                            }
                        }

                        console.log("VAL2:", val2);

                        filter.find('.criteria').val(datas.type