diff --git a/data/atlas.sql b/data/atlas.sql index 78458638..18fb39e5 100644 --- a/data/atlas.sql +++ b/data/atlas.sql @@ -13,6 +13,17 @@ create index on atlas.vm_taxref (nom_complet); create index on atlas.vm_taxref (nom_valide); +--Tous les organismes + +--DROP MATERIALIZED VIEW atlas.vm_organismes; +CREATE MATERIALIZED VIEW atlas.vm_organismes AS + SELECT o.id_organisme, + o.nom_organisme + FROM synthese.bib_organismes o; +create unique index on atlas.vm_organismes (id_organisme); + + + --Toutes les observations --DROP materialized view atlas.vm_observations; @@ -21,6 +32,7 @@ CREATE MATERIALIZED VIEW atlas.vm_observations AS s.insee, s.dateobs, s.observateurs, + s.id_organisme, s.altitude_retenue, s.the_geom_point::geometry('POINT',3857), s.effectif_total, diff --git a/data/atlas_usershub.sql b/data/atlas_usershub.sql new file mode 100644 index 00000000..29da8352 --- /dev/null +++ b/data/atlas_usershub.sql @@ -0,0 +1,17 @@ +-- Création de la table fille en foreign data wrapper, connectée à la base mère de UsersHub (usershubdbserver) + + +CREATE FOREIGN TABLE synthese.bib_organismes + ( id_organisme integer NOT NULL, + nom_organisme character varying(100) NOT NULL, + adresse_organisme character varying(128), + cp_organisme character varying(5), + ville_organisme character varying(100), + tel_organisme character varying(14), + fax_organisme character varying(14), + email_organisme character varying(100) + ) + SERVER usershubdbserver + OPTIONS (schema_name 'utilisateurs', table_name 'bib_organismes'); +ALTER TABLE synthese.bib_organismes OWNER TO myuser; +GRANT ALL ON TABLE synthese.bib_organismes TO myuser; diff --git a/install_db.sh b/install_db.sh index 155ff85a..95499b70 100755 --- a/install_db.sh +++ b/install_db.sh @@ -59,6 +59,17 @@ then sudo -n -u postgres -s psql -d $db_name -c "CREATE USER MAPPING FOR $owner_atlas SERVER geonaturedbserver OPTIONS (user '$atlas_source_user', password '$atlas_source_pass') ;" &>> log/install_db.log fi + # Si j'utilise UsersHub ($usershub_source = True), alors je créé les connexions en FWD à la BDD UsersHub + if $usershub_source + then + echo "Ajout du FDW et connexion à la BDD mère UsersHub" + sudo -n -u postgres -s psql -d $db_name -c "CREATE EXTENSION IF NOT EXISTS postgres_fdw;" &>> log/install_db.log + sudo -n -u postgres -s psql -d $db_name -c "CREATE SERVER usershubdbserver FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host '$dbusers_source_host', dbname '$dbusers_source_name', port '$dbusers_source_port');" &>> log/install_db.log + sudo -n -u postgres -s psql -d $db_name -c "ALTER SERVER usershubdbserver OWNER TO $owner_atlas;" &>> log/install_db.log + sudo -n -u postgres -s psql -d $db_name -c "CREATE USER MAPPING FOR $owner_atlas SERVER usershubdbserver OPTIONS (user '$atlas_dbusers_source_user', password '$atlas_dbusers_source_pass') ;" &>> log/install_db.log + fi + + # Création des schémas de la BDD sudo -n -u postgres -s psql -d $db_name -c "CREATE SCHEMA atlas AUTHORIZATION "$owner_atlas";" &>> log/install_db.log @@ -167,6 +178,40 @@ then rm -R data/taxonomie fi + + # Si j'utilise UsersHub ($usershub_source = True), alors je crée la table fille en FDW connectée à la BDD de UsersHub + if $usershub_source + then + # Creation des tables filles en FWD + echo "Création de la connexion a GeoNature" + sudo cp data/atlas_usershub.sql /tmp/atlas_usershub.sql + sudo sed -i "s/myuser;$/$owner_atlas;/" /tmp/atlas_usershub.sql + sudo -n -u postgres -s psql -d $db_name -f /tmp/atlas_usershub.sql &>> log/install_db.log + # Sinon je créé une table synthese.bib_organismes avec 3 organismes exemple + else + echo "Création de la table exemple bib_organismes" + sudo -n -u postgres -s psql -d $db_name -c "CREATE TABLE synthese.bib_organismes + ( + id_organisme integer PRIMARY KEY, + nom_organisme character varying(100) NOT NULL, + adresse_organisme character varying(128) , + cp_organisme character varying(5) , + ville_organisme character varying(100) , + tel_organisme character varying(14) , + fax_organisme character varying(14) , + email_organisme character varying(100) + ); + INSERT INTO synthese.bib_organismes + (id_organisme, nom_organisme, adresse_organisme, cp_organisme, ville_organisme, tel_organisme, fax_organisme, email_organisme) + VALUES (1, 'PNF', '', '', 'Montpellier', '', '', ''); + INSERT INTO synthese.bib_organismes + (id_organisme, nom_organisme, adresse_organisme, cp_organisme, ville_organisme, tel_organisme, fax_organisme, email_organisme) + VALUES (2, 'Parc National des Ecrins', 'Domaine de Charance', '05000', 'GAP', '04 92 40 20 10', '', ''); + INSERT INTO synthese.bib_organismes + (id_organisme, nom_organisme, adresse_organisme, cp_organisme, ville_organisme, tel_organisme, fax_organisme, email_organisme) + VALUES VALUES (99, 'Autre', '', '', '', '', '', '');" &>> log/install_db.log + sudo -n -u postgres -s psql -d $db_name -c "ALTER TABLE synthese.bib_organismes OWNER TO "$owner_atlas";" + fi # Creation des Vues Matérialisées (et remplacement éventuel des valeurs en dur par les paramètres) echo "Création des vues materialisées" diff --git a/main/atlasRoutes.py b/main/atlasRoutes.py index 3b41b740..8b5f976f 100644 --- a/main/atlasRoutes.py +++ b/main/atlasRoutes.py @@ -152,12 +152,14 @@ def ficheEspece(cd_ref): config.ATTR_MILIEU, config.ATTR_CHOROLOGIE ) observers = vmObservationsRepository.getObservers(connection, cd_ref) + orgas = vmObservationsRepository.getOrgasObservations(connection, cd_ref) configuration = base_configuration.copy() configuration.update({ 'LIMIT_FICHE_LISTE_HIERARCHY': config.LIMIT_FICHE_LISTE_HIERARCHY, 'PATRIMONIALITE': config.PATRIMONIALITE, 'PROTECTION': config.PROTECTION, + 'AFFICHAGE_ORGAS_OBS_FICHEESP': config.AFFICHAGE_ORGAS_OBS_FICHEESP, 'GLOSSAIRE': config.GLOSSAIRE, 'AFFICHAGE_MAILLE': config.AFFICHAGE_MAILLE, 'ZOOM_LEVEL_POINT': config.ZOOM_LEVEL_POINT, @@ -187,6 +189,7 @@ def ficheEspece(cd_ref): articles=articles, taxonDescription=taxonDescription, observers=observers, + orgas=orgas, configuration=configuration ) @@ -207,7 +210,7 @@ def ficheCommune(insee): observations = vmObservationsRepository.lastObservationsCommune( connection, config.NB_LAST_OBS, insee ) - + orgas = vmObservationsRepository.getOrgasCommunes(connection, insee) observers = vmObservationsRepository.getObserversCommunes( connection, insee ) @@ -216,6 +219,7 @@ def ficheCommune(insee): configuration.update({ 'NB_LAST_OBS': config.NB_LAST_OBS, 'AFFICHAGE_MAILLE': config.AFFICHAGE_MAILLE, + 'AFFICHAGE_ORGAS_OBS_FICHECOMM': config.AFFICHAGE_ORGAS_OBS_FICHECOMM, 'MAP': config.MAP, 'MYTYPE': 1, 'PATRIMONIALITE': config.PATRIMONIALITE, @@ -232,6 +236,7 @@ def ficheCommune(insee): communesSearch=communesSearch, observations=observations, observers=observers, + orgas=orgas, configuration=configuration ) @@ -246,6 +251,7 @@ def ficheRangTaxonomie(cd_ref): communesSearch = vmCommunesRepository.getAllCommunes(session) taxonomyHierarchy = vmTaxrefRepository.getAllTaxonomy(session, cd_ref) observers = vmObservationsRepository.getObservers(connection, cd_ref) + orgas = vmObservationsRepository.getOrgasObservations(connection, cd_ref) connection.close() session.close() @@ -254,6 +260,7 @@ def ficheRangTaxonomie(cd_ref): configuration.update({ 'LIMIT_FICHE_LISTE_HIERARCHY': config.LIMIT_FICHE_LISTE_HIERARCHY, 'MYTYPE': 0, + 'AFFICHAGE_ORGAS_OBS_FICHETAXO': config.AFFICHAGE_ORGAS_OBS_FICHETAXO, 'PATRIMONIALITE': config.PATRIMONIALITE, 'PROTECTION': config.PROTECTION, }) @@ -265,6 +272,7 @@ def ficheRangTaxonomie(cd_ref): communesSearch=communesSearch, taxonomyHierarchy=taxonomyHierarchy, observers=observers, + orgas=orgas, configuration=configuration ) @@ -278,6 +286,7 @@ def ficheGroupe(groupe): listTaxons = vmTaxonsRepository.getTaxonsGroup(connection, groupe) communesSearch = vmCommunesRepository.getAllCommunes(session) observers = vmObservationsRepository.getGroupeObservers(connection, groupe) + orgas = vmObservationsRepository.getGroupeOrgas(connection, groupe) session.close() connection.close() @@ -286,6 +295,7 @@ def ficheGroupe(groupe): configuration.update({ 'LIMIT_FICHE_LISTE_HIERARCHY': config.LIMIT_FICHE_LISTE_HIERARCHY, 'MYTYPE': 0, + 'AFFICHAGE_ORGAS_OBS_FICHEGROUPE': config.AFFICHAGE_ORGAS_OBS_FICHEGROUPE, 'PATRIMONIALITE': config.PATRIMONIALITE, 'PROTECTION': config.PROTECTION }) @@ -297,6 +307,7 @@ def ficheGroupe(groupe): referenciel=groupe, groups=groups, observers=observers, + orgas=orgas, configuration=configuration ) diff --git a/main/configuration/config.py.sample b/main/configuration/config.py.sample index 0a0ef2a6..10883cd5 100644 --- a/main/configuration/config.py.sample +++ b/main/configuration/config.py.sample @@ -154,6 +154,9 @@ ATTR_YOUTUBE = 7 ATTR_DAILYMOTION = 8 ATTR_VIMEO = 9 +# Afficher les organismes ayant fourni les données sur fiche espece. Affichage True/False +AFFICHAGE_ORGAS_OBS_FICHEESP = True + ############################################ #### FICHE COMMUNE ET RANG TAXONOMIQUE ##### ############################################ @@ -178,6 +181,20 @@ PATRIMONIALITE = { } } + +# Afficher les organismes ayant fourni les données sur fiche commune. Affichage True/False +AFFICHAGE_ORGAS_OBS_FICHECOMM = True + +# Afficher les organismes ayant fourni les données sur fiche rang taxonomique. Affichage True/False +AFFICHAGE_ORGAS_OBS_FICHETAXO = True + +####################### +#### FICHE GROUPE ##### +####################### + +# Afficher les organismes ayant fourni les données sur fiche groupe. Affichage True/False +AFFICHAGE_ORGAS_OBS_FICHEGROUPE = True + ############################# #### Pages statistiques ##### ############################# diff --git a/main/configuration/settings.ini.sample b/main/configuration/settings.ini.sample index a2111e24..94a616ca 100644 --- a/main/configuration/settings.ini.sample +++ b/main/configuration/settings.ini.sample @@ -52,6 +52,30 @@ taxhub_release=1.3.2 # GeoNature-atlas est-il connecté à une BDD GeoNature ? geonature_source=true +# GeoNature-atlas est-il connecté à une BDD UsersHub ? +usershub_source=true + +################################################ +##### CONNEXION A LA BDD USERSHUB SOURCE ###### +################################################ +# Necessaire uniquement si on veut se connecter à la BDD source UsersHub en foreign data wrapper + +# Host de la BDD UsersHub source +dbusers_source_host=localhost + +# Port de la BDD UsersHub source +dbusers_source_port=5432 + +# Nom de la BDD UsersHub source +dbusers_source_name=usershubdb + +# Nom de l'utilisateur atlas dans la BDD UsersHub source (lecture seule) +atlas_dbusers_source_user=geonatuser + +# Pass de l'utilisateur atlas dans la BDD UsersHub source (lecture seule) +atlas_dbusers_source_pass=monpassachanger + + ################################################ ##### CONNEXION A LA BDD GEONATURE SOURCE ###### ################################################ diff --git a/main/modeles/entities/vmOrganismes.py b/main/modeles/entities/vmOrganismes.py new file mode 100644 index 00000000..c341a747 --- /dev/null +++ b/main/modeles/entities/vmOrganismes.py @@ -0,0 +1,20 @@ +# coding: utf-8 +#from sqlalchemy import Column, Integer, MetaData, String, Table +#from geoalchemy2.types import Geometry +#from sqlalchemy.sql.sqltypes import NullType +#from sqlalchemy.orm import mapper +#from sqlalchemy.ext.declarative import declarative_base +#from ...utils import engine + +#metadata = MetaData() +#Base = declarative_base() + +class VmMois(Base): + __table__ = Table( + 'vm_organismes', metadata, + Column('id_organisme', Integer, primary_key=True, unique=True), + Column('nom_organisme', String(250)), + schema='atlas', autoload=True, autoload_with=engine +) + + diff --git a/main/modeles/repositories/vmObservationsMaillesRepository.py b/main/modeles/repositories/vmObservationsMaillesRepository.py index 3301ca73..c7fcf238 100644 --- a/main/modeles/repositories/vmObservationsMaillesRepository.py +++ b/main/modeles/repositories/vmObservationsMaillesRepository.py @@ -10,10 +10,12 @@ def getObservationsMaillesChilds(connection, cd_ref): sql = """SELECT obs.id_maille, obs.geojson_maille, + a.nom_organisme AS orgaobs, o.dateobs, extract(YEAR FROM o.dateobs) as annee FROM atlas.vm_observations_mailles obs JOIN atlas.vm_observations o ON o.id_observation = obs.id_observation + LEFT JOIN atlas.vm_organismes a ON a.id_organisme = o.id_organisme WHERE obs.cd_ref in ( SELECT * FROM atlas.find_all_taxons_childs(:thiscdref) ) @@ -27,6 +29,7 @@ def getObservationsMaillesChilds(connection, cd_ref): 'nb_observations': 1, 'annee': o.annee, 'dateobs': str(o.dateobs), + 'orga_obs': o.orgaobs, 'geojson_maille': ast.literal_eval(o.geojson_maille) } tabObs.append(temp) @@ -122,12 +125,15 @@ def getObservationsTaxonCommuneMaille(connection, insee, cd_ref): sql = """ SELECT o.cd_ref, t.id_maille, t.geojson_maille, - extract(YEAR FROM o.dateobs) as annee + extract(YEAR FROM o.dateobs) as annee, + a.nom_organisme AS orgaobs FROM atlas.vm_observations o JOIN atlas.vm_communes c ON ST_INTERSECTS(o.the_geom_point, c.the_geom) JOIN atlas.t_mailles_territoire t ON ST_INTERSECTS(t.the_geom, o.the_geom_point) + LEFT JOIN atlas.vm_organismes a + ON a.id_organisme = o.id_organisme WHERE o.cd_ref = :thiscdref AND c.insee = :thisInsee ORDER BY id_maille """ @@ -140,6 +146,7 @@ def getObservationsTaxonCommuneMaille(connection, insee, cd_ref): 'id_maille': o.id_maille, 'nb_observations': 1, 'annee': o.annee, + 'orga_obs': o.orgaobs, 'geojson_maille': ast.literal_eval(o.geojson_maille) } tabObs.append(temp) diff --git a/main/modeles/repositories/vmObservationsRepository.py b/main/modeles/repositories/vmObservationsRepository.py index 9ba92c94..4410bb0d 100644 --- a/main/modeles/repositories/vmObservationsRepository.py +++ b/main/modeles/repositories/vmObservationsRepository.py @@ -12,8 +12,10 @@ def searchObservationsChilds(connection, cd_ref): - sql = """SELECT obs.* + sql = """SELECT obs.*, + a.nom_organisme AS orgaobs FROM atlas.vm_observations obs + LEFT JOIN atlas.vm_organismes a ON a.id_organisme = obs.id_organisme WHERE obs.cd_ref in ( SELECT * FROM atlas.find_all_taxons_childs(:thiscdref) ) @@ -27,6 +29,7 @@ def searchObservationsChilds(connection, cd_ref): temp['geojson_point'] = ast.literal_eval(o.geojson_point) temp['dateobs'] = str(o.dateobs) temp['year'] = o.dateobs.year + temp ['orga_obs'] = o.orgaobs obsList.append(temp) return obsList @@ -78,11 +81,13 @@ def lastObservations(connection, mylimit, idPhoto): def lastObservationsCommune(connection, mylimit, insee): sql = """SELECT o.*, + a.nom_organisme AS orgaobs, COALESCE(split_part(tax.nom_vern, ',', 1) || ' | ', '') || tax.lb_nom as taxon FROM atlas.vm_observations o JOIN atlas.vm_communes c ON ST_Intersects(o.the_geom_point, c.the_geom) JOIN atlas.vm_taxons tax ON o.cd_ref = tax.cd_ref + LEFT JOIN atlas.vm_organismes a ON a.id_organisme = o.id_organisme WHERE c.insee = :thisInsee ORDER BY o.dateobs DESC LIMIT 100""" @@ -93,6 +98,7 @@ def lastObservationsCommune(connection, mylimit, insee): temp.pop('the_geom_point', None) temp['geojson_point'] = ast.literal_eval(o.geojson_point) temp['dateobs'] = str(o.dateobs) + temp ['orga_obs'] = o.orgaobs obsList.append(temp) return obsList @@ -178,6 +184,23 @@ def getGroupeObservers(connection, groupe): return observersParser(req) +def getGroupeOrgas(connection, groupe): + sql = """ + SELECT distinct a.nom_organisme AS orgaobs + FROM atlas.vm_observations o + LEFT JOIN atlas.vm_organismes a ON a.id_organisme = o.id_organisme + WHERE cd_ref in ( + SELECT cd_ref from atlas.vm_taxons WHERE group2_inpn = :thisgroupe + ) + """ + req = connection.execute(text(sql), thisgroupe=groupe) + listOrgasGroupe = list() + for r in req: + temp = {'orga_obs': r.orgaobs} + listOrgasGroupe.append(temp) + return listOrgasGroupe + + def getObserversCommunes(connection, insee): sql = """ SELECT distinct observateurs @@ -277,3 +300,33 @@ def genericStatMedias(connection, tab): return None else: return tabStat + + +def getOrgasObservations(connection, cd_ref): + sql = "select distinct(a.nom_organisme) AS orgaobs \ + FROM atlas.vm_observations o \ + JOIN atlas.vm_organismes a ON a.id_organisme = o.id_organisme \ + WHERE cd_ref in ( \ + SELECT * from atlas.find_all_taxons_childs(:thiscdref) \ + )OR cd_ref = :thiscdref \ + GROUP BY nom_organisme".encode('UTF-8') + req = connection.execute(text(sql), thiscdref = cd_ref) + listOrgas = list() + for r in req: + temp = {'orga_obs': r.orgaobs} + listOrgas.append(temp) + return listOrgas + + +def getOrgasCommunes(connection, insee): + sql = "select distinct(a.nom_organisme) AS orgaobs \ + FROM atlas.vm_observations o \ + JOIN atlas.vm_organismes a ON a.id_organisme = o.id_organisme \ + WHERE insee = :thisInsee \ + GROUP BY nom_organisme".encode('UTF-8') + req = connection.execute(text(sql), thisInsee = insee) + listOrgasCom = list() + for r in req: + temp = {'orga_obs': r.orgaobs} + listOrgasCom.append(temp) + return listOrgasCom diff --git a/main/modeles/repositories/vmOrganismesRepository.py b/main/modeles/repositories/vmOrganismesRepository.py new file mode 100644 index 00000000..d837fae8 --- /dev/null +++ b/main/modeles/repositories/vmOrganismesRepository.py @@ -0,0 +1,5 @@ + +# -*- coding:utf-8 -*- + +#from sqlalchemy.sql import text + diff --git a/static/css/ficheEspece.css b/static/css/ficheEspece.css index 50507782..c40c97de 100644 --- a/static/css/ficheEspece.css +++ b/static/css/ficheEspece.css @@ -110,7 +110,7 @@ p.imgDescription.main { } #map { - height: 600px; + height: 100%; } #loadingGif { diff --git a/static/css/listEspeces.css b/static/css/listEspeces.css index 60f1bbda..a4b1c39a 100644 --- a/static/css/listEspeces.css +++ b/static/css/listEspeces.css @@ -47,32 +47,35 @@ table.dataTable thead .sorting_desc { } #stat li { - float: left; + display: inline-block; width: 100px; text-align: center; border-right: 1px solid #e8e8e8; list-style-type: none; } +#stat li:last-child { + border-right: none; +} + ul#stat { - float: left; padding: 5px; - margin-left: 32%; } #statHierarchy li { - float: left; + display:inline-block; width: 100px; text-align: center; border-right: 1px solid #e8e8e8; list-style-type: none; } +#statHierarchy li:last-child { + border-right: none; +} + ul#statHierarchy { - float: left; padding: 5px; - margin-left: 38%; - margin-top: 10px; } .leaflet-bar.leaflet-control.leaflet-control-custom img { diff --git a/static/images/network.png b/static/images/network.png new file mode 100755 index 00000000..efc243ac Binary files /dev/null and b/static/images/network.png differ diff --git a/static/mapGenerator.js b/static/mapGenerator.js index cbddecc3..385a1682 100644 --- a/static/mapGenerator.js +++ b/static/mapGenerator.js @@ -95,27 +95,37 @@ function generateMap() { -//****** Fonction fiche espècce *********** - - - +//****** Fonction fiche espèce *********** // Popup Point function onEachFeaturePoint(feature, layer){ popupContent = "Date: "+ feature.properties.dateobsPopup+"
Altitude: "+ feature.properties.altitude_retenue+ - "
Observateurs: "+ feature.properties.observateurs; + "
Observateur(s): "+ feature.properties.observateurs; - // verifie si le champs effectif est rempli - if(feature.properties.effectif_total != undefined){ - layer.bindPopup(popupContent+"
Effectif: "+ feature.properties.effectif_total); - }else{ - layer.bindPopup(popupContent) - } + // verifie si on doit afficher les organismes ou non + if(configuration.AFFICHAGE_ORGAS_OBS_FICHEESP){ + popupContent=popupContent+"
Structure: " + feature.properties.orga_obs + " "; + } + + // verifie si le champs effectif est rempli + if(feature.properties.effectif_total != undefined){ + popupContent=popupContent+"
Effectif: "+ feature.properties.effectif_total; + } + + layer.bindPopup(popupContent) } // popup Maille function onEachFeatureMaille(feature, layer){ - popupContent = "Nombre d'observation(s): "+ feature.properties.nb_observations+"
Dernière observation: "+ feature.properties.last_observation+ " " ; + popupContent = "Nombre d'observation(s): " + feature.properties.nb_observations; + + // verifie si on doit afficher les organismes ou non + if(configuration.AFFICHAGE_ORGAS_OBS_FICHEESP){ + popupContent=popupContent+"
Structure(s): " + feature.properties.orga_obs + " "; + } + + popupContent=popupContent+"
Dernière observation: " + feature.properties.last_observation + " "; + layer.bindPopup(popupContent) } @@ -179,7 +189,7 @@ function generateGeojsonMaille(observations, yearMin, yearMax) { if(observations[i].annee >= yearMin && observations[i].annee <= yearMax ) { geometry = observations[i].geojson_maille; idMaille = observations[i].id_maille; - properties = {id_maille : idMaille, nb_observations : 1, last_observation: observations[i].annee, tabDateobs: [new Date(observations[i].dateobs)]}; + properties = {id_maille : idMaille, nb_observations : 1, orga_obs: observations[i].orga_obs, last_observation: observations[i].annee, tabDateobs: [new Date(observations[i].dateobs)]}; var j = i+1; while (j= yearMin && observations[j].annee <= yearMax ){ @@ -189,6 +199,9 @@ function generateGeojsonMaille(observations, yearMin, yearMax) { if (observations[j].annee >= properties.last_observation){ properties.last_observation = observations[j].annee } + if (!properties.orga_obs.includes(observations[j].orga_obs)) { + properties.orga_obs += ('
' + observations[j].orga_obs) + } j = j+1 } myGeoJson.features.push({ @@ -334,9 +347,20 @@ function displayMarkerLayerFicheEspece(observationsPoint, yearMin, yearMax){ function onEachFeaturePointLastObs(feature, layer){ popupContent = "Espèce: "+ feature.properties.taxon+ - "
Date: "+ feature.properties.dateobs+"
Altitude: "+ - feature.properties.altitude_retenue; - + "
Date: "+ feature.properties.dateobs; + + // verifie s'il y a une altitude renseignée + if(feature.properties.altitude_retenue != undefined){ + popupContent=popupContent+"
Altitude: "+ feature.properties.altitude_retenue; + }else{ + popupContent=popupContent+"
Altitude: non renseignée"; + } + + // verifie si on doit afficher les organismes ou non + if(configuration.AFFICHAGE_ORGAS_OBS_FICHECOMM){ + popupContent = popupContent + "
Structure(s): " + feature.properties.orga_obs + " "; + } + layer.bindPopup(popupContent + "
Fiche espèce ") } @@ -344,9 +368,9 @@ function onEachFeaturePointCommune(feature, layer){ popupContent = "Espèce: "+ feature.properties.taxon+ "
Date: "+ feature.properties.dateobs+"
Altitude: "+ feature.properties.altitude_retenue+ - "
Observateurs(s): "+ feature.properties.observateurs + "
Observateurs(s): "+ feature.properties.observateurs; - layer.bindPopup(popupContent + "
Fiche espèce ") + layer.bindPopup(popupContent + "
Fiche espèce ") } function generateGeojsonPointLastObs(observationsPoint){ diff --git a/templates/ficheCommune.html b/templates/ficheCommune.html index 5496634f..baa106f9 100644 --- a/templates/ficheCommune.html +++ b/templates/ficheCommune.html @@ -45,12 +45,15 @@
-
+

Commune de {{referenciel.communeName}}


  • {{listTaxons.nbObsTotal}}
    {{ 'observations' if listTaxons.nbObsTotal > 1 else 'observation' }}

  • {{listTaxons.taxons|length}}
    {{ 'espèces' if listTaxons.taxons|length > 1 else 'espèce' }}

  • {{observers | length}}
    {{ 'observateurs' if observers|length > 1 else 'observateur' }}
  • + {% if configuration.AFFICHAGE_ORGAS_OBS_FICHECOMM %} +

  • {{orgas|length}}
    {{ 'structures' if orgas|length > 1 else 'structure' }}
  • + {% endif %}
diff --git a/templates/ficheEspece.html b/templates/ficheEspece.html index 7f855430..6fa56267 100644 --- a/templates/ficheEspece.html +++ b/templates/ficheEspece.html @@ -239,17 +239,23 @@
{{taxon.listTaxonsChild|length }} taxon(s) agrégé
-
-
+ {% if configuration.AFFICHAGE_ORGAS_OBS_FICHEESP %} +
+ {% else %} +
+ {% endif %} +
@@ -338,6 +347,18 @@
{{taxon.listTaxonsChild|length }} taxon(s) agrégé {% endif %} {% endfor %}
+ + {% if configuration.AFFICHAGE_ORGAS_OBS_FICHEESP %} +
+ {% for s in orgas %} + {{s.orga_obs }} + {% if not loop.last %} + - + {% endif %} + {% endfor %} +
+ {% endif %} +
diff --git a/templates/ficheGroupe.html b/templates/ficheGroupe.html index 3902fa36..05f9ee8a 100644 --- a/templates/ficheGroupe.html +++ b/templates/ficheGroupe.html @@ -48,6 +48,9 @@

Les {{ referenciel }}


  • {{listTaxons.nbObsTotal}}
    {{ 'observations' if listTaxons.nbObsTotal > 1 else 'observation' }}

  • {{listTaxons.taxons|length}}
    {{ 'espèces' if listTaxons|length > 1 else 'espèce' }}

  • {{observers | length}}
    {{ 'observateurs' if listTaxons|length > 1 else 'observateur' }}
  • + {% if configuration.AFFICHAGE_ORGAS_OBS_FICHEGROUPE %} +

  • {{orgas|length}}
    {{ 'structures' if orgas|length > 1 else 'structure' }}
  • + {% endif %}
    diff --git a/templates/ficheRangTaxonomique.html b/templates/ficheRangTaxonomique.html index c5f864d5..a033eabe 100644 --- a/templates/ficheRangTaxonomique.html +++ b/templates/ficheRangTaxonomique.html @@ -63,6 +63,9 @@

    Espèces observées pour le taxon {{referenciel.lb_nom}} ({{refe

  • {{listTaxons.nbObsTotal}}
    {{ 'observations' if listTaxons.nbObsTotal > 1 else 'observation' }}

  • {{listTaxons.taxons|length}}
    {{ 'espèces' if listTaxons.taxons|length > 1 else 'espèce' }}

  • {{observers | length}}
    {{ 'observateurs' if observers|length > 1 else 'observateur' }}
  • + {% if configuration.AFFICHAGE_ORGAS_OBS_FICHETAXO %} +

  • {{orgas|length}}
    {{ 'structures' if orgas|length > 1 else 'structure' }}
  • + {% endif %}