Subversion Repositories eFlore/Applications.coel-consultation

Rev

Rev 65 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 65 Rev 70
Line 7... Line 7...
7
 * @category	php 5.2
7
 * @category	php 5.2
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
8
 * @author		Jean-Pascal MILCENT <jpm@tela-botanica.org>
9
 * @copyright	2010 Tela-Botanica
9
 * @copyright	2010 Tela-Botanica
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
10
 * @license		http://www.cecill.info/licences/Licence_CeCILL_V2-fr.txt Licence CECILL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
11
 * @license		http://www.gnu.org/licenses/gpl.html Licence GNU-GPL
12
 * @version		SVN: $Id: StructureDao.php 65 2010-05-06 16:49:32Z jpm $
12
 * @version		SVN: $Id: StructureDao.php 70 2010-05-21 12:45:04Z jpm $
13
 *
13
 *
14
 */
14
 */
15
class StructureDao extends ColModele {
15
class StructureDao extends ColModele {
-
 
16
	const ROLE_EQUIPE = 2027;
16
	const SERVICE_STRUCTURE = 'CoelStructure';
17
	const SERVICE_STRUCTURE = 'CoelStructure';
17
	const SERVICE_STRUCTURE_A_PERSONNE = 'CoelStructureAPersonne';
18
	const SERVICE_STRUCTURE_A_PERSONNE = 'CoelStructureAPersonne';
Line 18... Line 19...
18
	
19
	
19
	/**
20
	/**
Line 50... Line 51...
50
	 */
51
	 */
51
	public function getPersonnel($id) {
52
	public function getPersonnel($id) {
52
		$url = $this->url_jrest.self::SERVICE_STRUCTURE_A_PERSONNE."/$id";
53
		$url = $this->url_jrest.self::SERVICE_STRUCTURE_A_PERSONNE."/$id";
53
		$json = file_get_contents($url);
54
		$json = file_get_contents($url);
54
		$donnees = json_decode($json, true);
55
		$donnees = json_decode($json, true);
55
		$this->nettoyerTableauDeTableauxAssoc($donnees['structuresAPersonne']);
56
		$personnes = $donnees['structuresAPersonne'];
-
 
57
		
-
 
58
		$personnel = array();
56
		return $donnees['structuresAPersonne'];
59
		foreach ($personnes as $personne) {
-
 
60
			if ($personne['csap_id_role'] == self::ROLE_EQUIPE) {
-
 
61
				$personnel[] = $personne;
-
 
62
			}
-
 
63
		}
-
 
64
		return $personnel;
57
	}
65
	}
58
}
66
}
59
?>
67
?>
60
68