Commit 677a7c4c authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Début de gestion des jours fériés

parent 0c5747fb
Loading
Loading
Loading
Loading
+29 −0
Changes for admin/src/DataSource.php: 29 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -101,6 +101,35 @@ class DataSource



    public function JOUR_FERIE()
    {
        $joursFeries = require $this->oseAdmin->getOseDir() . 'data/jours_feries.php';

        $jfs = [];
        for ($a = 1950; $a < 2100; $a++) {
            foreach( $joursFeries as $date => $libelle ){
                if (strlen($date) == 5){
                    $jfs[] = [
                        'LIBELLE'    => $libelle,
                        'DATE_JOUR' => \DateTime::createFromFormat('Y-m-d H:i:s', $a . '-'.$date.' 00:00:00'),
                    ];
                }
            }
        }
        foreach( $joursFeries as $date => $libelle ){
            if (strlen($date) == 10){
                $jfs[] = [
                    'LIBELLE'    => $libelle,
                    'DATE_JOUR' => \DateTime::createFromFormat('Y-m-d H:i:s', $date.' 00:00:00'),
                ];
            }
        }

        return $jfs;
    }



    public function ETAT_SORTIE()
    {
        return require $this->oseAdmin->getOseDir() . 'data/etats_sortie.php';
+5 −0
Changes for data/data_updater_config.php: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -225,6 +225,11 @@ return [
            'UTILISATEUR_ID' => ['transformer' => 'SELECT id FROM utilisateur WHERE username = %s'],
        ],],
    ],
    'JOUR_FERIE'                 => [
        'actions' => ['install', 'update'],
        'key'     => ['DATE_JOUR'],
        'options' => ['update' => false, 'delete' => false],
    ],


    /* Jeu de données de configuration par défaut (tout perso) */
+14 −0
Changes for data/ddl/index/JOUR_FERIE_PK.php: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

//@formatter:off

return [
    'name'    => 'JOUR_FERIE_PK',
    'unique'  => TRUE,
    'table'   => 'JOUR_FERIE',
    'columns' => [
        'ID',
    ],
];

//@formatter:on
+14 −0
Changes for data/ddl/index/JOUR_FERIE_UN.php: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

//@formatter:off

return [
    'name'    => 'JOUR_FERIE_UN',
    'unique'  => TRUE,
    'table'   => 'JOUR_FERIE',
    'columns' => [
        'DATE_JOUR',
    ],
];

//@formatter:on
+14 −0
Changes for data/ddl/primary-constraint/JOUR_FERIE_PK.php: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?php

//@formatter:off

return [
    'name'    => 'JOUR_FERIE_PK',
    'table'   => 'JOUR_FERIE',
    'index'   => 'JOUR_FERIE_PK',
    'columns' => [
        'ID',
    ],
];

//@formatter:on
Loading