Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1148 Rev 1165
Line 348... Line 348...
348
			$sensible = false;
348
			$sensible = false;
349
		}
349
		}
350
		return $sensible;
350
		return $sensible;
351
	}
351
	}
Line -... Line 352...
-
 
352
 
-
 
353
	private function communeEstDemandee() {
-
 
354
	    $station_infos = $this->decomposerParametreStation();
-
 
355
	    $commune_demandee = true;
-
 
356
	    if($station_infos['type'] == self::MARQUEUR_STATION) {
-
 
357
			$commune_demandee = false;
-
 
358
	    }
-
 
359
	    return $commune_demandee;
-
 
360
	}
352
 
361
 
353
	/**
362
	/**
354
	 * Données pour l'affichage des obs d'une station
363
	 * Données pour l'affichage des obs d'une station
355
	 */
364
	 */
356
	public function getObservations($params) {
365
	public function getObservations($params) {
Line 362... Line 371...
362
						'	sector, x_utm, y_utm, insee_code, date_transmission '.
371
						'	sector, x_utm, y_utm, insee_code, date_transmission '.
363
						'FROM cel_inventory AS i '.
372
						'FROM cel_inventory AS i '.
364
						'	LEFT JOIN locations AS l '.
373
						'	LEFT JOIN locations AS l '.
365
						"		ON (l.name = i.location AND l.code = i.id_location) ".
374
						"		ON (l.name = i.location AND l.code = i.id_location) ".
366
						"WHERE transmission = '1' ".
375
						"WHERE transmission = '1' ".
367
						((!$this->etreNull($this->parametres['commune'])) ? $this->construireWhereCommuneSansCoordonneesAvecSensibles() : $this->construireWhereCoordonneesSansSensibles()).
376
						(($this->communeEstDemandee()) ? $this->construireWhereCommuneSansCoordonneesAvecSensibles() : $this->construireWhereCoordonneesSansSensibles()).
368
						$this->construireWhereDept().
377
						$this->construireWhereDept().
369
						$this->construireWhereUtilisateur().
378
						$this->construireWhereUtilisateur().
370
						$this->construireWhereNumTaxon().
379
						$this->construireWhereNumTaxon().
371
						$this->construireWhereNomTaxon().
380
						$this->construireWhereNomTaxon().
372
						$this->construireWhereDate().
381
						$this->construireWhereDate().
373
						$this->construireWhereCommentaire().
382
						$this->construireWhereCommentaire().
374
						$this->construireWhereProjet().
383
						$this->construireWhereProjet().
375
						$this->construireWhereTag().
384
						$this->construireWhereTag().
376
	                    'ORDER BY nom_sel ASC '.
385
	                    'ORDER BY nom_sel ASC '.
377
	                    "LIMIT {$this->start},{$this->limit} ";
386
	                    "LIMIT {$this->start},{$this->limit} ";
-
 
387
 
378
			$resultats = $this->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
388
			$resultats = $this->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
379
			$requete = 'SELECT FOUND_ROWS()';
389
			$requete = 'SELECT FOUND_ROWS()';
380
			$total = (int) $this->requeter($requete, self::SQL_RETOUR_COLONNE);
390
			$total = (int) $this->requeter($requete, self::SQL_RETOUR_COLONNE);
381
		}
391
		}
Line 582... Line 592...
582
				$lat = $this->proteger($lat);
592
				$lat = $this->proteger($lat);
583
				$lng = $this->proteger($lng);
593
				$lng = $this->proteger($lng);
584
				$sql = " AND (coord_x = $lat AND coord_y = $lng) ";
594
				$sql = " AND (coord_x = $lat AND coord_y = $lng) ";
585
			}
595
			}
586
		}
596
		}
587
		$sql .= ' AND mots_cles_texte NOT LIKE "%sensible%" ';
597
		$sql .= ' AND (mots_cles_texte IS NULL OR mots_cles_texte NOT LIKE "%sensible%" ) ';
588
		return $sql;
598
		return $sql;
589
	}
599
	}
Line 590... Line 600...
590
 
600
 
591
	private function construireWhereCommentaire() {
601
	private function construireWhereCommentaire() {