Skip to content
Extraits de code Groupes Projets
Valider 2c8743a1 rédigé par esj's avatar esj
Parcourir les fichiers

critere avec '?' mal vu (Klaus)

parent 0284ed25
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -550,36 +550,35 @@ function calculer_critere_DEFAUT($idb, &$boucles, $crit) { ...@@ -550,36 +550,35 @@ function calculer_critere_DEFAUT($idb, &$boucles, $crit) {
// Rajouter le nom de la table SQL devant le nom du champ // Rajouter le nom de la table SQL devant le nom du champ
if ($col_table) { if ($col_table) {
// `champ` devient `table.champ` (syntaxe SQL pour nom zarbi)
if ($col[0] == "`") if ($col[0] == "`")
$col = "$col_table." . substr($col,1,-1); $ct = "$col_table." . substr($col,1,-1);
else $col = "$col_table.$col"; else $ct = "$col_table.$col";
} } else $ct = $col;
// fonction SQL // fonction SQL
if ($fct) $col = "$fct($col)"; if ($fct) $ct = "$fct($ct)";
if (($op != '=') || !calculer_critere_repete($boucle, $col, $val[0])) if (($op != '=') || !calculer_critere_repete($boucle, $ct, $val[0]))
{ {
if (strtoupper($op) == 'IN') { if (strtoupper($op) == 'IN') {
$val = join(" .\n\"','\" . ", $val); $val = join(" .\n\"','\" . ", $val);
$where = "$col IN ('\" . $val . \"')"; $where = "$ct IN ('\" . $val . \"')";
if ($crit->not) { if ($crit->not) {
$where = "NOT ($where)"; $where = "NOT ($where)";
} else { } else {
$boucle->default_order = 'rang'; $boucle->default_order = 'rang';
$boucle->select[] = $boucle->select[] =
"FIND_IN_SET($col, \\\"'\" . " . $val . ' . "\'\\") AS rang'; "FIND_IN_SET($ct, \\\"'\" . " . $val . ' . "\'\\") AS rang';
} }
} else { } else {
if ($op == '==') $op = 'REGEXP'; if ($op == '==') $op = 'REGEXP';
$where = "($col $op '\" . " . $val[0] . ' . "\')'; $where = "($ct $op '\" . " . $val[0] . ' . "\')';
if ($crit->not) $where = "NOT $where"; if ($crit->not) $where = "NOT $where";
// operateur optionnel {lang?} // operateur optionnel {lang?}
if ($crit->cond) { if ($crit->cond) {
$champ = calculer_argument_precedent($idb, $arg1, $boucles) ; $champ = calculer_argument_precedent($idb, $col, $boucles) ;
$where = "\".($champ ? \"$where\" : 1).\""; $where = "\".($champ ? \"$where\" : 1).\"";
} }
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter