Ajout code pour la gestion du mode autocomplete

This commit is contained in:
Michael RICOIS 2012-05-21 07:30:51 +00:00
parent 505a8a5802
commit 99493051cf

View File

@ -56,10 +56,10 @@ class GeographiqueController extends Zend_Controller_Action
foreach ($result as $item) {
$output[] = array(
'label' => $item->libdep . $separator . $item->numdep,
'value' => $item->numdep
'value' => 'D'.$item->numdep
);
}
return ($output);
return $output;
}
protected function completedVil($q)
@ -73,11 +73,11 @@ class GeographiqueController extends Zend_Controller_Action
$result = $table->fetchAll($sql);
foreach ($result as $item) {
$output[] = array(
'label' => $item->Commune . $separator . $item->Codepos,
'value' => $item->INSEE
'label' => $item->Commune . $separator . $item->Codepos,
'value' => 'C'.$item->INSEE
);
}
return ($output);
return $output;
}
protected function getDeptFromReg($dep)
@ -93,7 +93,7 @@ class GeographiqueController extends Zend_Controller_Action
$string .= $res['numdep'].',';
}
$string = substr($string, 0, strlen($string)-1);
return ($string);
return $string;
}
protected function completedReg($q)
@ -108,11 +108,11 @@ class GeographiqueController extends Zend_Controller_Action
$result = $table->fetchAll($sql);
foreach ($result as $item) {
$output[] = array(
'label' => $item->REGION .' '.$item->NCCENR . $separator . $item->REGION,
'value' => $this->getDeptFromReg($item->REGION)
'label' => $item->NCCENR . $separator . $item->REGION,
'value' => 'R'.$item->REGION
);
}
return ($output);
return $output;
}
}