diff --git a/src/module_anc/module/forms/anc_parametrage/anc_parametrage_anc_entreprise.json b/src/module_anc/module/forms/anc_parametrage/anc_parametrage_anc_entreprise.json index 27f8a47c00c14ad16617f92841e2317d1af2b5da..c09edf1e1eff68046dae39dca4db31a3b77ae811 100755 --- a/src/module_anc/module/forms/anc_parametrage/anc_parametrage_anc_entreprise.json +++ b/src/module_anc/module/forms/anc_parametrage/anc_parametrage_anc_entreprise.json @@ -23,12 +23,12 @@ "fields":[ { "type":"label", - "name":"id_com", + "name":"commune", "label":"Commune", "disabled":false, "required":false, "nb_cols":6, - "id":"id_com_2_1" + "id":"commune_2_1" }, { "type":"label", @@ -343,7 +343,7 @@ "label":"Tab 0", "elements":[ "id_parametre_entreprises", - "id_com", + "commune", "siret", "raison_sociale", "nom_entreprise", @@ -382,8 +382,8 @@ { "fields":[ { - "type":"select", - "name":"id_com", + "type":"editable_select", + "name":"commune", "label":"Commune", "required":false, "nb_cols":4, @@ -395,8 +395,8 @@ "distinct":"true", "label_key":"nom", "order_by":"nom", - "id_key":"id_com", - "attributs":"id_com|nom" + "id_key":"nom", + "attributs":"nom" } }, { @@ -454,7 +454,7 @@ "label":"Tab 0", "elements":[ "search_button", - "id_com", + "commune", "raison_sociale", "nom_entreprise" ] @@ -472,22 +472,22 @@ { "fields":[ { - "type":"select", - "name":"id_com", + "type":"editable_select", + "name":"commune", "label":"Commune", "required":true, "nb_cols":6, - "id":"id_com_2_1", + "id":"commune_2_1", "datasource":{ "datasource_id":"datasource_1", "sort_order":"ASC", "distinct":"true", "label_key":"nom", "order_by":"nom", - "id_key":"id_com", - "attributs":"id_com|nom" + "id_key":"nom", + "attributs":"nom" }, - "id_from":"id_com_2_1_from" + "id_from":"commune_2_1_from" }, { "type":"text", @@ -830,7 +830,7 @@ { "label":"Tab 0", "elements":[ - "id_com", + "commune", "siret", "raison_sociale", "nom_entreprise", @@ -876,22 +876,22 @@ { "fields":[ { - "type":"select", - "name":"id_com", + "type":"editable_select", + "name":"commune", "label":"Commune", "required":true, "nb_cols":6, - "id":"id_com_2_1", + "id":"commune_2_1", "datasource":{ "datasource_id":"datasource_1", "sort_order":"ASC", "distinct":"true", "label_key":"nom", "order_by":"nom", - "id_key":"id_com", - "attributs":"id_com|nom" + "id_key":"nom", + "attributs":"nom" }, - "id_from":"id_com_2_1_from" + "id_from":"commune_2_1_from" }, { "type":"text", @@ -1283,7 +1283,7 @@ "label":"Tab 0", "elements":[ "id_parametre_entreprises", - "id_com", + "commune", "siret", "raison_sociale", "nom_entreprise", @@ -1316,7 +1316,7 @@ "datasource_1":{ "type":"web_service", "dataType":"tableValue", - "name":"id_com", + "name":"commune", "description":"", "parameters":{ "schema":"s_cadastre", @@ -1326,4 +1326,4 @@ "id":"datasource_1" } } -} \ No newline at end of file +} diff --git a/src/module_anc/module/forms/anc_saisie/anc_saisie_anc_controle_controle_schema.json b/src/module_anc/module/forms/anc_saisie/anc_saisie_anc_controle_controle_schema.json index 6b4ecd01b65da0e454d662f0ea067911c83a6e97..3c173b8f08c119992b87cab41bc204d55f9e7ed5 100755 --- a/src/module_anc/module/forms/anc_saisie/anc_saisie_anc_controle_controle_schema.json +++ b/src/module_anc/module/forms/anc_saisie/anc_saisie_anc_controle_controle_schema.json @@ -111,11 +111,11 @@ "attributes_def": [{ "label": "Type", "name": "composant_type" - }, + }, { "label": "Nom", "name": "label" - }, + }, { "label": "Observations", "name": "observations" @@ -216,27 +216,36 @@ { "fields": [ { - "type": "number", - "label": "Taille", + "type": "slider", "name": "size", - "required": false, - "default_value": 50, - "nb_cols": 12 + "label": "Taille", + "nb_cols": 12, + "options": { + "min": 0, + "max": 300, + "precision": 1, + "step": 1 + }, + "default_value": 50 } ] - }, + }, { "fields": [ { - "type": "text", - "label": "Angle", + "type": "slider", "name": "rotation", - "required": false, - "default_value": 0, - "nb_cols": 12 + "label": "Angle", + "nb_cols": 12, + "options": { + "min": 0, + "max": 360, + "precision": 1, + "step": 1 + } } ] - }, + }, { "fields": [ { @@ -300,4 +309,4 @@ ], "event": "sendSimpleForm()" } -} \ No newline at end of file +} diff --git a/src/module_anc/module/forms/anc_saisie/anc_saisie_anc_installation.json b/src/module_anc/module/forms/anc_saisie/anc_saisie_anc_installation.json index 53408c465e814843b03e29f9445cc0f5ff29cdd3..9fb7f5ed2d7d323698590236ea6c5d94100e70e6 100755 --- a/src/module_anc/module/forms/anc_saisie/anc_saisie_anc_installation.json +++ b/src/module_anc/module/forms/anc_saisie/anc_saisie_anc_installation.json @@ -698,14 +698,13 @@ "id":"Element_0_5_1" }, { - "type":"integer", + "type":"text", "name":"prop_code_postal", "label":"Code postal", "required":false, "pattern":"", "nb_cols":2, - "id":"Element_1_5_2", - "max_length": 5 + "id":"Element_1_5_2" }, { "type":"text", @@ -928,14 +927,13 @@ "id":"parc_adresse_6_1" }, { - "type":"integer", + "type":"text", "name":"code_postal", "label":"Code Postal", "disabled":false, "required":false, "nb_cols":2, - "id":"code_postal_7_1", - "max_length": 5 + "id":"code_postal_7_1" }, { "type":"text", @@ -1038,14 +1036,13 @@ "id":"prop_adresse_11_1" }, { - "type":"integer", + "type":"text", "name":"prop_code_postal", "label":"Code postal", "disabled":false, "required":false, "nb_cols":2, - "id":"prop_code_postal_12_1", - "max_length": 5 + "id":"prop_code_postal_12_1" }, { "type":"text", @@ -1656,14 +1653,13 @@ "id":"parc_adresse_6_1" }, { - "type":"integer", + "type":"text", "name":"code_postal", "label":"Code postal", "disabled":false, "required":false, "nb_cols":4, - "id":"code_postal_7_1", - "max_length": 5 + "id":"code_postal_7_1" }, { "type":"text", @@ -1766,14 +1762,13 @@ "id":"prop_adresse_11_1" }, { - "type":"integer", + "type":"text", "name":"prop_code_postal", "label":"Code postal", "disabled":false, "required":false, "nb_cols":4, - "id":"prop_code_postal_12_1", - "max_length": 5 + "id":"prop_code_postal_12_1" }, { "type":"text", diff --git a/src/module_anc/web_service/sql/sqlQueries.xml b/src/module_anc/web_service/sql/sqlQueries.xml index 9fa706eed922d13d8bd264ef4bfef66e07ba4a4d..1741ee1d666aca0520ac490ac6810771af3495e2 100644 --- a/src/module_anc/web_service/sql/sqlQueries.xml +++ b/src/module_anc/web_service/sql/sqlQueries.xml @@ -3119,11 +3119,36 @@ <version>2019.01.00</version> <code> <![CDATA[ + -- Frédéric le 16/01/2019 10:15 + UPDATE s_vitis.vm_table_field SET name = 'commune', width = 200 WHERE tab_id = (SELECT tab_id FROM s_vitis.vm_tab WHERE vm_tab.name = 'anc_entreprise') AND name = 'id_com'; DELETE FROM s_vitis.vm_table_button WHERE tab_id = (SELECT tab_id FROM s_vitis.vm_tab WHERE vm_tab.name = 'anc_installation') AND label_id IN ('anc_13', 'anc_14'); INSERT INTO s_vitis.vm_table_button (button_class, table_button_id, event, label_id, ressource_id, tab_id) VALUES ('add_smallFlexigrid',(SELECT nextval('s_vitis.seq_vm'::regclass)), 'AddSectionForm', 'anc_14', (SELECT ressource_id FROM s_vitis.vm_tab WHERE vm_tab.name = 'anc_installation'), (SELECT tab_id FROM s_vitis.vm_tab WHERE vm_tab.name = 'anc_installation')); INSERT INTO s_vitis.vm_table_button (button_class, table_button_id, event, label_id, ressource_id, tab_id) VALUES ('deleteFlexigrid',(SELECT nextval('s_vitis.seq_vm'::regclass)), 'DeleteSelection', 'anc_13', (SELECT ressource_id FROM s_vitis.vm_tab WHERE vm_tab.name = 'anc_installation'), (SELECT tab_id FROM s_vitis.vm_tab WHERE vm_tab.name = 'anc_installation')); UPDATE s_vitis.vm_tab SET sorted_dir = 'DESC' WHERE name = 'anc_installation'; - + -- Frédéric le 16/01/2019 15:52 + ALTER TABLE s_anc.param_entreprise ADD COLUMN commune character varying(50); + UPDATE s_anc.param_entreprise SET commune = id_com; + UPDATE s_anc.param_entreprise as "pe" SET commune = (SELECT texte FROM s_cadastre.commune WHERE id_com = "pe".id_com) WHERE (SELECT texte FROM s_cadastre.commune WHERE id_com = "pe".id_com) is not null; + ALTER TABLE s_anc.param_entreprise ALTER COLUMN commune SET NOT NULL; + -- Frédéric 17/01/2019 09:20 + DROP RULE insert_v_controle ON s_anc.v_controle; + DROP VIEW s_anc.v_installation; + ALTER TABLE s_anc.installation ALTER COLUMN parc_adresse TYPE character varying(254); + ALTER TABLE s_anc.installation ALTER COLUMN code_postal TYPE character varying(254); + ALTER TABLE s_anc.installation ALTER COLUMN parc_commune TYPE character varying(254); + ALTER TABLE s_anc.installation ALTER COLUMN prop_adresse TYPE character varying(254); + ALTER TABLE s_anc.installation ALTER COLUMN prop_code_postal TYPE character varying(254); + ALTER TABLE s_anc.installation ALTER COLUMN prop_commune TYPE character varying(254); + CREATE OR REPLACE VIEW s_anc.v_installation AS SELECT installation.id_installation,installation.id_com,installation.id_parc,installation.parc_sup,installation.parc_parcelle_associees,installation.parc_adresse,installation.code_postal,installation.parc_commune,installation.prop_titre,installation.prop_nom_prenom,installation.prop_adresse,installation.prop_code_postal,installation.prop_commune,installation.prop_tel,installation.prop_mail,installation.bati_type,installation.bati_ca_nb_pp,installation.bati_ca_nb_eh,installation.bati_ca_nb_chambres,installation.bati_ca_nb_autres_pieces,installation.bati_ca_nb_occupant,installation.bati_nb_a_control,installation.bati_date_achat,installation.bati_date_mutation,installation.cont_zone_enjeu,installation.cont_zone_sage,installation.cont_zone_autre,installation.cont_zone_urba,installation.cont_zone_anc,installation.cont_alim_eau_potable,installation.cont_puits_usage,installation.cont_puits_declaration,installation.cont_puits_situation,installation.cont_puits_terrain_mitoyen,installation.observations,installation.maj,installation.maj_date,installation."create",installation.create_date,installation.archivage,installation.geom,installation.photo_f,installation.document_f,(installation.id_com::text || '_anc_'::text) || installation.id_installation AS num_dossier,v_commune.nom AS commune,v_vmap_parcelle_all_geom.section,v_vmap_parcelle_all_geom.parcelle,count(controle_1.*) AS nb_controle,controle_2.last_date_control,controle_2.cl_avis,controle_3.next_control,controle_4.cl_classe_cbf AS classement_installation FROM s_anc.installation LEFT JOIN s_anc.controle controle_1 ON installation.id_installation = controle_1.id_installation LEFT JOIN ( SELECT b.last_date_control, b.id_installation,controle.cl_avis FROM ( SELECT max(a.des_date_control) AS last_date_control,a.id_installation FROM ( SELECT controle_a.des_date_control,controle_a.id_installation FROM s_anc.controle controle_a WHERE controle_a.des_date_control < now()) a GROUP BY a.id_installation ORDER BY a.id_installation) b LEFT JOIN s_anc.controle ON b.id_installation = controle.id_installation AND b.last_date_control = controle.des_date_control) controle_2 ON installation.id_installation = controle_2.id_installation LEFT JOIN ( SELECT b.next_control,b.id_installation FROM ( SELECT min(a.next_control) AS next_control,a.id_installation FROM ( SELECT controle_b.id_installation,controle_b.des_date_control + '1 year'::interval * controle_b.des_interval_control::double precision AS next_control FROM s_anc.controle controle_b WHERE controle_b.des_interval_control > 0 AND (controle_b.des_date_control + '1 year'::interval * controle_b.des_interval_control::double precision) > now()) a GROUP BY a.id_installation ORDER BY a.id_installation) b) controle_3 ON installation.id_installation = controle_3.id_installation LEFT JOIN ( SELECT controle.cl_classe_cbf,b.id_installation FROM ( SELECT max(a.des_date_control) AS last_date_controle,a.id_installation FROM ( SELECT controle_c.des_date_control,controle_c.id_installation FROM s_anc.controle controle_c WHERE controle_c.des_date_control < now() AND controle_c.controle_type::text <> 'CONCEPTION'::text) a GROUP BY a.id_installation ORDER BY a.id_installation) b LEFT JOIN s_anc.controle ON b.id_installation = controle.id_installation AND b.last_date_controle = controle.des_date_control) controle_4 ON installation.id_installation = controle_4.id_installation LEFT JOIN s_cadastre.v_commune ON installation.id_com::bpchar = v_commune.id_com LEFT JOIN s_cadastre.v_vmap_parcelle_all_geom ON installation.id_parc::bpchar = v_vmap_parcelle_all_geom.id_par WHERE installation.id_com::text ~ similar_escape(( SELECT "user".restriction FROM s_vitis."user" WHERE "user".login::name = "current_user"()), NULL::text) GROUP BY installation.id_installation, v_commune.nom, v_vmap_parcelle_all_geom.section, v_vmap_parcelle_all_geom.parcelle, controle_2.cl_avis, controle_2.last_date_control, controle_3.next_control, controle_4.cl_classe_cbf; + ALTER TABLE s_anc.v_installation OWNER TO postgres; + GRANT ALL ON TABLE s_anc.v_installation TO postgres; + GRANT ALL ON TABLE s_anc.v_installation TO u_vitis; + GRANT ALL ON TABLE s_anc.v_installation TO anc_admin; + GRANT ALL ON TABLE s_anc.v_installation TO anc_user; + CREATE OR REPLACE RULE delete_v_installation AS ON DELETE TO s_anc.v_installation DO INSTEAD DELETE FROM s_anc.installation WHERE installation.id_installation = old.id_installation; + CREATE OR REPLACE RULE insert_v_installation AS ON INSERT TO s_anc.v_installation DO INSTEAD INSERT INTO s_anc.installation (id_installation, id_com, id_parc, parc_sup, parc_parcelle_associees, parc_adresse, code_postal, parc_commune, prop_titre, prop_nom_prenom, prop_adresse, prop_code_postal, prop_commune, prop_tel, prop_mail, bati_type, bati_ca_nb_pp, bati_ca_nb_eh, bati_ca_nb_chambres, bati_ca_nb_autres_pieces, bati_ca_nb_occupant, bati_nb_a_control, bati_date_achat, bati_date_mutation, cont_zone_enjeu, cont_zone_sage, cont_zone_autre, cont_zone_urba, cont_zone_anc, cont_alim_eau_potable, cont_puits_usage, cont_puits_declaration, cont_puits_situation, cont_puits_terrain_mitoyen, observations, maj, maj_date, "create", create_date, archivage, geom, photo_f, document_f) VALUES (new.id_installation, new.id_com, new.id_parc, new.parc_sup, new.parc_parcelle_associees, new.parc_adresse, new.code_postal, new.parc_commune, new.prop_titre, new.prop_nom_prenom, new.prop_adresse, new.prop_code_postal, new.prop_commune, new.prop_tel, new.prop_mail, new.bati_type, new.bati_ca_nb_pp, new.bati_ca_nb_eh, new.bati_ca_nb_chambres, new.bati_ca_nb_autres_pieces, new.bati_ca_nb_occupant, new.bati_nb_a_control, new.bati_date_achat, new.bati_date_mutation, new.cont_zone_enjeu, new.cont_zone_sage, new.cont_zone_autre, new.cont_zone_urba, new.cont_zone_anc, new.cont_alim_eau_potable, new.cont_puits_usage, new.cont_puits_declaration, new.cont_puits_situation, new.cont_puits_terrain_mitoyen, new.observations, new.maj, new.maj_date, new."create", new.create_date, new.archivage, new.geom, new.photo_f, new.document_f) RETURNING installation.id_installation,installation.id_com,installation.id_parc,installation.parc_sup,installation.parc_parcelle_associees,installation.parc_adresse,installation.code_postal,installation.parc_commune,installation.prop_titre,installation.prop_nom_prenom,installation.prop_adresse,installation.prop_code_postal,installation.prop_commune,installation.prop_tel,installation.prop_mail,installation.bati_type,installation.bati_ca_nb_pp,installation.bati_ca_nb_eh,installation.bati_ca_nb_chambres,installation.bati_ca_nb_autres_pieces,installation.bati_ca_nb_occupant,installation.bati_nb_a_control,installation.bati_date_achat,installation.bati_date_mutation,installation.cont_zone_enjeu,installation.cont_zone_sage,installation.cont_zone_autre,installation.cont_zone_urba,installation.cont_zone_anc,installation.cont_alim_eau_potable,installation.cont_puits_usage,installation.cont_puits_declaration,installation.cont_puits_situation,installation.cont_puits_terrain_mitoyen,installation.observations,installation.maj,installation.maj_date,installation."create",installation.create_date,installation.archivage,installation.geom,installation.photo_f,installation.document_f,(installation.id_com::text || '_anc_'::text) || installation.id_installation AS num_dossier,( SELECT commune.texte AS commune FROM s_cadastre.commune WHERE commune.id_com = installation.id_com::bpchar) AS commune,( SELECT parcelle.section FROM s_cadastre.parcelle WHERE parcelle.id_par = installation.id_parc::bpchar) AS section,( SELECT parcelle.parcelle FROM s_cadastre.parcelle WHERE parcelle.id_par = installation.id_parc::bpchar) AS parcelle,( SELECT count(*) AS nb_controle FROM s_anc.controle WHERE controle.id_installation = installation.id_installation) AS nb_controle,( SELECT controle.des_date_control FROM s_anc.controle WHERE controle.des_date_control < now() AND controle.id_installation = installation.id_installation ORDER BY controle.des_date_control DESC LIMIT 1) AS last_date_control,( SELECT controle.cl_avis FROM s_anc.controle WHERE controle.des_date_control < now() AND controle.id_installation = installation.id_installation ORDER BY controle.des_date_control DESC LIMIT 1) AS cl_avis,( SELECT controle.des_date_control + '1 year'::interval * controle.des_interval_control::double precision AS next_control FROM s_anc.controle WHERE controle.des_date_control < now() AND controle.id_installation = installation.id_installation ORDER BY controle.des_date_control LIMIT 1) AS next_control,( SELECT controle.cl_classe_cbf FROM s_anc.controle WHERE controle.des_date_control < now() AND controle.id_installation = installation.id_installation AND controle.controle_type::text <> 'CONCEPTION'::text ORDER BY controle.des_date_control DESC LIMIT 1) AS classement_installation; + CREATE OR REPLACE RULE update_v_installation AS ON UPDATE TO s_anc.v_installation DO INSTEAD UPDATE s_anc.installation SET id_com = new.id_com, id_parc = new.id_parc, parc_sup = new.parc_sup, parc_parcelle_associees = new.parc_parcelle_associees, parc_adresse = new.parc_adresse, code_postal = new.code_postal, parc_commune = new.parc_commune, prop_titre = new.prop_titre, prop_nom_prenom = new.prop_nom_prenom, prop_adresse = new.prop_adresse, prop_code_postal = new.prop_code_postal, prop_commune = new.prop_commune, prop_tel = new.prop_tel, prop_mail = new.prop_mail, bati_type = new.bati_type, bati_ca_nb_pp = new.bati_ca_nb_pp, bati_ca_nb_eh = new.bati_ca_nb_eh, bati_ca_nb_chambres = new.bati_ca_nb_chambres, bati_ca_nb_autres_pieces = new.bati_ca_nb_autres_pieces, bati_ca_nb_occupant = new.bati_ca_nb_occupant, bati_nb_a_control = new.bati_nb_a_control, bati_date_achat = new.bati_date_achat, bati_date_mutation = new.bati_date_mutation, cont_zone_enjeu = new.cont_zone_enjeu, cont_zone_sage = new.cont_zone_sage, cont_zone_autre = new.cont_zone_autre, cont_zone_urba = new.cont_zone_urba, cont_zone_anc = new.cont_zone_anc, cont_alim_eau_potable = new.cont_alim_eau_potable, cont_puits_usage = new.cont_puits_usage, cont_puits_declaration = new.cont_puits_declaration, cont_puits_situation = new.cont_puits_situation, cont_puits_terrain_mitoyen = new.cont_puits_terrain_mitoyen, observations = new.observations, maj = new.maj, maj_date = new.maj_date, "create" = new."create", create_date = new.create_date, archivage = new.archivage, geom = new.geom, photo_f = new.photo_f, document_f = new.document_f WHERE installation.id_installation = new.id_installation; + CREATE OR REPLACE RULE insert_v_controle AS ON INSERT TO s_anc.v_controle DO INSTEAD INSERT INTO s_anc.controle (id_controle, id_installation, controle_type, controle_ss_type, des_date_control, des_interval_control, des_pers_control, des_agent_control, des_installateur, des_refus_visite, des_date_installation, des_date_recommande, des_numero_recommande, dep_date_depot, dep_liste_piece, dep_dossier_complet, dep_date_envoi_incomplet, des_nature_projet, des_concepteur, des_ancien_disp, car_surface_dispo_m2, car_permea, car_valeur_permea, car_hydromorphie, car_prof_app, car_nappe_fond, car_terrain_innondable, car_roche_sol, car_dist_hab, car_dist_lim_par, car_dist_veget, car_dist_puit, des_reamenage_terrain, des_reamenage_immeuble, des_real_trvx, des_anc_ss_accord, des_collecte_ep, des_sep_ep_eu, des_eu_nb_sortie, des_eu_tes_regards, des_eu_pente_ecoul, des_eu_regars_acces, des_eu_alteration, des_eu_ecoulement, des_eu_depot_regard, des_commentaire, ts_conforme, ts_type_effluent, ts_capacite_bac, ts_nb_bac, ts_coher_taille_util, ts_aire_etanche, ts_aire_abri, ts_ventilation, ts_cuve_etanche, ts_val_comp, ts_ruissel_ep, ts_absence_nuisance, ts_respect_regles, ts_commentaires, vt_primaire, vt_secondaire, vt_prim_loc, vt_prim_ht, vt_prim_diam, vt_prim_type_extract, vt_second_loc, vt_second_ht, vt_second_diam, vt_second_type_extract, da_chasse_acces, da_chasse_auto, da_chasse_pr_nat_eau, da_chasse_ok, da_chasse_dysfonctionnement, da_chasse_degradation, da_chasse_entretien, da_pr_loc_pompe, da_pr_acces, da_pr_nb_pompe, da_pr_nat_eau, da_pr_ventilatio, da_pr_ok, da_pr_alarme, da_pr_clapet, da_pr_etanche, da_pr_branchement, da_pr_dysfonctionnement, da_pr_degradation, da_pr_entretien, da_commentaires, cl_avis, cl_classe_cbf, cl_commentaires, cl_date_avis, cl_auteur_avis, cl_date_prochain_control, cl_montant, cl_facture, cl_facture_le, maj, maj_date, "create", create_date, cloturer, photos_f, fiche_f, rapport_f, schema_f, documents_f, plan_f, cl_constat, cl_travaux, vt_commentaire, tra_vm_geomembrane, emplacement_vt_secondaire, vt_prim_type_materiau, vt_second_type_materiau) VALUES (new.id_controle, new.id_installation, new.controle_type, new.controle_ss_type, new.des_date_control, new.des_interval_control, new.des_pers_control, new.des_agent_control, new.des_installateur, new.des_refus_visite, new.des_date_installation, new.des_date_recommande, new.des_numero_recommande, new.dep_date_depot, new.dep_liste_piece, new.dep_dossier_complet, new.dep_date_envoi_incomplet, new.des_nature_projet, new.des_concepteur, new.des_ancien_disp, new.car_surface_dispo_m2, new.car_permea, new.car_valeur_permea, new.car_hydromorphie, new.car_prof_app, new.car_nappe_fond, new.car_terrain_innondable, new.car_roche_sol, new.car_dist_hab, new.car_dist_lim_par, new.car_dist_veget, new.car_dist_puit, new.des_reamenage_terrain, new.des_reamenage_immeuble, new.des_real_trvx, new.des_anc_ss_accord, new.des_collecte_ep, new.des_sep_ep_eu, new.des_eu_nb_sortie, new.des_eu_tes_regards, new.des_eu_pente_ecoul, new.des_eu_regars_acces, new.des_eu_alteration, new.des_eu_ecoulement, new.des_eu_depot_regard, new.des_commentaire, new.ts_conforme, new.ts_type_effluent, new.ts_capacite_bac, new.ts_nb_bac, new.ts_coher_taille_util, new.ts_aire_etanche, new.ts_aire_abri, new.ts_ventilation, new.ts_cuve_etanche, new.ts_val_comp, new.ts_ruissel_ep, new.ts_absence_nuisance, new.ts_respect_regles, new.ts_commentaires, new.vt_primaire, new.vt_secondaire, new.vt_prim_loc, new.vt_prim_ht, new.vt_prim_diam, new.vt_prim_type_extract, new.vt_second_loc, new.vt_second_ht, new.vt_second_diam, new.vt_second_type_extract, new.da_chasse_acces, new.da_chasse_auto, new.da_chasse_pr_nat_eau, new.da_chasse_ok, new.da_chasse_dysfonctionnement, new.da_chasse_degradation, new.da_chasse_entretien, new.da_pr_loc_pompe, new.da_pr_acces, new.da_pr_nb_pompe, new.da_pr_nat_eau, new.da_pr_ventilatio, new.da_pr_ok, new.da_pr_alarme, new.da_pr_clapet, new.da_pr_etanche, new.da_pr_branchement, new.da_pr_dysfonctionnement, new.da_pr_degradation, new.da_pr_entretien, new.da_commentaires, new.cl_avis, new.cl_classe_cbf, new.cl_commentaires, new.cl_date_avis, new.cl_auteur_avis, new.cl_date_prochain_control, new.cl_montant, new.cl_facture, new.cl_facture_le, new.maj, new.maj_date, new."create", new.create_date, new.cloturer, new.photos_f, new.fiche_f, new.rapport_f, new.schema_f, new.documents_f, new.plan_f, new.cl_constat, new.cl_travaux, new.vt_commentaire, new.tra_vm_geomembrane, new.emplacement_vt_secondaire, new.vt_prim_type_materiau, new.vt_second_type_materiau) RETURNING controle.id_controle,controle.id_installation,( SELECT (v_installation.id_com::text || '_anc_'::text) || v_installation.id_installation AS num_dossier FROM s_anc.v_installation WHERE v_installation.id_com::text ~ similar_escape(( SELECT "user".restriction FROM s_vitis."user" WHERE "user".login::name = "current_user"()), NULL::text) AND controle.id_installation = v_installation.id_installation) AS num_dossier,controle.controle_type,controle.controle_ss_type,controle.des_date_control,controle.des_interval_control,controle.des_pers_control,controle.des_agent_control,controle.des_installateur,controle.des_refus_visite,controle.des_date_installation,controle.des_date_recommande,controle.des_numero_recommande,controle.dep_date_depot,controle.dep_liste_piece,controle.dep_dossier_complet,controle.dep_date_envoi_incomplet,controle.des_nature_projet,controle.des_concepteur,controle.des_ancien_disp,controle.car_surface_dispo_m2,controle.car_permea,controle.car_valeur_permea,controle.car_hydromorphie,controle.car_prof_app,controle.car_nappe_fond,controle.car_terrain_innondable,controle.car_roche_sol,controle.car_dist_hab,controle.car_dist_lim_par,controle.car_dist_veget,controle.car_dist_puit,controle.des_reamenage_terrain,controle.des_reamenage_immeuble,controle.des_real_trvx,controle.des_anc_ss_accord,controle.des_collecte_ep,controle.des_sep_ep_eu,controle.des_eu_nb_sortie,controle.des_eu_tes_regards,controle.des_eu_pente_ecoul,controle.des_eu_regars_acces,controle.des_eu_alteration,controle.des_eu_ecoulement,controle.des_eu_depot_regard,controle.des_commentaire,controle.ts_conforme,controle.ts_type_effluent,controle.ts_capacite_bac,controle.ts_nb_bac,controle.ts_coher_taille_util,controle.ts_aire_etanche,controle.ts_aire_abri,controle.ts_ventilation,controle.ts_cuve_etanche,controle.ts_val_comp,controle.ts_ruissel_ep,controle.ts_absence_nuisance,controle.ts_respect_regles,controle.ts_commentaires,controle.vt_primaire,controle.vt_secondaire,controle.vt_prim_loc,controle.vt_prim_ht,controle.vt_prim_diam,controle.vt_prim_type_extract,controle.vt_second_loc,controle.vt_second_ht,controle.vt_second_diam,controle.vt_second_type_extract,controle.da_chasse_acces,controle.da_chasse_auto,controle.da_chasse_pr_nat_eau,controle.da_chasse_ok,controle.da_chasse_dysfonctionnement,controle.da_chasse_degradation,controle.da_chasse_entretien,controle.da_pr_loc_pompe,controle.da_pr_acces,controle.da_pr_nb_pompe,controle.da_pr_nat_eau,controle.da_pr_ventilatio,controle.da_pr_ok,controle.da_pr_alarme,controle.da_pr_clapet,controle.da_pr_etanche,controle.da_pr_branchement,controle.da_pr_dysfonctionnement,controle.da_pr_degradation,controle.da_pr_entretien,controle.da_commentaires,controle.cl_avis,controle.cl_classe_cbf,controle.cl_commentaires,controle.cl_date_avis,controle.cl_auteur_avis,controle.cl_date_prochain_control,controle.cl_montant,controle.cl_facture,controle.cl_facture_le,controle.maj,controle.maj_date,controle."create",controle.create_date,controle.cloturer,controle.photos_f,controle.fiche_f,controle.rapport_f,controle.schema_f,controle.documents_f,controle.plan_f,controle.cl_constat,controle.cl_travaux,controle.vt_commentaire,controle.tra_vm_geomembrane,controle.emplacement_vt_secondaire,controle.vt_prim_type_materiau,controle.vt_second_type_materiau; -- Frédéric 17/01/2019 12:04 ALTER TABLE s_anc.traitement ADD COLUMN tra_commentaire text; DROP VIEW s_anc.v_traitement; diff --git a/src/module_anc/web_service/ws/Entreprise.class.inc b/src/module_anc/web_service/ws/Entreprise.class.inc index 00bb4aece45baabc3d64902c330bfd6edabaa6fe..acb6df42df2a3bbae7edbe1b3aed0129c037ec94 100755 --- a/src/module_anc/web_service/ws/Entreprise.class.inc +++ b/src/module_anc/web_service/ws/Entreprise.class.inc @@ -12,7 +12,7 @@ require_once dirname($_SERVER['SCRIPT_FILENAME']) . '/class/vitis_lib/Connection * \brief This file contains the Entreprise php class * * This class defines operation for one Entreprise - * + * */ class Entreprise extends Anc { @@ -30,11 +30,11 @@ class Entreprise extends Anc { $this->aPath = $aPath; $this->aProperties = $properties; $this->oConnection = new Connection($this->aValues, $this->aProperties); - $this->aSelectedFields = Array("id_parametre_entreprises", "id_com", "siret", "raison_sociale", "nom_entreprise", "nom_contact", "telephone_fixe", "telephone_mobile", "web", "mail", "code_postal", "voie", "bureau_etude", "concepteur", "constructeur", "installateur", "vidangeur", "en_activite", "observations", "creat", "creat_date", "maj", "maj_date", "geom"); + $this->aSelectedFields = Array("id_parametre_entreprises", "commune", "siret", "raison_sociale", "nom_entreprise", "nom_contact", "telephone_fixe", "telephone_mobile", "web", "mail", "code_postal", "voie", "bureau_etude", "concepteur", "constructeur", "installateur", "vidangeur", "en_activite", "observations", "creat", "creat_date", "maj", "maj_date", "geom"); } /** - * @SWG\Get(path="/entreprises/{id_entreprise}", + * @SWG\Get(path="/entreprises/{id_entreprise}", * tags={"Entreprises"}, * summary="Get Entreprise", * description="Request to get Entreprise by id", @@ -91,4 +91,4 @@ class Entreprise extends Anc { } -?> \ No newline at end of file +?> diff --git a/src/module_anc/web_service/ws/Entreprises.class.inc b/src/module_anc/web_service/ws/Entreprises.class.inc index 625e00892081a0f50eb0fc4dbdfbf8f3b7b15e8e..25cdc54b0555421acf78651a5a4eac21c8e2dd83 100755 --- a/src/module_anc/web_service/ws/Entreprises.class.inc +++ b/src/module_anc/web_service/ws/Entreprises.class.inc @@ -9,7 +9,7 @@ * \brief This file contains the Entreprises php class * * This class defines Rest Api to Vitis Entreprises - * + * */ require_once __DIR__ . '/Anc.class.inc'; require_once 'Entreprise.class.inc'; @@ -40,7 +40,7 @@ class Entreprises extends Anc { $this->aPath = $aPath; $this->aProperties = $properties; $this->oConnection = new Connection($this->aValues, $this->aProperties); - $this->aSelectedFields = Array("id_parametre_entreprises", "id_com", "siret", "raison_sociale", "nom_entreprise", "nom_contact", "telephone_fixe", "telephone_mobile", "web", "mail", "code_postal", "voie", "bureau_etude", "concepteur", "constructeur", "installateur", "vidangeur", "en_activite", "observations", "creat", "creat_date", "maj", "maj_date", "geom"); + $this->aSelectedFields = Array("id_parametre_entreprises", "commune", "siret", "raison_sociale", "nom_entreprise", "nom_contact", "telephone_fixe", "telephone_mobile", "web", "mail", "code_postal", "voie", "bureau_etude", "concepteur", "constructeur", "installateur", "vidangeur", "en_activite", "observations", "creat", "creat_date", "maj", "maj_date", "geom"); } /** @@ -154,7 +154,7 @@ class Entreprises extends Anc { */ function POST() { $this->aValues['creat'] = $_SESSION["ses_Login"]; - $this->aValues['creat_date'] = date('Y-m-d'); + $this->aValues['creat_date'] = date('Y-m-d'); $aReturn = $this->genericPost($this->aProperties['schema_anc'], 'param_entreprise', $this->aProperties['schema_anc'].'.param_entreprise_id_parametre_entreprises_seq', 'id_parametre_entreprises'); return $aReturn['sMessage']; } @@ -269,4 +269,4 @@ class Entreprises extends Anc { return $aReturn['sMessage']; } } -?> \ No newline at end of file +?> diff --git a/src/module_vmap/module/javascript/app/vmap/mapmanager/layerstree.js b/src/module_vmap/module/javascript/app/vmap/mapmanager/layerstree.js index 2a5fe743b519e0186dae873e6317327fee403212..593b84d22c30b1a15dcd6b4229e6a21921dc1e94 100644 --- a/src/module_vmap/module/javascript/app/vmap/mapmanager/layerstree.js +++ b/src/module_vmap/module/javascript/app/vmap/mapmanager/layerstree.js @@ -158,11 +158,21 @@ nsVmap.nsMapManager.LayersTree.prototype.LayertreeController = function ($scope, this['layerstree_collapsed'] = oVmap['properties']['vmap']['layerstree_collapsed']; } + console.log("oUrlParams: ", oUrlParams); + + var oPositionOptions = {}; if (goog.isDefAndNotNull(oUrlParams['extent'])){ - var aExtent = decodeURI(oUrlParams['extent']).split("|"); + oPositionOptions['extent'] = decodeURI(oUrlParams['extent']).split("|"); + } + if (goog.isDefAndNotNull(oUrlParams['lon']) && + goog.isDefAndNotNull(oUrlParams['lat']) && + goog.isDefAndNotNull(oUrlParams['zoom'])){ + oPositionOptions['lon'] = decodeURI(oUrlParams['lon']); + oPositionOptions['lat'] = decodeURI(oUrlParams['lat']); + oPositionOptions['zoom'] = decodeURI(oUrlParams['zoom']); } - this.loadTree(aExtent); + this.loadTree(oPositionOptions); // Événements sur les couches var keepLoadedTiles = true; @@ -389,10 +399,11 @@ nsVmap.nsMapManager.LayersTree.prototype.LayertreeController.prototype.reloadTre /** * Load layers from the tree - * @param {array|undefined} aExtent exent to fit on + * @param {object|undefined} oPositionOptions + * @param {array|undefined} oPositionOptions.extent exent to fit on * @returns {undefined} */ -nsVmap.nsMapManager.LayersTree.prototype.LayertreeController.prototype.loadTree = function (aExtent) { +nsVmap.nsMapManager.LayersTree.prototype.LayertreeController.prototype.loadTree = function (oPositionOptions) { oVmap.log('nsVmap.nsMapManager.LayersTree.prototype.LayertreeController.prototype.loadTree'); if (this['map'].getLayers().getArray().length > 0) @@ -452,9 +463,22 @@ nsVmap.nsMapManager.LayersTree.prototype.LayertreeController.prototype.loadTree this.addLayer(olLayers[i]); } - // Va à l'étendue fournie - if (goog.isDefAndNotNull(aExtent)) { - this['map'].getView().fit(aExtent, { + // Va à la position fournie + if (goog.isDefAndNotNull(oPositionOptions['lon']) && + goog.isDefAndNotNull(oPositionOptions['lat']) && + goog.isDefAndNotNull(oPositionOptions['zoom'])){ + + // Projette les coordonnées + var coordinates = [parseFloat(oPositionOptions['lon']), parseFloat(oPositionOptions['lat'])]; + var projection = 'EPSG:4326'; + var currentProjeciton = this['map'].getView().getProjection(); + var projectedCoordinates = ol.proj.transform(coordinates, projection, currentProjeciton); + + this['map'].getView().setCenter(projectedCoordinates); + this['map'].getView().setZoom(oPositionOptions['zoom']); + } + if (goog.isDefAndNotNull(oPositionOptions['extent'])) { + this['map'].getView().fit(oPositionOptions['extent'], { nearest : true }); } diff --git a/src/vitis/client/javascript/externs/formReader/formReaderDrtv.js b/src/vitis/client/javascript/externs/formReader/formReaderDrtv.js index 7d3a99d1e45dde528478d33d0d8d8591a5ff6162..342087b688211c13795caf597b497e645f412ab6 100644 --- a/src/vitis/client/javascript/externs/formReader/formReaderDrtv.js +++ b/src/vitis/client/javascript/externs/formReader/formReaderDrtv.js @@ -1350,7 +1350,9 @@ formReader.appFormFieldSpecificParamsDrtv = function ($timeout, $translate, prop scope['oFormValues'][scope['sFormDefinitionName']][scope['field']['name']] = 0; // Quand le slider change par l'action de l'utilisateur $(element).on('slide', function () { - scope['oFormValues'][scope['sFormDefinitionName']][scope['field']['name']] = $(element)['slider']('getValue'); + scope.$applyAsync(function(){ + scope['oFormValues'][scope['sFormDefinitionName']][scope['field']['name']] = $(element)['slider']('getValue'); + }); }); // Quand la valeur dans oFormValues du slider change scope.$watch('oFormValues.' + scope['sFormDefinitionName'] + '["' + scope['field']['name'] + '"]', function () {