From 17a4b7f0469a8da66957751654faaee359385b62 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 19 Nov 2010 10:43:35 +0000 Subject: [PATCH] =?UTF-8?q?Gestion=20des=20changements=20de=20r=C3=A9f?= =?UTF-8?q?=C3=A9rence=20chez=20infogreffe?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- includes/infogreffe/infogreffe_courrier.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/includes/infogreffe/infogreffe_courrier.php b/includes/infogreffe/infogreffe_courrier.php index d9b477a44..5af15e57e 100644 --- a/includes/infogreffe/infogreffe_courrier.php +++ b/includes/infogreffe/infogreffe_courrier.php @@ -15,10 +15,24 @@ $dejaCommande = false; $noemail = false; $sameLogin = false; $idCommande = 0; + //Vérification des commandes +if (preg_match('/^([0-9]{4})[_sociaux-|_-]/', $ref, $matches)) +{ + $searchRef = '^'.$matches[1].'[_-|_sociaux-]'; +} +elseif (preg_match('/^([0-9]{4})_consolide-/', $ref, $matches)) +{ + $searchRef = '^'.$matches[1].'_consolide-'; +} +else +{ + $searchRef = $ref; +} + $rep = mysql_select('commandes', ' idCommande, login, emailCommande, dateCommande', - "siren=$siren AND refDocument='$ref'"); + "siren=$siren AND refDocument='$searchRef'"); //Fichier de vérouillage commande en cours $lockFile = PATH_SITE.'/cache/'.$siren.'-'.$ref.'.txt';