diff --git a/Makefile b/Makefile index 7f9984b..92a4611 100644 --- a/Makefile +++ b/Makefile @@ -11,4 +11,4 @@ php-cs-fixer-apply: php-cs-fixer fix --config=.php-cs-fixer.dist.php php-cs-fixer-apply-docker: - docker run --rm -it -w=/app -v ${PWD}:/app oskarstark/php-cs-fixer-ga:3.12.0 --allow-risky=yes --config=.php-cs-fixer.dist.php + docker run --rm -it -w=/app -v ${PWD}:/app oskarstark/php-cs-fixer-ga:latest --allow-risky=yes --config=.php-cs-fixer.dist.php diff --git a/cadastre/classes/cadastre.listener.php b/cadastre/classes/cadastre.listener.php index a1ec922..e12d6f1 100644 --- a/cadastre/classes/cadastre.listener.php +++ b/cadastre/classes/cadastre.listener.php @@ -37,13 +37,13 @@ public function ongetMapAdditions($event) $css = array(); // Add the cadastre config only if at least one right is granted - $hasEnougRights = ( + $hasEnoughRights = ( jAcl2::check('cadastre.use.search.tool') || jAcl2::check('cadastre.acces.donnees.proprio') || jAcl2::check('cadastre.acces.donnees.proprio.simple') ); - if ($hasCadastreConfig && $hasEnougRights) { + if ($hasCadastreConfig && $hasEnoughRights) { $js = array( jUrl::get('jelix~www:getfile', array('targetmodule' => 'cadastre', 'file' => 'cadastre.js')), ); diff --git a/cadastre/classes/cadastreDockable.listener.php b/cadastre/classes/cadastreDockable.listener.php index d542dd6..a04f67e 100644 --- a/cadastre/classes/cadastreDockable.listener.php +++ b/cadastre/classes/cadastreDockable.listener.php @@ -66,6 +66,7 @@ public function onmapDockable($event) if ($p === null) { throw new Exception("Spatial search: Unknown repository/project {$event->repository}.'~'.{$event->project}"); } + // Get the PostgreSQL database info of the Parcelle layer /** @var \qgisVectorLayer $parcelleLayer The QGIS vector layer instance */ $parcelleLayer = $p->getLayer($parcelleId); @@ -119,15 +120,9 @@ public function onmapDockable($event) } } - public function onmapMiniDockable($event) - { - } + public function onmapMiniDockable($event) {} - public function onmapRightDockable($event) - { - } + public function onmapRightDockable($event) {} - public function onmapBottomDockable($event) - { - } + public function onmapBottomDockable($event) {} } diff --git a/cadastre/classes/listGeoCommuneDatasource.class.php b/cadastre/classes/listGeoCommuneDatasource.class.php index 230f2f2..0747b8f 100644 --- a/cadastre/classes/listGeoCommuneDatasource.class.php +++ b/cadastre/classes/listGeoCommuneDatasource.class.php @@ -15,9 +15,7 @@ class listGeoCommuneDatasource extends jFormsDynamicDatasource protected $profile; protected $dao; - public function __construct($formid) - { - } + public function __construct($formid) {} public function getData($form) { diff --git a/cadastre/classes/listGeoSectionDatasource.class.php b/cadastre/classes/listGeoSectionDatasource.class.php index 6a182f1..76cc6b7 100644 --- a/cadastre/classes/listGeoSectionDatasource.class.php +++ b/cadastre/classes/listGeoSectionDatasource.class.php @@ -16,9 +16,7 @@ class listGeoSectionDatasource extends jFormsDynamicDatasource protected $dao; - public function __construct($formid) - { - } + public function __construct($formid) {} public function getData($form) { diff --git a/cadastre/classes/listParcelleLieuDatasource.class.php b/cadastre/classes/listParcelleLieuDatasource.class.php index 3e1794a..b2dc5dc 100644 --- a/cadastre/classes/listParcelleLieuDatasource.class.php +++ b/cadastre/classes/listParcelleLieuDatasource.class.php @@ -16,9 +16,7 @@ class listParcelleLieuDatasource extends jFormsDynamicDatasource protected $profile; protected $dao; - public function __construct($formid) - { - } + public function __construct($formid) {} public function getData($form) { diff --git a/cadastre/classes/listParcelleLieuNoMajicDatasource.class.php b/cadastre/classes/listParcelleLieuNoMajicDatasource.class.php index c0543ed..6e999cd 100644 --- a/cadastre/classes/listParcelleLieuNoMajicDatasource.class.php +++ b/cadastre/classes/listParcelleLieuNoMajicDatasource.class.php @@ -16,9 +16,7 @@ class listParcelleLieuNoMajicDatasource extends jFormsDynamicDatasource protected $profile; protected $dao; - public function __construct($formid) - { - } + public function __construct($formid) {} public function getData($form) { diff --git a/cadastre/classes/listParcellePropDatasource.class.php b/cadastre/classes/listParcellePropDatasource.class.php index c1ceb86..9578189 100644 --- a/cadastre/classes/listParcellePropDatasource.class.php +++ b/cadastre/classes/listParcellePropDatasource.class.php @@ -16,9 +16,7 @@ class listParcellePropDatasource extends jFormsDynamicDatasource protected $profile; protected $dao; - public function __construct($formid) - { - } + public function __construct($formid) {} public function getData($form) { diff --git a/cadastre/classes/listParcelleSpatialDatasource.class.php b/cadastre/classes/listParcelleSpatialDatasource.class.php index 96d47f5..a3623ce 100644 --- a/cadastre/classes/listParcelleSpatialDatasource.class.php +++ b/cadastre/classes/listParcelleSpatialDatasource.class.php @@ -16,9 +16,7 @@ class listParcelleSpatialDatasource extends jFormsDynamicDatasource protected $profile; protected $dao; - public function __construct($formid) - { - } + public function __construct($formid) {} public function getData($form) { diff --git a/cadastre/classes/listSpatialLayerFieldDatasource.class.php b/cadastre/classes/listSpatialLayerFieldDatasource.class.php index 571facc..ac5b132 100644 --- a/cadastre/classes/listSpatialLayerFieldDatasource.class.php +++ b/cadastre/classes/listSpatialLayerFieldDatasource.class.php @@ -13,9 +13,7 @@ class listSpatialLayerFieldDatasource extends jFormsDynamicDatasource protected $fields; protected $aliases; - public function __construct($formid) - { - } + public function __construct($formid) {} public function getData($form) { diff --git a/cadastre/www/cadastre.js b/cadastre/www/cadastre.js index 2f499c4..5f609c8 100644 --- a/cadastre/www/cadastre.js +++ b/cadastre/www/cadastre.js @@ -340,10 +340,9 @@ lizMap.events.on({ let selectedIds = '-9999999'; if (layerId) { const getLayerConfig = lizMap.getLayerConfigById(layerId); - const layerName = getLayerConfig[0]; - const selectedFeatureIds = lizMap.config.layers[layerName]?.selectedFeatures; - if (selectedFeatureIds && selectedFeatureIds.length) { - selectedIds = selectedFeatureIds.join(); + const layerConfig = getLayerConfig[1]; + if ('selectedFeatures' in layerConfig && layerConfig.selectedFeatures && layerConfig.selectedFeatures.length) { + selectedIds = layerConfig.selectedFeatures.join(); } } $('#' + formId + '_' + 'spatial_layer_selected_ids').val(selectedIds).change();