correction bug session FJ

This commit is contained in:
Damien LASSERRE 2012-02-16 08:18:18 +00:00
parent 9312fee50b
commit d2a574d49e

View File

@ -1,6 +1,33 @@
<?php
class Object_Formejuridique extends Libs_Row
{
protected function _jstree_checked()
{
require_once('Scores/SessionCiblage.php');
$session = new SessionCiblage();
$valeurs = explode(',', $session->getCritere('cj'));
foreach($valeurs as $valeur) {
$return[] = $valeur;
}
if(is_array($return))
return ($return);
return (array($valeurs));
}
protected function _jstree_undetermined()
{
return (array());
}
public function _getClass($valeur)
{
if(in_array($valeur, $this->_jstree_checked()))
return ('jstree-checked');
else if (in_array($valeur, $this->_jstree_undetermined()))
return ('jstree-undetermined');
}
public function _getParents()
{
$formes = new Table_Formejuridiques();
@ -10,10 +37,11 @@ class Object_Formejuridique extends Libs_Row
foreach($formes as $forme) {
$structure[] = array(
'data' => $forme['fjCode'].' : '.$forme['fjLibelle'],
'attr' => array('id' => $forme['fjCode']),
'attr' => array('id' => $forme['fjCode'],
'class' => $this->_getClass($forme['fjCode'])),
'state' => 'closed',
'children' => array($this->_getFils($forme['fjCode']))
);
'children' => array($this->_getFils($forme['fjCode'])),
);
}
return (json_encode($structure));
}
@ -33,7 +61,8 @@ class Object_Formejuridique extends Libs_Row
foreach($formes as $forme) {
$structure = array(
'data' => $forme['fjCode'].' : '.$forme['fjLibelle'],
'attr' => array('id' => $forme['fjCode']),
'attr' => array('id' => $forme['fjCode'],
'class' => $this->_getClass($forme['fjCode'])),
'state' => 'close',
'children' => (($lenth < 6)?$this->_getFils($forme['fjCode']):array())
);