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