Browse Source

feat: ajout du nécessaire pour que sansnum fonctionne aussi avec TRI (balise et critère)

issue_5344
cy_altern 4 months ago
parent
commit
a58df16978
  1. 4
      ecrire/public/fonctions.php

4
ecrire/public/fonctions.php

@ -532,7 +532,7 @@ function tri_champ_order($t, $from = null, $senstri = '') {
$champ = $t;
$prefixe = '';
foreach (['num ', 'sinum '] as $p) {
foreach (['num ', 'sinum ', 'sansnum '] as $p) {
if (strpos($t, $p) === 0) {
$champ = substr($t, strlen($p));
$prefixe = $p;
@ -559,6 +559,8 @@ function tri_champ_order($t, $from = null, $senstri = '') {
return "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}, 0+$champ{$senstri}";
case 'sinum ':
return "CASE( 0+$champ ) WHEN 0 THEN 1 ELSE 0 END{$senstri}";
case 'sansnum ':
return "CASE WHEN $champ REGEXP(\"^[0-9]+\. \") THEN REVERSE(SUBSTRING_INDEX(REVERSE($champ), \" .\", 1)) ELSE $champ END{$senstri}";
default:
return $champ . $senstri;
}

Loading…
Cancel
Save