From 6b28ed061bfaea378af77c71446835561c2f71e3 Mon Sep 17 00:00:00 2001 From: Jean-Marc Pigeon Date: Sun, 14 Dec 2025 04:51:53 -0500 Subject: [PATCH] Commutation en<->fr for lvlmai.php display is working --- www/lvlmai.php | 44 ++++++++++++++++++++++++++++---------------- www/translations.js | 4 ++++ www/unilng.php | 27 +-------------------------- 3 files changed, 33 insertions(+), 42 deletions(-) diff --git a/www/lvlmai.php b/www/lvlmai.php index 6eb3053..5e3a499 100644 --- a/www/lvlmai.php +++ b/www/lvlmai.php @@ -24,11 +24,29 @@ function tblheader(string $dsearch,int $numrec,int $offset,int $limit, string $s global $userlang; global $myfilename; -$debut=$offset+1; -$originator=gettranslate($userlang,"Originator"); -$recipient=gettranslate($userlang,"Recipient"); $date=gettranslate($userlang,"Date"); +$filterOptions = [ + 'smtpfrom' => 'Originator', + 'rcptto' => 'Recipient', + 'creation' => 'Date', + ]; + +$optionsHtml = ''; + +foreach ($filterOptions as $value => $trkey) { + $selected = ($selectedField === $value) ? ' selected' : ''; + $optionsHtml .= + ''; +} +error_log($optionsHtml); +$debut=$offset+1; $STR = << @@ -66,9 +84,7 @@ $STR = <<Search @@ -105,14 +121,10 @@ global $userlang; global $isadmin; global $myfilename; -$horiginator=gettranslate($userlang,"Originator"); -$hrecipient=gettranslate($userlang,"Recipient"); -$hdate=gettranslate($userlang,"Date"); - $limit=20; $offset=0; $dsearch=""; -$selectedField = $hrecipient; +$selectedField = 'rcptto'; if (isset($_POST['limit'])) $limit=intval($_POST['limit']); @@ -127,7 +139,7 @@ if (isset($_POST['dsearch'])) { $dsearch=trim($_POST['dsearch']); if (strlen($dsearch)>0) { // sécuriser le champ sélectionné - $allowedFields = [$horiginator,$hrecipient,$hdate]; + $allowedFields = ['smtpfrom','rcptto','creation']; if (!in_array($selectedField,$allowedFields)) $selectedField = 'rcptto'; @@ -238,13 +250,13 @@ $tblheader - - + + - + - + $line
NumStatus$hdateStatusDate IPReverse AddressReverse IP Originator RecipientSubjectSubject
diff --git a/www/translations.js b/www/translations.js index 6f3ac80..b2d1ffe 100644 --- a/www/translations.js +++ b/www/translations.js @@ -4,6 +4,7 @@ const TR = [ ["Authentication", "Authentification"], + ["Date", "Date"], ["Email", "Courriel"], ["Login", "Connexion"], ["Logout", "Deconnexion"], @@ -11,9 +12,12 @@ const TR = ["Originator", "Expediteur"], ["Password", "Mot de passe"], ["Recipient", "Destinataire"], + ["Reverse IP", "IP inversée"], ["SMTP servers", "Serveurs SMTP"], ["Search", "Recherche"], + ["Subject", "Sujet"], ["Show", "Afficher"], + ["Status", "Statut"], ["Users management","Gestion des usagers"], [null, null] ]; diff --git a/www/unilng.php b/www/unilng.php index 41b2b19..6029e83 100644 --- a/www/unilng.php +++ b/www/unilng.php @@ -17,36 +17,11 @@ enum lng { $userlang=lng::en; -$TR= [ - ["Email","Courriel"], - ["Logout","Deconnexion"], - ["Main screen","Ecran Principal"], - ["Remote SMTP server","Serveur SMTP distant"], - ["Originator","Expediteur"], - ["Recipient","Destinataire"], - ["User Management","Gestion Usagers"], - ["Remote SMTP server Management","Gestion des serveurs SMTP distants"], - ["Search","Recherche"], - ]; - function gettranslate(lng $lang,$mot) { -global $TR; -foreach ($TR as $row) { - if ($row[0]===$mot) { - switch ($lang) { - case lng::fr : //French - $mot=$row[1]; - break; - case lng::en : //English - default : - break; - } - break; - } - } +$mot=$mot."_X"; return $mot; } ?> -- 2.47.3