From 9a78c49fd3501821e24d6c4f9bd11168718e1202 Mon Sep 17 00:00:00 2001
From: Armand Bahi <armand.bahi@veremes.com>
Date: Wed, 2 Jan 2019 14:04:21 +0100
Subject: [PATCH] =?UTF-8?q?Ajout=20champ=20en=20base=20de=20donn=C3=A9es?=
 =?UTF-8?q?=20et=20sur=20l=20=20API?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 ..._business_object_vmap_business_object.json | 45 +++++++++++++++++++
 src/module_vmap/module/lang/lang-en.json      |  2 +
 src/module_vmap/module/lang/lang-fr.json      |  2 +
 .../web_service/sql/sqlQueries.xml            | 12 +++++
 .../web_service/ws/BusinessObject.class.inc   |  2 +-
 .../web_service/ws/BusinessObjects.class.inc  |  2 +-
 6 files changed, 63 insertions(+), 2 deletions(-)

diff --git a/src/module_vmap/module/forms/vmap_business_object/vmap_business_object_vmap_business_object.json b/src/module_vmap/module/forms/vmap_business_object/vmap_business_object_vmap_business_object.json
index e0168f15..add59599 100644
--- a/src/module_vmap/module/forms/vmap_business_object/vmap_business_object_vmap_business_object.json
+++ b/src/module_vmap/module/forms/vmap_business_object/vmap_business_object_vmap_business_object.json
@@ -511,6 +511,51 @@
                     }
                 ]
             },
+            {
+                "fields": [
+                    {
+                        "type": "radio",
+                        "options": {
+                            "choices": [
+                                {
+                                    "label": "Oui",
+                                    "value": true
+                                },
+                                {
+                                    "label": "Non",
+                                    "value": false
+                                }
+                            ]
+                        },
+                        "name": "enable_selection",
+                        "label": "FORM_SELECTABLE_VMAP_BUSINESS_OBJECT_TOOLTIP",
+                        "disabled": false,
+                        "required": true,
+                        "nb_cols": 12,
+                        "default_value": true
+                    }, {
+                        "type": "radio",
+                        "options": {
+                            "choices": [
+                                {
+                                    "label": "Oui",
+                                    "value": true
+                                },
+                                {
+                                    "label": "Non",
+                                    "value": false
+                                }
+                            ]
+                        },
+                        "name": "enable_location",
+                        "label": "FORM_LOCATABLE_VMAP_BUSINESS_OBJECT_TOOLTIP",
+                        "disabled": false,
+                        "required": true,
+                        "nb_cols": 12,
+                        "default_value": true
+                    }
+                ]
+            },
             {
                 "fields": [
                     {
diff --git a/src/module_vmap/module/lang/lang-en.json b/src/module_vmap/module/lang/lang-en.json
index dfca19f9..a8198863 100644
--- a/src/module_vmap/module/lang/lang-en.json
+++ b/src/module_vmap/module/lang/lang-en.json
@@ -185,6 +185,8 @@
     "FORM_MAX_SNAPPING_SCALE_VMAP_BUSINESS_OBJECT_TOOLTIP": "Maximum edition scale",
     "FORM_MIN_SNAPPING_SCALE_VMAP_BUSINESS_OBJECT": "Minimum edition scale",
     "FORM_MIN_SNAPPING_SCALE_VMAP_BUSINESS_OBJECT_TOOLTIP": "Minimum edition scale",
+    "FORM_SELECTABLE_VMAP_BUSINESS_OBJECT_TOOLTIP": "Object selectable",
+    "FORM_LOCATABLE_VMAP_BUSINESS_OBJECT_TOOLTIP": "Object locatable",
     "LIST_DELETE_CONFIRM_VMAP_BUSINESS_OBJECT": "Delete the selected items and associations with layers?",
     "": "",
     "FORM_TITLE_VMAP_MODULE_MODULE": "Module {{::label}}",
diff --git a/src/module_vmap/module/lang/lang-fr.json b/src/module_vmap/module/lang/lang-fr.json
index a1b1a7bb..418acf5f 100644
--- a/src/module_vmap/module/lang/lang-fr.json
+++ b/src/module_vmap/module/lang/lang-fr.json
@@ -185,6 +185,8 @@
     "FORM_MAX_SNAPPING_SCALE_VMAP_BUSINESS_OBJECT_TOOLTIP": "Échelle à partir de laquelle la saisie ne sera plus possible : il faudra zoomer pour reprendre la saisie",
     "FORM_MIN_SNAPPING_SCALE_VMAP_BUSINESS_OBJECT": "Échelle minimale de saisie",
     "FORM_MIN_SNAPPING_SCALE_VMAP_BUSINESS_OBJECT_TOOLTIP": "Échelle à partir de laquelle la saisie sera possible : il faudra dézoomer pour reprendre la saisie",
+    "FORM_SELECTABLE_VMAP_BUSINESS_OBJECT_TOOLTIP": "Objet sélectionnable",
+    "FORM_LOCATABLE_VMAP_BUSINESS_OBJECT_TOOLTIP": "Objet localisable",
     "LIST_DELETE_CONFIRM_VMAP_BUSINESS_OBJECT": "Supprimer les objets métiers sélectionnés et les associations avec les calques ?",
     "": "",
     "FORM_TITLE_VMAP_MODULE_MODULE": "Module {{::label}}",
diff --git a/src/module_vmap/web_service/sql/sqlQueries.xml b/src/module_vmap/web_service/sql/sqlQueries.xml
index a7a4ff66..d9034076 100644
--- a/src/module_vmap/web_service/sql/sqlQueries.xml
+++ b/src/module_vmap/web_service/sql/sqlQueries.xml
@@ -1145,5 +1145,17 @@
 				]]>
 			</code>
 		</query>
+		<query>
+			<type>update</type>
+			<version>2019.01.00</version>
+			<code>
+				<![CDATA[
+					-- Armand 26/04/2018 14:27 Ajout des colonnes enable_selection et enable_location
+					ALTER TABLE s_vmap.business_object ADD COLUMN enable_selection boolean;
+					ALTER TABLE s_vmap.business_object ADD COLUMN enable_location boolean;
+					UPDATE s_vmap.business_object SET enable_selection=true, enable_location=true;
+				]]>
+			</code>
+		</query>
 	</queriesCollection>
 </sqlQueries>
diff --git a/src/module_vmap/web_service/ws/BusinessObject.class.inc b/src/module_vmap/web_service/ws/BusinessObject.class.inc
index b3da1a45..ba6c8a04 100644
--- a/src/module_vmap/web_service/ws/BusinessObject.class.inc
+++ b/src/module_vmap/web_service/ws/BusinessObject.class.inc
@@ -31,7 +31,7 @@ class BusinessObject extends Vmap {
      */
     function __construct($aPath, $aValues, $properties, $bShortcut = false, $oConnection = false) {
         parent::__construct($aPath, $aValues, $properties, $bShortcut, $oConnection);
-        $this->aSelectedFields = Array("business_object_id", "title", "formtitle", "summarytitle", "id_field", "database", "schema", "table", "sql_summary", "sql_list", "sorted_by", "geom_column", "search_field", "result_field", "search_use_strict", "event_id", "index", "add_form_size", "edit_form_size", "display_form_size", "selection_buffer", "user_rights", "max_edition_scale", "min_edition_scale");
+        $this->aSelectedFields = Array("business_object_id", "title", "formtitle", "summarytitle", "id_field", "database", "schema", "table", "sql_summary", "sql_list", "sorted_by", "geom_column", "search_field", "result_field", "search_use_strict", "event_id", "index", "add_form_size", "edit_form_size", "display_form_size", "selection_buffer", "user_rights", "max_edition_scale", "min_edition_scale", "enable_selection", "enable_location");
     }
 
     /**
diff --git a/src/module_vmap/web_service/ws/BusinessObjects.class.inc b/src/module_vmap/web_service/ws/BusinessObjects.class.inc
index fa7ca58d..6479b6aa 100755
--- a/src/module_vmap/web_service/ws/BusinessObjects.class.inc
+++ b/src/module_vmap/web_service/ws/BusinessObjects.class.inc
@@ -42,7 +42,7 @@ class BusinessObjects extends Vmap {
      */
     function __construct($aPath, $aValues, $properties, $bShortcut = false, $oConnection = false) {
         parent::__construct($aPath, $aValues, $properties, $bShortcut, $oConnection);
-        $this->aSelectedFields = Array("business_object_id", "title", "formtitle", "summarytitle", "id_field", "database", "schema", "table", "sql_summary", "sql_list", "sorted_by", "geom_column", "search_field", "result_field", "search_use_strict", "event_id", "index", "add_form_size", "edit_form_size", "display_form_size", "selection_buffer", "user_rights", "max_edition_scale", "min_edition_scale");
+        $this->aSelectedFields = Array("business_object_id", "title", "formtitle", "summarytitle", "id_field", "database", "schema", "table", "sql_summary", "sql_list", "sorted_by", "geom_column", "search_field", "result_field", "search_use_strict", "event_id", "index", "add_form_size", "edit_form_size", "display_form_size", "selection_buffer", "user_rights", "max_edition_scale", "min_edition_scale", "enable_selection", "enable_location");
     }
 
     /**
-- 
GitLab