From 7d4ce32bd99fa47731632e75690a63fe5a7c6815 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Carretero?=
 <frederic.carretero@veremes.com>
Date: Fri, 18 Jan 2019 15:07:38 +0100
Subject: [PATCH] =?UTF-8?q?Placeholder=20personnalisable=20dans=20la=20loc?=
 =?UTF-8?q?alisation=20d'un=20objet=20m=C3=A9tier?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../vmap_business_object_vmap_business_object.json   | 12 ++++++++++--
 .../javascript/app/vmap/mapmanager/mapmanager.js     |  3 ++-
 src/module_vmap/module/lang/lang-en.json             |  1 +
 src/module_vmap/module/lang/lang-fr.json             |  1 +
 src/module_vmap/module/template/tools/location.html  |  2 +-
 src/module_vmap/web_service/sql/sqlQueries.xml       |  2 ++
 .../web_service/ws/BusinessObject.class.inc          |  2 +-
 .../web_service/ws/BusinessObjects.class.inc         |  2 +-
 8 files changed, 19 insertions(+), 6 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 8cb2ecde..4aad624d 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
@@ -536,9 +536,17 @@
                         },
                         "disabled": false,
                         "required": true,
-                        "nb_cols": 12,
+                        "nb_cols": 3,
                         "default_value": true
-                    }, {
+                    },
+                    {
+                        "type": "text",
+                        "name": "location_placeholder",
+                        "label": "FORM_LOCATION_PLACEHOLDER_VMAP_BUSINESS_OBJECT",
+                        "nb_cols": 3,
+                        "id": "bo_location_placeholder"
+                    },
+                    {
                         "type": "radio",
                         "options": {
                             "choices": [
diff --git a/src/module_vmap/module/javascript/app/vmap/mapmanager/mapmanager.js b/src/module_vmap/module/javascript/app/vmap/mapmanager/mapmanager.js
index e3373e5e..19118736 100644
--- a/src/module_vmap/module/javascript/app/vmap/mapmanager/mapmanager.js
+++ b/src/module_vmap/module/javascript/app/vmap/mapmanager/mapmanager.js
@@ -1489,7 +1489,8 @@ nsVmap.nsMapManager.MapManager.prototype.getBusinessObjectsFromLayers = function
                 'bo_max_edition_scale': aBos[ii]['max_edition_scale'],
                 'bo_enable_location': aBos[ii]['enable_location'],
                 'bo_enable_selection': aBos[ii]['enable_selection'],
-                'bo_index': goog.isDefAndNotNull(aBos[ii]['index']) ? aBos[ii]['index'] : 1000000
+                'bo_index': goog.isDefAndNotNull(aBos[ii]['index']) ? aBos[ii]['index'] : 1000000,
+                'location_placeholder': aBos[ii]['location_placeholder']
             };
         }
     }
diff --git a/src/module_vmap/module/lang/lang-en.json b/src/module_vmap/module/lang/lang-en.json
index 22870579..8c8e2535 100644
--- a/src/module_vmap/module/lang/lang-en.json
+++ b/src/module_vmap/module/lang/lang-en.json
@@ -190,6 +190,7 @@
     "FORM_LOCATABLE_VMAP_BUSINESS_OBJECT": "Enable locate",
     "FORM_LOCATABLE_VMAP_BUSINESS_OBJECT_TOOLTIP": "Display the object on the locate tool",
     "LIST_DELETE_CONFIRM_VMAP_BUSINESS_OBJECT": "Delete the selected items and associations with layers?",
+    "FORM_LOCATION_PLACEHOLDER_VMAP_BUSINESS_OBJECT": "Location title",
     "": "",
     "FORM_TITLE_VMAP_MODULE_MODULE": "Module {{::label}}",
     "FORM_LABEL_VMAP_MODULE_MODULE": "Label",
diff --git a/src/module_vmap/module/lang/lang-fr.json b/src/module_vmap/module/lang/lang-fr.json
index c8fbb96d..78fa1211 100644
--- a/src/module_vmap/module/lang/lang-fr.json
+++ b/src/module_vmap/module/lang/lang-fr.json
@@ -190,6 +190,7 @@
     "FORM_LOCATABLE_VMAP_BUSINESS_OBJECT": "Objet localisable",
     "FORM_LOCATABLE_VMAP_BUSINESS_OBJECT_TOOLTIP": "Affiche l'objet dans la liste de l'outil de localisation (ne garantit pas la sécurité de la donnée)",
     "LIST_DELETE_CONFIRM_VMAP_BUSINESS_OBJECT": "Supprimer les objets métiers sélectionnés et les associations avec les calques ?",
+    "FORM_LOCATION_PLACEHOLDER_VMAP_BUSINESS_OBJECT": "Titre de la localisation",
     "": "",
     "FORM_TITLE_VMAP_MODULE_MODULE": "Module {{::label}}",
     "FORM_LABEL_VMAP_MODULE_MODULE": "Libellé",
diff --git a/src/module_vmap/module/template/tools/location.html b/src/module_vmap/module/template/tools/location.html
index 62e46ed3..59d1b1fa 100644
--- a/src/module_vmap/module/template/tools/location.html
+++ b/src/module_vmap/module/template/tools/location.html
@@ -4,7 +4,7 @@
         <!--Recherche-->
         <input id="location-search-input"
                type="text"
-               placeholder="Localiser.."
+               placeholder="{{ctrl.oBusinessObjects[ctrl.sSelectedLocationService].bo_enable_location && ctrl.oBusinessObjects[ctrl.sSelectedLocationService].location_placeholder != '' ? ctrl.oBusinessObjects[ctrl.sSelectedLocationService].location_placeholder : 'Localiser...'}}"
                ng-model="ctrl.locationSearch"
                ng-click="ctrl.searchLocation()">
         <!--Sélecteur-->
diff --git a/src/module_vmap/web_service/sql/sqlQueries.xml b/src/module_vmap/web_service/sql/sqlQueries.xml
index d3109ede..10d6a568 100644
--- a/src/module_vmap/web_service/sql/sqlQueries.xml
+++ b/src/module_vmap/web_service/sql/sqlQueries.xml
@@ -1164,6 +1164,8 @@
 					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;
+					-- Frédéric 18/01/2019 Placeholder dans la localisation
+					ALTER TABLE s_vmap.business_object ADD COLUMN location_placeholder character varying(100);
 				]]>
 			</code>
 		</query>
diff --git a/src/module_vmap/web_service/ws/BusinessObject.class.inc b/src/module_vmap/web_service/ws/BusinessObject.class.inc
index ba6c8a04..2a990d6d 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", "enable_selection", "enable_location");
+        $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", "location_placeholder");
     }
 
     /**
diff --git a/src/module_vmap/web_service/ws/BusinessObjects.class.inc b/src/module_vmap/web_service/ws/BusinessObjects.class.inc
index 6479b6aa..a90bc69b 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", "enable_selection", "enable_location");
+        $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", "location_placeholder");
     }
 
     /**
-- 
GitLab