Exclusions
This commit is contained in:
parent
5ad2717112
commit
b0962b753c
@ -32,7 +32,7 @@ Class Ciblage
|
||||
{
|
||||
$this->need = true;
|
||||
$configuration = Zend_Registry::get('configuration');
|
||||
print_r($structure);
|
||||
|
||||
//Instantiation Sphinx
|
||||
$this->sphinx = new SphinxClient();
|
||||
$this->sphinx->SetServer($configuration->sphinx->host, intval($configuration->sphinx->port));
|
||||
@ -107,8 +107,8 @@ print_r($structure);
|
||||
protected function setFilterRange($name, $valeur) {
|
||||
$this->sphinx->SetFilterRange($name, intval($valeur[0]), intval($valeur[1]));
|
||||
}
|
||||
protected function writeRequest($name, $valeur, $or = false, $ex =false) {
|
||||
$this->alpha .= '@'.$name . (($ex)?'-':'').' (';
|
||||
protected function writeRequest($name, $valeur, $ex, $or = false) {
|
||||
$this->alpha .= '@'.$name . (($ex)?' -':'').'(';
|
||||
if(!is_array($valeur)) {
|
||||
$this->alpha .= $valeur.')';
|
||||
} else {
|
||||
@ -125,16 +125,17 @@ print_r($structure);
|
||||
}
|
||||
protected function setAlpha($name, $valeur, $ex = false)
|
||||
{
|
||||
$or = array('adr_com', 'adr_dept');
|
||||
$or = array('adr_com', 'adr_dept', 'adr_com_ex');
|
||||
$and = array('bilType', 'ape_etab','ape_entrep', 'NaceEntrep', 'NaceEtab');
|
||||
if(!empty($this->alpha))
|
||||
$this->alpha .= ' ';
|
||||
if(in_array($name, $or)) {
|
||||
if(!empty($valeur))
|
||||
$this->writeRequest($name, $valeur, true);
|
||||
if(!empty($valeur)) {
|
||||
$this->writeRequest($name, $valeur, $ex);
|
||||
}
|
||||
} else if(in_array($name, $and)) {
|
||||
if(!empty($valeur))
|
||||
$this->writeRequest($name, $valeur);
|
||||
$this->writeRequest($name, $valeur, $ex);
|
||||
}
|
||||
}
|
||||
protected function transformIntval($array) {
|
||||
@ -154,7 +155,6 @@ print_r($structure);
|
||||
$this->setAlpha('adr_com', $valeur);
|
||||
}
|
||||
protected function adr_com_ex($valeur) {
|
||||
print_r($valeur);
|
||||
$this->setAlpha('adr_com', $valeur, true);
|
||||
}
|
||||
protected function adr_dept($valeur) {
|
||||
|
@ -376,7 +376,7 @@ Class Fields
|
||||
'title' => 'Localisation'
|
||||
),
|
||||
'adr_com_ex' => array(
|
||||
'label' => 'Code commune Insee',
|
||||
'label' => 'Localisation Villes (Exclure)',
|
||||
'fields' => array(
|
||||
'text' => array('value' => null),
|
||||
'textarea' => array('value' => null)
|
||||
@ -401,6 +401,19 @@ Class Fields
|
||||
'action' => 'geographique',
|
||||
'title' => 'Localisation'
|
||||
),
|
||||
'adr_dept_ex' => array(
|
||||
'label' => 'Liste départements (Exclure)',
|
||||
'fields' => array(
|
||||
'text' => array('value' => null),
|
||||
'textarea' => array('value' => null)
|
||||
),
|
||||
'famille' => 'geographique',
|
||||
'activated' => true,
|
||||
'type' => 'textarea',
|
||||
'class' => null,
|
||||
'action' => 'geographique',
|
||||
'title' => 'Localisation'
|
||||
),
|
||||
'adr_reg' => array(
|
||||
'label' => 'Liste code région',
|
||||
'fields' => array(
|
||||
@ -414,6 +427,19 @@ Class Fields
|
||||
'action' => 'geographique',
|
||||
'title' => 'Localisation'
|
||||
),
|
||||
'adr_reg_ex' => array(
|
||||
'label' => 'Liste code région (Exclure)',
|
||||
'fields' => array(
|
||||
'text' => array('value' => null),
|
||||
'textarea' => array('value' => null)
|
||||
),
|
||||
'famille' => 'geographique',
|
||||
'activated' => true,
|
||||
'type' => 'textarea',
|
||||
'class' => null,
|
||||
'action' => 'geographique',
|
||||
'title' => 'Localisation'
|
||||
),
|
||||
'zus' => array(
|
||||
'label' => 'Zones urbaines sensibles',
|
||||
'fields' => array(
|
||||
@ -833,7 +859,6 @@ Class Fields
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo 'ici';exit;
|
||||
$values[$key] = $item;
|
||||
}
|
||||
}
|
||||
@ -858,6 +883,7 @@ Class Fields
|
||||
case 'adr_dept':
|
||||
case 'adr_reg':
|
||||
case 'adr_com':
|
||||
case 'adr_com_ex':
|
||||
$valeurs = explode(',', $valeur);
|
||||
foreach($valeurs as $element) {
|
||||
if(!empty($element)) {
|
||||
|
Loading…
Reference in New Issue
Block a user