Subversion Repositories eFlore/Applications.cel

Rev

Rev 2732 | Rev 3135 | Go to most recent revision | Show entire file | Regard 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
 
-
 
136
		$colonnes = array();
-
 
137
		if (isset($groupe_de_champs['standardexport'])) { 
-
 
138
			$colonnes += Array(
-
 
139
				'guid'			=> self::GenColInfo(Array('abbrev' => 'guid',
-
 
140
																'nom' => 'Identifiant unique')),
-
 
141
				'nom_sel'			=> self::GenColInfo(Array('abbrev' => 'nom_sel',
-
 
142
															  'nom' => 'Espèce')),
-
 
143
				'nom_sel_nn'		=> self::GenColInfo(Array('abbrev' => 'nom_sel_nn',
-
 
144
															  'nom' => 'Numéro nomenclatural',
-
 
145
															  'importable' => FALSE)),
-
 
146
				'nom_ret'			=> self::GenColInfo(Array('abbrev' => 'nom_ret',
-
 
147
															  'nom' => 'Nom retenu',
-
 
148
															  'importable' => FALSE)),
-
 
149
				'nom_ret_nn'		=> self::GenColInfo(Array('abbrev' => 'nom_ret_nn',
-
 
150
															  'nom' => 'Numéro nomenclatural nom retenu',
-
 
151
															  'importable' => FALSE)),
-
 
152
				'nt'				=> self::GenColInfo(Array('abbrev' => 'nt',
-
 
153
															  'nom' => 'Numéro taxonomique',
-
 
154
															  'importable' => FALSE)),
-
 
155
				'famille'			=> self::GenColInfo(Array('abbrev' => 'famille',
-
 
156
															  'nom' => 'Famille',
-
 
157
															  'importable' => FALSE)),
-
 
158
				'nom_referentiel'	=> self::GenColInfo(Array('abbrev' => 'nom_referentiel',
-
 
159
															  'nom' => 'Referentiel taxonomique')),
-
 
160
				'pays'				=> self::GenColInfo(Array('abbrev' => 'pays',
-
 
161
															  'nom' => 'Pays')),
-
 
162
				'zone_geo'			=> self::GenColInfo(Array('abbrev' => 'zone_geo',
-
 
163
															  'nom' => 'Commune')),
-
 
164
				'ce_zone_geo'		=> self::GenColInfo(Array('abbrev' => 'ce_zone_geo',
-
 
165
															  'nom' => 'Identifiant Commune',
-
 
166
															  'fonction' => 'convertirCodeZoneGeoVersDepartement')),
-
 
167
				'date_observation'	=> self::GenColInfo(Array('abbrev' => 'date_observation',
-
 
168
															  'nom' => 'Date',
-
 
169
															  'fonction' => 'formaterDate')),
-
 
170
				'lieudit'			=> self::GenColInfo(Array('abbrev' => 'lieudit',
-
 
171
															  'nom' => 'Lieu-dit')),
-
 
172
				'station'			=> self::GenColInfo(Array('abbrev' => 'station',
-
 
173
															  'nom' => 'Station')),
-
 
174
				'milieu'			=> self::GenColInfo(Array('abbrev' => 'milieu',
-
 
175
															  'nom' => 'Milieu')),
-
 
176
				'commentaire'		=> self::GenColInfo(Array('abbrev' => 'commentaire',
-
 
177
															  'nom' => 'Notes')),
-
 
178
				'latitude'			=> self::GenColInfo(Array('abbrev' => 'latitude',
-
 
179
															  'nom' => 'Latitude',
-
 
180
															  'extra' => 1,
-
 
181
															  'fonction' => 'trim0')),
-
 
182
				'longitude'			=> self::GenColInfo(Array('abbrev' => 'longitude',
-
 
183
															  'nom' => 'Longitude',
-
 
184
															  'extra' => 1,
-
 
185
															  'fonction' => 'trim0')),
-
 
186
				'altitude'			=> self::GenColInfo(Array('abbrev' => 'altitude',
-
 
187
															  'nom' => 'Altitude',
-
 
188
															  'extra' => 1)), // pas de trim0 car INT(5) en DB
-
 
189
				'geodatum'			=> self::GenColInfo(Array('abbrev' => 'geodatum',
-
 
190
															  'nom' => 'Référentiel Géographique',
-
 
191
															  'extra' => 1,
-
 
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)),
131
		$colonnes = array();
199
			);
132
		if (isset($groupe_de_champs['standard'])) {
200
		} elseif (isset($groupe_de_champs['standard'])) {
133
			$colonnes += Array(
201
			$colonnes += Array(
134
				'nom_sel'			=> self::GenColInfo(Array('abbrev' => 'nom_sel',
202
					'nom_sel'			=> self::GenColInfo(Array('abbrev' => 'nom_sel',
135
															  'nom' => 'Espèce')),
203
							'nom' => 'Espèce')),
136
				'nom_sel_nn'		=> self::GenColInfo(Array('abbrev' => 'nom_sel_nn',
204
					'nom_sel_nn'		=> self::GenColInfo(Array('abbrev' => 'nom_sel_nn',