Subversion Repositories Sites.obs-saisons.fr

Rev

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

Rev 210 Rev 215
Line 261... Line 261...
261
	}
261
	}
Line 262... Line 262...
262
	
262
	
263
	private function construireDonneesCommunesAuxItems($observation) {
263
	private function construireDonneesCommunesAuxItems($observation) {
264
		$item = array();
264
		$item = array();
265
		$date_modification_timestamp = $this->convertirDateHeureMysqlEnTimestamp($observation['oo_date_modification']);
265
		$date_modification_timestamp = $this->convertirDateHeureMysqlEnTimestamp($observation['oo_date_modification']);
266
		$item['date_maj_simple'] = strftime('%A %d %B %Y à %H:%M', $date_modification_timestamp);
266
		$item['date_maj_simple'] = strftime('%A %d %B %Y', $date_modification_timestamp);
267
		$item['date_maj_RSS'] = date(DATE_RSS, $date_modification_timestamp);
267
		$item['date_maj_RSS'] = date(DATE_RSS, $date_modification_timestamp);
268
		$item['date_maj_ATOM'] = date(DATE_ATOM, $date_modification_timestamp);
268
		$item['date_maj_ATOM'] = date(DATE_ATOM, $date_modification_timestamp);
269
		$item['date_maj_W3C'] = date(DATE_W3C, $date_modification_timestamp);
269
		$item['date_maj_W3C'] = date(DATE_W3C, $date_modification_timestamp);
270
		$item['date_creation_simple'] = strftime('%A %d %B %Y à %H:%M', strtotime($observation['oo_date_saisie']));
270
		$item['date_creation_simple'] = strftime('%A %d %B %Y', strtotime($observation['oo_date_saisie']));
271
		$item['titre'] = $this->creerTitre($observation);
271
		$item['titre'] = $this->creerTitre($observation);
272
		$item['guid'] = $this->creerGuidItem($observation);
272
		$item['guid'] = $this->creerGuidItem($observation);
273
		$item['lien'] = $this->creerUrlService();
273
		$item['lien'] = $this->creerUrlService();
274
		$item['categorie'] = $this->creerCategorie($item);
274
		$item['categorie'] = $this->creerCategorie($item);
Line 347... Line 347...
347
		}
347
		}
Line 348... Line 348...
348
		
348
		
Line 349... Line 349...
349
		$description = "Observé à $lieu".'<br />';
349
		$description = "Observé à $lieu".'<br />';
350
		
-
 
351
		if($this->mode == 'admin') {
350
		
352
			
351
		if($this->mode == 'admin') {
-
 
352
			$description .= ' Individu : '.$obs['oi_nom'].'<br />';	
-
 
353
			$description .= 'Station : '.$obs['os_nom'].'<br />';
-
 
354
			if($this->estUneDateSqlInvalide($obs['oo_date'])) {
-
 
355
				$description .= ' Date d\'observation supprimée <br />';	
-
 
356
			} else {
353
			$description .= ' Individu : '.$obs['oi_nom'].'<br />';	
357
				$description .= ' Date de l\'observation changée en : '.strftime('%A %d %B %Y', strtotime($obs['oo_date'])).'<br />';	
354
			$description .= 'Station : '.$obs['os_nom'].'<br />';		
358
			}		
355
			$description .= 'Saisi le : '.$item['date_creation_simple'].'<br />';
359
			$description .= 'Saisi le : '.$item['date_creation_simple'].'<br />';
Line 356... Line 360...
356
			$description .= 'Modifié le : '.$item['date_maj_simple'].'<br />';
360
			$description .= 'Modifié le : '.$item['date_maj_simple'].'<br />';
Line 357... Line 361...
357
		}
361
		}
358
		
362
		
Line -... Line 363...
-
 
363
		$description = $this->nettoyerTexte($description);
-
 
364
		
-
 
365
		return $description;
-
 
366
	}
-
 
367
	
-
 
368
	private function estUneDateSqlInvalide($date) {
359
		$description = $this->nettoyerTexte($description);
369
		
360
		
370
		$date_tab = split('-', $date);
361
		return $description;
371
		return ($date_tab[2] == '00' || $date_tab[1] == '00' || $date_tab[0] == '0000');
362
	}
372
	}
363
	
373