Subversion Repositories eFlore/Projets.eflore-projets

Rev

Rev 613 | Rev 678 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 613 Rev 640
Line 85... Line 85...
85
		$requete = "SELECT DISTINCT zone_application, code_zone_application FROM sptb_lois_v".$this->table_version.' '.
85
		$requete = "SELECT DISTINCT zone_application, code_zone_application FROM sptb_lois_v".$this->table_version.' '.
86
			           "WHERE id IN (".implode(',',$id_lois).") ";   
86
			           "WHERE id IN (".implode(',',$id_lois).") ";   
87
		return $this->bdd->recupererTous($requete);
87
		return $this->bdd->recupererTous($requete);
88
	}
88
	}
Line 89... Line 89...
89
	
89
	
90
	private function obtenirStatuts() {		
90
	private function obtenirStatuts() {	
-
 
91
		$nn_demande = $this->parametres['masque.nn'];
91
		$requete = "SELECT * FROM sptb_especes_v".$this->table_version.' '.
92
		
-
 
93
		$conditions_taxons = array();
92
		           "WHERE ".
94
		$conditions_taxons = $this->obtenirNumNomTaxonsSuperieurs($nn_demande);
Line -... Line 95...
-
 
95
		$conditions_taxons[] = $this->bdd->proteger($nn_demande);
-
 
96
		
-
 
97
		$requete = "SELECT * FROM sptb_especes_v".$this->table_version.' '.
-
 
98
		           "WHERE num_nom_retenu IN (".implode(', ', $conditions_taxons).") OR ".
93
		           "num_nom = ".$this->bdd->proteger($this->parametres['masque.nn'])."";
99
				   "num_nom IN (".implode(', ', $conditions_taxons).") ";
94
		
100
				
95
		$statuts = $this->bdd->recuperer($requete);
101
		$statuts = $this->bdd->recuperer($requete);
96
		$statuts = $this->formaterRetour($statuts);
102
		$statuts = $this->formaterRetour($statuts);
Line -... Line 103...
-
 
103
		return $statuts;           
-
 
104
	}
-
 
105
	
-
 
106
	private function obtenirNumNomTaxonsSuperieurs($nn_demande) {
-
 
107
		$nn_taxons_sup = array();
-
 
108
		// TODO: ceci ramène trop de champs alors que l'on a besoin que du numéro nomenclatural
-
 
109
		// et il y a peut-être un meilleur moyen que ramener la hierarchie des taxons supérieurs
-
 
110
		// mais pour le moment ça marche et c'est assez rapide
-
 
111
		$url = $this->ajouterHrefAutreProjet('taxons', $nn_demande, '/relations/superieurs','bdtfx');
-
 
112
		$classification = $this->consulterHref($url);
-
 
113
		$classification = is_object($classification) ? get_object_vars($classification) : array();
-
 
114
		
-
 
115
		if(isset($classification[$nn_demande])) {
-
 
116
			$classification_nn_demande = get_object_vars($classification[$nn_demande]);
-
 
117
			$tab_nn_demandes = array_keys($classification_nn_demande);
-
 
118
			$nn_taxons_sup = array_map(array($this->bdd,'proteger'), $tab_nn_demandes);
-
 
119
		}	
97
		return $statuts;           
120
		return $nn_taxons_sup;
Line 98... Line 121...
98
	}
121
	}
99
	
122
	
100
//+---------------------------FONCTIONS DE FORMATAGE---------------------------------------------------------+
123
//+---------------------------FONCTIONS DE FORMATAGE---------------------------------------------------------+
Line 129... Line 152...
129
		return $zones_geo_lois;
152
		return $zones_geo_lois;
130
	}
153
	}
Line 131... Line 154...
131
	
154
	
132
	private function formaterStatutsTaxon($statuts_taxon) {
155
	private function formaterStatutsTaxon($statuts_taxon) {
133
		$statuts_formates = array();
-
 
134
		unset($statuts_taxon['num_nom']);
-
 
135
		unset($statuts_taxon['nom_sci']);
156
		$statuts_formates = array();
-
 
157
		$lois_statuts = array();
-
 
158
		
-
 
159
		if(is_array($statuts_taxon)) {
-
 
160
			unset($statuts_taxon['num_nom']);
-
 
161
			unset($statuts_taxon['num_nom_retenu']);
136
		$lois_statuts = array();
162
			unset($statuts_taxon['nom_sci']);
137
		foreach ($statuts_taxon as $champ => $statut) {
163
			foreach ($statuts_taxon as $champ => $statut) {
138
			if($statut == "1") {
164
				if($statut == "1") {
-
 
165
					$lois_statuts[] = $champ;
139
				$lois_statuts[] = $champ;
166
				}
140
			}
167
			}
Line 141... Line 168...
141
		}
168
		}