From d81a4df56f773b785f5e6685ba26ec9f5bc8e5f2 Mon Sep 17 00:00:00 2001 From: Damien LASSERRE Date: Tue, 17 Jan 2012 09:38:23 +0000 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20champs=20oubli=C3=A9s=20comme=20(b?= =?UTF-8?q?ilCloture,=20bilTca)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/Scores/Ciblage.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/library/Scores/Ciblage.php b/library/Scores/Ciblage.php index 72f3b5e4..9941c4fc 100644 --- a/library/Scores/Ciblage.php +++ b/library/Scores/Ciblage.php @@ -101,7 +101,7 @@ Class Ciblage protected function setAlpha($name, $valeur) { - $or = array('adr_cp', 'adr_dep'); + $or = array('adr_cp', 'adr_dep', 'bilType'); $and = array('ape_entrep', 'ape_etab', 'age_entrep', 'age_etab', 'NaceEntrep', 'NaceEtab'); if(in_array($name, $or)) { @@ -289,7 +289,7 @@ Class Ciblage } protected function bilType($valeur) { - $this->setFilter('bilType', $valeur); + $this->setAlpha('bilType', $valeur); } protected function bilAnnee($valeur) { @@ -387,4 +387,19 @@ Class Ciblage protected function mail($valeur) { $this->setFilter('mail', $valeur); } + + protected function bilCloture($valeur) { + if(!is_array($valeur)) { + $format = explode('/', $valeur); + $valeur = $format[2].$format[1].$format[0]; + } else { + $format1 = explode('/', $valeur[0]); + $format2 = explode('/', $valeur[0]); + + $valeur[0] = $format1[2].$format1[1].$format1[0]; + $valeur[1] = $format2[2].$format2[1].$format2[0]; + } + //print_r($valeur); + $this->setFilterRange('bilCloture', $valeur); + } } \ No newline at end of file