Commit 2cfb3425 authored by Stephane Bouvry's avatar Stephane Bouvry
Browse files

- UP : Ajout d'un filtre sur les disciplines dans la recherche des activités

parent 9ad4dead
Loading
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2125,6 +2125,7 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                'ads' => 'Date de signature',
                'adp' => 'Date d\'ouverture du PFI dans SIFAC',
                'pp' => 'Activités sans projet',
                'ds' => 'Ayant pour discipline',

                // Ajout d'un filtre sur les jalons
                'aj' => 'Ayant le jalon'
@@ -2473,7 +2474,8 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                            $qb->andWhere('c.status NOT IN (:withoutstatus)');
                            break;

                        // Filtre sur le type de l'activité


                        case 'at' :
                            if (!isset($parameters['withtype'])) {
                                $parameters['withtype'] = [];
@@ -2519,6 +2521,10 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                            $filterIds = $this->getActivityService()->getActivityIdsByJalon($crit['val1']);
                            break;
                        case 'add' :
                        case 'ds' :
                            $qb->andWhere('dis.id = :discipline');
                            $parameters['discipline'] = $value1;
                            break;
                        case 'adf' :
                        case 'adm' :
                        case 'adc' :
@@ -2668,6 +2674,7 @@ class ProjectGrantController extends AbstractOscarController implements UseNotif
                'sortDirection' => $sortDirection,
                'sortIgnoreNull' => $sortIgnoreNull,
                'types' => $this->getActivityTypeService()->getActivityTypes(true),
                'disciplines' => $this->getActivityService()->getDisciplines(),
            ]);
            $view->setTemplate('oscar/project-grant/advanced-search.phtml');
            return $view;
+24 −0
Original line number Diff line number Diff line
@@ -182,6 +182,26 @@
            </nav>
        </article>
    </script>
    <script type="text/x-handlebars" id="discipline-criteria-tpl">
        <article class="criteria criteria-type card">
            <div class="icon-beaker"></div>
            {{#if error}}<strong class="text-danger"><i class="icon-attention-1"></i> {{error}}</strong>{{/if}}
            <input type="hidden" name="criteria[]" class="criteria" value="{{criteria}}"/>
            <small>{{typeLabel}}</small>
            <select class="select2 form-control val1 changer types" id="filter_discipline">
                <option></option>
                <?php foreach ($disciplines as $id => $label): ?>
                    <option
                        value="<?= $id ?>"><?= $label ?></option>
                <?php endforeach; ?>
            </select>
            <nav>
                <a href="#" class="delete">
                    <i class="icon-cancel-outline"></i>
                </a>
            </nav>
        </article>
    </script>

    <script type="text/x-handlebars" id="country-tpl">
        <article class="criteria criteria-country card">
@@ -688,6 +708,9 @@
                    else if(datas.type == 'aj' ){
                        dom = $(tplMilestone(datas));
                    }
                    else if(datas.type == 'ds'){
                        dom = $(tplDiscipline(datas));
                    }
                    else {
                        console.error("le type", datas.type, "n'est pas pris en charge", datas);
                        return;
@@ -843,6 +866,7 @@
                    tplCountry = Handlebars.compile($('#country-tpl').html()),
                    tplFinance = Handlebars.compile($('#finance-criteria-tpl').html()),
                    tplType = Handlebars.compile($('#type-criteria-tpl').html()),
                    tplDiscipline = Handlebars.compile($('#discipline-criteria-tpl').html()),
                    tplStatic = Handlebars.compile($('#static-criteria-tpl').html()),
                    tplNumber = Handlebars.compile($('#number-criteria-tpl').html()),
                    tplPersons = Handlebars.compile($('#persons-criteria-tpl').html()),