issue #0001311 : Traitement des formes juridiques sous forme de liste
This commit is contained in:
parent
ad1a877ef4
commit
aa0db85f31
@ -79,6 +79,7 @@
|
||||
<div id="juridique">
|
||||
<ul id="fieldsblock">
|
||||
<li><?=$this->Field('cj')?></li>
|
||||
<li class="advanced"><?=$this->Field('cjlist')?></li>
|
||||
<li><?=$this->Field('actifEco')?></li>
|
||||
<li><?=$this->Field('procolHisto')?></li>
|
||||
<li><?=$this->Field('dateImmat')?></li>
|
||||
|
@ -471,14 +471,15 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
'famille' => 'juridique',
|
||||
'activated' => true,
|
||||
),
|
||||
'cjliste' => array(
|
||||
'cjlist' => array(
|
||||
'label' => 'Liste de formes juridique',
|
||||
'fields' => array(
|
||||
'list' => array(),
|
||||
),
|
||||
'famille' => 'juridique',
|
||||
'title' => 'Liste de codes formes juridiques séparés des virgules ou des points-virgules',
|
||||
'activated' => true,
|
||||
'sessionKey' => 'cj',
|
||||
'title' => 'Liste de codes formes juridiques séparés des virgules ou des points-virgules',
|
||||
),
|
||||
'actifEco' => array(
|
||||
'label' => 'Établissement économiquement actif',
|
||||
@ -788,10 +789,15 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
Zend_Registry::get('firebug')->info('CLE INCORRECT');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$sessionKey = $key;
|
||||
if (array_key_exists('sessionKey', $this->fields[$key])) {
|
||||
$sessionKey = $this->fields[$key]['sessionKey'];
|
||||
}
|
||||
|
||||
//Remove critere for these values on all type of fields
|
||||
if ( in_array($value, array('', '-', null)) ) {
|
||||
unset($this->ciblage[$key]);
|
||||
unset($this->ciblage[$sessionKey]);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -819,11 +825,11 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
$value = $matches[1];
|
||||
}
|
||||
//Add value to the existing
|
||||
if (array_key_exists($key, $this->ciblage)) {
|
||||
if (array_key_exists($sessionKey, $this->ciblage)) {
|
||||
if ($ex) {
|
||||
$value = array_merge($this->ciblage[$key]['ex'], $value);
|
||||
$value = array_merge($this->ciblage[$sessionKey]['ex'], $value);
|
||||
} else {
|
||||
$value = array_merge($this->ciblage[$key]['in'], $value);
|
||||
$value = array_merge($this->ciblage[$sessionKey]['in'], $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -846,7 +852,7 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
break;
|
||||
case 'checkbox':
|
||||
if ( $value==0 ) {
|
||||
unset($this->ciblage[$key]);
|
||||
unset($this->ciblage[$sessionKey]);
|
||||
}
|
||||
break;
|
||||
case 'tree':
|
||||
@ -861,9 +867,9 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
|
||||
if ($ex) {
|
||||
Zend_Registry::get('firebug')->info('Exclude : ');
|
||||
Zend_Registry::get('firebug')->info($value);
|
||||
$this->ciblage[$key]['ex'] = $value;
|
||||
$this->ciblage[$sessionKey]['ex'] = $value;
|
||||
} else {
|
||||
$this->ciblage[$key]['in'] = $value;
|
||||
$this->ciblage[$sessionKey]['in'] = $value;
|
||||
Zend_Registry::get('firebug')->info('Include: ');
|
||||
Zend_Registry::get('firebug')->info($value);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user