Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1639 Rev 1642
Line 71... Line 71...
71
			$obs_ids = Array('*');
71
			$obs_ids = Array('*');
72
		}
72
		}
73
		else {
73
		else {
74
			$obs_ids = self::rangeToList(trim($_POST['range']));
74
			$obs_ids = self::rangeToList(trim($_POST['range']));
75
		}
75
		}
-
 
76
 
-
 
77
		$params['format'] = 'CSV';
-
 
78
		if($_POST['format'] == 'xls') $params['format'] = 'Excel5';
-
 
79
		if($_POST['format'] == 'xlsx') $params['format'] = 'Excel2007';
-
 
80
 
76
		$this->export($obs_ids, NULL, $params);
81
		$this->export($obs_ids, NULL, $params);
77
		exit;
82
		exit;
78
	}
83
	}
Line 79... Line 84...
79
 
84
 
Line 142... Line 147...
142
							'color' => array('rgb' => PHPExcel_Style_Color::COLOR_BLUE)
147
							'color' => array('rgb' => PHPExcel_Style_Color::COLOR_BLUE)
143
						)
148
						)
144
					)
149
					)
145
				);
150
				);
146
			}
151
			}
-
 
152
			if(! $colonne['importable']) {
-
 
153
				$feuille->getStyleByColumnAndRow($colid, 1)->getFill()->applyFromArray(
-
 
154
					array(
-
 
155
						'type' => PHPExcel_Style_Fill::FILL_SOLID,
-
 
156
						'color' => array('rgb' => PHPExcel_Style_Color::COLOR_YELLOW)
-
 
157
					)
-
 
158
				);
-
 
159
			}
-
 
160
 
147
			$colid++;
161
			$colid++;
148
		}
162
		}
Line 149... Line 163...
149
 
163
 
Line 187... Line 201...
187
		}
201
		}
Line 188... Line 202...
188
 
202
 
189
		header("Content-Type: application/vnd.ms-excel");
203
		header("Content-Type: application/vnd.ms-excel");
190
		header("Content-Disposition: attachment; filename=\"liste.xls\"; charset=utf-8");
204
		header("Content-Disposition: attachment; filename=\"liste.xls\"; charset=utf-8");
-
 
205
		header("Cache-Control: max-age=0");
-
 
206
 
191
		header("Cache-Control: max-age=0");
207
		// csv|xls|xlsx => CSV|Excel5|Excel2007
192
		// Le format Excel2007 utilise un fichier temporaire
208
		// Note: le format Excel2007 utilise un fichier temporaire
193
		$generateur = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
-
 
194
		// $generateur = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
209
		$generateur = PHPExcel_IOFactory::createWriter($objPHPExcel, $params['format']);
195
		$generateur->save('php://output');
210
		$generateur->save('php://output');
196
		exit;
211
		exit;
Line 197... Line 212...
197
	}
212
	}
Line 235... Line 250...
235
		$colonnes = Array();
250
		$colonnes = Array();
Line 236... Line 251...
236
 
251
 
237
		if(isset($groupe_de_champs['standard'])) {
252
		if(isset($groupe_de_champs['standard'])) {
238
		   $colonnes += Array(
253
		   $colonnes += Array(
239
			   'nom_sel'			=> self::GenColInfo('nom_sel', 'Espèce'),
254
			   'nom_sel'			=> self::GenColInfo('nom_sel', 'Espèce'),
240
			   'nom_sel_nn'			=> self::GenColInfo('nom_sel_nn', 'Numéro nomenclatural'),
255
			   'nom_sel_nn'			=> self::GenColInfo('nom_sel_nn', 'Numéro nomenclatural', 0, NULL, NULL, FALSE),
241
			   'nom_ret'			=> self::GenColInfo('nom_ret', 'Nom retenu'),
256
			   'nom_ret'			=> self::GenColInfo('nom_ret', 'Nom retenu', 0, NULL, NULL, FALSE),
242
			   'nom_ret_nn'			=> self::GenColInfo('nom_ret_nn', 'Numéro nomenclatural nom retenu'),
257
			   'nom_ret_nn'			=> self::GenColInfo('nom_ret_nn', 'Numéro nomenclatural nom retenu', 0, NULL, NULL, FALSE),
243
			   'nt'					=> self::GenColInfo('nt', 'Numéro taxonomique'),
258
			   'nt'					=> self::GenColInfo('nt', 'Numéro taxonomique', 0, NULL, NULL, FALSE),
244
			   'famille'			=> self::GenColInfo('famille', 'Famille'),
259
			   'famille'			=> self::GenColInfo('famille', 'Famille', 0, NULL, NULL, FALSE),
245
			   'nom_referentiel'	=> self::GenColInfo('nom_referentiel', 'Referentiel taxonomique'),
260
			   'nom_referentiel'	=> self::GenColInfo('nom_referentiel', 'Referentiel taxonomique'),
246
			   'zone_geo'			=> self::GenColInfo('zone_geo', 'Commune'),
261
			   'zone_geo'			=> self::GenColInfo('zone_geo', 'Commune'),
247
			   'ce_zone_geo'		=> self::GenColInfo('ce_zone_geo', 'Identifiant Commune', 0, 'convertirCodeZoneGeoVersDepartement'),
262
			   'ce_zone_geo'		=> self::GenColInfo('ce_zone_geo', 'Identifiant Commune', 0, 'convertirCodeZoneGeoVersDepartement'),
248
			   'date_observation'	=> self::GenColInfo('date_observation', 'Date', 0, 'formaterDate'),
263
			   'date_observation'	=> self::GenColInfo('date_observation', 'Date', 0, 'formaterDate'),
249
			   'lieudit'			=> self::GenColInfo('lieudit', 'Lieu-dit'),
264
			   'lieudit'			=> self::GenColInfo('lieudit', 'Lieu-dit'),
250
			   'station'			=> self::GenColInfo('station', 'Station'),
265
			   'station'			=> self::GenColInfo('station', 'Station'),
251
			   'milieu'				=> self::GenColInfo('milieu', 'Milieu'),
266
			   'milieu'				=> self::GenColInfo('milieu', 'Milieu'),
252
			   'commentaire'		=> self::GenColInfo('commentaire', 'Notes'),
267
			   'commentaire'		=> self::GenColInfo('commentaire', 'Notes'),
253
			   'latitude'			=> self::GenColInfo('latitude', 'Latitude', 1),
268
			   'latitude'			=> self::GenColInfo('latitude', 'Latitude', 1),
254
			   'longitude'			=> self::GenColInfo('longitude', 'Longitude', 1),
269
			   'longitude'			=> self::GenColInfo('longitude', 'Longitude', 1),
Line 255... Line 270...
255
			   'geodatum'			=> self::GenColInfo('geodatum', 'Référentiel Géographique', 1),
270
			   'geodatum'			=> self::GenColInfo('geodatum', 'Référentiel Géographique', 1, NULL, NULL, FALSE),
256
 
271
 
257
			   // TODO: importable = FALSE car pas de merge de données importées
272
			   // TODO: importable = FALSE car pas de merge de données importées
Line 258... Line 273...
258
			   'ordre'				=> self::GenColInfo('ordre', 'Ordre', 1, NULL, NULL, FALSE),
273
			   'ordre'				=> self::GenColInfo('ordre', 'Ordre', 1, NULL, NULL, FALSE),
259
			   'id_observation'		=> self::GenColInfo('id_observation', 'Identifiant', 1, NULL, NULL, FALSE),
274
			   'id_observation'		=> self::GenColInfo('id_observation', 'Identifiant', 1, NULL, NULL, FALSE),
260
 
275
 
261
			   'mots_cles_texte'	=> self::GenColInfo('mots_cles_texte', 'Mots Clés', 1),
276
			   'mots_cles_texte'	=> self::GenColInfo('mots_cles_texte', 'Mots Clés', 1),
Line 262... Line 277...
262
			   'commentaire'		=> self::GenColInfo('commentaire', 'Commentaires', 1),
277
			   'commentaire'		=> self::GenColInfo('commentaire', 'Commentaires', 1),
263
			   'date_creation'		=> self::GenColInfo('date_creation', 'Date Création', 1),
278
			   'date_creation'		=> self::GenColInfo('date_creation', 'Date Création', 1, NULL, NULL, FALSE),
264
			   'date_modification'	=> self::GenColInfo('date_modification', 'Date Modification', 1),
279
			   'date_modification'	=> self::GenColInfo('date_modification', 'Date Modification', 1, NULL, NULL, FALSE),
265
 
280
 
266
			   // rappel transmission = 1, signifie simplement "public"
281
			   // rappel transmission = 1, signifie simplement "public"
267
			   // des données importées peuvent être d'emblée "publiques"
282
			   // des données importées peuvent être d'emblée "publiques"
268
			   // "importable" = TRUE
283
			   // "importable" = TRUE
269
			   'transmission'		=> self::GenColInfo('transmission', 'Transmis', 1),
284
			   'transmission'		=> self::GenColInfo('transmission', 'Transmis', 1),
Line 270... Line 285...
270
			   'date_transmission'	=> self::GenColInfo('date_transmission', 'Date Transmission', 1),
285
			   'date_transmission'	=> self::GenColInfo('date_transmission', 'Date Transmission', 1, NULL, NULL, FALSE),
271
			   'abondance'			=> self::GenColInfo('abondance', 'Abondance', 1, NULL, NULL, FALSE),
286
			   'abondance'			=> self::GenColInfo('abondance', 'Abondance', 1),
272
			   'certitude'			=> self::GenColInfo('certitude', 'Certitude', 1, NULL, NULL, FALSE),
287
			   'certitude'			=> self::GenColInfo('certitude', 'Certitude', 1),
Line 273... Line 288...
273
			   'phenologie'			=> self::GenColInfo('phenologie', 'Phénologie', 1, NULL, NULL, FALSE),
288
			   'phenologie'			=> self::GenColInfo('phenologie', 'Phénologie', 1),
274
 
289
 
275
			   'nom_commun'			=> self::GenColInfo('nom_commun', 'Nom Commun', 1, NULL, 'getNomCommun', FALSE),
290
			   'nom_commun'			=> self::GenColInfo('nom_commun', 'Nom Commun', 1, NULL, 'getNomCommun', FALSE),
Line 276... Line 291...
276
			   //'nom-commun'			=> self::GenColInfo('nom-commun', 'Nom Commun', 1, NULL, 'getNomCommun_v2'),
291
			   //'nom-commun'			=> self::GenColInfo('nom-commun', 'Nom Commun', 1, NULL, 'getNomCommun_v2'),
277
			   //'nom-commun'			=> self::GenColInfo('nom-commun', 'Nom Commun', 1, NULL, 'getNomCommun_v3'),
292
			   //'nom-commun'			=> self::GenColInfo('nom-commun', 'Nom Commun', 1, NULL, 'getNomCommun_v3'),