Correction des array en string pour l'affichage des sessions dans le select
This commit is contained in:
parent
c992950c33
commit
7e53de8c28
@ -56,7 +56,7 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
private function selectMultipleHTML($name, $field)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
|
||||
$return = '<select class="criteres" name="'.$name.'">';
|
||||
$return .= '<option value="tous">Tous</option>';
|
||||
foreach($field['fields'][$field['type']]['value'] as $value => $label) {
|
||||
@ -73,12 +73,15 @@ Class Zend_View_Helper_Field extends Zend_View_Helper_Abstract
|
||||
private function selectHTML($name, $field)
|
||||
{
|
||||
$session = new SessionCiblage();
|
||||
|
||||
|
||||
$sessionValeur = $session->getCritere($name);
|
||||
if(is_array($sessionValeur))
|
||||
$sessionValeur = implode(',', $sessionValeur);
|
||||
$return = '<select class="criteres" name="'.$name.'">';
|
||||
$return .= '<option value="tous">Tous</option>';
|
||||
foreach($field['fields'][$field['type']]['value'] as $value => $label) {
|
||||
$selected = "";
|
||||
if(($session->getCritere($name) != null) and $session->getCritere($name) == $value)
|
||||
if(($sessionValeur != null) and $sessionValeur == $value)
|
||||
$selected = " selected";
|
||||
$return .= '<option'.((!empty($selected))?$selected:null).' value="'.$value.'">'.$label.'</option>';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user