finalisation de l'arbo departements

This commit is contained in:
Damien LASSERRE 2012-01-25 16:05:05 +00:00
parent 569150e763
commit 82b4019f8b

View File

@ -183,7 +183,7 @@ class ArborescenceController extends Zend_Controller_Action
foreach($regions as $region) { foreach($regions as $region) {
$structure = array( $structure = array(
'data' => $region['NCCENR'], 'data' => $region['NCCENR'],
'attr' => array('id' => 'R'.$region['REGION'], 'niveau' => 1), 'attr' => array('id' => 'R'.$region['REGION'], 'niveau' => 0),
'state' => 'closed', 'state' => 'closed',
'children' => array() 'children' => array()
); );
@ -198,18 +198,6 @@ class ArborescenceController extends Zend_Controller_Action
$this->view->regions = json_encode($tabAdrDep); $this->view->regions = json_encode($tabAdrDep);
} }
public function getGeographiqueParent($values)
{
foreach($values as $value) {
$type = strlen($value, 0, 1);
if($type == 'D') {
$table = new Application_Model_Departements();
}
}
}
public function geographiqueajaxAction() public function geographiqueajaxAction()
{ {
$this->_helper->layout()->disableLayout(); $this->_helper->layout()->disableLayout();
@ -217,9 +205,9 @@ class ArborescenceController extends Zend_Controller_Action
$request = $this->getRequest(); $request = $this->getRequest();
$key = $request->getParam('key'); $key = $request->getParam('key');
$niveau = $request->getParam('niveau'); $id = $request->getParam('id');
if($niveau == 1) { if($id[0] == 'R') {
require_once 'Scores/SessionCiblage.php'; require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage(); $session = new SessionCiblage();
$val = $session->getCritere('adr_cp'); $val = $session->getCritere('adr_cp');
@ -254,7 +242,7 @@ class ArborescenceController extends Zend_Controller_Action
foreach($departements as $departement) { foreach($departements as $departement) {
$structure = array( $structure = array(
'data' => $departement['libdep'], 'data' => $departement['libdep'],
'attr' => array('id' => 'D'.$departement['numdep'], 'niveau' => 2), 'attr' => array('id' => 'D'.$departement['numdep'], 'niveau' => 1),
'state' => 'closed', 'state' => 'closed',
'children' => array() 'children' => array()
); );
@ -267,7 +255,7 @@ class ArborescenceController extends Zend_Controller_Action
$departementTab[] = $structure; $departementTab[] = $structure;
} }
echo json_encode($departementTab); echo json_encode($departementTab);
} else { } else if($id[0] == 'D') {
require_once 'Scores/SessionCiblage.php'; require_once 'Scores/SessionCiblage.php';
$session = new SessionCiblage(); $session = new SessionCiblage();
$val = $session->getCritere('adr_cp'); $val = $session->getCritere('adr_cp');
@ -314,7 +302,7 @@ class ArborescenceController extends Zend_Controller_Action
foreach($codePostaux as $codePostau) { foreach($codePostaux as $codePostau) {
$structure = array( $structure = array(
'data' => '[ '.$codePostau['Codepos'].' ]'.ucfirst(strtolower($codePostau['Commune'])), 'data' => '[ '.$codePostau['Codepos'].' ]'.ucfirst(strtolower($codePostau['Commune'])),
'attr' => array('id' => $codePostau['Codepos'], 'niveau' => 3) 'attr' => array('id' => $codePostau['Codepos'], 'niveau' => 2)
); );
if(in_array($codePostau['Codepos'], $valuesCheckeds)) { if(in_array($codePostau['Codepos'], $valuesCheckeds)) {
$structure['attr']['class'] = 'jstree-checked'; $structure['attr']['class'] = 'jstree-checked';