issue #0001326 : Gestion des intervalles de dates comme les intervalles

This commit is contained in:
Michael RICOIS 2012-09-07 09:29:13 +00:00
parent 4e71d73328
commit 64a68e1cc7

View File

@ -815,7 +815,7 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
//Do some operation on value
$types = array_keys($this->fields[$key]['fields']);
if ( !is_array($value) && !in_array($types[0], array('select', 'checkbox', 'interval')) ) {
if ( !is_array($value) && !in_array($types[0], array('select', 'checkbox', 'interval', 'intervalDate')) ) {
//Remove all space in string value
$value = str_replace(' ', '', $value);
//Try to detect separator and transform as array
@ -834,10 +834,10 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
}
}
if ( in_array($types[0], array('interval')) ) {
if ( in_array($types[0], array('interval', 'intervalDate')) ) {
$value = explode(',', $value);
}
//Remove duplicate values
if (is_array($value) ) {
$value = array_unique($value);
@ -845,6 +845,9 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
//Before to save the value
switch ( $types[0] ) {
case 'intervalDate':
unset($this->ciblage[$sessionKey]['in']);
break;
case 'interval':
//@todo : Check Min Max
//@todo : Check Number => A préciser dans Fields
@ -869,9 +872,9 @@ Les zones urbaines sensibles constituent un sous-ensemble de l'ensemble plus lar
Zend_Registry::get('firebug')->info($value);
$this->ciblage[$sessionKey]['ex'] = $value;
} else {
Zend_Registry::get('firebug')->info('Include: ');
Zend_Registry::get('firebug')->info($value);
$this->ciblage[$sessionKey]['in'] = $value;
Zend_Registry::get('firebug')->info('Include: ');
Zend_Registry::get('firebug')->info($value);
}
return true;