Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 2732 Rev 3134
Line 30... Line 30...
30
	static $is_table = false;
30
	static $is_table = false;
Line 31... Line 31...
31
 
31
 
32
	// les groupes de champs utilisables
32
	// les groupes de champs utilisables
33
	static $fieldGroups = array(
33
	static $fieldGroups = array(
-
 
34
		'standard',
34
		'standard',
35
		'standardexport',
35
		'avance',
36
		'avance',
36
		'etendu',
37
		'etendu',
37
		'baseflor',
38
		'baseflor',
38
		'auteur'
39
		'auteur'
Line 79... Line 80...
79
		'vitesseCroissance',
80
		'vitesseCroissance',
80
		'perceptionTechnicien',
81
		'perceptionTechnicien',
81
		'perceptionRiverainMauvaise',
82
		'perceptionRiverainMauvaise',
82
	);
83
	);
Line 83... Line 84...
83
 
84
 
84
	static function colGroupsValidation($groupe_de_champs = 'standard,avance') {
85
	static function colGroupsValidation($groupe_de_champs = 'standard,avance', $programme = "") { 
85
		if (! $groupe_de_champs) return FALSE;
86
		if (! $groupe_de_champs) return FALSE;
86
		if (is_string($groupe_de_champs)) {
87
		if (is_string($groupe_de_champs)) {
87
			$groupe_de_champs = array_flip(explode(',', $groupe_de_champs));
88
			$groupe_de_champs = array_flip(explode(',', $groupe_de_champs));
88
		} elseif(is_array($groupe_de_champs)) {
89
		} elseif(is_array($groupe_de_champs)) {
Line 92... Line 93...
92
		}
93
		}
93
		$groupe_de_champs = array_intersect_key(array_flip(self::$fieldGroups), $groupe_de_champs);
94
		$groupe_de_champs = array_intersect_key(array_flip(self::$fieldGroups), $groupe_de_champs);
94
		if (!$groupe_de_champs) {
95
		if (!$groupe_de_champs) {
95
			return false;
96
			return false;
96
		}
97
		}
-
 
98
		if ($programme != "") {
-
 
99
			$groupe_de_champs['avance'] = true;
-
 
100
			$groupe_de_champs['etendu'] = true;
-
 
101
		}
97
		// toujours ajouter standard
102
		// toujours ajouter standard
98
		$groupe_de_champs['standard'] = true;
103
		$groupe_de_champs['standard'] = true;
99
		return implode(',', array_keys($groupe_de_champs));
104
		return implode(',', array_keys($groupe_de_champs));
100
	}
105
	}
Line 127... Line 132...
127
		if (!$groupe_de_champs) {
132
		if (!$groupe_de_champs) {
128
			return null;
133
			return null;
129
		}
134
		}
Line 130... Line 135...
130
 
135
 
131
		$colonnes = array();
136
		$colonnes = array();
132
		if (isset($groupe_de_champs['standard'])) {
137
		if (isset($groupe_de_champs['standardexport'])) { 
-
 
138
			$colonnes += Array(
-
 
139
				'guid'			=> self::GenColInfo(Array('abbrev' => 'guid',
133
			$colonnes += Array(
140
																'nom' => 'Identifiant unique')),
134
				'nom_sel'			=> self::GenColInfo(Array('abbrev' => 'nom_sel',
141
				'nom_sel'			=> self::GenColInfo(Array('abbrev' => 'nom_sel',
135
															  'nom' => 'Espèce')),
142
															  'nom' => 'Espèce')),
136
				'nom_sel_nn'		=> self::GenColInfo(Array('abbrev' => 'nom_sel_nn',
143
				'nom_sel_nn'		=> self::GenColInfo(Array('abbrev' => 'nom_sel_nn',
137
															  'nom' => 'Numéro nomenclatural',
144
															  'nom' => 'Numéro nomenclatural',
Line 181... Line 188...
181
															  'extra' => 1)), // pas de trim0 car INT(5) en DB
188
															  'extra' => 1)), // pas de trim0 car INT(5) en DB
182
				'geodatum'			=> self::GenColInfo(Array('abbrev' => 'geodatum',
189
				'geodatum'			=> self::GenColInfo(Array('abbrev' => 'geodatum',
183
															  'nom' => 'Référentiel Géographique',
190
															  'nom' => 'Référentiel Géographique',
184
															  'extra' => 1,
191
															  'extra' => 1,
185
															  'importable' => FALSE)),
192
															  'importable' => FALSE)),
-
 
193
				'programme'			=> self::GenColInfo(Array('abbrev' => 'programme',
-
 
194
															'nom' => 'Programme de sciences participatives ou observatoire citoyen',
-
 
195
															'importable' => FALSE)),
-
 
196
				'validation_identiplante'			=> self::GenColInfo(Array('abbrev' => 'validation_identiplante',
-
 
197
															'nom' => 'Espéce validée sur IdentiPlante',
-
 
198
															'importable' => FALSE)),
186
			);
199
			);
-
 
200
		} elseif (isset($groupe_de_champs['standard'])) {
-
 
201
			$colonnes += Array(
-
 
202
					'nom_sel'			=> self::GenColInfo(Array('abbrev' => 'nom_sel',
-
 
203
							'nom' => 'Espèce')),
-
 
204
					'nom_sel_nn'		=> self::GenColInfo(Array('abbrev' => 'nom_sel_nn',
-
 
205
							'nom' => 'Numéro nomenclatural',
-
 
206
							'importable' => FALSE)),
-
 
207
					'nom_ret'			=> self::GenColInfo(Array('abbrev' => 'nom_ret',
-
 
208
							'nom' => 'Nom retenu',
-
 
209
							'importable' => FALSE)),
-
 
210
					'nom_ret_nn'		=> self::GenColInfo(Array('abbrev' => 'nom_ret_nn',
-
 
211
							'nom' => 'Numéro nomenclatural nom retenu',
-
 
212
							'importable' => FALSE)),
-
 
213
					'nt'				=> self::GenColInfo(Array('abbrev' => 'nt',
-
 
214
							'nom' => 'Numéro taxonomique',
-
 
215
							'importable' => FALSE)),
-
 
216
					'famille'			=> self::GenColInfo(Array('abbrev' => 'famille',
-
 
217
							'nom' => 'Famille',
-
 
218
							'importable' => FALSE)),
-
 
219
					'nom_referentiel'	=> self::GenColInfo(Array('abbrev' => 'nom_referentiel',
-
 
220
							'nom' => 'Referentiel taxonomique')),
-
 
221
					'pays'				=> self::GenColInfo(Array('abbrev' => 'pays',
-
 
222
							'nom' => 'Pays')),
-
 
223
					'zone_geo'			=> self::GenColInfo(Array('abbrev' => 'zone_geo',
-
 
224
							'nom' => 'Commune')),
-
 
225
					'ce_zone_geo'		=> self::GenColInfo(Array('abbrev' => 'ce_zone_geo',
-
 
226
							'nom' => 'Identifiant Commune',
-
 
227
							'fonction' => 'convertirCodeZoneGeoVersDepartement')),
-
 
228
					'date_observation'	=> self::GenColInfo(Array('abbrev' => 'date_observation',
-
 
229
							'nom' => 'Date',
-
 
230
							'fonction' => 'formaterDate')),
-
 
231
					'lieudit'			=> self::GenColInfo(Array('abbrev' => 'lieudit',
-
 
232
							'nom' => 'Lieu-dit')),
-
 
233
					'station'			=> self::GenColInfo(Array('abbrev' => 'station',
-
 
234
							'nom' => 'Station')),
-
 
235
					'milieu'			=> self::GenColInfo(Array('abbrev' => 'milieu',
-
 
236
							'nom' => 'Milieu')),
-
 
237
					'commentaire'		=> self::GenColInfo(Array('abbrev' => 'commentaire',
-
 
238
							'nom' => 'Notes')),
-
 
239
					'latitude'			=> self::GenColInfo(Array('abbrev' => 'latitude',
-
 
240
							'nom' => 'Latitude',
-
 
241
							'extra' => 1,
-
 
242
							'fonction' => 'trim0')),
-
 
243
					'longitude'			=> self::GenColInfo(Array('abbrev' => 'longitude',
-
 
244
							'nom' => 'Longitude',
-
 
245
							'extra' => 1,
-
 
246
							'fonction' => 'trim0')),
-
 
247
					'altitude'			=> self::GenColInfo(Array('abbrev' => 'altitude',
-
 
248
							'nom' => 'Altitude',
-
 
249
							'extra' => 1)), // pas de trim0 car INT(5) en DB
-
 
250
					'geodatum'			=> self::GenColInfo(Array('abbrev' => 'geodatum',
-
 
251
							'nom' => 'Référentiel Géographique',
-
 
252
							'extra' => 1,
-
 
253
							'importable' => FALSE)),
-
 
254
					);
187
		}
255
		}
Line 188... Line 256...
188
 
256
 
189
		if(isset($groupe_de_champs['avance'])) {
257
		if(isset($groupe_de_champs['avance'])) {
190
			$colonnes += array(
258
			$colonnes += array(