Commit 6bbc8a6b authored by Laurent Lecluse's avatar Laurent Lecluse
Browse files

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

# Conflicts:
#	module/Application/view/application/formule/test-saisir.phtml
parents 50efc073 86135234
Loading
Loading
Loading
Loading
+3 −0
Changes for config/application.config.php: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -68,6 +68,9 @@ class AppConfig

    public static function getEnv()
    {
        $forcedEnv = self::get('dev', 'forced-env', false);
        if (false !== $forcedEnv) return $forcedEnv;

        return getenv('APPLICATION_ENV') ?: 'dev';
    }

+24 −4
Changes for module/Application/src/Model/FormuleCalcul.php: 24 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -971,6 +971,7 @@ END FORMULE_" . $this->getName() . ";";
            'OR'      => 'traductionFunctionOr',
            'ISBLANK' => 'traductionFunctionIsBlank',
            'SUMIF'   => 'traductionFunctionSumIf',
            'MID'     => 'traductionFunctionMid',
        ];

        if (array_key_exists($term['name'], $functions)) {
@@ -1143,9 +1144,9 @@ END FORMULE_" . $this->getName() . ";";
            }
        }

        var_dump($plage);
        var_dump($critere);
        var_dump($plageSomme);
//        var_dump($plage);
//        var_dump($critere);
//        var_dump($plageSomme);

        $plsql = "val := 0;\n";
        for ($c = 0; $c <= ($plage['colEnd'] - $plage['colBegin']); $c++) {
@@ -1174,7 +1175,26 @@ END FORMULE_" . $this->getName() . ";";

        $plsql .= 'RETURN ' . $this->traductionExpr($term['valExpr']);

        echo '<pre>' . htmlentities($plsql) . '</pre>';
//        echo '<pre>' . htmlentities($plsql) . '</pre>';

        return $plsql;
    }



    private function traductionFunctionMid(array &$expr, int $i): string
    {
        $term  = $expr[$i];
        $plsql = 'SUBSTR(';

        $plExprs = [];
        foreach ($term['exprs'] as $e => $fExpr) {
            $fExpr[]     = null;
            $plExprs[$e] = $this->traductionExpr($fExpr);
        }
        $plsql .= implode(', ', $plExprs);

        $plsql .= ')';

        return $plsql;
    }
+4 −1
Changes for module/Application/view/application/formule/test-saisir.phtml: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -392,7 +392,10 @@ echo $this->tag('h1', ['class' => 'page-header'])->html($title);
    </table>
    <div>
        <h2>Informations de débogage
            <a class="btn btn-secondary btn-sm" data-bs-toggle="collapse" href="#debug-info">Afficher/masquer</a>
            <button class="btn btn-secondary btn-sm" type="button" data-bs-toggle="collapse" data-bs-target="#debug-info"
                    aria-expanded="false" aria-controls="debug-info">
                Afficher/masquer
            </button>
        </h2>
        <div class="collapse debug-info" id="debug-info"></div>
    </div>