Skip to content

Commit

Permalink
Merge pull request #427 from PnX-SI/develop
Browse files Browse the repository at this point in the history
Develop >> Master / RELEASE 2.0.0-rc.1
  • Loading branch information
camillemonchicourt committed Sep 21, 2018
2 parents c6af666 + a5e6c7f commit 13681e5
Show file tree
Hide file tree
Showing 27 changed files with 401 additions and 147 deletions.
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
2.0.0.beta6.dev0
2.0.0-rc.1
5 changes: 3 additions & 2 deletions backend/geonature/core/gn_synthese/routes.py
Expand Up @@ -271,13 +271,14 @@ def get_status(info_role):

filters = dict(request.args)

q = DB.session.query(distinct(VSyntheseForWebApp.cd_nom), Taxref, TaxrefProtectionArticles).join(
q = (DB.session.query(distinct(VSyntheseForWebApp.cd_nom), Taxref, TaxrefProtectionArticles)
.join(
Taxref, Taxref.cd_nom == VSyntheseForWebApp.cd_nom
).join(
TaxrefProtectionEspeces, TaxrefProtectionEspeces.cd_nom == VSyntheseForWebApp.cd_nom
).join(
TaxrefProtectionArticles, TaxrefProtectionArticles.cd_protection == TaxrefProtectionEspeces.cd_protection
)
))

allowed_datasets = TDatasets.get_user_datasets(info_role)
q = synthese_query.filter_query_all_filters(VSyntheseForWebApp, q, filters, info_role, allowed_datasets)
Expand Down
2 changes: 1 addition & 1 deletion backend/geonature/core/gn_synthese/utils/query.py
Expand Up @@ -151,7 +151,7 @@ def filter_query_all_filters(model, q, filters, user, allowed_datasets):
# if the geom is a circle
if 'radius' in filters:
radius = filters.pop('radius')[0]
geom_wkt = circle_from_point(geom_wkt, radius)
geom_wkt = circle_from_point(geom_wkt, float(radius))
geom_wkb = from_shape(geom_wkt, srid=4326)
q = q.filter(model.the_geom_4326.ST_Intersects(geom_wkb))
filters.pop('geoIntersection')
Expand Down
42 changes: 23 additions & 19 deletions config/default_config.toml.example
Expand Up @@ -12,13 +12,14 @@ DEBUG = true
URL_APPLICATION = 'http://url.com/geonature' # Replace my_url.com by your domain or IP
API_ENDPOINT = 'http://url.com/geonature/api' # Replace my_url.com by your domain or IP
API_TAXHUB ='http://127.0.0.1:5000/api/'
ID_APPLICATION_GEONATURE = 14 # id_application of GeoNature in UsersHub
ID_APPLICATION_GEONATURE = 3 # id_application of GeoNature in UsersHub
SESSION_TYPE = 'filesystem'
SECRET_KEY = 'super secret key'
COOKIE_EXPIRATION = 7200
COOKIE_AUTORENEW = true
TRAP_ALL_EXCEPTIONS = false
HTTPS = false
# code EPSG des geom local de la BDD
LOCAL_SRID =

# MTD
XML_NAMESPACE = "{http://inpn.mnhn.fr/mtd}"
Expand All @@ -41,6 +42,9 @@ CAS_URL_VALIDATION = 'https://preprod-inpn.mnhn.fr/auth/serviceValidate'
ID = 'mon_id'
PASSWORD = 'mon_pass'

[BDD]
id_area_type_municipality = 25

[RIGHTS]
NOTHING = 0
MY_DATA = 1
Expand All @@ -49,8 +53,11 @@ CAS_URL_VALIDATION = 'https://preprod-inpn.mnhn.fr/auth/serviceValidate'

# Front end configuration
[FRONTEND]
# passe le frontend en mode production (message de la console moins parlant en développement)
PROD_MOD = false
# Affiche me composant 'custom/components/footer' sur la page d'accueil
DISPLAY_FOOTER = false
# Passe le frontend en mode multilingue
MULTILINGUAL = false

[MAILERROR]
Expand All @@ -67,31 +74,34 @@ MULTILINGUAL = false
# Liste des entités géographiques sur lesquels les filtres
# géographiques de la synthese s'appuient (id_area = id de l'entité géo, table ref_geo.bib_areas_types)
AREA_FILTERS = [
{ label = "Zone natural 2000", id_type = 201 },
{ label = "Secteurs", id_type = 202 }
{ label = "Communes", id_type = 25 },
]
# Colonne à afficher par défaut sur la liste des resultats de la synthese
# 'prop' corespond au nom de la colonne tel qu'il est écrit en BDD
# champs disponible de la table synthese : 'date_min', 'date_max', 'observers', 'id_synthese', 'altitude_min', 'altitude_max'
# champs disponible de la table taxon: 'nom_valide', 'cd_nom', 'lb_nom', 'nom_vern'
# champs disponible de la table t_dataset: 'dataset_name
# champs disponible de la table gn_synthese.t_sources: 'name_source'
# 'prop' corespond au nom de la colonne tel qu'il est écrit en BDD (gn_synthese.v_synthese_for_web_app)

LIST_COLUMNS_FRONTEND = [
{ prop = "nom_vern_or_lb_nom", name = "Taxon" },
{ prop = "date_min", name = "Date début" },
{ prop = "observateurs", name = "Observateurs" },
{ prop = "dataset_name", name = "Jeu de données" }
]

# id_attribut taxhub pour l'affichage dans la modale du détail d'une observation et dans les filtres taxonomique avancés

ID_ATTRIBUT_TAXHUB = [1, 2]

# Colonne de la table gn_synthese.synthese que l'on veut masquer dans les filtres du formulaire 'occurrence avancé'. Par défaut, c'est un tableau vide. Exemple:
EXCLUDED_COLUMNS = ['non_digital_proof'] pour enlever le filtre 'preuve non numérique'

EXCLUDED_COLUMNS = []

# Affiche ou masque l'arbre de recherche taxonomique (recherche taxonommique avancé)
# Cette fonctionnalité n'est actuallement pas stable sur un grand nombre de taxon, passer à false si le temps de chargement est trop long
DISPLAY_TAXON_TREE = true
# Active le fait de rechercher sur le nom d'observateur en ILIKE sur les portée 1 et 2 du CRUVED
CRUVED_SEARCH_WITH_OBSERVER_AS_TXT = false
# Nombre d'observation maximum à afficher sur la carte après une recherche
NB_MAX_OBS_MAP = 10000
# Nombre des dernières observations affichées par défaut quand on arrive sur la synthese
NB_LAST_OBS = 100
# Nombre max d'observation dans les exports
NB_MAX_OBS_EXPORT = 40000
# Champs à afficher dans l'export
[EXPORT_COLUMNS]
[EXPORT_COLUMNS.SYNTHESE_COLUMNS] = [
Expand Down Expand Up @@ -137,9 +147,3 @@ MULTILINGUAL = false
'nom_valide'
]

default_maplist_columns = [
{ prop = "taxons", name = "Taxon" },
{ prop = "date_min", name = "Date début" },
{ prop = "observateurs", name = "Observateurs" },
{ prop = "dataset_name", name = "Jeu de données" }
]
8 changes: 4 additions & 4 deletions contrib/occtax/data/exports_occtax.sql
Expand Up @@ -49,8 +49,8 @@ CREATE OR REPLACE VIEW pr_occtax.export_occtax_sinp AS
ccc.count_min AS "denbrMin",
ref_nomenclatures.get_cd_nomenclature(ccc.id_nomenclature_obj_count) AS "objDenbr",
ref_nomenclatures.get_cd_nomenclature(ccc.id_nomenclature_type_count) AS "typDenbr",
COALESCE(string_agg((r.nom_role::text || ' '::text) || r.prenom_role::text, ','::text), rel.observers_txt::text) AS "obsId",
COALESCE(string_agg(r.organisme::text, ','::text), o.nom_organisme::text, 'NSP'::text) AS "obsNomOrg",
COALESCE(string_agg(DISTINCT(r.nom_role::text || ' '::text) || r.prenom_role::text, ','::text), rel.observers_txt::text) AS "obsId",
COALESCE(string_agg(DISTINCT r.organisme::text, ','::text), o.nom_organisme::text, 'NSP'::text) AS "obsNomOrg",
COALESCE(occ.determiner, 'Inconnu'::character varying) AS "detId",
'NSP'::text AS "detNomOrg",
'NSP'::text AS "orgGestDat",
Expand Down Expand Up @@ -104,8 +104,8 @@ CREATE OR REPLACE VIEW pr_occtax.export_occtax_dlb AS
ccc.count_min AS "denbrMin",
ref_nomenclatures.get_cd_nomenclature(ccc.id_nomenclature_obj_count) AS "objDenbr",
ref_nomenclatures.get_cd_nomenclature(ccc.id_nomenclature_type_count) AS "typDenbr",
COALESCE(string_agg((r.nom_role::text || ' '::text) || r.prenom_role::text, ','::text), rel.observers_txt::text) AS "obsId",
COALESCE(string_agg(r.organisme::text, ','::text), o.nom_organisme::text, 'NSP'::text) AS "obsNomOrg",
COALESCE(string_agg(DISTINCT(r.nom_role::text || ' '::text) || r.prenom_role::text, ','::text), rel.observers_txt::text) AS "obsId",
COALESCE(string_agg(DISTINCT r.organisme::text, ','::text), o.nom_organisme::text, 'NSP'::text) AS "obsNomOrg",
COALESCE(occ.determiner, 'Inconnu'::character varying) AS "detId",
'NSP'::text AS "detNomOrg",
'NSP'::text AS "orgGestDat",
Expand Down

0 comments on commit 13681e5

Please sign in to comment.