Commit dbc0a48e authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

Merge branch 'master' of https://git.unicaen.fr/open-source/OSE into missions

# Conflicts:
#	composer.json
#	composer.lock
parents 92d4f531 6f1c9b29
Loading
Loading
Loading
Loading
+12 −2
Changes for admin/actions/chargens-calcul-effectifs.php: 12 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -5,16 +5,22 @@ $bdd->setLogger($c);

$sql = "
SELECT
  sne.id scenario_noeud_effectif_id,
  sne.effectif effectif,
  sn.noeud_id,
  sn.scenario_id,
  sne.type_heures_id,
  sne.etape_id
  sne.etape_id,
  n.annee_id
FROM
  scenario_noeud_effectif sne
  JOIN scenario_noeud sn ON sn.id = sne.scenario_noeud_id
  JOIN noeud n ON n.id = sn.noeud_id
WHERE
  n.etape_id IS NOT NULL
  AND COALESCE(sne.effectif_calcule,-1) <> sne.effectif
ORDER BY 
  n.annee_id DESC
";


@@ -25,14 +31,18 @@ $c->msg("Attention : ce traitement peut être long.");
$snes  = $bdd->select($sql);
$count = count($snes);
foreach ($snes as $index => $sne) {
    $sneId      = (int)$sne['SCENARIO_NOEUD_EFFECTIF_ID'];
    $effectif   = (float)$sne['EFFECTIF'];
    $noeud      = (int)$sne['NOEUD_ID'];
    $scenario   = (int)$sne['SCENARIO_ID'];
    $typeHeures = (int)$sne['TYPE_HEURES_ID'];
    $etape      = (int)$sne['ETAPE_ID'];
    $annee      = ((int)$sne['ANNEE_ID']) . '/' . ((int)$sne['ANNEE_ID'] + 1);

    $c->msg("Calcul de la formation $index / $count ...", true);
    $c->msg("Calcul de la formation $index / $count (année $annee)...", true);

    $bdd->exec("BEGIN OSE_CHARGENS.CALC_SUB_EFFECTIF( $noeud, $scenario, $typeHeures, $etape ); END;");
    $bdd->getTable('SCENARIO_NOEUD_EFFECTIF')->update(['EFFECTIF_CALCULE' => $effectif], ['ID' => $sneId]);
}

$c->end("Fin du calcul");
 No newline at end of file
+6 −6
Changes for composer.json: 6 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -9,13 +9,13 @@
    ],
    "require"     : {
        "php"                    : ">=8.0",
        "unicaen/app"            : "dev-ll-php8-bs5",
        "unicaen/auth"           : "dev-ll-php8-bs5",
        "unicaen/app"            : "6.0.0",
        "unicaen/auth"           : "6.0.0",
        "laminas/laminas-file"   : "^2.8",
        "unicaen/code"           : "7.2",
        "unicaen/import"         : "dev-ll-php8-bs5",
        "unicaen/tbl"            : "dev-ll-php8-bs5",
        "unicaen/open-document"  : "^4.0",
        "unicaen/code"           : "6.0.5",
        "unicaen/import"         : "6.0.0",
        "unicaen/tbl"            : "6.0.0",
        "unicaen/open-document"  : "6.0.0",
        "unicaen/siham"          : "^2.0",
        "laminas/laminas-cache-storage-adapter-memory": "2.1.x-dev",
        "laminas/laminas-text": "2.10.x-dev"
+102 −104

File changed.

Preview size limit exceeded, changes collapsed.

+12 −0
Changes for data/ddl/table/SCENARIO_NOEUD_EFFECTIF.php: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -21,6 +21,18 @@ return [
            'position'    => 4,
            'commentaire' => NULL,
        ],
        'EFFECTIF_CALCULE'      => [
            'name'        => 'EFFECTIF_CALCULE',
            'type'        => 'float',
            'bdd-type'    => 'FLOAT',
            'length'      => 0,
            'scale'       => NULL,
            'precision'   => 126,
            'nullable'    => TRUE,
            'default'     => NULL,
            'position'    => 14,
            'commentaire' => NULL,
        ],
        'ETAPE_ID'              => [
            'name'        => 'ETAPE_ID',
            'type'        => 'int',
+1 −0
Changes for data/ddl_columns_pos.php: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -1158,6 +1158,7 @@ return [
        'HISTO_MODIFICATEUR_ID',
        'HISTO_DESTRUCTION',
        'HISTO_DESTRUCTEUR_ID',
        'EFFECTIF_CALCULE',
    ],
    'SCENARIO_NOEUD_SEUIL'           => [
        'ID',
Loading