Commit b8f23d57 authored by Antony Le Courtes's avatar Antony Le Courtes
Browse files

Ajout d'un paramétrage général pour choisir l'état de sortie pour l'export de l'offre de formation

parent 2e819c51
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -70,6 +70,12 @@ return [
        "DESCRIPTION" => "État de sortie pour les états de paiement",
        "QUERY"       => 'SELECT id valeur FROM etat_sortie WHERE code = :valeur',
    ],
    Parametre::ES_EXPORT_FORMATION => [
        "VALEUR"      => "export-offre-formation",
        "DESCRIPTION" => "État de sortie pour l'export offre de formation",
        "QUERY"       => 'SELECT id valeur FROM etat_sortie WHERE code = :valeur',
    ],



    /* Divers */
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ class Parametre implements HistoriqueAwareInterface
    const ES_SERVICES_PDF          = 'es_services_pdf';
    const ES_SERVICES_CSV          = 'es_services_csv';
    const ES_ETAT_PAIEMENT         = 'es_etat_paiement';
    const ES_EXPORT_FORMATION = 'es_export_formation';


    /* Divers */
+13 −0
Original line number Diff line number Diff line
@@ -369,6 +369,19 @@ class ParametresForm extends AbstractForm
                       ],
                   ]);

        $this->add([
                       'type'       => 'Select',
                       'name'       => 'es_export_formation',
                       'options'    => [
                           'value_options' => Util::collectionAsOptions($this->getServiceEtatSortie()->getList()),
                           'label'         => 'État de sortie pour l\'export de l\'offre de formation',
                       ],
                       'attributes' => [
                           'class'            => 'selectpicker',
                           'data-live-search' => 'true',
                       ],
                   ]);

        $this->add([
                       'type'       => 'Select',
                       'name'       => 'scenario_charges_services',
+3 −0
Original line number Diff line number Diff line
@@ -80,6 +80,9 @@
                    <div class="col-md-6">
                        <?= $this->formControlGroup($form->get('es_extraction_indemnites')); ?>
                    </div>
                    <div class="col-md-6">
                        <?= $this->formControlGroup($form->get('es_export_formation')); ?>
                    </div>
                </div>
            </div>
        </div>
+2 −1
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ use Application\Service\Traits\AnneeServiceAwareTrait;
use Application\Service\Traits\ContextServiceAwareTrait;
use Application\Service\Traits\EtatSortieServiceAwareTrait;
use Application\Service\Traits\LocalContextServiceAwareTrait;
use Application\Service\Traits\ParametresServiceAwareTrait;
use Application\Service\Traits\SourceServiceAwareTrait;
use Lieu\Entity\Db\Structure;
use OffreFormation\Entity\Db\CheminPedagogique;
@@ -298,7 +299,7 @@ class OffreFormationService extends AbstractEntityService
    public function generateCsvExport(?Structure $structure, ?NiveauEtape $niveau, ?Etape $etape): CsvModel
    {
        /* Préparation et affichage */
        $etatSortie = $this->getServiceEtatSortie()->getRepo()->findOneBy(['code' => 'export-offre-formation']);
        $etatSortie = $this->getServiceEtatSortie()->getByParametre('es_export_formation');
        $annee = $this->getServiceContext()->getAnnee()->getId();

        $fileName = 'Export-offre-formation - ' . date('dmY') . '.csv';