Commit 575d285c authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Ajout de deux nouveaux paramètres pour préparer la personnalisation de la...

Ajout de deux nouveaux paramètres pour préparer la personnalisation de la répartition des heures AA/AC
parent 61ec9088
Loading
Loading
Loading
Loading
+8 −1
Changes for data/parametres.php: 8 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -92,7 +92,14 @@ return [
        "VALEUR"      => "enseignement",
        "DESCRIPTION" => "Centres de coûts utilisés pour la paye",
    ],

    "regle_paiement_annee_civile"                => [
        "VALEUR"      => "4-6sur10",
        "DESCRIPTION" => "Règle de répartition années civiles antérieure / en cours pour les paiements",
    ],
    "pourc_s1_pour_annee_civile"                 => [
        "VALEUR"      => "0.67",
        "DESCRIPTION" => "Taux de répartition en année civile pour les heures du premire semestre",
    ],

    /* Documentations */
    "doc-intervenant-vacataires"                 => [
+8 −3
Changes for module/Application/src/Application/Controller/ParametreController.php: 8 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@

namespace Application\Controller;

use Application\Filter\FloatFromString;
use Application\Filter\StringFromFloat;
use Application\Form\CampagneSaisieFieldset;
use Application\Form\Traits\CampagneSaisieFormAwareTrait;
use Application\Form\Traits\ParametresFormAwareTrait;
@@ -32,7 +34,6 @@ class ParametreController extends AbstractController
    use CampagneSaisieFormAwareTrait;



    public function indexAction()
    {
        return [];
@@ -61,8 +62,6 @@ class ParametreController extends AbstractController

            return compact('annees', 'canEdit');
        }


    }


@@ -119,6 +118,9 @@ class ParametreController extends AbstractController

        if ($canEdit) {
            $posted = $this->params()->fromPost();
            if (isset($posted['pourc_s1_pour_annee_civile'])) {
                $posted['pourc_s1_pour_annee_civile'] = floatToString(FloatFromString::run($posted['pourc_s1_pour_annee_civile']) / 100);
            }
        } else {
            $posted = [];// rien ne peut être modifié!!
        }
@@ -150,6 +152,9 @@ class ParametreController extends AbstractController
            }

            if ($form->has($parametre)) {
                if ($parametre == 'pourc_s1_pour_annee_civile') {
                    $value = StringFromFloat::run(stringToFloat($value) * 100);
                }
                $element = $form->get($parametre);
                if (!$canEdit) $element->setAttribute('disabled', true);
                $element->setValue($value);
+31 −0
Changes for module/Application/src/Application/Form/ParametresForm.php: 31 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -176,6 +176,37 @@ class ParametresForm extends AbstractForm
            ],
        ]);

        $this->add([
            'type'       => 'Select',
            'name'       => 'regle_paiement_annee_civile',
            'options'    => [
                'label'         => 'Répartition années civiles antérieure / en cours',
                'value_options' => [
                    '4-6sur10'      => 'Répartition 4/10 des heures pour l\'année  antérieure, 6/10 pour l\'année en cours',
                    'semestre-date' => 'En fonction du semestre des heures ou de la date des cours',
                ],
            ],
            'attributes' => [
                'class'     => 'selectpicker',
                'data-size' => 20,
            ],
        ]);

        $this->add([
            'name'       => 'pourc_s1_pour_annee_civile',
            'options'    => [
                'label'  => 'Pour le 1er semestre, % d\'heures sur l\'année antérieure',
                'suffix' => '%',
            ],
            'attributes' => [
                'class' => 'input-sm',
                'step'  => 'any',
                'min'   => 0,
                'max'   => 1,
            ],
            'type'       => 'Text',
        ]);

        $this->add([
            'name'    => 'doc-intervenant-vacataires',
            'type'    => 'Text',
+8 −0
Changes for module/Application/view/application/parametre/generaux.phtml: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -170,6 +170,14 @@
                        <?= $this->formControlGroup($form->get('centres_couts_paye')); ?>
                    </div>
                </div>
                <div class="row">
                    <div class="col-md-6">
                        <?= $this->formControlGroup($form->get('regle_paiement_annee_civile')); ?>
                    </div>
                    <div class="col-md-6">
                        <?= $this->formControlGroup($form->get('pourc_s1_pour_annee_civile')); ?>
                    </div>
                </div>
            </div>
        </div>